## 2 Improved BP Neural Network Model Based on GA  
### BP Neural Network Principle  
BP neural network is a multi-layer feedforward neural network trained by error backpropagation algorithm, which repeatedly adjusts the weights and thresholds of the network through backpropagation process to minimize the difference between the output value and the true value [17]. The topology structure of the BP neural network model includes an input layer, a hidden layer, and an output layer. The hidden layer can have one or more layers, and the layers are fully interconnected. The basic structure is shown in Figure 1[18]. In the figure, two types of signals propagate between layers, namely signal forward propagation and error backpropagation, based on the difference between the input and weight functions and the actual output value and expected value of the network. In the forward propagation process, the input vector starts from the hidden layer, is calculated layer by layer through the hidden layer, and then transmitted to the output layer, and the state of each layer of neurons only affects the state of the next layer of neurons. When the output layer cannot obtain the expected value, it will enter the error backpropagation process, and the error signal will return along the original route, gradually adjusting the weights and thresholds of each layer of the network until the input layer and then repeating iterative calculations.  
Figure 1: Structure diagram of a typical three-layer BP neural network.  
The specific operation steps are as follows.  
1. Select training samples and test samples to provide to the network;  
2. Positive propagation:  
(1) The input \(net_{i}\) of the \(i\)-th node in the hidden layer:  
\[net_{i}=\sum_{j=1}^{M}\omega_{ij}x_{j}+\theta_{i}. \tag{1}\]  
(2) The output \(Y_{i}\) of the \(i\)-th node in the hidden layer:  
\[Y_{i}=\Phi(net_{i})=\Phi\Bigl{(}\sum_{j=1}^{M}\omega_{ij}x_{j}+\theta_{i} \Bigr{)}. \tag{2}\]  
The commonly used activation functions include _Sigmoid_ function and _ReLU_ function.  
(3) The input \(net_{k}\) of the \(k\)th node in the output layer is  
\[net_{k}=\sum_{i=1}^{q}\omega_{ki}y_{i}+a_{k}=\sum_{i=1}^{q}\omega_{ki}\Phi \Bigl{(}\sum_{j=1}^{M}\omega_{ij}x_{j}+\theta_{i}\Bigr{)}+a_{k}. \tag{3}\]  
(4) The output of the \(k\)th node in the output layer, \(Y_{k}\), is  
\[Y_{k}=\psi(net_{k})=\psi\Bigl{(}\sum_{i=1}^{q}\omega_{ki}\Phi\Bigl{(}\sum_{j=1 }^{M}\omega_{ij}x_{j}+\theta_{i}\Bigr{)}+a_{k}\Bigr{)}. \tag{4}\]  
3. Backpropagation:  
(1) The error function of the output layer is defined as  
\[E=\frac{1}{2}{\sum_{k=1}^{L}}(z_{k}-y_{k})^{2}. \tag{5}\]  
(2) The total error function of the system for the training samples is  
\[E=\frac{1}{2}{\sum_{p=1}^{p}}\sum_{k=1}^{L}(z_{k}-y_{k})^{2}. \tag{6}\]  
The BP neural network algorithm is widely used because of its simple operation and strong parallelism, but because it chooses the fastest descent method in nonlinear programming and modifies the weight according to the negative gradient direction of the error function, it has problems such as slow convergence speed and easy to fall into a local minima state. Therefore, this article uses the GA to optimize its weights and thresholds to solve the above problems and improve the prediction accuracy of the network model.