Solar Cycle 25 Prediction Using an Optimized Long Short-Term Memory Mode with F10.7

In this paper, an optimized long short-term memory (LSTM) model is proposed to deal with the smoothed monthly F10.7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$F_{10.7}$\end{document} data, aiming to predict the peak amplitude of F10.7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$F_{10.7}$\end{document} and the occurring time for Solar Cycle 25 (SC-25) to obtain the maximum amplitude of sunspot number (SSN) and the reaching time. The “re-prediction” process in the model uses the latest prediction results obtained from the previous prediction as the input for the next prediction calculation. The prediction errors between the predicted and observed peak amplitude of F10.7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$F_{10.7}$\end{document} for SC-23 and SC-24 are 2.87% and 1.09%, respectively. The predicted peak amplitude of F10.7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$F_{10.7}$\end{document} for SC-25 is 156.3, and the maximum value of SSN is calculated as 147.9, which implies that SC-25 will be stronger than SC-24. SC-25 will reach its peak in July 2025.


Introduction
The variable activity of the Sun changes the space environment in the solar system, which is manifested in changing the flux of solar radiation, solar magnetic fields, and solar energetic particles. The phenomena that embrace as space weather are due to the energetic events, such as flares and coronal mass ejections (CMEs), that introduce extreme perturbations in our space, which could affect the conditions of satellites and the health of astronauts, destroy communications and navigation networks based on satellite, high-frequency radio communications, and air-traffic (Nandy, 2021). Therefore, it is critical to assess and predict space weather for the protection of modern-day technologies.
The solar radio flux at 10.7 cm (2800 MHz) is an excellent and one of the most widely used indicators of solar activity, which is often called the F 10.7 index and is one of the M. He hemu@bbgu.edu.cn 1 longest-running records of solar activity (Tapping, 2013). The F 10.7 has been measured consistently in Canada since 1947, first in Ottawa (Covington, 1948(Covington, , 1952; it can be measured accurately and reliably from the ground in all weather conditions with few spacing or calibration problems. The F 10.7 is highly correlated with the sunspot number (SSN), a number of Ultra Violet (UV) and visible solar irradiance records. The production processes of the F 10.7 and SSN are completely independent and different, but they had parallel changing trends over the last 73 years, which retraced the same evolution of the last seven solar activity cycles. A 13-month Zurich smoothed F 10.7 and geomagnetic (Ap) index intermediate (months) and long-range (years) statistical estimation technique was developed by the NASA Marshall Space Flight Center (MSFC) (Niehuss, Euler, and Vaughan, 1996;Vaughan et al., 1999). Pesnell and Schatten used an Ap/F 10.7 geomagnetic precursor pair for forecasting the amplitude of SC-25, indicating that it would be much weaker than average (Schatten and Pesnell, 1993). Later they combined F 10.7 with the solar dynamo (SODA) index and values of the solar polar magnetic field as the precursor of SC-25, and the predicted maximum amplitude of SSN was 135 ± 25 occurring in 2025.2 ± 1.5 (Pesnell and Schatten, 2018). Clette (2021) reviewed the proxy relations between SSN and F 10.7 , due to their strong correlation, allowing conversions between them.
Besides the above studies, Nandy (2021) categorized and summarized the predictions for SC-25 in 7 types of utilized methods, and the mean predicted peak amplitude of all SC-25 predictions was found as 136.2 ± 41.6. The precursor method is the classic method for the prediction of the peak amplitude of the next solar activity and is based on the observed values of solar activity or magnetic field in a chosen period (Helal and Galal, 2013;Hawkes and Berger, 2018;Hazra and Choudhuri, 2019). Few studies utilized machine learning and neural networks for the prediction of solar cycle amplitude. Only six were done for SC-24 (Prasad et al., 2022). Long Short-Term Memory (LSTM) neural network was used in combination with other models for the prediction of SC-25 (Pala and Atici, 2019;Benson et al., 2020;Lee, 2020;Prasad et al., 2022). Several machine learning methods were used by Dani and Sulistiani (2019) to compare the predicted peak amplitude of SSN for SC-25, and the obtained results were different among these methods, namely: 159.4 ± 22.3, 95.5 ± 21.9, 110.2 ± 12.8, and 93.7 ± 23.2 respectively for Linear Regression (LR), Radial Basis Function (RBF), Random Forest (RF) and Support Vector Machine (SVM), and peak occurring times of SC-25 would be September 2023, December 2024, December 2024 and July 2024. Other methods based on a non-linear model (Kitiashvili, 2020;Sarp et al., 2018), statistical methods used feature parameters of the solar cycle to predict the behavior of SC-25 (Li, Feng, and Li, 2015;Singh and Bhargawa, 2017;Kakad, Kumar, and Kakad, 2020), and spectral methods (Rigozo et al., 2011) also obtained different prediction results of the maximum SSN or the peak amplitude of SC-25 with the occurring time.
An optimized LSTM model (defined as LSTM+ model) is proposed in this paper to predict the peak amplitude and occurring time of F 10.7 in the coming cycle and then to calculate a forecast for the SSN of SC-25 based on the relation between F 10.7 and SSN. The results indicate that the proposed LSTM+ model fits the long-term prediction of F 10.7 perfectly, and the precision is much better than that obtained by the general neural network method, such as Back Propagation (BP).

Datasets and Preprocessing
The F 10.7 data used in this work are obtained from the "Natural Resources Canada" under the Government of Canada and correspond to the period from April 1954 to December 2019 (the 789 months). They are publicly available on the website (www.spaceweather.gc.ca/forecastprevision/solar-solaire/solarflux/sx-5-en.php). The data for the SSN are the monthly averages from the Sunspot Index and Long-term Solar Observations (SILSO) database of the Royal Observatory of Belgium in Brussels and correspond to the same period as the F 10.7 dataset. Then the monthly averaged data for F 10.7 were calculated under the following equations based on the number of daily observations, in which data before January 1996 were used the equation ①, and data after March 1996 were based on the equation ②, particularly, the value of February 1996 was calculated with the combination of ① and ②. Here, X t is the average monthly value, n is the days of the current month, X d is the daily value of the current month. X 1d , X 2d , X 3d presents the value of three observation periods of each day, respectively.
After that, the smoothed monthly mean values of F 10.7 were calculated according to the following equation (Conway, 1998;Peng, 2020). Supposing R(i) is the i th smoothed monthly mean F 10.7 . Figure 1 shows the smoothed data of SSN and F 10.7 during the considered period, showing that both quantities have the same fluctuating trend, corresponding to the 11-year periodic changes associated with solar activity.

LSTM+ Methods
LSTM neural networks were designed to solve the problem of long-term dependence in a neural network so that the neural network can remember long-term information by default (Xu et al., 2020). This solves the problem of vanishing and exploding gradients during the longtime sequence training. There are three gates in LSTM, which are: the Forget gate, the Input gate and the Output gate, and one memory state unit (Ma et al., 2021). LSTM has been widely used in training neural networks, but few studies have employed it with the fine adjustment of the parameters (Absar et al., 2022). The number of neurons (N) is the number of nodes in the hidden layer of the LSTM model, which could directly affect the performance of the network. A too-small value of N could cause the failure of the training and poor performance, but a too-large value of N would prolong the training time and cause falling into local minima. The batch size (B) is the data volume that feeds into the model each time, which could cause the hindrance of reaching convergence for the model with a small value of B. However, the improvement of the memory utilization and parallelization efficiency with an increasing value of B, the same accuracy, would require a higher number of training rounds (Wang, Li, and Guo, 2021). An Epoch (E) is the number of times the model is trained. Because of the significant influence of these parameters on the training quality and the prediction precision of the LSTM model, it is of great interest to find their most suitable values to enhance the precision. The proposed optimized LSTM model (LSTM+) is based on the traditional model with two improved aspects, one is the multiple fine adjustments of all important model parameters (N, B, E) and the replacement of different optimizers in the training and prediction process, and the other is the re-prediction process which uses the latest prediction results obtained from the previous prediction as the input data.
• The re-prediction procedure The procedure that uses the outputs from the previous prediction as the input for the next prediction is defined as re-prediction. The purpose of this procedure is to get the "true" prediction of the changing trend rather than the "fake" form using the actual values as the input in the model, which just proves the verification of the model with the existing data but without the real ability to predict the future trend. This means that the whole final predicted result is the deduction instead of the modification of the actual data. When the validation of the model is performed in this way, the prediction using this model could be able to really predict the future.
The approach used for the re-prediction procedure takes the whole value of the predicted outputs from the latest prediction as the input for the next prediction. The workflow of the re-prediction procedure is shown in Table 1, where i indicates the number of predictions, n is the length of the input, m the length of the output, x t+i is the input value, h t+i the output values, and the relationship is followed by x t+i = h t+i .

• The fine adjustment parameters in LSTM+
The batch size (B) was fixed to 100, according to earlier experience with LSTM+. The values of N and E were adjusted in pairs under 4 situations with different lengths of input and output. Adam and Nadam optimizers were used in each adjustment and compared to obtain the more suitable one. The Nadam optimizer is the Nesterov version of the Adam optimizer with a default learning rate of 0.002. The data of F 10.7 from SC-19 to SC-22 were used in the training and prediction in LSTM+ for SC-23, and data from SC-19 to SC-23 were used for SC-24. Additionally, the hidden layer in the LSTM+ model was set to 1. The detailed adjustments of these parameters are shown in Table 2. Figure 2 shows the absolute percentage error of the peak value (E r ) results in the adjustments for SC-23, and Figure 3 is the result for corresponding SC-24. The fluctuation of the results of E r indicates that the adjustment of parameters was sensitive and important to the prediction precision of LSTM+. Then the chosen combination of parameters was the one with the lowest value of E r for both training and test calculations.

Evaluation Indicators
Because the main indexes of the prediction of activity for the following solar cycle are the peak amplitude and the occurring time, the absolute percentage error of the peak value (E r ) and the error of the occurring month value (E m ) are used in this paper as indicators to evaluate the error between the predicted values (PV) and the actual values (AV). The formulas for the evaluation indicators are as follows: where, V A represents the true peak value, V P is the predicted peak value, M A represents the occurring month of the real peak value, and M P is the occurring month of the predicted peak amplitude.

The Validation of LSTM+
The validation of LSTM+ for the prediction of F 10.7 was performed with the training and test for SC-23 and SC-24. The data of SC-19 to SC-22 were used as the training set for the prediction test of SC-23, and the forecasting process was performed with the re-prediction. Then the predicted values of SC-23 were compared with the actual values. A similar reprediction process was made for the prediction test of SC-24, with the data of SC-19 to SC-23 used as the training set. The comparison between the results for AV and PA obtained from LSTM+ and BP (with the same parameter values) is shown in Figures 4 and 5. Clearly, the prediction results obtained using LSTM+ are better than those obtained with BP. The values of E r and E m were calculated for SC-23 and SC-24, and the results proved the better predictive ability of LSTM+ (Table 3). The value of E r obtained with LSTM+ is below 3% for both solar cycles, and the predicted occurring time for the maximum amplitude was within 2 months.

Prediction of the SC-25
The prediction results of F 10.7 for SC-23 and SC-24 indicate that the LSTM+ model could predict the trend of F 10.7 accurately in the strength and the occurring time of the peak amplitude. Then the curve of F 10.7 for SC-25 was predicted using LSTM+ model, Figure 6. The peak amplitude of F 10.7 for SC-25 was predicted as 156.3 and will occur in July 2025. Additionally, using observed data of F 10.7 from January 2020 to December 2021 from the same data source, we calculated the errors between these actual data and the predicted val-

Figure 5
The predicted results for training and test of F 10.7 (SC-24) using LSTM+ and BP models (train and test: black, and test predict with LSTM+: red, and test predict with BP: blue).
ues using LSTM+ and found that the average E r was 6.6%, which proves the validity of the proposed LSTM+ model. The main purpose of this paper was to predict the maximum amplitude and occurring time of the peak amplitude of SSN of SC-25; therefore, the relation between F 10.7 and SSN was calculated with the same datasets. Figure 7 is the linear fitting result between F 10.7 and SSN. The fitting formula is SSN = b + a × F 10.7 , with b = −93.37987 ± 0.85525, and a = 1.51582 ± 0.00648. The Person's R coefficient is 0.993, the goodness of fit of the linear model R-square is 0.986, and the p-value is lower than 0.01. This linear relationship between the smoothed monthly F 10.7 and SSN agrees with the results based on daily data (Clette, 2021). Then the predicted peak amplitude of SSN for SC-25 was obtained as 143.6  according to this linear relationship. And the occurring time of the peak amplitude was the same as that of F 10.7 based on the relation shown in Figure 1.

Comparing with Earlier Methods
The upcoming SC-25 has been predicted with several types of methods and data. Table 4 lists some forecast results of SC-25, which show similar results as this paper. Pesnell and Schatten (2018) reported a forecasted peak amplitude of SC-25 as 110 -160 in February 2025 (±1.5 year) with Solar Dynamo Index. Bhowmik and Nandy (2018) studied the Sun's surface and interior with magnetic field evolution models, and the predicted peak amplitude was found to be similar to Pesnell and Schatten (2018), but the peak occurring time is slightly earlier. Velasco Herrera, Soon, and Legates (2021) proposed a Machine Learning Bayesian model to forecast the peak value of SSN of SC-25 occurring in the same year as Bhowmik with a probable range of 80 -115. A similar maximum amplitude was predicted by Okoh et al. (2018) using a hybrid Regression-Neural Network. In addition, these authors find a relatively narrow occurring time window. A very close predicted peak occurring time range, as shown in this paper, was given by Chowdhury et al. (2021), but their peak value of SSN was lower than ours. Kakad, Kumar, and Kakad (2020) used two models to forecast the peak smoothed SSN of SC-25, finding a range of 112.9 -160.9, with a histogram-derived probability distribution function (PDF), and a slightly higher range of 125.7 -175.7 with a kernel density estimator-derived PDF. Lu et al. (2022) predicted almost the same SSN-peak amplitude as our study, but they forecasted it is happening nearly one year earlier. In a series of articles (Du, 2020a(Du, , 2022a, this author used three different methods to forecast SC-25, such as using the rate of decrease in the smoothed monthly mean SSN over the final several months before SC-24 minimum as the precursor for the maximum amplitude of SC-25, obtaining the peak SSN as 98.1 -161.9 in October 2024 (±13 months). A similar forecasting peak amplitude was obtained with the rising rate of a solar cycle as the indicator but narrowed the occurring time range to December 2024 ± 11 months. This result was later revised with a modified Gaussian function.

Conclusions and Discussion
An LSTM+ model was proposed as the optimal version of an LSTM model to predict the activity for SC-25 with data of F 10.7 during the period of April 1954 to December 2019 and the monthly data of SSN from "Natural Resources Canada" under the Government of Canada and SILSO data of the Royal Observatory of Belgium in Brussels. The fine adjustments process of model parameters (the number of neurons, batch size, epochs, optimizer, the length of input and output) for LSTM+ were described with the data of F 10.7 , which proved the sensitivity and importance of these parameters to the prediction precision. The definition of the process of re-prediction was given, which emphasized the means to obtain the "true" forecast using the last previous prediction results rather than the actual values as the input of the model. The validation of the LSTM+ model was proved with the training and test process of F 10.7 for SC-23 and SC-24. The error between the actual peak amplitude and the predicted value for SC-23 and SC-24 was 2.87% and 1.09%, respectively. The prediction error of the occurring time of peak amplitude for both solar cycles was 1 month and 2 months, respectively. These results were found to be better than those obtained using BP model. Particularly, the prediction results of F 10.7 of the first two years of SC-25 were compared with the published actual observed data, and the average error value (6.6%) proved the predicting ability and validity of the LSTM+ model. Then the peak amplitude and occurring time of F 10.7 for SC-25 were predicted using the LSTM+ model. The prediction results of the SSN of SC-25 were obtained based on the linear relation between F 10.7 and SSN, which was 143.6 for the maximum amplitude and the occurring time as of July 2025. Most of the predictions of F 10.7 were focused on the short and medium-term, seldom directly for the forecast of the 11-year variation (Du, 2020b;Luo et al., 2021;Si-qing et al., 2010); for example, the relative errors of the prediction of F 10.7 for 7 days and 27 days were around 12% (Wang et al., 2018). Therefore, the long-term prediction of F 10.7 for a whole solar cycle in this paper was of great significance for the study of F 10.7 . The NOAA/NASA Scientific panel released a preliminary forecast for SC-25 on 5 April 2019 that it would start slowly and reach the peak around July 2025 with the value for SSN from 95 to 130, which is supported by the prediction results obtained in this paper.