# Research on a Coal Seam Gas Content Prediction Method Based on an Improved Extreme Learning Machine
## 2 Development of Prediction Models for Coal Seam Gas Content
### Development of a Gas Content Prediction Model Based on the GASA-BPNN Algorithm  
BP theory was originally proposed by [PERSON] in 1974, and it served as a cornerstone for the development of artificial neural networks [26, 28]. In 1986, [PERSON] and [PERSON] introduced the error backpropagation learning algorithm, which is used for training multilayer neural networks. The neural network trained using the BP algorithm is referred to as the BP neural network (BPNN). The BPNN is a multilayer feedforward neural network that is trained using the error backpropagation algorithm. It comprises an input layer, several hidden layers, and an output layer, with each layer being connected through different weight parameters in a fully connected manner. Research has demonstrated that a single hidden layer BPNN has the ability to arbitrarily approximate any complex nonlinear system, as depicted in Figure 5.  
Figure 4: Iterative curve of the fitness value of the optimal individual. An insufficient number of hidden layer nodes in a BPNN can result in underfitting and low prediction accuracy, while an excessive number of nodes can lead to overfitting. The range of nodes is determined based on empirical Formula (2) and found to be [4,12]. The optimal number of nodes is selected by comparing the average relative prediction error of the model, and the results are presented in Table 2. The table demonstrates that the error is minimized when the number of nodes is \(W\) = 12, indicating that 12 nodes are optimal. Research has revealed that a three-layer BPNN can effectively approximate any complex nonlinear system; therefore, the GASA-BPNN prediction model is structured as a 6-12-1 BPNN. \[W=\sqrt{c+q}+B \tag{2}\]  
The variables in the equation are defined as follows: \(W\) denotes the count of nodes in the hidden layer, \(c\) represents the number of nodes in the input layer, \(q\) signifies the number of nodes in the output layer, and \(B\) is an integer ranging from 1 to 10. Figure 6 depicts the process of applying the model, while Figure 7 shows the GASA-BPNN gas content prediction model. The application steps are described below in detail [16]:  
1. To apply the prediction model, the data are first normalized to the range of [0, 1]. Subsequently, the dataset is stratified and sampled into 10 mutually exclusive subsets. Each time, one subset is chosen as the test set, while the remaining subsets are used as training sets for 10 rounds of training and testing. Figure 8 illustrates the schematic diagram of the sample division process. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \(W\) & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\ \hline Relative Error/\% & 27.9 & 30.84 & 21.29 & 19.73 & 24.18 & 19.62 & 16.35 & 21.87 & 15.22 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Number of hidden layer nodes and the average relative error table. Figure 5: Structural diagram of a three-layer BP neural network. Figure 6: Flowchart of the GASA algorithm for initializing BP neural network parameters. Figure 7: Diagram of the gas content prediction model. 2. The initialization of the GA population involves encoding the 97 parameters using floating point number encoding rules. Each individual in the population represents a unique set of weights and thresholds. The initial population, P\({}_{K}\), consists of 50 individuals who are randomly generated. 3. The GA parameters are set as follows: The maximum number of genetic iterations is set to 800, \(K\) is initialized to 1, and the GA stops when the maximum number of iterations is reached. The crossover probability is set to 0.7, and the mutation probability is set to 0.005. 4. The fitness function is defined based on the MSE of the prediction, whereby a smaller MSE value yields a higher fitness value for the individual. 5. The initial population P\({}_{K}\) was subjected to fitness evaluation, and the individuals were ranked based on their respective fitness values. 6. Stopping criteria for GASA: Check if the maximum number of genetic iterations has been reached.