## 2 The BP Neural Network Model
### Model Parameters  
According to the relevant theoretical research on the BP neural network and roof pressure of the working face, we determine the BP neural network model parameters in this paper, including the number of hidden layers, number of hidden layer neurons, initial weights, activation function, expected error, learning rate, and learning times. The number of hidden layers  
[PERSON] proved that a three-layer BP neural network containing only one hidden layer can perform any nonlinear mapping, which can be a mapping from the \(n\) dimension to the \(m\) dimension. Therefore, the BP neural network prediction model established in this paper is a three-layer BP neural network with only a single hidden layer. The suitable empirical formula for a BP neural network with a single hidden layer to determine the number of neurons in the hidden layer is shown as follows:  
\[z=\sqrt{p+q}+a, \tag{9}\]  
where \(p\) and \(q\) represent the number of nodes in the input layer and output layer, respectively, and \(a\) is a constant whose value range is (1,10). According to the above analysis of the gray correlation degree, the number of input data characteristic values is 12, and the number of output results is 1. Therefore, \(z=\sqrt{12+1}+1\approx 5\), and the initial number of neurons in the hidden layer of the BP neural network model established in this paper is 5. After repeated tests, the graph of the relationship between the number of hidden layer nodes and absolute relative errors is shown in Figure 2. The absolute relative error can be obtained from formula 10. It can be seen from the figure that when the number of hidden layer nodes reaches 15, the network output error is minimized. \[\varphi=\frac{\left|y-y^{\prime}\right|}{y}, \tag{10}\]  
where \(\varphi\) is the absolute relative error; \(y\) and \(y^{\prime}\) represent the measured results and training results, respectively. \begin{table}
\begin{tabular}{c c c c} \hline
**Influencing Factors** & \(\gamma_{i}\) & **Influencing Factors** & \(\gamma_{i}\) \\ \hline Buried depth & 0.7149 & Thickness of main roof & 0.8155 \\ Change rate of buried depth & 0.7094 & Mining height & 0.8468 \\ Coal seam pitch & 0.6952 & Coal thickness & 0.8371 \\ Change rate of coal seam pitch & 0.8343 & Change rate of coal thickness & 0.7017 \\ Working face length & 0.4523 & Advance speed & 0.858 \\ Working face width & 0.8604 & Roof condition of coal seam & 0.8518 \\ Thickness of immediate roof & 0.8174 & & \\ \hline \end{tabular}
\end{table} 
Table 2: The correlations of the first weighting and related influencing factors. To avoid the saturation region of the activation function, the weighted sum output value will be near to 0 as much as possible, which can increase the weight adjustment range. Therefore, the initial connection weights are usually random numbers between (-1,1) or (0,2), so that the network will not be greatly affected. The activation function of the hidden layer in this paper is the tansig function, which is found in the MATLAB toolbox, whose value range is (-1,1), which also conforms to the normalized data falling between (-1,1). The output layer selects the purelin function from the MATLAB toolbox, which is linear to increase the value range of the output value. The tansig function is shown below:  
\[f(x)=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}, \tag{11}\]  
where \(e\) is the base of the natural log function. According to practical experience, the value range of the learning rate in the BP neural network model is generally between 0.01 and 0.08. In this paper, based on the sample data collected at present, it is concluded by repeated training that when the learning rate is adopted, the performance of the established roof pressure prediction model based on the BP neural network is better.