## 2 Materials and Methods
### Optimizing BPNN Using PSO  
Particle swarm optimization (PSO) is inspired by the behavior of bird and fish swarms. It was developed by [PERSON] and [PERSON] in 1995 [26]. Each member of the population is called a particle, each particle represents a potential feasible solution, and the position of the particle is considered to be the global optimal solution. The population searches for the global optimal solution in the d-dimensional space. Meanwhile, each particle decides its own flight direction through the value of the adaptive function and the velocity, and gradually moves to the better region to finally search for the global optimal solution. Particles in a particle swarm are described by position vectors and velocity vectors, and the possible solutions of particle position vectors correspond to the weight values in the network. The velocity vector and position vector are updated with Equations (6) and (7) respectively. Using PSO to optimize the BP neural network accelerates the convergence speed and reduces the possibility of falling into local extremum. \[v_{id}(t+1)=\omega v_{id}(t)+c_{1}rand_{1}^{d}(gBest_{id}(t)-x_{id}(t))+c_{2}rand _{2}^{d}(zBest_{d}(t)-x_{id}(t)) \tag{6}\]  
\[x_{id}(t+1)=x_{id}(t)+v_{id}(t+1) \tag{7}\]  
where, \(v_{id}(t)\) is the \(d\)-dimensional flying speed component of particle \(i\) when it evolves to generation \(t\); \(x_{id}(t)\) is the \(d\)-dimensional position component of particle \(i\) when it evolves to generation \(t\); \(gBest_{id}(t)\) is the optimal position \(gBest_{i}\) component of \(d\)-dimensional individual in the evolution of particle \(i\) to generation \(t\); \(zBest_{d}(t)\) is the \(d\)-dimensional component of zBest\({}_{i}\), the optimal position of the whole particle swarm in the evolution to generation \(t\); \(\omega\) = inertia weight, \(c_{1,2}\) = accelerated constant, \(rand_{1,2}^{d}\) is a random number of [0,1]. It can be seen that inertia weight \(\omega\) determines the global optimization and local optimization of PSO in Equation (8). The larger the \(\omega\) value is, the stronger the global optimization ability is. On the contrary, the smaller the \(\omega\) value is, the stronger the local optimization ability is. Linear decrement is used to adjust the weight for this part in Equation (8). \[\omega=\omega_{max}-\frac{(\omega_{max}-\omega_{min})\times t}{G} \tag{8}\]where, \(\omega_{max}\) = maximum inertia weight; \(\omega_{min}\) = minimum inertia weight; \(t\) = current iteration number; \(G_{max}\) = maximum evolutionary algebra. The particle swarm optimization algorithm procedures are usually demonstrated as follows. **Step 1: Initialize swarm**  
According to the problem to be optimized, the particle swarm's velocity \(v_{i}\), position \(x_{i}\), population size \(N\), individual extreme value \(gBest_{i}\) and global extreme value zBest\({}_{i}\) are initialized. **Step 2: Calculate the particle fitness value**  
The mean square error (MSE) Equation (9) is selected as the objective function to calculate the fitness value of the initial particle swarm. **Step 3: Update individual extremum \(gBest_{i}\)**  
The individual fitness value calculated by step 2 is compared with the fitness value of the individual extreme value \(gBest_{i}\). If the individual fitness value is good, the current position of the individual will be regarded as the historic optimal position of the individual; that is, the individual extreme value of \(gBest_{i}\). Otherwise, the current individual extreme value \(gBest_{i}\) will be maintained until a better individual appears. **Step 4: Update global extremum zBest\({}_{i}\)**  
The fitness values of \(gBest_{i}\) and zBest\({}_{i}\) are compared. If the fitness value of \(gBest_{i}\) is better, the optimal position of an individual will be taken as the historical optimal position of the group, namely the global extreme value. Otherwise, the current global extreme value will be maintained until a better individual extreme value appears.