A flare prediction method based on multiple deep learning algorithms
By combining 1D-CNN, LSTM, and TCN models, the shortcomings of traditional flare prediction methods in terms of accuracy and timeliness are addressed, achieving efficient and accurate flare prediction and improving the ability of space weather forecasting.
Patent Information
- Application Number
- CN202510739750.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Traditional flare prediction methods have significant limitations in capturing the complex nonlinear evolution of the solar magnetic field, resulting in insufficient prediction accuracy and timeliness, making it difficult to meet the needs of space weather forecasting.
We employ three deep learning algorithms—1D-CNN, LSTM, and TCN—for feature extraction and temporal modeling. We combine SMOTE and undersampling algorithms to address the data imbalance problem and use a weighted average method to fuse the model prediction results, thereby improving prediction accuracy.
It significantly improves the accuracy and reliability of flare prediction, reduces the false alarm rate, and provides important technical support for space weather forecasting, spacecraft protection, and power and communication security.
Smart Images

Figure CN120632452B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of astronomy, space science and machine learning, and relates to a solar flare prediction method, specifically a flare prediction method based on multiple deep learning algorithms. Background Technology
[0002] Solar flares are violent eruptions triggered by intense magnetic reconnection in solar active regions. They release large amounts of high-energy particles and radiation, severely impacting Earth's space environment, power systems, navigation and communications, and spacecraft operations. X-class flares, in particular, and their accompanying coronal mass ejections (CMEs) can cause geomagnetic storms, extreme ionospheric disturbances, and even threaten the safety of space missions. Therefore, accurately predicting the timing, intensity, and spatial distribution of solar flares is a core task of space weather forecasting and is crucial for ensuring the normal operation of a high-tech society.
[0003] Traditional flare prediction methods primarily rely on statistical models and physics-based numerical simulations, such as empirical prediction methods based on sunspot classification (e.g., McIntosh, Mount Wilson classification) or solar magnetic field parameters. However, these methods have significant limitations in capturing the complex nonlinear evolution of the solar magnetic field, and their prediction accuracy and timeliness need improvement. In recent years, with the accumulation of solar observation data and breakthroughs in deep learning technology, deep learning-based flare prediction methods have become a research hotspot. Deep learning methods can automatically learn high-dimensional feature relationships from large amounts of historical data, making them particularly suitable for processing complex spatiotemporal correlations in solar activity data. With NASA's SDO / HMI and GOES satellites providing abundant magnetic field and flare data, deep learning-based flare prediction technology is gradually developing towards real-time and high-precision prediction. Summary of the Invention
[0004] This invention provides an efficient and accurate flare prediction method based on multiple deep learning algorithms. This method utilizes various deep learning techniques to express the features of sequence data and achieves more accurate flare prediction through comprehensive processing, thereby improving the efficiency and accuracy of flare prediction and providing important support for space exploration and activities.
[0005] The objective of this invention is achieved through the following technical solution:
[0006] A flare prediction method based on multiple deep learning algorithms includes the following steps:
[0007] Step S1: Obtain the solar flare magnetic field data file;
[0008] Step S2: Perform data cleaning, remove missing and outlier values from the data, form a dataset, and divide it into training, validation, and test sets;
[0009] Step S3: Normalize the dataset using the Min-Max method, then proceed to step S4;
[0010] Step S4: Use the XGBoost algorithm to calculate feature importance and select important features;
[0011] Step S5: Determine whether the processed training set belongs to a balanced dataset. If yes, proceed to step S8; otherwise, proceed to step S6.
[0012] Step S6: Generate positive samples using the SMOTE algorithm;
[0013] Step S7: Use an undersampling algorithm to reduce negative samples;
[0014] Step S8: Input the obtained balanced training set into the independently trained 1DCNN, TCN, and LSTM models respectively for prediction, and obtain three prediction results;
[0015] Step S9: Use a weighted average method to fuse the prediction results obtained from the three models to obtain the final prediction result.
[0016] Compared with the prior art, the present invention has the following advantages:
[0017] This invention provides a novel method for predicting solar flares, utilizing three deep learning algorithms—1D-CNN, LSTM, and TCN—for efficient feature extraction and temporal modeling of magnetic field parameters in solar active regions. 1D-CNN extracts local spatial features, LSTM captures long-term dependencies in magnetic field evolution, and TCN combines causal convolution and dilated convolution to enhance time-series prediction capabilities. Through multi-model fusion and weighted integration strategies, this invention can more accurately predict the timing and intensity of solar flares, improving forecast reliability and lead time. This invention not only significantly enhances space weather forecasting capabilities but also reduces false alarm rates, providing crucial technical support for spacecraft protection, power and communication security, and Earth's space environment monitoring. Attached Figure Description
[0018] Figure 1 The flowchart shows a flare prediction method based on multiple deep learning algorithms.
[0019] Figure 2 The AUC comparison results are shown for different models. Detailed Implementation
[0020] The technical solution of the present invention will be further described below with reference to the accompanying drawings, but it is not limited thereto. Any modifications or equivalent substitutions to the technical solution of the present invention that do not depart from the spirit and scope of the technical solution of the present invention should be covered within the protection scope of the present invention.
[0021] This invention provides a flare prediction method based on multiple deep learning algorithms. First, data cleaning is performed to handle missing and outlier values, and the dataset is partitioned. Then, Min-Max normalization is used to enhance the numerical stability of the model. Given the numerous magnetic field features, XGBoost is employed for feature selection. To address the class imbalance problem in the dataset, minority class samples are first generated using SMOTE, and then undersampling is used to reduce majority class samples, thereby balancing the positive and negative sample ratios. Next, the data is input into 1DCNN, TCN, and LSTM models respectively, and the prediction results from the three models are fused using a weighted average method to obtain the final prediction result. Figure 1 As shown, the specific steps are as follows:
[0022] Step S1: Obtain the flare magnetic field data file.
[0023] In this step, 25 officially published magnetic field features and flare eruption records were obtained. Specific magnetic field features are shown in Table 1.
[0024] Table 1
[0025]
[0026] When acquiring the magnetic field characteristic data of the active area, it is converted into a CSV format table. This table is then searched for in the flare eruption records according to the recording time and active area number. If no flare record is found, the data is considered a negative sample; if a corresponding flare eruption record is found, the data is considered a positive sample.
[0027] Step S2: Perform data cleaning, remove missing and outlier values from the data, form a dataset, and divide it into training, validation, and test sets.
[0028] The specific methods for data cleaning in this step are as follows:
[0029] a. Missing Value Handling: Check the completeness of each data record. If a single record has a missing value percentage of ≥30% or a missing core parameter (defined as: TOTUSJH, USFLUX, R_VALUE, MEANPOT, SHRGT45, MEANJZH, and TOTBSQ), then the record is marked as invalid. For records with a missing value percentage <30% and missing non-core parameters, fill in the missing non-core parameters (mean imputation) and do not mark the record as invalid.
[0030] b. Outlier detection: An improved robust Z-score method is used to check complete data records. Data that exceeds the range (defined as: modified_z > 3.5) is directly marked as erroneous data.
[0031] c. Data deletion rules: Delete records that meet any of the following conditions: marked as invalid data, marked as erroneous data.
[0032] In this step, a non-overlapping partitioning strategy is used to divide the dataset into training, validation, and test sets according to the time series. The time window is a continuous 24 hours, and the sliding step is 1 hour. The training set contains samples from the first 70% of the time period, the test set contains the last 5%, and the validation set contains the remaining 15%. A 24-hour isolation zone is set between the three sets to prevent information leakage.
[0033] Step S3: Normalize the dataset using the Min-Max method, then proceed to step S4.
[0034] In this step, the Min-Max method is used to normalize different features with very large ranges. Note the normalization parameters ( , This is calculated only from the training set and applied simultaneously to the validation and test sets. The specific formula is shown below:
[0035] (1)
[0036] in, and These represent the values before and after scaling, respectively. and These represent the minimum and maximum values, respectively.
[0037] Step S4: Use the XGBoost algorithm to calculate feature importance and select important features.
[0038] In this step, the following operations are performed using only the training set data:
[0039] a. Train the XGBoost model (parameters: max_depth=6, learning_rate=0.3, n_estimators=100).
[0040] b. Calculate the sum of the gains of each feature on the training set according to formula (2). :
[0041] (2)
[0042] in, Features The total gain generated from splitting all decision tree nodes. For the feature variables whose importance is to be assessed, For all decision trees, through features The set of instances that perform node splitting. The index of the split node in the decision tree. For the node The loss function value before splitting, For the node The sum of the weighted losses of its child nodes after the split.
[0043] c. Calculate the feature importance according to formula (3) :
[0044] (3)
[0045] in, For the first in the dataset There are 25 features (a total of 25 magnetic field parameters).
[0046] d. Selection Features with a value greater than 0.05 form the final feature set F_selected.
[0047] e. Apply the feature set F_selected to the training set, validation set, and test set simultaneously to ensure that the data dimensions input to the model are consistent.
[0048] Step S5: Determine whether the processed training set belongs to a balanced dataset. If yes, proceed to step S8; otherwise, proceed to step S6.
[0049] In this step, it is necessary to determine whether the training set is balanced, and if not, how to perform the appropriate balancing process. The specific method is as follows:
[0050] The formula for calculating the class imbalance index of the training set is as follows:
[0051] (4)
[0052] in, and These represent the number of positive and negative samples, respectively.
[0053] When IR≥5, proceed to step S6 to perform balancing (Note: This step is only applied to the training set; the validation set and test set maintain their original data distribution): When IR<5, the training set is a balanced dataset, and step S8 is executed directly.
[0054] Step S6: Use the SMOTE algorithm to generate positive samples.
[0055] In this step, the SMOTE algorithm is used to generate synthetic samples, and the positive samples are amplified to 80% of the negative samples (nearest neighbor number k=5), and then the process proceeds to step S7.
[0056] Step S7: Use an undersampling algorithm to reduce negative samples.
[0057] In this step, K-Means undersampling is performed on the negative samples (the number of clusters is twice the number of positive samples), and then the process proceeds to step S8.
[0058] Step S8: Input the obtained training set into the independently trained 1DCNN, TCN, and LSTM models respectively for prediction, and obtain three prediction results.
[0059] In this step, the processed training set is input into the 1DCNN, TCN, and LSTM models respectively, and the three models are trained independently. The specific implementation is as follows:
[0060] (1) Input the training set into each model according to the following specifications:
[0061] 1DCNN: Input a 3D tensor with shape (training set size, 24, 15).
[0062] TCN: The input shape is (training set size, 15, 24), then transposed to (training set size, 24, 15) to fit the temporal convolution.
[0063] LSTM: Input a 3D temporal tensor with shape (training set size, 24, 15).
[0064] (2) The configuration for independent training of each model is as follows:
[0065] 1DCNN model:
[0066] a. Structure:
[0067] First convolutional layer: 15 input channels, 32 output channels, kernel length 3, stride 1, padding 1.
[0068] ReLU activation function.
[0069] Maximum pooling layer (pooling window length 2).
[0070] Second convolutional layer: 32 input channels, 64 output channels, kernel length 3, stride 1, padding 1.
[0071] The flattened layer outputs a 1024-dimensional feature vector (64 channels × 16 time steps).
[0072] The fully connected layer is mapped to a 1D output.
[0073] b. Training parameters:
[0074] Optimizer: Adam (β1=0.9, β2=0.999).
[0075] Initial learning rate: 0.001 (cosine annealing adjustment).
[0076] Batch size: 128.
[0077] Early termination method: Terminate when the loss on the validation set has not decreased for 15 consecutive rounds.
[0078] TCN model:
[0079] a. Structure:
[0080] Four layers of dilated causal convolutions, with dilation coefficients of 1, 2, 4, and 4 respectively.
[0081] Each layer has 64 convolutional kernels with a kernel length of 3.
[0082] Global max pooling layers compress the time dimension.
[0083] The fully connected layer outputs a 1D prediction result.
[0084] b. Training parameters:
[0085] Optimizer: NAdam.
[0086] Initial learning rate: 0.002.
[0087] Weight decay: 1e-5.
[0088] Gradient clipping threshold: 1.0.
[0089] LSTM model:
[0090] a. Structure:
[0091] Unidirectional LSTM layer: 2 layers stacked, 32 hidden units per layer.
[0092] Fully connected layer: 32-dimensional input is mapped to 1-dimensional input.
[0093] b. Training parameters:
[0094] Dropout rate: 0.3.
[0095] Initial learning rate: 0.001 (step decay, 0.1 every 50 rounds).
[0096] Sequence length: 24 steps.
[0097] (3) Each model satisfies the following independent conditions:
[0098] a. Parameter independence: The model weight initialization does not affect each other (1DCNN uses He initialization, TCN uses Xavier initialization, and LSTM uses orthogonal initialization).
[0099] b. Gradient isolation: Gradient sharing or parameter fusion across models is prohibited during training.
[0100] Step S9: Use a weighted average method to fuse the prediction results obtained from the three models to obtain the final prediction result.
[0101] In this step, the AUC (Area Under the Receiver Operating Characteristic Curve) of each model is first calculated on the validation set. Weights , , Calculated using AUC normalization:
[0102]
[0103] (5)
[0104]
[0105] in, , and Each represents a single model The AUC values obtained from TCN and LSTM models.
[0106] Then, the final integrated prediction result is calculated according to the weighted average formula (6):
[0107] (6)
[0108] in, For the final prediction result, , and Each is a single model The predicted probabilities obtained from TCN and LSTM.
[0109] Finally, the test set was used for final performance verification, and the specific experimental results are shown in Table 2:
[0110] Table 2 Prediction effect provided by the present invention
[0111]
[0112] The results in Table 3 can be obtained by comparing the prediction methods with those proposed by others.
[0113] Table 3 Comparison of prediction performance between the present invention and existing algorithms.
[0114]
[0115] Feature importance analysis was performed on the obtained dataset using the XGBoost method, and the top 15 features were selected for model training. Since solar flares are low-probability events, class imbalance is highly likely in the dataset. When the dataset was determined to be imbalanced, the SMOTE method and undersampling were used to address the class imbalance. (As...) Figure 2 The red data represents data processed using class imbalance techniques, while the blue data represents unprocessed datasets. Using these datasets to train 1DCNN, TCN, LSTM models, and an ensemble model of these three (1DCNN-TCN-LSTM), we can obtain the following results: Figure 2 The data results shown in the figure demonstrate that the ensemble model obtained through the weighted average method significantly outperforms the single model.
Claims
1. A flare prediction method based on multiple deep learning algorithms, characterized in that... The method includes the following steps: Step S1: Obtain the solar flare magnetic field data file; Step S2: Perform data cleaning, remove missing and outlier values from the data, form a dataset, and divide it into training, validation, and test sets; Step S3: Normalize the dataset using the Min-Max method, then proceed to step S4; Step S4: Calculate feature importance using the XGBoost algorithm and select important features. The specific steps are as follows: a. Train the XGBoost model; b. Calculate the sum of the gains of each feature on the training set. : in, Features The total gain generated from splitting all decision tree nodes. For the feature variables whose importance is to be assessed, For all decision trees, through features The set of instances that perform node splitting. This is the index of the split node in the decision tree. For the node The loss function value before splitting, For the node The sum of the weighted losses of its child nodes after the split; c. Calculate the importance of features : in, For the first in the dataset One feature; d. Selection Features with a value > 0.05 form the final feature set F_selected; Step S5: Determine whether the processed training set belongs to a balanced dataset. If yes, proceed to step S8; otherwise, proceed to step S6. The specific steps are as follows: Calculate the class imbalance index of the training set : in, and These represent the number of positive and negative samples, respectively. When IR≥5, proceed to step S6 to perform balancing; when IR<5, the training set is a balanced dataset, and proceed directly to step S8. Step S6: Generate positive samples using the SMOTE algorithm; Step S7: Use an undersampling algorithm to reduce negative samples; Step S8: Input the obtained balanced training set into the independently trained 1DCNN, TCN, and LSTM models respectively for prediction, and obtain three prediction results; Step S9: Use a weighted average method to fuse the prediction results obtained from the three models to obtain the final prediction result.
2. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S1, when the magnetic field characteristic data of the active area is obtained, it is converted into a CSV format table and searched in the flare eruption record according to the recording time and active area number. If no flare record is found, the data is a negative sample; if the corresponding flare eruption record is found, the data is a positive sample.
3. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S2, the specific steps of data cleaning are as follows: a. Missing value handling: Check the integrity of each data record. If the missing value ratio of a single data record is ≥30% or the core parameter is missing, then mark the record as invalid data. For missing values <30% and non-core parameters are missing, fill in the missing non-core parameters and do not mark the record as invalid data. b. Outlier detection: The complete data records are checked using an improved robust Z-score method, and data that exceeds the range is directly marked as erroneous data; c. Data deletion rules: Delete records that meet any of the following conditions: marked as invalid data, marked as erroneous data.
4. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S3, the normalization formula is as follows: in, and These represent the values before and after scaling, respectively. and These represent the minimum and maximum values, respectively.
5. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S6, the SMOTE algorithm is used to generate synthetic samples, amplifying the positive samples to 80% of the negative samples, and then proceeding to step S7.
6. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S7, negative samples are undersampled using K-Means, and then the process proceeds to step S8.
7. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S8, the training set is input into each model according to the following specifications: 1DCNN: Input is a 3D tensor with shape (training set size, 24, 15); TCN: The input shape is (training set size, 15, 24), then transposed to (training set size, 24, 15) to fit the temporal convolution; LSTM: Input a 3D temporal tensor with shape (training set size, 24, 15); Each model satisfies the following independence conditions: a. Parameter independence: The model weight initialization does not affect each other. 1DCNN uses He initialization, TCN uses Xavier initialization, and LSTM uses orthogonal initialization. b. Gradient isolation: Gradient sharing or parameter fusion across models is prohibited during training.
8. The flare prediction method based on multiple deep learning algorithms according to claim 1, characterized in that... In step S9, the weighted average formula is: in, For the final prediction result, , and Each is a single model The predicted probabilities obtained from TCN and LSTM , , Each represents a single model The weights of TCN and LSTM models , and Each represents a single model The AUC values obtained from TCN and LSTM models.
Citation Information
Patent Citations
Solar flare dichotomy prediction method based on support vector machine
CN113902053A
Solar flare spectral line inversion method
CN119358245A