Solar Flare Forecasting with Data-driven Interpretable Model
Anonymous Author(s)
AffiliationAddress
Abstract
Solar flares are the most violent activities in the solar system, which are generatedby evolutions of magnetic field in solar active regions.
However, the triggeringmechanism of solar flares is still an active research area and many algorithms areproposed to forecast solar flares based on different models In this paper, we proposea novel data-driven and explainable algorithm, which could not only achieve over90 % precision rate and low false alarm rate to forecast solar flares, but also showthe show the mechanism in forecasting solar flares.
The algorithm proposed inthis paper is built with CNNs and LSTM to percept continuous magnetic fieldobservation data with 6 hours long.
At the last layer, a Bayesian neural network isused to predict the probability of flares with different levels in the next 24 hours.
We propose to use the class activation mapping (CAM) to analyze the mechanismin triggering of solar flares.
Through the analysis of attention map, it is concludedthat the prediction model mainly focuses on the strong magnetic field area, thepolarity reversal line and the magnetic field conversion area, which is consistent totheory predictions
Introduction
The changes of Earth space environment due to solar activity, which will bring catastrophic effects toaerospace, communication navigation, oil pipelines and power grids etc.
Solar flares are one of themost important forms of solar activity.
Therefore, it is of great significance to study the triggeringmechanism of solar flares and establish an accurate and reliable solar flare forecasting model, toavoid or reduce the impact of solar flares on human beings.
So far the specific physical mechanism of solar flare eruption has not been very clear and theforecasting model of solar flare based on physics is still in the research stage [13, 11, 16].
Theexisting prediction model mainly relies on the statistical relationship between flare eruption recordsand historical observation data.
Traditional flare forecasting models mainly rely on manual experienceand domain knowledge to extract characteristic parameters related to solar flares from observed datato forecast solar flares[6, 2, 17, 1, 7].
It is difficult to make full use of the information related to solarflares contained in massive observational data.
In recent years, machine learning technology has been developed, especially the data modelingmethod represented by deep learning, which can automatically extract effective features from data,providing a new way for flare prediction research.
Studies have shown that most of the solar activityparameters used for solar flare prediction are extracted from solar magnetogram, and there are manyfeatures related to solar flare eruption in solar magnetogram.
In deep learning, convolutional neural networks can automatically extract effective features from images, so many researchers have appliedconvolutional neural networks [8, 14, 12, 9, 18] to the establishment of solar flare prediction models.
Meanwhile, the dynamic change of the solar active area over time is closely related to the eruptionof solar flares, and the long short-term memory network is often used to process sequence data toanalyze the correlation of features in the temporal dimension [3, 4, 15].
These methods perform well on classification problems, but they still have their own limitationsin capturing the evolution of solar flares, mainly reflected in: 1.The characteristics of physicalparameters of continuous solar magnetic field activity region over time are not considered; 2.Thesloar flares prediction problem is regarded as a deterministic problem without considering the randomand sudden characteristics of flares; 3.Input data needs to be preprocessed before being input into themodel.
A Bayesian spatio-temporal connection solar flare forecasting model based on deep learning isproposed to predict the probability of various solar flares in the next 24 hours.
Meanwhile, we use theclass activation mapping technology to draw the focus area of the model and analyze the mechanismin triggering of solar flares.
Moreover, our method does not require pre-processing of input data.
This article is orginzed as follows:
A forecasting model based on the deep learning method is proposedin Section 2; The interpretability of the model is investigated in Section 3; The performance ofthe prediction model and the interpretability of the model in Section 4; Finally, discussions andconclusions are provided in Section 5.
Forecasting model
The study shows that continuous solar magnetic field data can be used to predict the probabilityof future flares in the active region.
Therefore, Therefore, solar flare prediction is regarded as avideo prediction problem, and the occurrence of solar flare is random and unexpected.
Bayesianspatio-temporal connection solar flare forecasting model based on deep learning is proposed toachieve the probability of projections for the future of all kinds of the occurrence of flares.
The modelmainly includes two parts: Feature extractor and Forecasting model .
Feature extractor extracts thespatial features of each magnetogram frame and its correlation in the time dimension.
Forecastingmodel to forecast the maximum brightness distribution, after by setting different threshold, to givethe probability of all kinds of solar flares occur.
The overall structure is shown in Figure 1.
2.1 Feature extractor
The extraction of spatiotemporal features of continuous solar magnetic field data is particularlyimportant because continuous field observations are the number of frames of video sequences.
In theexisting deep learning methods, the combination (LRCN)[5] of convolutional neural networks(CNNs)and long short-term memory(LSTM) neural network is mainly used to fully consider the spatialfeatures in the video and its characteristics over time.
CNNs is used to extract image features, and
LSTM is used to analyze the correlation of feature sequences in the temporal dimension.
LRCNusually requires the size of the input picture to be fixed to ensure the link between CNNs and LSTM.
However, we did not want to do anything with the magnetic field data, so we modified the LRCN byadding a GAP between the CNN and the LSTM.
The specific feature extraction process is as follows:
Convolutional neural networks (CNNs) are suitable for extracting the basic features of imagesand reducing the complexity of the model.
Therefore, CNNs are used as the spatial feature extractionnetwork of magnetograms, namely Encoder , to capture the spatial interaction, maintain the spatialcontinuity of the image, and extract the spatial features of magnetograms.
The structure of Encoder isshown in the Figure 2 , which consists of four convolution block composed of convolution layer,instance normalization layer and Relu activation function.
Global average pooling (GAP) [10] can compress spatial features extracted by Encoder, poolingthe data of different scales to the same size, and reducing the number of parameters and calculationin the model to prevent overfitting.
The specific operation is to perform global average pooling on
LSTM
GAP
Encoder
LSTM
BB F C
GAP GAP
LSTM LSTM
H t
Analysis
N:0.2, C:0.5, M:0.1, X:0.
Distribution of the peak x-ray flux ...
Encoder Encoder Encoder
Encoder Encoder Encoder
E t
I t
G t
Initial state
Final state
H t+
E t+
I t+
G t+ .......
H t+s
E t+s
I t+s
G t+s the feature map of each channel to obtain a value, as shown in the Figure 2.
3.Long Short Term …
Global Average Pooling feature maps averaging I t
E t
G t
C o n v d
B a t c h N o r m 2 d
R e L U
C o n v d
B a t c h N o r m 2 d
R e L U
C o n v d
B a t c h N o r m 2 d
R e L U
C o n v d
B a t c h N o r m 2 d
R e L U
E t
Encoder
[Figure]
5 × 5, 2),Block2 (64, 3 × 3, 2), Block3 (128, 3 × 3, 2), Block
(256, 3 × 3, 2).
82 Memory(LSTM) extracts the change information of spatial features of magnetic maps, so as to studythe correlation of continuous magnetic maps in the dimension of time.
This paper use a single-layerbidirectional LSTM structure, which contains a hidden layer with 256 nodes and the input data arethe spatial features of the continuous magnetic map extracted by Encoder.
2.2 Prediction model
The prediction model is required to have the ability of uncertainty modeling and inference whenpredicting flare, because of the randomness and suddenness of flare occurrence and the existence ofgeneral uncertainty.
Bayesian network based on probability reasoning has great advantages in solvingthe uncertainty.
It is a neural network model regularized by introducing uncertainty into the weight ofthe neural network.
This model achieves a balance between underfitting and overfitting by learningthe probability distribution over the weights of the neural network.
Here, Bayesian neural networkis used as the maximum X-ray brightness prediction model to introduce uncertainty into the flare prediction model, predict the distribution of the maximum X-ray brightness.
And then the probabilityof each type of flare is given by setting different thresholds.
Interpretability analysis
In a data-driven way, the flare prediction model can learn the statistical relationship between continuous magnetic field observation data and solar flares, and the region related to the solar flares canbe obtained according to the focus area of the feature extraction model, so as to further analyze thecharacteristics of flare triggering.
Grad-CAM [10] can help us analyze the focus area of the modelfor the output results.
Through the focus area of the model, we can in turn analyze whether the modellearns the right features or information, or find some rules from it.
[Figure]
Regression task is taken as the basic task of the model, and the specific flow of Grad-cam is shownin Figure 3 .
The model first conducts forward propagation to obtain the feature layer E and thenetwork predictive value Out .
Then the back propagation of Out can get the gradient informationof the feature layer.
By calculating the importance of each channel in the feature layer, and thenweighted summing through ReLU , the final result is Grad-CAM, as shown in Figure 2.
The formula1 2 is shown below:
[Equation]
Where E stands for the feature layer output by encoder, k represents the k channel in feature layer
E , E k stands for the data of channel k in feature layer E , and w k stands for the weight of networkoutput result for E k .
[Equation]
Where y stands for the predicted value of the network output, K kij represents the data at ij of featurelayer E in channel k , Z is equal to H × w .
The above is for the case that a single image is taken as input, but the data we input is video data, sowhen carrying out weighted summation, it is necessary to carry out weighted summation of featuresof the same frame to obtain Grad-CAM of the model for different frames.
Experiment design and result analysis
4.1 Production of data sets
At present, solar active region data mainly come from SDO/HMI data and SOHO/MDI data.
Since1996, these two types of data have provided consistent, high-quality data on solar active regions.
Among them, the SOHO/MDI data starts and ends from January 1 1996 to April 12 2011.
SDO/HMI is the successor of SOHO/MDI.
It has accumulated more than 10 years of data since it started dailyobservation on April 30 2010, and its sampling frequency is 12 minutes.
According to the peak valueof soft X-ray flux observed by the Geostationary Operational Environmental Satellite System (GOES),solar flares can be classified into A, B, C, M, and X classes, with the energy released increasingsuccessively.
The values following each class represent the specific values of the peak X-ray flux.
The data can be downloaded from (https://www.ngdc.noaa.gov/stp/space-weather/solardata/solarfeatures/solar-flflares/x-rays/goes/xrs/).
In this paper, SDO/HMI data with high image data quality are used for continuous magnetic fielddata.
The data can be from joint scientific operations center (JSOC) database SHARPs data sequence.
We downloaded 2010.
The data of 5-2021.5 (the time interval is 1h) is used as the magnetic fielddata of the active area.
During the loading process, the SHARP parameter of the active area of spaceweather HMI is used to delete the active area.
The data has to be 1) disambiguated with a version ofthe disambiguation module greater than 1.1, 2) taken while the orbital velocity of the spacecraft isless than 3500 m/s, 3) of a high quality, and 4) within 70 degrees.
According to GOES, there were 839 active flares larger than A1.0 that met these requirements between
May 2010 and May 2021.05.
Since the influence of A and B is not significant and insignificant, westudy the flares with flare grades greater than C, M and X, and A total of 5252 flares greater than
C1.0 have occurred.
The data amount of all kinds of data is shown in Table 1.
For the production of
[Table]
10 − 5 ≤ M < 10 − 1000 × n 979 \10 − 4 ≤ X 100 × n 472 \140 labels, previous studies have used flare prediction as a classification task, and there is no relationshipbetween classes.
In fact, the flare outburst problem we study has a certain size relationship betweenclasses, so we regard it as a regression problem here.
Our label is generated according to the peakflow of soft X-ray, and the specific value is shown in Table 1 .
At the same time, due to the imbalanceof three types of C, M and X data, setting such a value is also conducive to reducing the result biascaused by data imbalance.
According to the number of flares occurring in each active area, multiple time points are randomlyselected from each active area as the starting point of our prediction time, and then the data sets andcorresponding labels are synthesized according to the prior and posterior time periods.
In the data set,we randomly selected 10 % of the active area data as the test set, and the rest as the training set.
4.2 Experiment
Based on the data-driven solar flare prediction model, a large number of labeled observation dataare used to train the forecast model, and the statistical relationship between magnetic map and solarflare occurrence is learned, so as to forecast the solar flare.
We also further used the class activationmapping (CAM) to analyze the triggering mechanism of solar flares.
In this paper, we investigate theperformance of the network using 6 hours of continuous magnetic field observations to predict theprobability of various flares occurring within the next 24 hours.
The training set is used to train thenetwork, and when the training process is complete, the performance of the prediction model can beestimated by the test set.
4.2.1 The distribution of the maximum X-ray brightness
We use the Bayesian neural network as the last layer of the network to predict the distribution ofthe highest brightness in the next 24 hours.
Since the Bayesian network will learn the probability distribution on the weight of the neural network, we will get different highest brightness values for asingle sample, forming a distribution, as shown in Figure 4.
We show the results of four types of N,
C, M and X prediction, and calculate the corresponding probability of flare occurrence based on thethreshold value given by the way the tag is made.
The title is the time range of the prior time periodentered, the upper left corner is the probability of occurrence in the next 24 hours, the mean andstandard deviation.
It should be noted here that since the output result of the model is the distributionof the maximum X-ray brightness, we can set different thresholds to study the prediction results.
   
 7KHSHDNYDOXHRI;UD\ 
    ' H Q L V W \ BBBBB7$,BBBBB7$, PHDQVWG
