Solar Flare Now-casting Using GOES X-Ray Time-Series Data and Machine Learning
Solar flares are sudden releases of energy from the Sun that can produce intense electromagnetic radiation and influence the near-Earth space environment. Strong flares can disrupt radio communication, satellite operations, navigation systems, and other space-based technologies.
Because of this, being able to identify the likelihood of a flare before it occurs is an important problem in space-weather research.
In this project, I explored a machine-learning-based approach to solar-flare nowcasting using GOES X-ray time-series observations. Instead of relying only on static measurements, the approach uses temporal information from the solar X-ray signal to estimate whether a flare is likely to occur over different future time horizons.
The horizons evaluated were:
- 1 hour
- 3 hours
- 6 hours
- 12 hours
- 24 hours
- 48 hours
The final analysis showed an important result: shorter forecasting horizons are substantially more useful for this dataset than longer horizons.
Why Solar Flare Nowcasting?
Solar activity is highly dynamic. A solar active region can evolve rapidly, and the X-ray emission observed from the Sun can contain information about changing activity levels.
Traditional flare forecasting approaches often use magnetic-field measurements from instruments such as SDO/HMI. Machine-learning methods have been widely investigated for this problem, including logistic regression, support vector machines, random forests, neural networks, and deep-learning models.
Previous research has demonstrated that machine learning can produce useful probabilistic flare forecasts, but the problem remains difficult because flare events are relatively rare and the cost of false alarms can be significant.
This motivated me to investigate a different perspective:
Can the temporal behavior of GOES X-ray observations itself provide useful information for short-term flare nowcasting?
The GOES Dataset
The project uses time-series observations from the Geostationary Operational Environmental Satellites (GOES) X-ray measurements.
Rather than treating each observation independently, the data were processed as a chronological time series.
The dataset was divided chronologically into three periods:
Dataset Period Rows Training
This chronological separation is important.
A random train-test split can allow information from later periods to influence training and produce an overly optimistic estimate of performance. For a forecasting problem, the model should learn from the past and then be evaluated on genuinely later observations.
Therefore, the final test period was kept independent from calibration and threshold selection.
Defining the Forecasting Problem
The model was evaluated at six different future horizons:
1h, 3h, 6h, 12h, 24h, and 48h.
For each horizon, the target indicates whether a flare occurs within that future window.
This creates six related forecasting problems rather than treating solar-flare forecasting as a single fixed-horizon task.
One immediate challenge becomes visible from the class distribution.
For the test period, the number of positive events was:
HorizonTest Positive Events1h5673h1,6476h2,89612h5,04324h9,25948h16,667
The 1-hour problem is particularly imbalanced.
Only 567 positive observations occurred among more than 179,000 usable test observations.
That means a model can achieve apparently good accuracy simply by predicting “no flare” most of the time.
For this reason, accuracy alone is not an appropriate measure of success.
Feature Engineering
The forecasting pipeline uses a compact set of engineered time-series features rather than relying only on the raw X-ray measurements.
The purpose of feature engineering is to represent not only the current X-ray level but also how the signal is changing.
Examples of useful temporal information include:
- Current X-ray intensity
- Log-transformed measurements
- Changes in X-ray intensity
- Velocity-like temporal changes
- Acceleration-like changes
- Rolling statistical information
- Short-term activity or burst behavior
The underlying idea is simple:
A flare is not necessarily characterized only by how bright the Sun is at one moment, but also by how its emission is evolving.
Preventing Data Leakage
Time-series forecasting introduces a major danger: data leakage.
For example, calculating a feature using future observations would allow the model to indirectly see information that would not have been available at prediction time.
Similarly, selecting thresholds or calibration parameters using the test set would contaminate the final evaluation.
The pipeline therefore enforced several safeguards:
- Chronological train/validation/test separation
- Validation-only calibration
- Validation-only threshold selection
- Independent test evaluation
- Leakage control for threshold optimization
The final Stage 11 evaluation reported:
Calibration integrity: PASS
Threshold leakage control: PASS
Validation-only calibration: PASS
Validation-only threshold selection: PASS
TEST independence: PASS
These checks are important because the goal is not simply to obtain a high metric, but to estimate how the forecasting system behaves on genuinely unseen future data.
Why Calibration Matters
A machine-learning classifier can output a probability, but that probability is not automatically trustworthy.
For example, if a model outputs:
0.70 probability of a flare
we would ideally want observations assigned probabilities around 0.70 to actually contain the event roughly 70% of the time.
This property is known as probability calibration.
In this project, calibration was investigated using two approaches:
- Platt scaling
- Isotonic regression
The calibration method was selected using validation data.
Interestingly, Platt scaling was selected for all six forecasting horizons.
The improvement was particularly strong at shorter horizons.
For example:
ECE, or Expected Calibration Error, measures the difference between predicted probabilities and observed event frequencies.
The results show a clear pattern:
Calibration substantially improved probability reliability for the 1h–12h horizons, while it did not improve the longer 24h and 48h horizons.
This is an important distinction.
Calibration improved the interpretation of the probabilities, but it did not magically make the underlying forecasting problem easier.
Choosing an Operational Threshold
A probability model still needs a decision threshold if it is going to produce an alert.
A default threshold of 0.5 is often inappropriate for rare-event forecasting.
Instead, thresholds were selected using validation data, with F1 used as the optimization criterion.
The resulting calibrated thresholds were:
The relatively low threshold for the 1-hour forecast illustrates the difficulty of the rare-event problem.
A useful forecasting system cannot simply wait until the predicted probability exceeds 50%, because doing so could miss a large fraction of actual events.
What Happened to Precision and Recall?
This is where the results become more interesting.
For the 1-hour horizon:
- Baseline precision: 0.0417
- Baseline recall: 0.1093
- Baseline F1: 0.0604
After calibration and threshold optimization:
- Precision: 0.0424
- Recall: 0.1411
- F1: 0.0652
So the 1-hour model achieved:
+0.0317 recall
and
+0.0048 F1
while precision changed only slightly.
This means the optimization helped the model identify more of the actual flare events, but it did not solve the false-alarm problem.
That distinction is crucial.
Results Across All Horizons
The complete test comparison was:
These numbers need to be interpreted carefully.
Get Surendarpurohit’s stories in your inbox
Join Medium for free to get updates from this writer.
The longer horizons have more positive samples because the prediction window is larger. Consequently, their precision can look better without meaning that they are better operational forecasting systems.
The project’s final scientific decision therefore did not simply rank models by F1.
Instead, the horizons were classified according to their practical usefulness.
The Most Important Finding: 1 Hour
The final assessment was:
HorizonStatus1hOperationally promising3hResearch useful6hResearch useful12hLimited use24hNot supported48hNot supported
The 1-hour model emerged as the most promising horizon for nowcasting research.
This does not mean that it is ready for operational deployment.
The test period covers only approximately five months, and false alarms remain substantial.
Therefore, the defensible conclusion is:
The 1-hour GOES-based model shows operational promise, but additional prospective validation is required before operational deployment can be claimed.
The False-Alarm Problem
One of the biggest lessons from this project is that improving calibration does not automatically solve false alarms.
The final analysis explicitly found:
False-alarm reduction: Limited
This is especially important for rare-event forecasting.
A system that generates too many false warnings may become difficult to use operationally, even if it detects a reasonable fraction of real events.
For example, the 1-hour model’s precision was only about 4.2%.
That means most positive predictions were still false alarms.
This is arguably the most important limitation of the current system.
Rather than hiding this result, it provides a clear direction for future development.
Calibration Did Not Improve Ranking Performance
Another important observation was that calibration did not improve the underlying ranking ability of the model.
The project found that:
- AP remained essentially unchanged
- ROC-AUC remained essentially unchanged
This makes sense conceptually.
Calibration changes the mapping between a model score and an interpretable probability.
It does not fundamentally change the ordering of predictions.
In other words:
Calibration can make probabilities more trustworthy without making the model better at ranking flare events.
This distinction is often overlooked in machine-learning projects.
What Worked — and What Did Not?
The final Stage 11 decision can be summarized simply.
What worked
1. Short-horizon probability calibration
Calibration substantially reduced ECE for the 1h–12h horizons.
2. Validation-based threshold optimization
Threshold selection produced modest improvements in F1 and MCC on validation data.
3. Temporal evaluation
The chronological split provided a more realistic forecasting evaluation than a random split.
4. 1-hour nowcasting
The 1-hour horizon showed the strongest potential for practical nowcasting research.
What did not work sufficiently
1. False-alarm reduction
False alarms remained high even after threshold optimization.
2. Long-horizon forecasting
The 24-hour and 48-hour horizons were not supported by the final analysis.
3. Calibration at longer horizons
Calibration actually worsened ECE for the 24h and 48h horizons.
4. Operational readiness
The short test period and remaining false alarms prevent a strong claim of operational deployment readiness.
How This Relates to Previous Solar-Flare Forecasting Research
Machine learning has already been extensively investigated for solar-flare forecasting.
Previous studies have used magnetic-field parameters from SDO/HMI and other solar observations with methods including support vector machines, random forests, neural networks, and deep-learning architectures.
For example, earlier work has demonstrated that machine-learning models can produce useful forecasts for M- and C-class flares over 24-hour windows. Other studies have emphasized the importance of class imbalance, probabilistic forecasting, chronological evaluation, and appropriate decision thresholds.
This project takes a different angle by focusing on GOES X-ray time-series behavior and evaluating multiple future horizons from very short-term nowcasting to longer-term forecasting.
The objective is therefore not to claim that GOES X-ray observations replace magnetogram-based forecasting.
Instead, the results suggest that the temporal information contained in GOES observations can be investigated as a useful component of short-term flare nowcasting.
What Makes the Approach Interesting?
The most interesting aspect of this project is the focus on multiple forecasting horizons.
Rather than asking only:
“Will a flare occur in the next 24 hours?”
the system asks:
“How does forecasting performance change as we move from the next hour to the next two days?”
This exposes an important characteristic of the problem.
The model’s usefulness is not constant across time.
The results suggest that the closer the prediction horizon is to the current observation, the more useful the available X-ray temporal information becomes.
As the horizon increases, the relationship between the current time-series state and the future flare becomes harder to exploit.
This provides a useful research direction for future solar-flare nowcasting systems.
Limitations
The results should not be interpreted without considering the limitations.
1. Short test period
The independent test period covers only approximately five months.
Solar activity changes over the solar cycle, so a longer evaluation period would provide a stronger test of generalization.
2. High false-alarm rate
The precision values remain low, particularly for short horizons.
This is currently the largest obstacle to operational use.
3. Limited long-horizon support
The 24-hour and 48-hour models are explicitly classified as not supported by the current analysis.
4. Calibration is not enough
Although calibration improved probability reliability for shorter horizons, it did not improve ranking metrics or eliminate false alarms.
5. Operational deployment requires prospective testing
A research test on historical data is not equivalent to running the system prospectively.
Before operational use, the model would need continued monitoring on genuinely future observations.
Future Work
The next stage of this project should focus less on simply increasing model complexity and more on improving operational reliability.
Several directions are particularly important.
Adaptive thresholds
A single fixed threshold may not remain optimal under changing solar conditions.
Adaptive thresholds could respond to changes in the distribution of solar activity.
Online calibration
Calibration may need to be updated as the underlying data distribution changes.
The current results motivate investigation of adaptive or online calibration methods.
False-alarm reduction
This is probably the most important technical objective.
Future work should investigate additional temporal features, ensemble methods, cost-sensitive learning, and decision strategies designed specifically around false-alarm costs.
Longer independent evaluation
A much longer test period covering different phases of the solar cycle would provide stronger evidence about generalization.
Multi-instrument forecasting
GOES X-ray information could potentially be combined with magnetic-field information from instruments such as SDO/HMI.
A multimodal model could combine:
magnetic structure + X-ray evolution + temporal behavior
rather than depending on a single observation source.
Final Takeaway
The main result of this project is not that machine learning can perfectly predict solar flares.
It cannot.
The more useful finding is that GOES X-ray time-series data contain measurable short-term information about future flare activity, and that this information appears most useful at short forecasting horizons.
The 1-hour model was classified as the most promising for nowcasting research.
Calibration substantially improved probability reliability for the shorter horizons, while validation-based threshold optimization produced modest improvements in classification performance.
However, false alarms remain high, and the 24-hour and 48-hour horizons are not supported by the current evaluation.
So the appropriate conclusion is not:
“Solar flares can now be predicted accurately.”
It is:
“GOES-based machine learning shows potential for short-term solar-flare nowcasting, particularly at the 1-hour horizon, but substantial work remains before the approach can be considered operationally reliable.”
That is where the project becomes interesting.
The challenge is no longer simply building a model.
It is building a forecasting system that can provide useful, calibrated, timely, and trustworthy warnings without overwhelming users with false alarms.



