Surya
Model Introduction
Surya is a spatiotemporal foundation model for heliophysics and space weather research. It learns solar dynamics from multi-instrument SDO observations. The model combines spectral gating with long-short attention to predict future solar images from two historical time steps and supports autoregressive multi-step forecasting.
Paper: Surya: Foundation Model for Heliophysics
https://ntrs.nasa.gov/citations/20250008498
Model Description
Surya was proposed by institutions including NASA, IBM Research, and the University of Alabama in Huntsville. The model uses eight AIA channels and five HMI products from SDO as training data. It is suitable for one-step prediction and autoregressive multi-step forecasting of solar images.
Use Cases
| Scenario | Description |
|---|---|
| Solar dynamics forecasting | Predict future multichannel solar images from two historical time steps. |
| Space weather research | Analyze solar activity and errors at different forecast lead times. |
| SDO multi-instrument modeling | Jointly process multichannel observations from AIA and HMI. |
| Solar flare forecasting | Fine-tune model representations to predict M-class and X-class solar flares within future time periods. |
| Solar active region segmentation | Fine-tune on magnetograms to segment solar active regions and polarity inversion lines. |
| Local quick validation | Use synthetic data to validate training, inference, evaluation, and visualization. |
| Multi-GPU training | Launch distributed data-parallel training with torchrun. |
Usage Guide
1. OneCode Usage
Experience intelligent one-click AI4S programming through the OneCode online environment:
Click to Experience Intelligent One-Click AI4S Programming
2. Manual Installation and Usage
Hardware Requirements
- A GPU or DCU is recommended.
- CPU can be used for pipeline validation with the current default small configuration.
- Training the original paper configuration with
4096x4096resolution and 366 million parameters requires large-scale multi-GPU computing resources.
Download the Model Package
hf download OneScience-Group/Surya --local-dir ./Surya
cd Surya
Install the Runtime Environment
DCU Environment
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU Environment
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
Training Data Introduction
The paper uses SDO data from 2010 to 2024, including AIA 94, 131, 171, 193, 211, 304, 335, and 1600 Å, as well as HMI magnetic-field and Doppler-velocity products. The data are standardized to a 12-minute interval and spatially registered. The original training data are approximately 257 TB.
This model package uses synthetic data by default:
python scripts/fake_data.py
Each NPZ file contains at least inputs, targets, and activity. inputs has shape [N, 2, 13, H, W], targets has shape [N, S, 13, H, W], and activity stores the solar activity intensity at each forecast time step. When using real data, prepare files with the same fields and modify conf/config.yaml.
When using real data, do not run fake_data.py. Save temporally aligned, spatially registered, channel-organized, and signum-log normalized data to data/, replacing the synthetic data files:
data/train.npz
data/test.npz
Each NPZ file contains at least:
inputs: float32 [N,2,13,H,W]
targets: float32 [N,S,13,H,W]
activity: float32 [N,S]
The 13 channels correspond in order to eight AIA channels and five HMI products, and S is consistent with forecast_steps in conf/config.yaml. Modify conf/config.yaml according to the image size, number of forecast steps, channel statistics, and data paths of the real data. After data preparation, continue to use the unified training, inference, and evaluation commands below; use script arguments to override the default paths if other file locations are required.
Training
Single GPU:
python scripts/train.py
Multiple GPUs:
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
Training outputs:
result/checkpoints/surya.pt
result/training/metrics.json
The training outputs include a model checkpoint for subsequent multi-step forecasting and training metrics that reflect different training stages, overall loss, and learning-rate changes, facilitating training-state preservation and model optimization analysis. Results on synthetic data are only for code-flow validation and do not represent paper results.
Training Weights
This repository provides weights trained on SDO/AIA and SDO/HMI solar observations in the weight/ folder. The weight files will be uploaded soon and are expected to be available in the near future.
Inference
python scripts/inference.py
Inference results are output to:
result/output/forecast.npz
Evaluation and Visualization
python scripts/result.py
Evaluation and visualization outputs are written to:
result/evaluation/metrics.json
result/evaluation/rollout_forecast_skill.png
result/evaluation/solar_dynamics_forecast.png
result/evaluation/solar_activity_evolution.png
result/evaluation/sdo_channel_error.png
result/evaluation/persistence_skill.png
The evaluation results comprehensively measure multi-step forecast errors, forecast skill relative to a persistence baseline, performance across AIA/HMI channels, and changes in solar activity intensity. Forecast images and lead-time curves show the evolution of solar dynamics and the long-term forecast stability of the model. The results follow the autoregressive forecasting protocol from the paper; results on synthetic data are only for validating the Surya workflow and do not represent performance on the paper's downstream tasks.
Official OneScience Resources
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation and License
This repository is a reproduction of the original Surya paper.
中文说明
模型简介
Surya 是面向日球物理和空间天气研究的时空基础模型,从 SDO 的多仪器观测中学习太阳动力学。该模型结合谱门控与长短注意力,根据两个历史时间步预测未来的太阳图像,并支持自回归多步预报。
论文《Surya:日球物理基础模型》
https://ntrs.nasa.gov/citations/20250008498
模型描述
Surya 由 NASA、IBM Research 和阿拉巴马大学亨茨维尔分校等机构提出。模型使用来自 SDO 的八个 AIA 通道和五个 HMI 产品作为训练数据,适用于太阳图像的单步预测和自回归多步预报。
使用场景
| 场景 | 说明 |
|---|---|
| 太阳动力学预报 | 根据两个历史时间步预测未来的多通道太阳图像。 |
| 空间天气研究 | 分析不同时效的太阳活动与预报误差。 |
| SDO 多仪器建模 | 联合处理来自 AIA 和 HMI 的多通道观测。 |
| 太阳耀斑预报 | 微调(fine-tuning)模型表征,预测未来时间段内 M 级和 X 级太阳耀斑。 |
| 太阳活动区分割 | 在磁图上微调,分割太阳活动区及极性反转线。 |
| 本地快速验证 | 使用合成数据验证训练、推理(inference)、评估及可视化。 |
| 多 GPU 训练 | 使用 torchrun 启动分布式数据并行训练。 |
使用指南
1. OneCode 使用方法
通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 手动安装与使用
硬件要求
- 建议使用 GPU 或 DCU。
- 可使用 CPU 按当前的默认小配置验证流程。
- 训练原论文中分辨率为
4096x4096、参数量为 366 million 的配置需要大规模多 GPU 计算资源。
下载模型包
hf download OneScience-Group/Surya --local-dir ./Surya
cd Surya
安装运行环境
DCU 环境
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU 环境
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
训练数据简介
论文使用 2010 至 2024 年的 SDO 数据,包括 AIA 94、131、171、193、211、304、335 和 1600 Å,以及 HMI 磁场和多普勒速度产品。数据统一为 12 分钟间隔,并进行了空间配准。原始训练数据约为 257 TB。
此模型包默认使用合成数据。
python scripts/fake_data.py
每个 NPZ 文件至少包含 inputs、targets 和 activity。inputs 的形状为 [N, 2, 13, H, W],targets 的形状为 [N, S, 13, H, W],activity 保存每个预报时间步的太阳活动强度。使用真实数据时,请准备具有相同字段的文件,并修改 conf/config.yaml。
使用真实数据时,不要运行 fake_data.py。请将完成时间对齐、空间配准、通道组织及 signum-log 归一化的数据保存至 data/,替换合成数据文件。
data/train.npz
data/test.npz
每个 NPZ 文件至少包含以下内容。
inputs: float32 [N,2,13,H,W]
targets: float32 [N,S,13,H,W]
activity: float32 [N,S]
13 个通道依次对应八个 AIA 通道和五个 HMI 产品,S 与 forecast_steps(位于 conf/config.yaml 中)一致。按照真实数据的图像大小、预报步数、通道统计量及数据路径修改 conf/config.yaml。准备好数据后,继续使用下方统一的训练、推理及评估命令。如需使用其他文件位置,可通过脚本参数覆盖默认路径。
训练
单 GPU
python scripts/train.py
多 GPU
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
训练输出
result/checkpoints/surya.pt
result/training/metrics.json
训练输出包含用于后续多步预报的模型权重(检查点)(checkpoint),以及反映不同训练阶段、总体损失和学习率变化的训练指标,便于保存训练状态及分析模型优化情况。合成数据上的结果仅用于验证代码流程,不代表论文结果。
训练权重
本仓库在 weight/ 文件夹中提供使用 SDO/AIA 和 SDO/HMI 太阳观测训练的权重。权重文件即将上传,预计近期可用。
推理
python scripts/inference.py
推理结果输出至以下位置。
result/output/forecast.npz
评估与可视化
python scripts/result.py
评估及可视化输出写入以下位置。
result/evaluation/metrics.json
result/evaluation/rollout_forecast_skill.png
result/evaluation/solar_dynamics_forecast.png
result/evaluation/solar_activity_evolution.png
result/evaluation/sdo_channel_error.png
result/evaluation/persistence_skill.png
评估结果综合衡量多步预报误差、相对于持续性基线的预报技巧、各 AIA/HMI 通道的性能及太阳活动强度变化。预报图像和时效曲线展示太阳动力学的演化以及模型的长期预报稳定性。结果遵循论文中的自回归预报协议。合成数据上的结果仅用于验证 Surya 流程,不代表论文下游任务上的性能。
OneScience 官方资源
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可证
本仓库是对 Surya 原始论文的复现。
- Downloads last month
- 13