Skip to main content
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}
}

Metadata

Release files for pinn-me 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pinn-me 0.1.1
File Interpreter ABI Platform
pinn_me-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / pinn_me-0.1.1-py3-none-any.whl

Download URL pinn_me-0.1.1-py3-none-any.whl
Size 66.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
702686c5ca022f75ae0dbbed03f1a38e405f642b2b06ad496db8c8ffbfa78a70
BLAKE2b-256 checksum
How to use checksums
65ed60e405bc30a8cd0cc7d5fc38a3fec53baee65ca2c6d5530297e7b0eb43a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page