ODEHO1RXW^ 1 
 & 
0  ;
`          7KHSHDNYDOXHRI;UD\          ' H Q L V W \ BBBBB7$,BBBBB7$, PHDQ
VWG ODEHO&RXW^ 1  &
 0  ;
`   
    7KHSHDNYDOXHRI;UD\          ' H Q L V W \ BBBBB7$,BBBBB7$, PHDQ

VWG
 ODEHO0RXW^ 1  &  0  ;
`          7KHSHDNYDOXHRI;UD\      ' H Q L V W \ BBBBB7$,BBBBB7$, PHDQVWG
 ODEHO;RXW^ 1  &  0  ;
`
4.2.2 Classification results
We randomly sampled 50 samples from each type of solar flare in the test set to investigate theoverall performance of the prediction model.
For each sample, the result of the model output is thedistribution of the highest brightness in the next 24 hours, and further by setting the threshold, theprobability of different flares is obtained.
In the analysis process, we choose the flare type with thehighest flare probability as the output to study the classification results of the network.
For the binary classification task of whether a flare occurs or not, we set different thresholds to studythe prediction results of the model.
As shown in the following table 2, TP rate is the percentageof positive instances correctly classifified, TN rate is the percentage of negative instances correctlyclassifified.
Precision is the percentage of how many positive predictions are actually positive.
Allaccis the percentage of all correctly classified samples in the total sample.
The table shows the comparisonbetween our algorithm and different algorithms, from which it can be seen that our model can achievemore than 90 % accuracy for different threshold divisions, and maintain a low false positive rate.
The confusion matrix shows the difference between the actual and predicted values, with the elementson its main diagonal corresponding to the correct classification, while the other elements tell us howmany samples in a category are incorrectly assigned to other categories as a proportion of the totalnumber of categories.
It tells us intuitively how much data is correctly predicted and which data isnot correctly predicted.
So here we use confusion matrix to study the multi-classification results ofthe model.
It is worth noting that specific categories are divided according to labels.
It can be seenfrom the table 3 that the model makes good predictions for no flares (N) and large flares (X), whilefor small flares C is more likely to be predicted as M, and M is more likely to be predicted as C.
[Table]
[Table]
4.2.3 Attention area
Based on the data-driven model, the model automatically extracts features related to flares from thedata to predict flares.
If the model can correctly predict the classification result of flares, it can beconsidered that the model has extracted effective features.
Here, we use Grad-CAM to study thefeatures extracted by the model.
Figure 5 shows the magnetic map of a frame in AR12192, the focus area of the model on the map,and the result of the multiplication of the two.
It can be seen that the focus area of the model is mainlyin the polarity reversal region and the strong magnetic field region.
Figure 6 shows the change ofthe magnetic map within 24 hours before the occurrence of a large flare (the time interval is 3h) toshow the change of the model’s focus area.
This show the model also focuses on the magnetic fieldconversion area.
for active regions 12192.
Future work
We propose a data-driven solar flare prediction model, which can extract effective features fromcontinuous magnetic maps to achieve distribution prediction of maximum brightness in active regionsover the next 24 hours.
Forecast model of the test results show that (1) can be the model for a singlesample of highest brightness distribution prediction, can realize the characteristics of randomness,forecast model (2) the statistical results, further research model can realize not only predict the flareoccurred or not more than 90 % accuracy, and compared with other algorithms to predict solar flarescan be reduced by the rate of false positives.
(3) By analyzing the effective features extracted fromthe model, we can find that the regions that the network pays attention to are mainly polar reversalregions, strong magnetic field regions and the magnetic field conversion area.
The data-driven method is used to find out the region concerned by the model, so as to study the change of the magneticfield of the flare from zero to presence, and find some parameters related to the flare generation, topromote the study of the flare mechanism.