## 2 The BP Neural Network Model
### Training Results of the BP Model  
It can be seen from the above analysis that the number of nodes in the input layer of the model is 12. The input parameters are the inclined length of the working face, advance speed, roof condition of the coal seam, mining height, coal thickness, change rate of the inclination angle, direct top thickness, basic top thickness, burial depth, change rate of the burial depth, coal thickness change rate, and coal seam inclination angle; through repeated tests in this paper, the number of nodes in the hidden layer of the model was determined to be 15; and according to the requirements, the number of nodes in the output layer of the model is set to 1. Sixty sets of data collected from the Datong mining area were selected to establish the model, among which 50 sets were used as training samples and 10 sets were used as prediction samples. The BP neural network model is trained and evaluated by predicting the initial compressive strength and periodic compressive strength of the roof. MATLAB is used in this paper to train the sample data and validate the model. Due to the instability of the BP neural network, the results of each training session are different, so the pressure of the initial weighting and periodic weighting are taken as the target output for 30 training sessions, and the optimal training results are selected as the model obtained by training.  
(1) The first roof weighting strength  
Figure 3 shows the comparison between the predicted value and the real value of the first roof weighting strength predicted by the BP prediction model, which is the best result of the curve fitting between the predicted value and true value in 30 training sessions, with a maximum determination coefficient of 0.8807. The determination coefficient is derived from Equation (13) [29]. The larger the determination coefficient, the better the fit is.  
\[R^{2}=\frac{\left(N\sum\limits_{i=1}^{N}y_{i}^{\prime}y_{i}-\sum\limits_{i=1}^ {N}y_{i}^{\prime}\sum\limits_{i=1}^{N}y_{i}\right)^{2}}{\left(N\sum\limits_{i= 1}^{N}y_{i}^{\prime}{}^{2}-\left(\sum\limits_{i=1}^{N}y_{i}^{\prime}\right)^{ 2}\right)\left(N\sum\limits_{i=1}^{N}y_{i}^{\prime}{}^{2}-\left(\sum\limits_{i =1}^{N}y_{i}^{\prime}\right)^{2}\right)}, \tag{13}\]  
where \(N\) is the number of predicted samples, \(y_{i}^{\prime}\) is the predicted value, \(y_{i}\) is the true value, and \(R^{2}\) is the determinant.  
Figure 3: Comparison of the first roof weighting strength.  
Predicting the first roof weighting interval  
Figure 4 shows the comparison between the predicted value and the real value of the first roof weighting interval predicted by the BP prediction model, which is the best result of the curve fitting between the predicted value and true value in 30 training sessions, with a maximum determination coefficient of 0.8756.  
It can be concluded from the above diagram that, although the BP neural network model can predict the first weighting strength and first weighting interval of the coal mine roof, the training determination coefficient is small, which indicates that this model is not stable and has a large error. Therefore, this prediction model needs to be optimized.