Tunnel face shale gas emission quantity prediction method and system based on machine learning
The method for predicting shale gas outburst at the tunnel face by combining principal component analysis and ELM model with ReLU activation function solves the problem of insufficient prediction accuracy in traditional methods, achieving higher prediction accuracy and adaptability, and is suitable for tunnel construction safety management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional methods for predicting shale gas outbursts cannot effectively capture the complex and variable geological structure and nonlinear relationships at the tunnel face, resulting in insufficient prediction accuracy and reliability, which affects construction safety and economic benefits.
A machine learning-based approach was adopted, which combines principal component analysis and extreme learning machine (ELM) models with the ReLU activation function to construct a shale gas outburst prediction model at the tunnel face. This model was then integrated into the tunnel monitoring system to perform dynamic predictions using real-time data.
It improves the accuracy and comprehensiveness of shale gas outburst prediction, better adapts to the complex nonlinear data characteristics of tunnel faces, reduces the gradient vanishing problem, and provides more accurate prediction results.
Smart Images

Figure CN121859686A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for predicting shale gas outburst at tunnel faces based on machine learning. Background Technology
[0002] Accurate prediction of shale gas outbursts is crucial for ensuring construction safety and efficiency during tunnel construction. Traditional methods for predicting shale gas outbursts primarily rely on the experience of geological experts and simplified physical models. These methods are often limited by subjective judgment and simplistic assumptions, failing to fully reflect the complexity and dynamics of shale gas outbursts. Especially in environments with complex geological structures and significant nonlinear relationships, the accuracy and reliability of traditional methods are greatly reduced, directly impacting the safety of construction workers and the economic benefits of the project.
[0003] Currently, some progress has been made in predicting combustible gas emission through various models. For example, a combination of principal component analysis, particle swarm optimization, and extreme learning machine (ELM) models has been used to predict gas emission. For instance, publication number CN107122861 B describes a gas emission prediction method based on PCA-PSO-ELM. This method uses principal component analysis to process the data on influencing factors of gas emission, obtaining dimensionality-reduced principal component data. An extreme learning machine is then established, and the dimensionality-reduced principal component data is used as input to the extreme learning machine. Particle swarm optimization is then used to optimize the number of hidden layer neurons and the type of activation function in the extreme learning machine, resulting in a gas emission prediction model. The predicted gas emission is then obtained by inputting the test dataset E into the gas emission prediction model.
[0004] However, coal mine gas mainly originates from coal seams, while shale gas at tunnel faces is closely related to the complex and variable structure of shale formations. Shale gas release is influenced by more geological parameters, such as organic matter content, porosity, and permeability. The geological conditions of coal mines and tunnel faces are fundamentally different, and the relationship between shale gas outbursts and factors such as geological structure and construction techniques is more nonlinear than that between shale gas outbursts and gas outbursts. The fixed activation function used in such gas prediction models cannot fully express these complex nonlinear relationships. Directly predicting shale gas outbursts at tunnel faces using the models described above would lead to significant distortion in the prediction results. Therefore, finding a better approach to predict shale gas outbursts at tunnel faces is the problem this proposal aims to solve. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a machine learning-based method for predicting shale gas outbursts at tunnel faces. By using diverse sample data of shale gas and employing a specific activation function, the constructed model predicts shale gas outbursts at tunnel faces, which can better address the nonlinear relationships in the data and improve prediction accuracy.
[0006] The first aspect of this invention employs a machine learning-based method for predicting shale gas outbursts at tunnel faces, comprising:
[0007] Sample data related to shale gas outbursts during tunnel construction were collected. The sample data included geological parameters, engineering parameters, and real-time monitored gas concentration data. This data was divided into first influencing factor data and second influencing factor data. The first influencing factor data consisted of existing, clearly defined influencing factors, while the second influencing factor data consisted of influencing factors affecting the predicted shale gas outburst. After standardizing the first and second influencing factor data, principal component analysis was used to obtain dimensionality-reduced principal component data.
[0008] The principal component data is used as training data and input into an Extreme Learning Machine (ELM) as a prediction model for training. The input principal component data includes at least geological parameters and engineering parameters. An ELM model is constructed and the model is validated. When constructing the ELM model, the ReLU function is activated. The geological parameters include TOC or total porosity corresponding to the organic matter type, and the engineering parameters include fracturing operation data.
[0009] The constructed and validated ELM model is integrated into the tunnel monitoring system, and the real-time data retrieval function is used to dynamically predict the shale gas outburst.
[0010] In predicting shale gas outbursts at tunnel faces, data diversity is crucial. Considering the complex and nonlinear nature of shale gas data at tunnel faces, this approach not only employs principal component analysis for dimensionality reduction, enabling the model to more comprehensively capture various factors influencing shale gas outbursts and improving prediction accuracy and comprehensiveness, but also incorporates at least the ReLU activation function in the ELM model construction mentioned in this scheme. This gives the model greater flexibility and adaptability when handling complex and nonlinear data, allowing it to more accurately capture the dynamic changes in shale gas outbursts and better adapt to predicting shale gas outbursts at tunnel faces.
[0011] In some embodiments, activating the ReLU function or tanh function includes:
[0012] Randomly initialize the weight matrix and bias vector from the input layer to the hidden layer;
[0013] The output of the hidden layer is calculated through forward propagation using the randomly initialized weight matrix and bias vector.
[0014] The weight matrix of the output layer is calculated using the least squares method. This weight is used to map the output of the hidden layer to the final output layer.
[0015] Through forward and backward propagation, the output weights are updated until the error between the predicted output and the actual output of the ELM model is minimized, thus obtaining the ELM model for predicting shale gas outburst at the tunnel face.
[0016] In predicting shale gas outbursts at tunnel faces, the ReLU activation function is unique in its ability to effectively handle nonlinear phenomena. The nonlinear characteristics of the ReLU function allow the model to capture complex nonlinear behaviors, thereby improving prediction accuracy. Furthermore, the linear rectification properties of the ReLU function help accelerate model convergence and reduce the gradient vanishing problem.
[0017] In some embodiments, after initializing the ELM model, ReLU is set as the default activation function, and tanh, ELU, or Leaky ReLU are used as alternative activation functions.
[0018] After the ReLU function is activated, the performance metrics of the ELM model are continuously monitored, and performance metric thresholds and / or performance improvement standards are defined. The case where the metric threshold or performance improvement standard is not met is recorded as the function switching condition.
[0019] Start the training loop: Record initial performance metrics and evaluate model performance at the end of each epoch; check if the performance meets the function switching condition; if the function switching condition is met, switch the activation function to ELU or Leaky ReLU; train the model and re-evaluate the model performance; if the performance improves, retain the currently activated ELU or Leaky ReLU function; if the performance does not improve or deteriorates, switch back to the default ReLU function; if the function switching condition is met again after switching back to the default ReLU function, switch the tanh function and start the training loop again.
[0020] The training loop terminates when any of the following conditions are met:
[0021] The maximum number of iterations is reached; the performance metrics meet the preset standards; and the performance of the ELM model no longer changes significantly over multiple cycles.
[0022] In some embodiments, defining performance metric thresholds and / or performance improvement criteria, and denoting the failure to meet the metric thresholds or performance improvement criteria as function switching conditions, specifically includes:
[0023] If the current MSE is higher than 0.01, or the relative change of MSE in the last 5 to 100 epochs, or 5, 10, 15, 20, 50, or 80 training epochs is less than 0.001%, then the function switching condition is triggered.
[0024] After switching the trigger function, if the current MSE continuously improves in the most recent 3 to 100 rounds, or 3, 5, 10, 15, 20, 50, or 80 rounds of training, and the improvement in each round is at least 3%, 4%, or 5%, then the current activation function is considered effective.
[0025] In some embodiments, during the process of inputting principal component data into the ELM model for training, a grid search is used, that is, by changing the number of hidden layer nodes within a certain preset range, monitoring the changes in model performance, and selecting the number of nodes that optimizes model performance to obtain the optimal number of nodes.
[0026] In some embodiments, the activation function type is used as a hyperparameter, and the activation function type is incorporated into the grid search for optimization, including:
[0027] The number of hidden layer nodes, regularization parameters, learning rate, and activation function type (ReLU, tanh, ELU, LeakyReLU) are used as hyperparameter combinations to define the search space of grid search;
[0028] The ELM model is initialized using the default activation function ReLU, at which point the model has not yet been trained.
[0029] For each combination of hyperparameters (including activation function type) in the defined search space, repeat the following steps:
[0030] Based on the current hyperparameter combination, instantiate the ELM model. If the activation function type in the current combination is not ReLU, skip the dynamic switching logic for now and directly use the specified activation function ReLU.
[0031] Train the model using the training dataset and record initial performance metrics (such as MSE, MAE, R2 score);
[0032] At the end of each epoch, the model performance is evaluated using the validation dataset, and the results are recorded.
[0033] For each set of hyperparameters used in grid search, if the current activation function is ReLU and the preset function switching conditions are met (such as MSE not changing significantly or increasing for three consecutive times), then the switching logic is entered.
[0034] Switch the activation function to ELU or Leaky ReLU and continue training the model;
[0035] Re-evaluate model performance using the validation dataset.
[0036] If switching activation functions improves model performance, retain the current activation function (ELU or Leaky ReLU); if it does not improve or worsens, switch back to ReLU.
[0037] If the function switching condition is met again, try switching to the tanh activation function;
[0038] The training loop terminates when any of the following conditions are met:
[0039] The predetermined maximum number of iterations has been reached.
[0040] The performance indicators have met the preset standards.
[0041] The performance of the ELM model no longer changes significantly over multiple periods.
[0042] From all the hyperparameter combinations tried, select the model that performs best on the validation set (with the lowest MSE or the highest R2 score).
[0043] Use the selected combination of hyperparameters and activation function type as the configuration for the final model.
[0044] Explanation of the relationship between the preceding and following steps:
[0045] In some embodiments, the principal component data, used as training data, includes at least fracturing pressure;
[0046] Treating fracturing pressure as time-series data and recording its variation trajectory during the fracturing process creates one or two ordered sets of sequence data; this can be achieved by saving the measured values at each time point.
[0047] The sliding window method is used to transform the continuous time point data in one or two ordered sequence data sets into a fixed-length sequence, which is used to extract a fixed-length subsequence from the ordered sequence data set; each subsequence represents dynamic changes over a period of time; for example, a sliding window containing the most recent 10 time point data can be set, so that each sample will contain recent dynamic information.
[0048] Within each sliding window, the trend value of the parameter is calculated, and the trend value includes any one or any combination of any of the following: average, maximum, minimum, slope, standard deviation, rate of change, autocorrelation, periodicity, and mutation point detection.
[0049] The trend values are input into the ELM model as training data. These trend features can reveal how the parameters change over time.
[0050] In some embodiments, when the trend value is input into the ELM model as training data, drilling status (such as start, pause, resume) and / or fracturing stage (such as preparation, execution, end) are added to the ELM model as classification feature labels to mark the state of fracturing pressure.
[0051] In some embodiments, the method for obtaining total porosity includes obtaining the adsorbed gas content in the target shale reservoir and determining the porosity occupied by adsorbed gas in the micropores based on the adsorbed gas content.
[0052] Another aspect of the present invention provides a tunnel monitoring system, comprising:
[0053] The data input module is used to collect unprocessed data related to shale gas outbursts during tunnel construction. The unprocessed data includes geological parameters, engineering parameters, and real-time monitored gas concentration data.
[0054] The data processing module, which is connected to the data input module, is used to process the data to be processed using the ELM model constructed by the machine learning-based shale gas outburst prediction method at the tunnel face mentioned above, so as to obtain the prediction result of the shale gas outburst at the tunnel face. Attached Figure Description
[0055] Figure 1 This is a schematic diagram illustrating the machine learning-based shale gas outburst prediction method at the tunnel face in Embodiment 1 or 2.
[0056] Figure 2 This is a schematic diagram illustrating the machine learning-based method for predicting shale gas outburst at the tunnel face in Embodiment 1 or 2. Detailed Implementation
[0057] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0058] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0059] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0060] Currently, in the field of combustible gas emission prediction, researchers have made significant progress by combining multivariate statistical analysis with intelligent algorithms. For example, a prediction model constructed by fusing Principal Component Analysis (PCA), Particle Swarm Optimization (PSO), and Extreme Learning Machine (ELM) has been successfully applied to the prediction of coal mine gas emission. A published patent (patent number: CN107122861 B) details this methodology, in which PCA is used to process the data of influencing factors of gas emission, achieving data dimensionality reduction and extracting key features; subsequently, the dimensionality-reduced principal component data is used as input to the ELM model, while PSO optimizes the number of hidden layer neurons and the combination of their activation functions in the ELM model, thereby establishing an accurate gas emission prediction model. Finally, by inputting the test dataset E into the model, the predicted value of gas emission can be obtained.
[0061] However, it is worth noting that the generation and emission mechanisms of coal mine gas differ fundamentally from those of shale gas at tunnel faces. Shale gas release is subject to a series of complex geological parameters, including but not limited to organic matter content, porosity, and permeability, which are closely related to the structure and properties of shale formations. Given the essential differences in geological conditions between coal mines and tunnel faces, and the more complex nonlinear relationships between shale gas emission and geological structure and construction techniques, the fixed activation functions used in traditional gas prediction models are insufficient to fully capture and express these nonlinear correlations. Therefore, directly applying the aforementioned gas prediction models to predict shale gas emission at tunnel faces is highly likely to lead to significant deviations in the prediction results.
[0062] Therefore, there is an urgent need for a more refined and adaptable prediction scheme to accurately reflect the complexity of shale gas outbursts at tunnel faces. An ideal prediction model should be able to effectively integrate the diversity of geological parameters, capture subtle changes in nonlinear relationships, and thus provide reliable predictions of shale gas outburst volumes. Therefore, this embodiment provides a machine learning-based method for predicting shale gas outburst volumes at tunnel faces, with the aim of obtaining a reliable machine learning-based prediction scheme for shale gas outburst volumes at tunnel faces.
[0063] Example 1:
[0064] Machine learning-based methods for predicting shale gas outbursts at tunnel faces include:
[0065] Sample data related to shale gas outbursts during tunnel construction were collected. The sample data included geological parameters, engineering parameters, and real-time monitored gas concentration data. This data was divided into first influencing factor data and second influencing factor data. The first influencing factor data consisted of existing, clearly defined influencing factors, while the second influencing factor data consisted of influencing factors affecting the predicted shale gas outburst. After standardizing the first and second influencing factor data, principal component analysis was used to obtain dimensionality-reduced principal component data.
[0066] Given the complexity and nonlinearity of shale gas outburst prediction, and considering that ELM can handle time-series data and possesses rapid learning and good generalization capabilities, the principal component data is used as training data and input into the Extreme Learning Machine (ELM) as the prediction model for training. The input principal component data includes at least geological parameters and engineering parameters. An ELM model is constructed and validated. The construction of the ELM model includes activating the ReLU function. The geological parameters include TOC or total porosity corresponding to the organic matter type, and the engineering parameters include fracturing operation data. During model construction, the model parameters are optimized using techniques such as cross-validation.
[0067] The constructed and validated ELM model was integrated into the tunnel monitoring system, and the real-time data retrieval function was used to dynamically predict shale gas outbursts. The method for obtaining the total porosity mentioned above includes obtaining the adsorbed gas content in the target shale reservoir, and then determining the porosity occupied by adsorbed gas in the micropores based on the adsorbed gas content.
[0068] In predicting shale gas emissions at the tunnel face, data heterogeneity and richness are considered core factors. Given the inherent complexity and nonlinearity of shale gas data, this embodiment adopts the aforementioned scheme to enhance the performance of the prediction model. Through the synergistic effect of PCA preprocessing, the ELM model combined with ReLU or tanh activation functions, and parameter optimization, the proposed prediction model demonstrates significant advantages in predicting shale gas emissions at the tunnel face, where complexity and nonlinearity are high, resulting in a significant improvement in its predictive performance.
[0069] Based on the above scheme, activating the ReLU function or tanh function includes:
[0070] Randomly initialize the weight matrix and bias vector from the input layer to the hidden layer;
[0071] The output of the hidden layer is calculated through forward propagation using the randomly initialized weight matrix and bias vector.
[0072] The weight matrix of the output layer is calculated using the least squares method or other linear algebra methods. This weight is used to map the output of the hidden layer to the final output layer.
[0073] Through forward and backward propagation, the output weights are updated until the error between the predicted and actual outputs of the ELM model is minimized, resulting in an ELM model for predicting shale gas outbursts at tunnel faces. The model's predictive performance can then be evaluated using a test dataset to ensure good generalization ability.
[0074] Combination Figure 1 When implementing this, the following steps can be followed:
[0075] S1: Collect sample data, including sample data related to shale gas outbursts during tunnel construction, including geological parameters, engineering parameters, and real-time monitored gas concentration data. This data is divided into first-influencing factor data (existing, clearly defined influencing factor data) and second-influencing factor data (influencing factor data for the predicted shale gas outburst).
[0076] S2: Perform data standardization and principal component analysis, including standardizing the data for the first and second influencing factors. Then, use principal component analysis (PCA) to reduce the dimensionality of the standardized data, obtaining the dimensionality-reduced principal component data.
[0077] S3: Constructing an ELM model, including inputting the dimensionality-reduced principal component data as training data into the Extreme Learning Machine (ELM) model. When constructing an ELM model, at least the ReLU function must be activated.
[0078] Geological parameters should include at least the TOC (Total Organic Carbon) or total porosity corresponding to the type of organic matter, and engineering parameters should include at least fracturing operation data. Model parameters should be optimized using techniques such as cross-validation.
[0079] The ELM model is trained using principal component data. During training, activation functions are initialized, and weight matrices and bias vectors from the input layer to the hidden layer are randomly initialized. Using these randomly initialized weight matrices and bias vectors, the outputs of the hidden layers are calculated via forward propagation. The weight matrix of the output layer is calculated using least squares or other linear algebra methods; these weights are used to map the outputs of the hidden layers to the final output layer. Through forward and backward propagation, the output weights are updated until the error between the predicted and actual outputs of the ELM model is minimized, resulting in the ELM model used to predict shale gas outbursts at tunnel faces.
[0080] S4: Finally, the constructed and validated ELM model is integrated into the tunnel monitoring system. Real-time data retrieval is used to dynamically predict shale gas outbursts.
[0081] Unlike predicting gas outburst volume, this approach addresses the nonlinear phenomena of shale gas flow, such as the slip effect and non-Darcy flow. The slip effect refers to the phenomenon where gas molecules detach from the rock surface due to a decrease in fluid pressure within tiny fractures in shale gas reservoirs, leading to an increase in the effective permeable area of the fractures. Because it involves complex nonlinear relationships, this phenomenon is difficult to accurately capture in traditional prediction models. The ReLU function, through its piecewise linearity, can introduce nonlinearity into the model's hidden layers, helping the model capture the nonlinear behavior caused by the slip effect. During the training of the ELM model, the ReLU function ensures that even linear forward propagation, through the combination of multiple hidden layers, can approximate complex nonlinear functions. This characteristic allows the ELM model to better handle the slip effect of shale gas flow, thereby improving the accuracy of the model's shale gas outburst volume prediction. In practice, the application of the ReLU function involves directly applying its mathematical definition to the hidden layer neurons of the ELM model. That is, for each neuron's weighted input, if its value is less than 0, the output is 0; if it is greater than or equal to 0, the output is the input value itself. This simple mathematical operation can be directly integrated into the programming implementation of the ELM model without complicated adjustment steps. In this way, the ReLU function is more suitable for the ELM model when dealing with the nonlinear characteristics of shale gas flow.
[0082] In predicting shale gas outbursts at tunnel faces, the ReLU activation function is unique in its ability to effectively handle nonlinear phenomena. The nonlinear characteristics of the ReLU function allow the model to capture complex nonlinear behaviors, thereby improving prediction accuracy. Furthermore, the linear rectification properties of the ReLU function help accelerate model convergence and reduce the gradient vanishing problem.
[0083] In the ELM model, the application of the ReLU activation function in this scheme helps improve the model's ability to fit the nonlinear characteristics of shale gas flow, thereby more accurately predicting shale gas outbursts. In this way, the ReLU activation function overcomes the limitations of traditional activation functions (such as Sigmoid or Tanh) in handling complex nonlinear problems, such as the vanishing gradient problem, and accelerates the model's convergence speed. The gradient of the ReLU function in the positive region is constant (1), which maintains the gradient during backpropagation in the deep network, thus accelerating the learning process. In contrast, the gradients of the Sigmoid and Tanh functions are close to 0 in their saturation regions, easily leading to the vanishing gradient problem. This means that using the current PCA-PSO-ELM-based gas prediction model cannot solve the vanishing gradient problem, making it difficult for the network to learn deep feature representations and severely affecting the model's training effect and prediction performance.
[0084] In other words, avoiding the vanishing gradient problem in predicting shale gas outbursts at tunnel faces ensures that the ELM model can effectively capture the nonlinear characteristics of shale gas flow. Vanishing gradients weaken the model's ability to learn these complex dynamic behaviors, thus reducing the accuracy and reliability of predictions. By avoiding vanishing gradients, the ELM model can better simulate the slip effect and non-Darcy flow of shale gas, providing more accurate predictions.
[0085] Of course, in addition to the above-mentioned choice of activation function, the tanh (hyperbolic tangent) activation function can also be chosen. When dealing with asymmetric data, the output of the tanh function is centered at 0 (the output ranges from -1 to 1). This data centralization makes the average value of the data closer to 0 rather than 0.5, which is more efficient for gradient calculation and model training. Also, because the tanh function is centrally symmetric, it can "support," "disagree," or "abstain" from the results from the previous layer, while the sigmoid function can only "agree" with the results from the previous layer. This is more suitable for dealing with asymmetric data such as shale gas outburst data.
[0086] The following example illustrates this process. We assume we have collected a series of sample data on shale gas outbursts at tunnel faces, including geological parameters, engineering parameters, and real-time gas concentration data. The data is divided into first-factor data (data on known influencing factors) and second-factor data (data on influencing factors to be predicted), and all data are standardized. Next, we use Principal Component Analysis (PCA) to reduce the dimensionality of the data, obtaining the reduced principal component data, which is then prepared for training the ELM model.
[0087] Given N samples, each with p features (i.e., influencing factors), the standardized data matrix is X = [x ij ]N×P, where x ij It is the value of the j-th feature of the i-th sample.
[0088] By using PCA dimensionality reduction, we obtain the dimensionality-reduced data matrix Y = [y ik N×m, where m <p,y ik It is the value of the k-th principal component of the i-th sample.
[0089] Then, the ELM model is constructed. The basic form of the ELM model is:
[0090]
[0091] Among them, w j It is the input weight vector, b j It is a bias, β j is the output weight, g(*) is the activation function, and H is the number of hidden neurons.
[0092] Activation function selection is performed; in this example, the ReLU function is used as the activation function, which is defined as:
[0093] g(z) = max(0,z)
[0094] Then, the ELM model is trained. Given the input Y and the target output T, the goal of ELM is to minimize the loss function:
[0095]
[0096] Where W = [w1, ..., wH], b = [b1, ..., bH] T y i The data is the principal component data of the i-th sample, t i It is the target output of the i-th sample.
[0097] The output weight β is obtained by solving a least squares problem:
[0098] β=(H T H+λI) -1 H T T
[0099] Where H is the hidden layer output matrix, λ is the regularization parameter, and I is the identity matrix.
[0100] Thus, for example, consider the following dataset:
[0101] N = 5 samples
[0102] p = 4 features
[0103] m = 2 principal components
[0104] H = 3 hidden layer neurons
[0105] First, PCA dimensionality reduction is performed to obtain the dimensionality-reduced data Y:
[0106]
[0107] Randomly initialize the input weights W and bias b, and calculate the hidden layer output matrix H:
[0108]
[0109] Given the target output T, calculate the output weight β:
[0110] β=(H T H+λI) -1 H T T
[0111] The trained ELM model is used to predict shale gas outbursts from new sample data.
[0112] Example 2
[0113] Combination Figure 2 Based on the above embodiment one, it can be further optimized, that is, after initializing the ELM model, ReLU is set as the default activation function, and tanh, ELU or Leaky ReLU are used as alternative activation functions;
[0114] After the ReLU function is activated, the performance metrics of the ELM model are continuously monitored. The performance metrics include mean squared error (MSE), mean absolute error (MAE), or R2 score on the validation set. Performance metric thresholds and / or performance improvement criteria are defined, and the case where the metric threshold or performance improvement criteria are not met is recorded as the function switching condition.
[0115] Start the training loop: Record initial performance metrics and evaluate model performance at the end of each epoch; check if the performance meets the function switching condition (e.g., MSE shows no significant change or increase for three consecutive times); activation function switching logic: if the function switching condition is met, switch the activation function to ELU or Leaky ReLU; train the model and re-evaluate model performance; if performance improves, retain the currently activated ELU or Leaky ReLU function; if performance does not improve or deteriorates, switch back to the default ReLU function.
[0116] If the function switching condition is met again after switching back to the default ReLU function, then the training loop will be restarted after switching back to the tanh function.
[0117] The training loop terminates when any of the following conditions are met:
[0118] The ELM model is considered to have reached its maximum number of iterations, met the preset performance standards, and its performance no longer changes significantly over multiple cycles. "Significant" here means that the change does not exceed a predetermined range.
[0119] Specifically, if the MSE remains unchanged for three consecutive training epochs without a significant downward trend, it indicates that the model's learning speed has slowed down or stopped, and the activation function is limiting further optimization. An increase in MSE is a more direct negative signal, indicating that the model's performance is deteriorating. This is due to overfitting or gradient problems caused by the activation function (such as the "dead neuron" phenomenon of ReLU).
[0120] When the MSE shows no significant change or increases for three consecutive times, this is considered a signal that the model's performance is not meeting expectations. In this case, you can try switching the activation function to ELU or Leaky ReLU. These two functions can solve the gradient vanishing problem of ReLU, allowing negative inputs to generate non-zero gradients, which helps the model overcome the current learning obstacle.
[0121] If the model's MSE starts to drop significantly after switching to ELU or Leaky ReLU, it indicates that the new activation function is more suitable for the current model and dataset and can continue to be used.
[0122] However, if the MSE does not improve or even increases after using ELU or Leaky ReLU, it may mean that these activation functions have not achieved the expected results. In this case, consider switching back to ReLU, or try other optimization strategies, such as adjusting the learning rate, adding regularization terms, or changing the model structure.
[0123] Based on the above scheme, a further step is to define performance indicator thresholds and / or performance improvement standards, denoted as the condition that the indicator threshold or performance improvement standard is not met, which is used as the function switching condition. This function switching condition specifically includes:
[0124] If the current MSE is higher than 0.01, or the relative change of MSE in the last 5 to 100 epochs, or 5, 10, 15, 20, 50, or 80 training epochs is less than 0.001%, then the function switching condition is triggered.
[0125] After switching the trigger function, if the current MSE continuously improves in the most recent 3 to 100 rounds, or 3, 5, 10, 15, 20, 50, or 80 rounds of training, and the improvement in each round is at least 3%, 4%, or 5%, then the current activation function is considered effective.
[0126] Step 1: Data Preprocessing
[0127] The preprocessed principal component data is used as training data and input into the Extreme Learning Machine (ELM) as the prediction model for training, including:
[0128] Transform all input features (geological and engineering parameters) to the same numerical range, for example, by using min-max scaling. Divide the principal component dataset into a construction set and a test set; this could be done with 80% construction data and 20% test data.
[0129] Step 2: Initialize ELM
[0130] The weights and biases from the input layer to the hidden layer of the ELM model are randomly initialized; random initialization of weights and biases: a key feature of ELM is that the weights and biases from the input layer to the hidden layer are randomly initialized and remain constant throughout the construction process. The number of hidden layer nodes can be determined through experimentation or cross-validation to find the optimal model complexity.
[0131] Step 3: Build ELM
[0132] The output of the hidden layer is computed using forward propagation and randomly initialized weights and biases;
[0133] Solving for the output weights: This is done by solving a least squares problem to ensure that the predicted values of the output layer are as close as possible to the actual target values, thus solving for the output layer weights of the ELM.
[0134] Step 4: Model Evaluation
[0135] Validation using a test set: Input the test set into the model to evaluate its predictive performance. Commonly used evaluation metrics include mean squared error (MSE) and coefficient of determination (R²).
[0136] Parameter tuning: If the model performance is poor, you can adjust the number of hidden layer nodes, preprocessing strategies, or try different feature selection methods, and then repeat the construction and evaluation process.
[0137] Step 5: Apply the model
[0138] Real-time prediction: Once the model is built and fully validated, it can be applied to real-time data to predict the amount of shale gas inrush at the tunnel face, providing a basis for construction decisions.
[0139] Through the above process, the ELM model can learn the mapping relationship from geological and engineering parameters to shale gas outbursts, providing strong support for the safety management of tunnel construction.
[0140] When using function switching logic to build a model, the following example illustrates the process:
[0141] In this embodiment, the model parameters are set as follows: number of hidden layer neurons 100, default activation function ReLU, alternative activation function Leaky ReLU (α = 0.01), maximum number of iterations 100, learning rate 0.01, MSE change threshold 0.01, and initial MSE 2.5.
[0142] We initially used ReLU as the activation function. During training, we recorded the MSE at the end of each epoch. Assuming that at the 10th epoch, the MSE remained relatively stable for three consecutive epochs, the specific values are as follows:
[0143] Epoch 8: MSE = 1.2
[0144] Epoch 9: MSE = 1.21
[0145] Epoch 10: MSE = 1.22
[0146] Since the MSE change is less than 0.01, the program decides to switch the activation function to Leaky ReLU.
[0147] Training with Leaky ReLU
[0148] Next, we will retrain the model using Leaky ReLU. Let's assume we continue training from epoch 11.
[0149] At the start of epoch 11, the Leaky ReLU activation function is used. The following is an example of the calculation process for this epoch:
[0150] Perform forward propagation; for each neuron j, its output o j The calculation is as follows:
[0151]
[0152] Where wj is the weight vector and bj is the bias term. x is the input vector, and f(z) is the Leaky ReLU function, defined as:
[0153]
[0154] Here, z is the input value, and α is a positive number (such as 0.01 or 0.001), ensuring that when the input z is negative, the function does not become completely zero, but rather has a small slope. In this way, even in the negative region, Leaky ReLU can provide a non-zero gradient, allowing the weights to continue to be updated and avoiding the problem of neuron "death".
[0155] Example 3
[0156] In this embodiment, during the process of inputting principal component data into the ELM model for training, a grid search is adopted. That is, by changing the number of hidden layer nodes within a certain preset range, the changes in model performance are monitored, and the number of nodes that optimizes model performance is selected to obtain the optimal number of nodes.
[0157] The activation function type is used as a hyperparameter and incorporated into the grid search above for optimization, including:
[0158] Step 1: Define the search space and initialize the model
[0159] The number of hidden layer nodes, regularization parameters, learning rate, and activation function type (ReLU, tanh, ELU, LeakyReLU) are used as hyperparameter combinations to define the search space of the grid search; the ELM model is initialized using the default activation function ReLU, at which point the model has not yet been trained.
[0160] Step 2: Grid search, instantiate and train the model, and evaluate its performance.
[0161] Begin grid search: For each combination of hyperparameters (including activation function type) in the defined search space, repeat the following steps:
[0162] Model instantiation: Instantiate the ELM model based on the current hyperparameter combination. If the activation function type in the current combination is not ReLU, skip the dynamic switching logic and directly use the specified activation function ReLU.
[0163] Training the model: Train the model using the training dataset and record initial performance metrics (such as MSE, MAE, R2 score);
[0164] Model evaluation: At the end of each epoch, evaluate the model performance using the validation dataset and record the results;
[0165] The third step is dynamic activation function switching. If the model's performance stagnates or deteriorates, the activation function is dynamically switched to try to optimize the model's performance.
[0166] Check the function switching condition. That is, for each set of hyperparameters used in the grid search, if the current activation function is ReLU and the preset function switching condition is met (such as MSE not changing or increasing significantly for three consecutive times), then enter the switching logic.
[0167] Switch the activation function to ELU or Leaky ReLU and continue training the model; re-evaluate the model performance using the validation dataset. If the model performance improves after switching the activation function, retain the current activation function (ELU or Leaky ReLU); if it does not improve or worsens, switch back to ReLU; if the function switching condition is met again, try switching to the tanh activation function.
[0168] Step 4: Termination Conditions. Step 3 dynamically switches the activation function. Step 4 checks if the termination conditions are met. If they are met, training stops; otherwise, training continues. Specifically, the training loop terminates when any of the following conditions are met: the predetermined maximum number of iterations is reached; the performance metric reaches a preset standard; or the ELM model performance no longer changes significantly over multiple epochs.
[0169] Step 5: Select the best model
[0170] The grid search results are reviewed, selecting the model that performs best on the validation set (with the lowest MSE or highest R2 score) from all tried hyperparameter combinations. The selected hyperparameter combination and activation function type are then used as the configuration for the final model.
[0171] For example, consider the following settings:
[0172] Number of hidden layer nodes: [50, 100, 200][50, 100, 200]
[0173] Regularization parameters: [0.001,0.01,0.1][0.001,0.01,0.1]
[0174] Learning rate: [0.001, 0.01][0.001, 0.01]
[0175] Activation function types: ReLU, tanh, ELU, Leaky ReLU
[0176] The default activation function, ReLU, initializes the ELM model.
[0177] Search all hyperparameter combinations, starting with the first combination (50, 0.001, 0.001, ReLU); select the model that performs best on the validation set from all tried hyperparameter combinations. For example, if (200, 0.01, 0.001, LeakyReLU) gives the lowest MSE, then this combination will be selected as the configuration of the final model.
[0178] Example 4
[0179] Based on the above scheme, the principal component data is used as training data, and the principal component data must contain at least the fracturing pressure; the fracturing pressure is processed to obtain trend values for ELM model training.
[0180] A. Perform time series analysis; treat fracturing pressure as time series data and record the fracturing pressure change trajectory during the fracturing process to form one or two ordered series data sets; this can be achieved by saving the measurement value at each time point.
[0181] B. Employing the sliding window technique; applying the sliding window method to transform the continuous time point data in one or two ordered sequence data sets into a fixed-length sequence, which is used to extract a fixed-length subsequence from the ordered sequence data set; each subsequence represents dynamic changes over a period of time; for example, a sliding window containing the most recent 10 time point data can be set, so that each sample will contain recent dynamic information.
[0182] C. Perform trend analysis; within each sliding window, calculate the trend value of the parameter, which includes any one or any combination of any of the following: average, maximum, minimum, slope, standard deviation, rate of change, autocorrelation, periodicity, and mutation point detection.
[0183] The trend values are input into the ELM model as training data. These trend features can characterize how the parameters change over time.
[0184] For example, suppose we are monitoring the fracturing pressure during a fracturing process that lasts for 100 time points, and the pressure measurements at each time point are as follows (in MPa):
[0185] P=[12.3,12.5,12.8,13.0,13.2,13.5,13.8,14.0,14.2,14.5,...,23.2,23.5]
[0186] The fracturing pressure is used as time series data to record its change trajectory during the fracturing process.
[0187] The sliding window size is set to w = 10, and each sample will contain data from 10 consecutive time points. At the first position, the window covers the following data:
[0188] W1=[12.3,12.5,12.8,13.0,13.2,13.5,13.8,14.0,14.2,14.5]
[0189] When the sliding window moves to the next position, it moves back one time point, and the data in the second window is:
[0190] W2=[12.5,12.8,13.0,13.2,13.5,13.8,14.0,14.2,14.5,14.8]
[0191] In trend analysis, trend characteristics such as mean, standard deviation, and slope are calculated within each sliding window. For the first window W1, the mean is used as an example.
[0192] For window W1, the average value is calculated as follows:
[0193]
[0194] μ = 13.38
[0195] P i This represents the measured fracturing pressure value at the i-th time point during the fracturing process;
[0196] Standard deviation σ:
[0197]
[0198] σ = 0.6373 ≈ 0.64
[0199] Assuming the first and tenth points are reference points, the slope M is:
[0200]
[0201] M = 0.24
[0202] Based on the above feature values, the feature vector of the first sliding window is input into the ELM model.
[0203] F1=[μ,P max ,P min ,m,σ]=[13.38,14.5,12.3,0.24,0.64]
[0204] In this way, F1 can be used as training sample data for the ELM model. Similarly, a feature vector is generated for each sliding window, and these vectors are then input into the ELM model as training data.
[0205] Based on the above scheme, further optimizations can be made, such as adding status markers to reflect different stages of engineering activities. When the trend values are input into the ELM model as training data, the fracturing stage (such as preparation, execution, and termination) is added to the ELM model as a classification feature marker to indicate the state of the fracturing pressure.
[0206] For example, the fracturing stages can be defined as preparation, execution, and termination, and the states should correspond to the actual engineering activities.
[0207] For each data point, the corresponding fracturing stage is determined. This approach can be based on timestamps and project logs, or through specific rules or algorithms.
[0208] For example, if a certain time point corresponds to the "preparation" stage of fracturing, a corresponding label can be added to this time point in the dataset.
[0209] Therefore, when constructing feature vectors, in addition to the trend values of fracturing pressure (such as average, maximum, minimum, slope, standard deviation, etc.), the fracturing stage should also be marked. This can be in the form of a unique code, that is, each state or stage is converted into a binary vector, in which only one element is 1 and the rest are 0, indicating which state or stage the time point belongs to.
[0210] For example, if there are three stages in the fracturing process (preparation, execution, and termination), then the unique thermal code for the "preparation" stage is [1,0,0]; for the "execution" stage, it is [0,1,0]; and for the "termination" stage, it is [0,0,1].
[0211] Then, the feature vectors with trend values and state labels are input into the ELM model. In the input layer of the model, ensure that the number of neurons is sufficient to accommodate all feature dimensions, including the one-hot encoding dimensions of the original trend values and state labels.
[0212] Taking the above feature vector as an example, [13.38, 14.5, 12.3, 0.24, 0.64] represents the average, maximum, minimum, slope, and standard deviation, respectively. At this point, the fracturing stage is "preparation," and the fracturing stage has three markers (preparation, execution, and termination). Therefore, the feature vector of this data point can be represented as:
[0213] [13.4,14.5,12.3,0.24,0.76,1,0,0], where [1,0,0] indicates that the fracturing stage is "preparation".
[0214] In this way, the ELM model can learn the dynamic variation patterns of fracturing pressure at different stages of engineering activities, thereby improving the accuracy and reliability of predictions.
[0215] Example 5
[0216] A tunnel monitoring system, comprising:
[0217] The data input module is used to collect unprocessed data related to shale gas outbursts during tunnel construction. The unprocessed data includes geological parameters, engineering parameters, and real-time monitored gas concentration data.
[0218] The data processing module, which is connected to the data input module, is used to process the data to be processed using the ELM model constructed by the machine learning-based shale gas outburst prediction method at the tunnel face mentioned above, so as to obtain the prediction result of the shale gas outburst at the tunnel face.
[0219] When the above-mentioned data input module is implemented, it may include sensors, data loggers, and wireless / wired communication devices.
[0220] Sensors are used to monitor geological parameters (such as rock strength, porosity, and permeability), engineering parameters (such as drilling depth, drilling speed, and drilling pressure), and gas concentrations (such as methane and carbon dioxide). Common sensors include pressure sensors, temperature sensors, and gas concentration sensors.
[0221] A data logger is used to store data collected from sensors. It can be a dedicated hardware device or a storage module integrated into the sensor.
[0222] Wireless / wired communication devices are used to transmit data from field sensors to the central processing unit, and can be Wi-Fi routers, Bluetooth adapters, Zigbee modules, LoRa modules, or Ethernet cables, etc.
[0223] The aforementioned data processing module is responsible for receiving information from the data input module, applying machine learning models to process and analyze the data, and predicting the amount of shale gas emerging at the tunnel face. Specifically, this may include deployed servers or workstations, configured computers for running complex machine learning models, or cloud computing services.
[0224] For data processing, libraries like Python's Pandas can be used for cleaning and preprocessing data. Machine learning frameworks such as TensorFlow, PyTorch, or Scikit-Learn can be used to build and train ELM models. For data analysis, libraries like Matplotlib or Seaborn can be used for data visualization and result presentation.
[0225] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A machine learning-based method for predicting shale gas outburst at tunnel faces, characterized in that, include: Sample data related to shale gas outbursts during tunnel construction were collected. The sample data included geological parameters, engineering parameters, and real-time monitored gas concentration data. This data was divided into first influencing factor data and second influencing factor data. The first influencing factor data consisted of existing, clearly defined influencing factors, while the second influencing factor data consisted of influencing factors affecting the predicted shale gas outburst. After standardizing the first and second influencing factor data, principal component analysis was used to obtain dimensionality-reduced principal component data. The principal component data is used as training data and input into an extreme learning machine (ELM) as a prediction model for training to construct an ELM model and complete model validation. The input principal component data includes at least geological parameters and engineering parameters. When constructing the ELM model, the ReLU function is activated. The geological parameters include TOC or total porosity corresponding to the organic matter type, and the engineering parameters include fracturing operation data. The constructed and validated ELM model is integrated into the tunnel monitoring system, and the real-time data retrieval function is used to dynamically predict the shale gas outburst.
2. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 1, characterized in that, Activating the ReLU function or tanh function includes: Randomly initialize the weight matrix and bias vector from the input layer to the hidden layer; The output of the hidden layer is calculated through forward propagation using the randomly initialized weight matrix and bias vector. The weight matrix of the output layer is calculated using the least squares method. Through forward and backward propagation, the output weights are updated until the error between the predicted output and the actual output of the ELM model is minimized, thus obtaining the ELM model for predicting shale gas outburst at the tunnel face.
3. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 2, characterized in that, After initializing the ELM model, set ReLU as the default activation function and use tanh, ELU, or Leaky ReLU as alternative activation functions. When the ReLU function is activated, a performance metric threshold and / or a performance improvement standard are defined. The case where the metric threshold or performance improvement standard is not met is used as the function switching condition, and the performance metrics of the ELM model are continuously monitored. Start the training loop: Record initial performance metrics and evaluate model performance at the end of each epoch; check if the performance meets the function switching conditions; if the function switching conditions are met, switch the activation function to ELU or Leaky ReLU; train the model and re-evaluate the model performance; if the performance improves, retain the currently activated ELU or Leaky ReLU function; if the performance does not improve or deteriorates, switch back to the default ReLU function. If the function switching condition is met again after switching back to the default ReLU function, then the training loop process will be repeated after switching back to the tanh function. The training loop terminates when any of the following termination conditions are met: The maximum number of iterations is reached; the performance metrics meet the preset standards; and the performance of the ELM model no longer changes significantly over multiple cycles.
4. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 3, characterized in that, The function switching conditions specifically include: If the current MSE is higher than 0.01, or the relative change of MSE in the last 5 to 100 epochs, or 5, 10, 15, 20, 50, or 80 training epochs is less than 0.001%, then the function switching condition is triggered. After switching the trigger function, if the current MSE continuously improves in the most recent 3 to 100 rounds, or 3, 5, 10, 15, 20, 50, or 80 rounds of training, and the improvement in each round is at least 3%, 4%, or 5%, then the current activation function is considered effective.
5. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 4, characterized in that, During the training process of inputting principal component data into the ELM model, grid search is used to obtain the optimal combination of model parameters, including changing the number of hidden layer nodes within a preset range, monitoring changes in model performance, and selecting the number of nodes that optimizes model performance to obtain the optimal number of nodes.
6. The method for predicting shale gas outburst at a tunnel face based on machine learning according to any one of claims 3 to 5, characterized in that, The activation function type is used as a hyperparameter and incorporated into the grid search for optimization. This optimization operation includes: The number of hidden layer nodes, regularization parameters, learning rate, and activation function type are combined as hyperparameters to define the search space of grid search. Initialize the ELM model using the default activation function ReLU; For each combination of hyperparameters in the predefined search space, repeat the following steps: Based on the current hyperparameter combination, instantiate the ELM model. If the activation function type in the current combination is not ReLU, skip the function switching condition triggering mechanism and directly use the specified activation function. Train the model using the training dataset and record the initial performance metrics; At the end of each epoch, the model performance is evaluated using the validation dataset, and the results are recorded. For each set of hyperparameters used in grid search, if the current activation function is ReLU and the preset function switching conditions are met, then the switching logic is entered. When switching the activation function to ELU or Leaky ReLU, continue training the model; re-evaluate the model performance using the validation dataset; If switching activation functions improves model performance, retain the current activation function ELU or Leaky ReLU; if it does not improve or worsens, switch back to ReLU. If the function switching condition is met again, the function is switched to the tanh activation function; the training loop terminates when any of the termination conditions are met. From all the tried hyperparameter combinations, select the model that performs best on the validation set; use the selected hyperparameter combination and activation function type as the configuration for the final model.
7. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 1, characterized in that, The principal component data used as training data includes at least fracturing pressure; Treating fracturing pressure as time series data and recording the fracturing pressure change trajectory during the fracturing process to form one or two ordered series data sets; The sliding window method is applied to transform the continuous time point data in one or two ordered sequence data sets into a fixed-length sequence, which is used to obtain a fixed-length subsequence extracted from the ordered sequence data set. Within each sliding window, the trend value of the parameter is calculated, and the trend value includes any one or any combination of any of the following: average, maximum, minimum, slope, standard deviation, rate of change, autocorrelation, periodicity, and mutation point detection. The trend values are input into the ELM model as training data.
8. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 7, characterized in that, When the trend value is input into the ELM model as training data, the fracturing stage is added to the ELM model as a classification feature label to mark the state of the fracturing pressure.
9. The method for predicting shale gas outburst at a tunnel face based on machine learning according to claim 1, characterized in that, The method for obtaining the total porosity includes obtaining the adsorbed gas content in the target shale reservoir and determining the porosity occupied by adsorbed gas in the micropores based on the adsorbed gas content.
10. A tunnel monitoring system, characterized in that, include: The data input module is used to collect unprocessed data related to shale gas outbursts during tunnel construction. The unprocessed data includes geological parameters, engineering parameters, and real-time monitored gas concentration data. A data processing module, connected to the data input module, is used to process the data to be processed using an ELM model constructed according to any one of claims 1 to 9, based on the machine learning-based method for predicting shale gas outbursts at tunnel faces, in order to obtain the prediction result of shale gas outbursts at tunnel faces.
Citation Information
Patent Citations
A Gas Emission Prediction Method Based on PCA-PSO-ELM
CN107122861B