# A Model-Assisted Combined Machine Learning Method for Ionospheric TEC Prediction
## 2 Materials and Methods
### Methods
#### 2.2.3 Modeling of Neural Network Optimization Based on Genetic Algorithm
Similarly, the connection weight of neuron \(r\) (\(r\) = 1, 2, \(\dots\), 10) in the second hidden layer is \(W_{r2}^{1},W_{r2}^{2},\cdots,W_{r2}^{15}\). The threshold value of this neuron is \(\Phi_{r2}\). The connection weight of the hidden layer to the output layer is \(V^{1},V^{2},\cdots,V^{10}\). The threshold value is \(\Psi\). All activation functions in this paper are Sigmod functions [17]. \[Sigmod(x)=\frac{1}{1+e^{-x}}, \tag{7}\]  
BP-NN is mainly composed of the topology structure of the neural network (number of input/output parameters, number of layers of neural network), the weight and threshold between each layer, and the training and prediction of the neural network. The algorithm flow chart of BP-NN is shown in Figure 6a. GA is a global optimization algorithm with good global search ability. The adaptive method mainly changes the individual crossover and mutation probability automatically with the change of fitness function value, which  
Figure 5: Schematic structure of the neural network, which is used in MMAdapGA-BP-NN. can improve the computational efficiency and accelerate the convergence rate of the algorithm [26]. Multi-mutation and multi-crossover can improve individual mutation rate and crossover rates and reduce the probability of local minimization resulting in a dead cycle [39]. The MMAdapGA can optimize the weight and threshold of BP-NN, improve the computational efficiency and accuracy of BP-NN, and reduce the error [25]. In this paper, MMAdapGA is used to calculate and optimize the weights and thresholds between each layer of BP-NN. The flowchart of the algorithm is shown in Figure 6b. Since the topological structure of BP-NN has been determined, that is, the weights and thresholds between each layer of the neural network have been determined, then the number of optimization parameters of the genetic algorithm can be determined. In addition, the weights and thresholds of BP-NN are random numbers in the interval [\(-0.5\), \(0.5\)] initialized randomly, so the coding length of the individual population can be determined. In this paper, two crossover points and two mutation points are set, and the mating and mutation probabilities are changed automatically with the change of fitness function value. The optimization process of MMAdapGA for BP-NN is as follows:  
Step 1: Population initialization. The individual coding method is real coding, and each individual is a real number string, which consists of six parts: the connection weight of the input layer and hidden layer, the connection weight of hidden layer and the hidden layer, a threshold of two hidden layers, connection weight of the hidden layer and the output layer, and threshold of the output layer. The individual contains all the weights and  
Figure 6: (**a**) The flowchart of BP-NN; (**b**) the flowchart of MMAdapGA-BP-NN. thresholds of BP-NN. Under the condition that the network structure remains unchanged, a neural network with definite structure, weights and thresholds can be formed. Step 2: Fitness function. The initial weight of the neural network is obtained according to the individual. After training the neural network with training data, the TEC output is predicted. The sum of absolute error E between the predicted output \(TEC^{f}\) and the expected output \(TEC^{r}\) is used as the calculation formula for the individual fitness value. \[E_{t}=k\sum_{j=1}^{M}\left|\text{TEC}^{f}_{ij}-\text{TEC}^{r}_{j}\right|, \tag{8}\]  
\(\text{TEC}^{f}_{\text{ij}}\) is the TEC value predicted by an input \(j\) in the data set, and the neural network population it uses is composed of a fixed topology structure and the threshold and weight obtained by decoding individual \(a_{t}\). \(\text{TEC}^{r}_{j}\) is the expected output, namely the actual TEC value corresponding to \(j\) in the data set. \(k\) is the coefficient. Step 3: Selection operation. Regeneration individuals are selected according to fitness. Individuals with high fitness have a higher probability of being selected, while individuals with low fitness are eliminated.