## 3 Model Construction
### FA-PSOBP Construction of Optimized Model  
The Particle Swarm Optimization (PSO) algorithm mimics evolutionary or physical processes in nature to achieve efficient search and optimization within a larger parameter space. These algorithms leverage population-based search and random selection mechanisms, allowing for the exploration of a broader range of parameter combinations and the discovery of global optimal solutions to avoid local optima. The flowchart for the FA-PSOBP prediction model is illustrated in Figure 7.  
Figure 7: Flowchart of the FA-PSOBP prediction model. The specific process for rock mass acoustic emission prediction based on the FA-PSOBP model is as follows:  
Step 1: Prepare and preprocess the dataset for model training. Randomly divide the acoustic emission sample dataset into a 70% training set and a 30% testing set. Normalize the data for model training to ensure that it is within a suitable range for the neural network. Step 2: Perform factor analysis and weighting. Conduct factor analysis on 10 units to identify significant factors. Assume that the factor analysis results in 3 factors, y1, y2, and y3, which together account for 88.325% of the total variance and are considered meaningful. Perform weighting calculations on these factors to obtain a composite input for the BP neural network. Step 3: Determine the BP neural network structure. Define the number of neurons in the input layer and output layer. In this case, both are set to 1, as we are predicting a single output value based on a single input (the composite factor obtained from Step 2). Determine the number of hidden layer nodes. This is typically conducted using empirical formulas or through trial and error. One common formula for determining the number of hidden layer nodes (H) is  
\[H=(R+C)^{0.5}+r \tag{10}\]  
In Equation (10), R represents the number of input layer neurons (Input Nodes) (in this study, it is 3 (corresponding to Y1, Y2, Y3)); C represents the number of output layer neurons (Output Nodes) (in this study, it is 1 (the predicted value Y)); and r represents the empirical adjustment factor (Empirical Adjustment Factor), which typically ranges from 1 to 10 (in this study, it was determined to be 3 through grid search). Step 4: Particle Swarm Optimization (PSO) for BP Neural Network. In this step, the initial connection weights and thresholds of the BP neural network are treated as the target parameters for optimization using the Particle Swarm Optimization (PSO) algorithm. Through the iterative process of PSO, the optimal initial connection weights and thresholds are obtained. The specific implementation steps are as follows:  
Initialize PSO parameters. Set the population update iterations F = 200, population size \(p\) = 30, and individual and social learning factors c1 = c2 = 2. Initialize the particle swarm's positions and velocities, both constrained within the range [-1,1]. The fitness function is consistent with the objective function of the BP neural network in Equation (8), which is the mean squared error of the network's predictions, thus minimizing the network error. Perform PSO iterative optimization. Calculate the initial fitness of the particles based on the fitness function to obtain the initial best particle. Calculate the population fitness and update the particles' velocities and positions using Equations (2) and (3) to determine the particles' individual best solutions and the global best solution. After iterations, all particles in the swarm will move towards the optimal solution until the minimum error accuracy is achieved or the maximum number of iterations is reached, at which point the optimal particle individual is output. Run the BP neural network optimized by PSO. Assign the parameters corresponding to the optimal individual obtained in Step 2 to the weights and thresholds in the BP neural network net structure parameters. Then, run the neural network to train and obtain the optimal model. Step 5: Performance Error Analysis.