遇见数据集

Data and Codes for the article: "Explainable AI for Solar Flare Prediction: Quantitative Magnetic Field Analysis of Model-Focused Regions"

收藏
Zenodo2026-07-20 更新2026-08-01 收录
官方服务:

资源简介:

Data and Codes — XAI for Solar flare Predicting This directory contains the full pipeline for "Explainable AI for Solar Flare Prediction: Quantitative Magnetic Field Analysis of Model-Focused Regions": data preparation, CNN training and evaluation, mask generation (MFR/PIL), SHARP parameter computation, and parameter-based classification. You can also get this project on GitHub. Directory structure code/ ├── README.md ├── data_preparation.ipynb # Data prep: time windows, labels, train/valid/test split ├── train_model.ipynb # CNN training ├── pipeline.ipynb # Classification pipeline from SHARP/MFR/PIL parameters ├── analysis.ipynb # Model evaluation, RoI and Grad-CAM analysis ├── code_mask/ # Masks and SHARP parameter computation │ ├── MFR_mask.py # MFR masks from Grad-CAM │ ├── PIL_mask.py # Polarity Inversion Line (PIL) masks │ ├── SHARP_masked.py # SHARP parameters under mask (ori / pil / mfr) │ └── Calculate_sharpkeys_masked.py # SHARP parameter function library ├── cnn/ │ └── utils/ │ ├── model.py # CNN model definition │ └── utils.py # Dataset, transforms, evaluation, FITS helpers ├── data/ # Data and splits │ ├── split/ # train/valid/test CSV splits │ ├── param_data/ # SHARP/MFR/PIL parameter CSVs (a2/a3 aligned) │ └── ... └── param/ # Pipeline outputs: parameters and performance Workflow Data preparation. Run data_preparation.ipynb: build time windows in operational_form.csv from flare records, assign positive/negative labels, and create train/valid/test splits in data/split/*.csv and data/label.csv. CNN training. Run train_model.ipynb: train the binary CNN using data/split/train.csv, valid.csv, and the dataset/model in cnn/utils. Models are saved under model/ (or your configured path). Mask generation MFR: run code_mask/MFR_mask.py to produce MFR attention masks (.attr.npy) from the trained CNN and Grad-CAM. PIL: run code_mask/PIL_mask.py to compute the polarity inversion line from Br.fits and save PIL masks (.pil.npy). SHARP parameters (masked). Run code_mask/SHARP_masked.py with --method ori, pil, or mfr. SHARP parameters are computed under the chosen mask and written to the corresponding CSV under param_data. Parameter pipeline. Run pipeline.ipynb: load SHARP/MFR/PIL parameters, clean and align (a2: SHARP+MFR; a3: SHARP+MFR+PIL), train/evaluate SVM, Random Forest, etc., and write results to param/. Analysis and visualization. Run analysis.ipynb: analysis in this work, such as: predictive capability evaluation, magnetic complexity analysis, and so on. Dependencies Python 3.10 Scientific stack: numpy, pandas, scipy, scikit-learn, astropy, torch, torchvision Optional: captum (Grad-CAM), sunpy (PIL-related), skimage References and acknowledgements SHARP parameter code is derived from mbobra/SHARPs. PIL (polarity inversion line) computation is derived from RanHao1999/Flare_SHARP. We modified it with vectorized computation. MFR masks are produced in-house using CNN Grad-CAM on the trained flare prediction model. SHARP/HMI data are from the Joint Science Operations Center (JSOC). License These data and code are provided on GitHub and Zenodo under the MIT license.

提供机构:
Zenodo
创建时间:
2026-07-20
二维码
社区交流群
二维码
科研交流群
商业服务