## 5 Test-Result Analysis
### Prediction-and-Evaluation System of Mechanical Properties of Steel Anchor Box Based on PSO-BP
#### 6.2.2 PSO-BP Prediction Model  
The BP neural-network model consists of three components: the input, hidden, and output layers. Furthermore, the model includes two processes: the forward propagation of the signal and the backward propagation of the error. The input signal is processed layer by layer from the input layer through the hidden layer and transferred to the output layer in the forward-propagation process, where the state of the neurons in each layer only affects the state of the neurons in the following layer. If the output result was not optimal, the network-connection weights and thresholds are changed through reverse propagation for repeated training to obtain the optimal result [16; 17; 18]. The BP neural network is illustrated in Figure 19.  
Particle Swarm Optimization (PSO) Algorithms  
The PSO algorithm originated in the study of birds' predation behavior. Each particle in the algorithm corresponds to the role of a bird in a flock, defining the position of each particle as a possible solution to the optimization problem [19; 20]. The PSO algorithm \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values (mm)** \\ \hline Support plates N1 and N2, thickness & 30, 32, 34 \\ Pressure plate N7, thickness & 38, 40, 42, 44, 46 \\ Support plates N1, N2, length & 1600, 1710, 1800, 1900, 2000 \\ Design load & 4000, 4600, 5000, 6000, 7000 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Input parameters for the calculation of the force-transmission state of the weld. Figure 19: BP neural network. Note: \(w_{\bar{y}}\) and \(v_{k}\) denote the weights from the input layer to the hidden layer and from the hidden layer to the output layer, respectively; \(\theta_{j}\) and \(O_{k}\) are the thresholds of the hidden layer and the output layer, respectively. is initialized as a flock of random particles, each representing a potential solution to the optimization problem, and then it is iterated to find the optimal solution, updating individual positions by following individual extremes and global extremes in each iteration, with each position representing a potential solution to the problem. Assume that there is a population of \(N\) particles in a D-dimensional search space, where the position of the \(i\)th particle in the D-dimensional search space is represented as a D-dimensional vector, and the fitness value of each particle position can be calculated according to the fitness function. When the individual and global extremes are found, the particle updates its velocity and position using Equations (4) and (5). \[V_{id}^{k+1}=wV_{id}^{k}+c_{1}r_{1}(P_{id}^{k}-X_{id}^{k})+c_{2}r_{2}(P_{id}^{ k}-X_{id}^{k}) \tag{4}\]  
\[X_{id}^{k+1}=X_{id}^{k}+V_{id}^{k+1} \tag{5}\]  
where \(w\) is the inertia weight, \(k\) is the number of current iterations, \(V\) is the velocity of the particle, \(X\) is the position of the particle, and \(c_{1}\) and \(c_{2}\) are the learning factors, also known as acceleration factors. PSO-BP-Prediction-Model Construction  
The hidden nodes in a BP neural network are usually determined by repeated forward pass and backward propagation. By modifying or constructing the training method to change the number of hidden nodes, the corresponding initial weights and thresholds are also changed, thus affecting the convergence and learning efficiency of the network. In this study, in order to reduce the impact, the adjustment of the weights and thresholds was optimized by using a BP neural-network model based on the particle-swarm algorithm, thus speeding up the convergence of the network and improving its learning efficiency. The specific computational flow chart was shown in Figure 20.  
Figure 20: Flow chart of PSO-BP model. In this paper, Windows 7 was used as the system platform and MATLAB 2016a was used as the processor. The length and thickness of the support plates N1 and N2, the thickness of the pressure plate N7, the designed load-bearing cable force were used as the input variables, and the number of input nodes was four.