# Research on Coal and Rock Recognition in Coal Mining Based on Artificial Neural Network Models
## 3 Coal and Rock Recognition Experiment Based on the BP Neural Network  
### BP Neural Network Construction and Matlab Simulation Experiment  
There are three situations that a shearer will encounter when working in a mining area, which are coal seams, rock layers, and coal-rock mixed layers. In order to improve the intelligence level of the shearer, it is necessary to realize the coal and rock recognition technology, so that the shearer can automatically change the working mode according to the coal and rock recognition results of the computer. The purpose of this chapter is shown in Figure 6.  
In this section, the BP neural network is designed to carry out a coal and rock recognition experiment. The BP neural network is a multi-layer feedforward network trained by error back propagation. Based on the gradient descent method, the mean square error of the actual output value and the expected output value of the network is minimized. The algorithm includes two processes: forward propagation of the signal and back propagation of the error. Based on the previous experimental results, a BP neural network with an input \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Feature Number**} & **Coal Seam** & **Rock Characteristic** & **Characteristic Value of** \\  & **Characteristic Value** & **Value** & **Coal-Rock Mixed Layer** \\ \hline \(\beta_{LL}\) (1) & 0.00983 & 0.0057 & 0.0038 \\ \(\alpha_{LL}\) (1) & 46.496 & 79.853 & 133.133 \\ \(G_{LL}\) (1) & 0.0293 & 0.0368 & 0.0192 \\ \(E_{LL}\) (1) & 119.345 & 144.28 & 219.836 \\ \(\sigma_{LL}\) (1) & 25.6 & 41.696 & 14.42 \\ \(\beta_{LL}\) (2) & 0.014 & 0.00766 & 0.00375 \\ \(\alpha_{LL}\) (2) & 29.361 & 74.28 & 202.18 \\ \(G_{LL}\) (2) & 0.0215 & 0.0193 & 0.0414 \\ \(E_{LL}\) (2) & 221.5 & 255.691 & 301.225 \\ \(\sigma_{LL}\) (2) & 41.491 & 65.2 & 61.579 \\ \(\beta_{LL}\) (3) & 0.0184 & 0.00977 & 0.0057 \\ \(\alpha_{LL}\) (3) & 101.577 & 139.641 & 369.682 \\ \(G_{LL}\) (3) & 0.00681 & 0.00694 & 0.00607 \\ \(E_{LL}\) (3) & 477.1 & 426.608 & 786.49 \\ \(\sigma_{LL}\) (3) & 70.662 & 89.390 & 59.581 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Eigenvalues extracted from some sample images. Figure 6: Purpose of the experiment in this chapter. layer neuron number of 15, a hidden layer neuron number of 50, an output layer neuron number of 3, an initial weight of 0.5, a learning rate of 0.1, an expected error of 10\({}^{-1}\), and a transfer function of the Sigmoid function is built. The BP neural network architecture of the experimental design is shown in Figure 7.  
In order to expand the scale of the data set and to enhance the characteristics of the data set, the data enhancement method is used to expand the image data set of the coal and rock samples. The common methods of data enhancement used in this training set include image size scaling, rotation, pixel translation, changing contrast, perspective transformation, adding noise, and so on. Through data enhancement, the number of sample images in the experimental training set increased from 270 to 1347. Data enhancement is performed on the sample images, as shown in Figure 8.  
The Matlab simulation experiment of coal and rock image recognition is carried out with the trained BP neural network. A total of 1347 images of experimental samples are randomly divided into a training set and test set, according to the ratio of 2:1. The training set is used to determine the network threshold and weight, and the test set is used to test the classification performance of the network. The Matlab simulation results of the coal and rock recognition of the BP neural network model are shown in Figure 9. In this figure, ordinate 1 represents that the model recognition target is a coal seam, ordinate 2 represents that the model recognition target is a rock stratum, and ordinate 3 represents that the model recognition target is a coal-rock mixed layer. In Figure 9, the red part represents the real type of image samples, and the blue part represents the image type predicted by the BP neural network model.