# Fatigue Characteristics Analysis of Carbon Fiber Laminates with Multiple Initial Cracks
## 2 Methods
### An PSO-BP Life Prediction Model
#### 2.2.2 PSO-BP Neural Network  
The quintessential mechanism of the Backpropagation (BP) neural network hinges on the utilization of gradient descent to mitigate the aggregate of squared prediction errors, effectively narrowing the gap between the anticipated and the actual outcomes. Nonetheless, this methodology is susceptible to the pitfall of local optima during optimization, which can impede the network's capacity to realize its peak theoretical performance and compromise its forecasting prowess on novel datasets. Integrating Particle Swarm Optimization (PSO) amplifies the global search proficiency within the neural network's parameter optimization regimen, steering the network clear of local minima while it endeavors to identify the optimal configuration of weights and thresholds, thus augmenting the network's predictive capabilities. The foundational ideology of this technique draws inspiration from the synergistic interactions and information dissemination observed within biological communities, harnessing swarm intelligence to navigate and uncover the most efficacious solution [23]. The detailed implementation is delineated as follows:  
Figure 4: Schematic diagram of BP neural network structure.  
\[V_{i}^{k+1}\ =\ \mathrm{w}V_{i}^{k}+c_{1}r_{1}(p_{best,i}^{k}-x_{i}^{k})+c_{2}r_{2}(g_{ best,i}^{k}-x_{i}^{k}) \tag{11}\] \[x_{i}^{k+1}\ =\ x_{i}^{k}+V_{i}^{k+1} \tag{12}\]  
Within this framework, \(V_{i}\) symbolizes the kinetic velocity of particle i, which mirrors its rate of advancement through the parameter space. The term \(x_{i}\) signifies the position coordinates of particle i, marking its precise location within the expanse of potential solutions. The iteration index, denoted by \(k\), serves to monitor the algorithm's progression. The learning coefficients \(c_{1}\) and \(c_{2}\) dictate the particle's sensitivity to its individual best performance and the collective best performance of the swarm, respectively. The inertia weight, represented by \(\omega\), alongside the stochastic elements \(r_{1}\) and \(r_{2}\) that reside within the [0,1] range, contribute to the dynamics of the system. The individual best position for particle \(i\) is encapsulated by \(p_{best,i}\), while \(g_{best,i}\) denotes the optimal position that the swarm converges upon as a collective achievement.  
In order to assess the efficacy of the Particle Swarm Optimization-Backpropagation (PSO-BP) approach, the present study adopts a suite of metrics that are delineated as follows:  
\[\mathrm{MAE}\ =\ \frac{1}{n}\sum\limits_{i\ =\ 1}^{n}\left|Y_{i}-\hat{Y}_{i}\right| \tag{13}\]  
\[\mathrm{RMSE}\ =\ \sqrt{\frac{1}{n}\sum\limits_{i\ =\ 1}^{n}\left(Y_{i}-\hat{Y}_{i} \right)^{2}} \tag{14}\]  
\[\mathrm{MAPE}\ =\ \frac{1}{n}\sum\limits_{i\ =\ 1}^{n}\left|\frac{Y_{i}-\hat{Y}_{i} }{\hat{Y}_{i}}\right|\times 100\% \tag{15}\]  
\[R^{2}\ =\ 1-\frac{\sum\limits_{i\ =\ 1}^{n}\left(Y_{i}-\hat{Y}_{i}\right)^{2}}{ \sum\limits_{i\ =\ 1}^{n}\left(Y_{i}-\hat{Y}_{i}\right)^{2}} \tag{16}\]  
where MAE stands for Mean Absolute Error, RMSE stands for Root Mean Square Error, MAPE stands for Mean Absolute Percentage Error, \(R^{2}\) stands for the coefficient of determination, \(n\) stands for the number of samples, \(Y_{i}\) stands for the predicted value, \(\hat{Y}_{i}\) stands for the actual value, and \(\overline{Y_{i}}\) stands for the mean value.  
The PSO-BP neural network leverages the synergy within the particle swarm to iteratively refine particle parameters, thereby identifying the ideal weights and decision boundaries for the neural network. The in-depth strategy for estimating the lifespan of carbon fiber laminates via the PSO-BP algorithm, as outlined in this paper, is depicted in Figure 5.  
Figure 5: PSO–BP fatigue life prediction flow.