Skip to main content

Spectropolarimetric Milne-Eddington Inversions with Physics-Informed Neural Networks

Project description

drawing

A Physics-Informed Neural Network Framework for Accurate Milne-Eddington Inversions of Solar Magnetic Fields

Overview

We present a novel spectropolarimetric inversion method based on Physics Informed Neural Networks (PINNs) to infer the solar photospheric magnetic field under the Milne-Eddington approximation (PINN ME). Our approach maps spatio-temporal coordinates (t,x,y) to spectropolarimetric parameters, enabling the synthesis of Stokes profiles that are iteratively optimized to fit observations. Instrumental effects are directly incorporated via the point-spread function. Evaluated on synthetic data and radiative MHD simulations, PINN ME demonstrates strong resilience to noise, efficient memory usage, and intrinsic spatio-temporal coupling. When applied to observations, it yields high spatial coherence and resolves small-scale magnetic features in both strong- and weak-field regions.

Method Overview Overview of the PINN ME Milne-Eddington inversion method. The neural network acts as a representation of the parameter space, and maps pixel coordinates ($t, x, y$) of the input image sequence to the respective plasma parameters. For model training, the parameters are used as input to the fully-differentiable ME forward model which yields the corresponding spectral line profiles of the Stokes vector ($I, Q, U, V$). The difference (loss) between the predicted Stokes vectors and the observed data is used to update the network weights. The model is iteratively updated until the difference between the modeled and observed stokes vectors converges to a minimum. From the trained model, the individual pixel coordinates can be queried to obtain the final inversion result.

Installation

PINN ME can be installed via pip. The package is compatible with Python 3.8 and above.

pip install pinn-me

The installation requires pyTorch, lightning, sunPy, and WandB. The code is developed for GPU acceleration, and the package will automatically detect the available GPU. If no GPU is available, the code will run on CPU, but it will be significantly slower.

Usage

Hinode/SOTSP example

Download the Hinode/SOTSP Level 1 data from the Hinode archive. The data should be a folder with fits files. https://csac.hao.ucar.edu/sp_data.php

Example Hinode/SOTSP data available at: https://app.globus.org/file-manager?origin_id=aa4a093a-5b00-4a4b-b8d4-5bb65f324c8c&origin_path=%2F

Create .yaml file for the configuration. The following is an example Hinode/SOTSP configuration file:

---
base_path: "<<PATH TO OUTPUT DIRECTORY>>"
work_directory: "<<PATH TO DIRECTORY FOR LOGGING>>"
data:
  type: "hinode"
  files: "<<PATH TO FOLDER FITS FILES>>"
  num_workers: 8
  batch_size: 4096
logging:
  project: pinn-me
model:
  encoding: "gaussian_positional"
training:
  epochs: 100
  check_val_every_n_epoch: 5

Run the code:

pinn-me-train --config "<<PATH TO CONFIG FILE>>"

Convert PINN ME output to NPZ

To convert the PINN ME output to NPZ format, use the following command:

pinn-me-to-npz --input "<<PATH TO .PME FILE>>" --output "<<PATH TO OUTPUT .NPZ FILE>>"

Publication

  • Arxiv pre-print: arXiv:2502.13924
  • Under review for publication in the Astrophysical Journal Letters.

Citation

If you find this work useful, please cite our paper:

@article{jarolim2025pinnme,
  title={PINN ME: A Physics-Informed Neural Network Framework for Accurate Milne-Eddington Inversions of Solar Magnetic Fields},
  author={Jarolim, Robert and Molnar, Momchil E and Tremblay, Benoit and Centeno, Rebecca and Rempel, Matthias},
  journal={arXiv preprint arXiv:2502.13924},
  year={2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinn_me-0.1.1-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

Details for the file pinn_me-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pinn_me-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 66.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for pinn_me-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 702686c5ca022f75ae0dbbed03f1a38e405f642b2b06ad496db8c8ffbfa78a70
MD5 b6ebf748ba289731f9e6f74415a3aeb3
BLAKE2b-256 65ed60e405bc30a8cd0cc7d5fc38a3fec53baee65ca2c6d5530297e7b0eb43a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page