A random forest model training method, a gas concentration prediction method and device

By using a random forest model training method that identifies and assigns incentive weights to features, the accuracy and stability issues of underground gas concentration prediction in coal mines have been resolved, enabling accurate prediction and early warning of gas concentration.

CN123178979APending Publication Date: 2026-11-27NINGXIA BAOFENG ENERGY GROUP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611594173.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-15
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately predict gas concentration trends in underground coal mine environments. Existing random forest models lack the ability to focus on core features in gas concentration prediction, resulting in unsatisfactory prediction accuracy and stability.

Method used

By training a benchmark random forest model to identify core features and assign feature incentive weights, the optimal splitting feature selection for each decision tree in the target random forest model is guided, thereby improving the model's accuracy and generalization ability in predicting gas concentration.

Benefits of technology

It enables accurate prediction of gas concentration in complex underground environments, provides reliable early warning capabilities, and improves the model's prediction accuracy and resistance to noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178979A_ABST
    Figure CN123178979A_ABST
Patent Text Reader

Abstract

The application discloses a random forest model training method, a gas concentration prediction method and device. Feature data of a target coal mine work site in a preset historical time period is obtained. A baseline random forest model is trained using the feature data. Based on the baseline random forest model, core features in the feature data and feature excitation weights corresponding to each core feature are determined. Based on the feature data, a target random forest model for predicting gas concentration is trained, wherein the target random forest model includes multiple decision trees, and the optimal split feature of each node in each decision tree is determined based on the core features and the feature excitation weights. The above method can identify core features, guide the node split process of each decision tree to preferentially select core features with feature excitation weights, thereby adapting to the scene of multiple factor coupling and dynamic changes of working conditions underground, improving the prediction accuracy and generalization ability of the target random forest model for gas concentration, and providing a reliable basis for early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application generally relates to the fields of coal mine safety monitoring and machine learning prediction technology. More specifically, this application relates to a training method for a random forest model, a method for predicting gas concentration, and an apparatus. Background Technology

[0002] Excessive methane concentration in coal mines is a core cause of safety accidents such as methane explosions and asphyxiation, directly threatening the lives of underground workers and the safety of mine production. Accurately predicting the trend of methane concentration changes is crucial to ensuring the safety of underground operations.

[0003] Currently, coal mines mainly rely on fixed sensors to monitor gas concentration in real time. However, this method can only reflect the concentration status at the current moment and cannot predict the trend of concentration changes in advance, thus lacking the ability to prevent and control gas outbursts. To address this, researchers have developed mechanistic prediction models based on gas geological theory. These models predict gas outbursts by constructing mathematical equations for gas migration. However, such models require manual modeling and parameter calibration for specific mine conditions, making it difficult to adapt to complex working conditions such as variable underground geological conditions, dynamic adjustments in production processes, and multiple coupled factors. Consequently, their generalization ability and prediction accuracy are not ideal.

[0004] In recent years, machine learning methods have been introduced into the field of gas concentration prediction, among which random forests have attracted widespread attention due to their good nonlinear modeling ability and resistance to overfitting. However, existing random forest-based prediction methods have weak ability to capture nonlinear changes in gas concentration, poor resistance to noise interference, and the model prediction accuracy and stability are still insufficient.

[0005] Therefore, there is an urgent need to provide a training method for random forest models and a method for predicting gas concentration, so as to accurately predict changes in gas concentration. Summary of the Invention

[0006] In order to at least address one or more of the technical problems mentioned above, this application proposes training methods for random forest models in several aspects.

[0007] In a first aspect, this application provides a method for training a random forest model, comprising: acquiring feature data of a target coal mine operation site over a preset historical time period, the feature data including feature data of multiple dimensions corresponding to different working conditions; training a baseline random forest model using the feature data; determining, based on the baseline random forest model, core features in the feature data and feature activation weights corresponding to each core feature; and training a target random forest model for predicting gas concentration based on the feature data, wherein the target random forest model includes multiple decision trees, and the optimal splitting feature of each node in each decision tree is determined based on the core features and the feature activation weights.

[0008] In some embodiments, based on a benchmark random forest model, the core features in the feature data and the feature incentive weights corresponding to each core feature are determined. Specifically, this includes: calculating the basic importance score of each dimension feature in the feature data based on the reduction in mean squared error caused by the participation of each dimension feature in the node splitting of each decision tree in the benchmark random forest model; determining the core features in the feature data based on the basic importance score; and determining the feature incentive weights corresponding to each core feature based on the basic importance score, feature incentive coefficient, average value and maximum value of the basic importance score of each dimension feature.

[0009] In some embodiments, a target random forest model comprising multiple decision trees is trained based on feature data. Specifically, this includes: when splitting at each decision tree node, obtaining the mean squared error corresponding to each candidate splitting feature randomly selected from the training samples of the current node; obtaining the corrected mean squared error corresponding to each candidate splitting feature based on the ratio of the mean squared error corresponding to each candidate splitting feature to the feature activation weight; and training the current node with the feature that has the smallest corrected mean squared error among the candidate splitting features to obtain the target random forest model.

[0010] In some embodiments, the target random forest model further includes prediction incentive weights corresponding to each decision tree, which are obtained by: determining the prediction error of each decision tree; and determining the prediction incentive weights of the corresponding decision tree based on the prediction error.

[0011] In some embodiments, before acquiring feature data of a target coal mine operation site over a preset historical time period, the method further includes: acquiring candidate feature data of the target coal mine operation site over a preset historical time period; and determining feature data that meets preset conditions from the candidate feature data, wherein the preset conditions are used to characterize the contribution to the prediction of gas concentration.

[0012] In some embodiments, the feature data includes at least one of continuous features, discrete features, or historical correlation features. Continuous features refer to features with continuous change characteristics, discrete features refer to features of non-continuous variables with a finite number of discrete states in their value space, and historical correlation features refer to features constructed statistically based on gas concentration time series data that reflect the concentration level or trend information at historical moments.

[0013] In some embodiments, continuous features include at least one of the following: current gas concentration, basic gas emission, mining advance speed, geological disturbance value, temperature change, extraction negative pressure, number of effective extraction boreholes, coal seam permeability coefficient, instantaneous gas emission increment, fan air supply, air leakage rate, airway resistance, and air volume loss coefficient; discrete features include at least one of the following: operating status, equipment failure status, violation operation, and manual intervention status; and historical correlation features include at least one of the following: gas concentration at the previous sampling time, average gas concentration in the previous window, and maximum gas concentration in the previous window.

[0014] In a second aspect, this application provides a gas concentration prediction method, comprising: acquiring multidimensional feature data of the target coal mine operation site at the current moment; inputting the multidimensional feature data into a target random forest model trained using any of the methods in the first aspect, to obtain the gas concentration at a future preset time.

[0015] In some embodiments, multidimensional feature data is input into a target random forest model trained using any of the methods in the first aspect to obtain the gas concentration at a future preset time. Specifically, this includes: when the target random forest model includes prediction incentive weights corresponding to each decision tree, predicting the corresponding gas concentration for each decision tree; and obtaining the gas concentration at a future preset time based on the prediction incentive weights and the predicted gas concentration values.

[0016] In some embodiments, inputting multidimensional feature data into a target random forest model trained using any of the methods in the first aspect to obtain the gas concentration at a future preset time specifically includes: inputting multidimensional feature data into a target random forest model trained using any of the methods in the first aspect to obtain a first gas concentration corresponding to a first future preset time; updating historical correlation features in the multidimensional feature data based on the first gas concentration to obtain updated feature data; and inputting the updated feature data into a target random forest model trained using any of the methods in the first aspect to obtain a second gas concentration corresponding to a second future preset time, wherein the second future preset time is a time after the first future preset time.

[0017] In some embodiments, an early warning level is determined based on a first gas concentration, a second gas concentration, and a rate of change in gas concentration, and an early warning operation corresponding to the early warning level is triggered.

[0018] In a third aspect, this application provides a training apparatus for a random forest model, comprising: The acquisition module is used to acquire feature data of the target coal mine operation site for a preset historical time period. The feature data includes feature data of multiple dimensions corresponding to different working conditions. The first training module is used to train a baseline random forest model using feature data; The determination module is used to determine the core features in the feature data and the feature activation weights corresponding to each core feature based on the benchmark random forest model. The second training module is used to train a target random forest model for predicting gas concentration based on feature data. The target random forest model includes multiple decision trees, and the optimal splitting feature of each node in each decision tree is determined based on the core feature and feature incentive weights.

[0019] In a fourth aspect, this application provides a gas concentration prediction device, comprising: The acquisition module is used to acquire multi-dimensional feature data of the target coal mine work site at the current moment; The inference module is used to input multidimensional feature data into the target random forest model trained using any of the methods in the first aspect, and obtain the gas concentration at a future preset time.

[0020] In a fifth aspect, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any of the first aspects, or the method of any of the second aspects.

[0021] In a sixth aspect, this application provides an electronic device comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method of any one of the first aspects, or to implement the method of any one of the second aspects.

[0022] The technical solutions provided in this application embodiment may include the following beneficial effects: The training method for a random forest model described above involves first training a baseline random forest model using feature data, then determining the core features and corresponding feature activation weights based on the baseline random forest model, and finally training a target random forest model based on these feature activation weights. This ensures that the optimal splitting feature for each node in each decision tree is determined based on the core features and feature activation weights. This approach addresses the technical problems of existing random forest models in gas concentration prediction, such as insufficient focus on core features and low prediction accuracy. It enables the objective identification of core features through the baseline random forest model and guides the node splitting process of each decision tree in the target random forest model to prioritize the selection of core features. This adapts to scenarios with multiple coupled factors and dynamic changes in working conditions underground, improving the prediction accuracy and generalization ability of the target random forest model for gas concentration and providing a reliable basis for early warning. Attached Figure Description

[0023] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, and the same or corresponding reference numerals denote the same or corresponding parts, wherein: Figure 1 An exemplary flowchart of a training method for a random forest model according to some embodiments of this application is shown; Figure 2 An exemplary flowchart of a gas concentration prediction method according to some embodiments of this application is shown; Figure 3 An exemplary structural block diagram of a training apparatus for a random forest model according to some embodiments of this application is shown; Figure 4 An exemplary structural block diagram of a gas concentration prediction device according to some embodiments of this application is shown. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] It should be understood that the terms "comprising" and "including" used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0026] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0027] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0028] The specific embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0029] In coal mine operations, excessive methane concentration is a core cause of safety accidents such as methane explosions and asphyxiation, directly threatening the lives of underground workers and the safety of mine production. Accurately predicting the trend of methane concentration changes is crucial to ensuring the safety of underground operations.

[0030] Currently, coal mines mainly rely on fixed sensors to monitor gas concentration in real time. However, this method can only reflect the concentration status at the current moment and cannot predict the trend of concentration changes in advance, thus lacking the ability to prevent and control the situation in advance.

[0031] For example, in actual operations, key areas such as mining faces and return airways are usually equipped with a variety of sensors (such as gas concentration sensors, air volume sensors, and extraction negative pressure sensors). Among them, gas concentration sensors can be used to monitor gas concentration in real time.

[0032] In order to predict the trend of concentration changes in advance, a mechanism prediction model based on gas geology theory is proposed. The gas emission volume is predicted by constructing a mathematical equation for gas migration. However, such models need to be manually modeled and calibrated for specific mine conditions. They are difficult to adapt to the complex working conditions of changing underground geological conditions, dynamic adjustment of production processes, and coupling of multiple factors. Their generalization ability and prediction accuracy are not ideal.

[0033] In other solutions, machine learning methods have been introduced into the field of gas concentration prediction, with random forests attracting widespread attention due to their superior nonlinear modeling capabilities and resistance to overfitting. However, existing random forest-based prediction methods typically treat all input features as equally important during model training, failing to effectively distinguish the differences in the contributions of different features to the prediction results during the node splitting stage of the decision tree. This makes it difficult for the model to accurately capture the key factors affecting gas concentration, and in complex underground scenarios with multiple coupled factors and high noise interference, the prediction accuracy and stability remain unsatisfactory.

[0034] In view of this, embodiments of this application provide a training method for a random forest model, a method and apparatus for predicting gas concentration. This method first trains a baseline model to identify core features and assigns feature incentive weights. Then, based on the core features and feature incentive weights, it guides the selection of optimal splitting features for each decision tree in the target random forest model. This effectively distinguishes the differences in the contribution of different features to the prediction results during the model training phase, thereby improving the model's ability to focus on core features and its resistance to noise interference. This enhances the accuracy and generalization ability of gas concentration prediction, providing reliable technical support for accurate prediction and early warning of underground gas concentration in coal mines.

[0035] Figure 1 An exemplary flowchart of a training method for a random forest model according to some embodiments of this application is shown.

[0036] like Figure 1 As shown, the training method for a random forest model may include the following steps: S101, Obtain feature data of the target coal mine work site for a preset historical time period, the feature data including feature data of multiple dimensions corresponding to different working conditions.

[0037] The feature data in multiple dimensions may include at least one of continuous features, discrete features, or historical correlation features.

[0038] Among them, continuous characteristics refer to characteristics with continuous change characteristics. For example, continuous characteristics may include at least one of the following: current gas concentration, basic gas emission, mining advance speed, geological disturbance value, temperature change, extraction negative pressure, number of effective extraction boreholes, coal seam permeability coefficient, instantaneous gas emission increment, fan air supply, air leakage rate, airway resistance, and air volume loss coefficient.

[0039] Discrete features refer to the features of non-continuous variables whose value space is a finite number of discrete states. For example, discrete features may include at least one of the following: work status, equipment failure status, violation operation, and manual intervention status.

[0040] Historical correlation features refer to features constructed statistically based on gas concentration time series data that reflect the concentration level or trend information at historical moments. For example, historical correlation features may include at least one of the following: gas concentration at the previous sampling time, average gas concentration in the previous window, and maximum gas concentration in the previous window.

[0041] In some embodiments, feature data can be obtained by: first acquiring raw data of a preset historical time period of the target coal mine operation site as sample data; and then, obtaining feature data based on the raw data.

[0042] For example, the raw data can cover different operating states such as coal cutting, blasting, and no operation, as well as data on different working conditions such as normal ventilation, equipment failure, and geological disturbance.

[0043] For example, the raw data may include at least one of the following: current gas concentration (which can be directly obtained from a gas concentration sensor), basic gas emission rate (which can be obtained based on historical mine measurement data or gas emission monitoring results), current gas emission rate, operating distance and operating time of mining equipment, coal seam thickness stability, coal seam fault density, coal seam roof stability, extraction negative pressure (which can be directly obtained from a negative pressure sensor in the gas extraction pipeline), number of boreholes in effective operation (which can be counted from the number of boreholes in effective operation in the extraction system), and coal seam permeability coefficient (which can be determined based on field measurement results). (Or the most recent geological parameter calibration results), blower air supply (which can be obtained directly from the air volume sensor or ventilation system), working face inlet air volume, effective air volume reaching the working face, air path resistance or air volume loss coefficient (which can be calculated or calibrated based on air path resistance, damper status and measured air volume), operation status (which can be obtained by coding operation statuses such as coal cutting, blasting, maintenance, shutdown, no operation), equipment fault status (which can be coded into normal or different fault categories based on equipment alarm information), and abnormal operation status (which can be coded based on event records such as violation of regulations, abnormal opening of dampers, and manual intervention).

[0044] For example, the mining advance speed in the continuous features can be calculated from the running distance and running time of the mining equipment in the above-mentioned original data; the geological disturbance value can be calculated by weighting the coal seam thickness stability, coal seam fault density and coal seam roof stability; the temperature change can be calculated from the temperature at the current sampling time and the temperature at the previous sampling time; the instantaneous gas emission increment can be calculated from the current gas emission and the reference gas emission; and the air leakage rate can be calculated from the air intake at the working face inlet and the effective air volume reaching the working face.

[0045] In some embodiments, before obtaining feature data based on the original data, the original data may be cleaned and normalized first, and then feature data may be obtained based on the processed data.

[0046] For example, data cleaning can remove invalid sample data. Invalid sample data includes at least one of the following: gas concentration < 0%, extraction negative pressure > 50 kPa, missing values, non-numerical values, invalid timestamps, duplicate data, sensor malfunction status, out-of-range values, long-term constant values, abnormal jumps, inconsistent units, and out-of-time data.

[0047] Normalization can include performing min-max normalization on sample data with continuously varying characteristics, mapping the normalized data to [0,1]. After data cleaning and normalization, supervised learning samples are constructed based on the processed historical data (original data). The multidimensional feature data corresponding to historical time t is used as the model input, and the gas concentration corresponding to a preset time interval after time t is used as the prediction label. The constructed supervised learning samples are then divided into training and validation sets.

[0048] In some embodiments, before obtaining feature data based on raw data, the following steps may be included: acquiring candidate feature data for a preset historical time period of the target coal mine operation site; determining feature data that meets preset conditions from the candidate feature data, wherein the preset conditions are used to characterize the contribution to gas concentration prediction.

[0049] For example, candidate feature data for a predetermined historical time period of the target coal mine operation site can be extracted based on the training set and validation set, that is, candidate feature data corresponding to each data point in the training set and validation set. The candidate feature data may include at least one of continuous features, discrete features, or historical correlation features.

[0050] The preset conditions may include the contribution of each candidate feature data. The contribution can be obtained in the following way: compare the changes in mean absolute error (MAE), mean square error (MSE), and coefficient of determination (R²) after adding or deleting a candidate feature data on the training set and validation set, and combine the cross-validation stability, permutation importance, and ablation experiments to determine the contribution of the candidate feature data to the gas concentration prediction.

[0051] In this way, by using the candidate feature data screening steps provided above, redundant and noisy features that contribute little or no to gas concentration prediction can be pre-screened before model training. This effectively avoids interference from irrelevant features in model training, reduces the risk of overfitting, and improves the model's generalization ability and prediction accuracy. At the same time, the dual evaluation mechanism based on the training and validation sets ensures the objectivity and reliability of feature screening. The permutation importance test and ablation experiment cross-validate the true contribution of each feature from different dimensions, ensuring that the screening results do not depend on a single evaluation index. This provides high-quality, high-information input feature data for the target random forest model, laying a data foundation for subsequent core feature identification and feature activation weight allocation.

[0052] S102, a baseline random forest model is obtained by training using feature data.

[0053] In one possible implementation, a baseline random forest model is trained using feature data. This can be achieved as follows: First, based on the feature data in the training set, hyperparameters such as the optimal number of decision trees and the maximum tree depth are determined through time series cross-validation and grid search. Then, a baseline random forest model is trained based on the feature data in the training set and the hyperparameters such as the optimal number of decision trees and the maximum tree depth.

[0054] It should be noted that the node splitting of each decision tree in the benchmark random forest model is not based on the core features and feature incentive weights.

[0055] S103, based on the benchmark random forest model, determines the core features in the feature data and the feature activation weights corresponding to each core feature.

[0056] In this context, core features refer to those features in the baseline random forest model whose base importance score (Ibase) exceeds the average importance score (Imean) of all features; these are the features that contribute the most to and have the most significant impact on gas concentration prediction. After determining the core features, the corresponding feature activation weights can be calculated. and the feature activation weights corresponding to non-core features Among them, the feature activation weights corresponding to non-core features It can be set to 1.

[0057] In one possible implementation, the core features can be determined as follows: based on the reduction in mean squared error caused by the participation of each dimension of features in the node splitting of each decision tree in the baseline random forest model, the basic importance score of each dimension of features in the feature data is calculated. And based on the basic importance scores corresponding to all feature data. Calculate the average of the basic importance scores If the basic importance score corresponds to the feature data. Greater than the average of the basic importance scores If the feature data has a certain value, then it is considered a core feature; if the feature data has a certain value, then it is considered a core feature. Less than or equal to the average of the basic importance scores If so, then the feature data is a non-core feature.

[0058] For example, the feature activation weights corresponding to the core features The following formula can be used to determine it: ; Where α represents the characteristic excitation coefficient, and the specific value is determined based on experience, such as 1.1; This represents the highest score for the importance of the basic feature among all feature data.

[0059] In this way, by calculating the basic importance score of each dimension feature based on the reduction of mean squared error before and after splitting each decision tree node in the benchmark random forest model, the core features are determined based on the basic importance score. The feature incentive weight corresponding to each core feature is determined by combining the basic importance score, feature incentive coefficient, average and maximum basic importance scores of each dimension feature. This enables objective quantitative screening and differentiated weight allocation of core features, so that core features with higher importance receive greater incentive weights, avoiding the bias caused by subjective weighting, and thus accurately amplifying the influence of high-contribution features in model training.

[0060] S104. Based on feature data, a target random forest model for predicting gas concentration is trained. The target random forest model includes multiple decision trees, and the optimal splitting feature of each node in each decision tree is determined based on the core feature and feature incentive weights.

[0061] In some embodiments, when splitting at each decision tree node, the mean squared error (MSE) corresponding to each candidate splitting feature randomly selected from the training samples of the current node is obtained; based on the ratio of the MSE corresponding to each candidate splitting feature to the feature activation weight, the corrected MSE corresponding to each candidate splitting feature is obtained; the feature with the smallest corrected MSE among the candidate splitting features is used as the optimal splitting feature for the current node for training, thus obtaining the target random forest model. Specifically, in the target random forest model, the training samples of each decision tree are extracted with replacement from the training set through bootstrap; when splitting at each node, candidate splitting features are randomly selected from the feature set of the training samples of the decision tree corresponding to that node, the MSE after splitting is calculated for each candidate splitting feature and candidate splitting point, and the corresponding feature activation weight is introduced into the MSE calculation to obtain the corrected MSEω(D,f), which can be determined using the following formula: ; Where MSE(D,f) represents the weighted mean square error of the child nodes after the node training sample set D is split according to the candidate splitting feature f and the corresponding candidate splitting point, and ωf represents the feature activation weight corresponding to the candidate splitting feature f.

[0062] Among the candidate splitting features and candidate splitting points, the candidate splitting feature and candidate splitting point with the smallest corrected mean squared error are selected as the optimal splitting scheme for the current node. The node is then split based on this optimal splitting scheme. This process is recursively executed until preset stopping conditions are met (including hyperparameters such as maximum tree depth and minimum number of samples per node), thus completing the training of the target random forest model. Since the feature activation weight of the core features is greater than 1, after correction by dividing the mean squared error by the feature activation weight, the core features can obtain a smaller corrected mean squared error when the original splitting errors are similar, thereby increasing the probability of them being selected as the optimal splitting feature and making the model more focused on high-contribution features during training.

[0063] It should be noted that none of the decision trees undergo initial pruning in order to preserve the complete tree structure and ensure the ability of the trained decision trees to capture complex nonlinear relationships.

[0064] After each decision tree is trained, the gas concentration prediction value for each decision tree is determined using the validation set or out-of-bag samples. , where k represents the k-th decision tree.

[0065] In some embodiments, the target random forest model further includes prediction incentive weights corresponding to each decision tree, which are obtained by first determining the prediction error of each decision tree through the validation set or out-of-bag samples; and then determining the prediction incentive weights corresponding to each decision tree based on the prediction error.

[0066] For example, predicting incentive weights The following formula can be used to determine it: ; Where Ek represents the prediction error of the k-th decision tree on the validation set or out-of-bag samples, which can be calculated using mean squared error (MSE) or mean absolute error (MAE); ε represents a preset positive number, such as 1, used to prevent the denominator from being 0.

[0067] From the above formula, it can be seen that the predicted incentive weight ω p,k It is negatively correlated with the prediction error Ek of the corresponding decision tree; the smaller the prediction error, the higher ω is. p,k The larger.

[0068] The final goal of the random forest model is to use a weighted average method to combine the gas concentration predictions of each decision tree. Its corresponding predictive incentive weights Multiply the results to obtain the weighted predictions of each decision tree; sum the weighted predictions of all decision trees and divide by the sum of all prediction weights to obtain the final prediction value of the target random forest model. .

[0069] For example, The following formula can be used to determine it:

[0070] Where K represents the number of decision trees in the objective random forest model.

[0071] The final output value of the objective random forest model is calculated using the formula described above.

[0072] In this way, by determining the prediction incentive weights corresponding to each decision tree and assigning weights based on the prediction errors on the validation set or out-of-bag samples, the decision trees with smaller prediction errors occupy higher weights in the ensemble results. This allows for the introduction of a tree weighting mechanism on top of feature weighting, constructing a dual weighting architecture of "feature level + tree level". This not only increases the priority of core features in node splitting but also increases the contribution of decision trees with better generalization performance to the final prediction results, thereby improving the prediction accuracy and robustness of the ensemble model.

[0073] In some embodiments, a dynamic optimization mechanism for the entire lifecycle of a model can be established, which includes "data accumulation - regular updates - anomaly monitoring - version management". On-site data is accumulated in batches, and the model is retrained every time a preset number of valid data (e.g., 1000) are accumulated or periodically (e.g., weekly). Prediction errors are monitored and model version rollback is supported.

[0074] In summary, the training method for the random forest model provided in this application first trains a benchmark random forest model to identify core features and assign feature incentive weights. Then, based on the core features and feature incentive weights, it guides the selection of optimal splitting features for each decision tree in the target random forest model. This effectively distinguishes the differences in the contribution of different features to the prediction results during the model training stage, thereby improving the model's ability to focus on key features and resist noise interference, enhancing the accuracy and generalization ability of gas concentration prediction, and providing reliable technical support for accurate prediction and early warning of underground gas concentration in coal mines.

[0075] The target random forest model obtained from the above training can be used to predict gas concentration. The following describes the method for predicting gas concentration based on the target random forest model obtained from the training.

[0076] Figure 2 An exemplary flowchart of a gas concentration prediction method according to some embodiments of this application is shown.

[0077] like Figure 2 As shown, the gas concentration prediction method may include the following steps: S201, Obtain multi-dimensional feature data of the target coal mine work site at the current moment.

[0078] The multidimensional feature data at the current moment refers to the input data during the inference phase. For details on the dimensions and extraction methods of the specific feature data, please refer to the description of step S101, which will not be repeated here.

[0079] S202, input the multidimensional feature data into the target random forest model trained using the above-mentioned random forest model training method to obtain the gas concentration at a future preset time.

[0080] In some embodiments, when the target random forest model includes prediction incentive weights corresponding to each decision tree, the gas concentration corresponding to each decision tree is predicted; based on the prediction incentive weights... and gas concentration prediction values To obtain the gas concentration at a future preset time. .

[0081] For example, The following formula can be used to determine it: .

[0082] In some embodiments, multidimensional feature data is input into the target random forest model trained using the above-described random forest model training method. The target random forest model outputs the gas concentration prediction value for the next sampling frequency (e.g., 1 time / minute). To obtain gas concentration prediction values ​​for multiple time scales such as 10 minutes (short-term), 30 minutes (medium-term), and 60 minutes (long-term), a rolling prediction method can be used.

[0083] For example, the rolling prediction method can be implemented as follows: First, multidimensional feature data is input into the target random forest model, and the target random forest model outputs the first gas concentration corresponding to the first future preset time. Then, based on the first gas concentration, historical correlation features such as the gas concentration at the previous sampling time, the average gas concentration in the previous window, and the maximum gas concentration in the previous window are updated. For other dynamic features, the measured values, planned values, or those that can be obtained at the next prediction time are used, or the updated feature data is maintained or updated according to preset rules. For example, the current gas concentration is updated based on the first gas concentration, while the basic gas emission, mining speed, geological disturbance value, temperature change, extraction negative pressure, number of effective extraction boreholes, coal seam permeability coefficient, instantaneous gas emission increment, fan air supply, air leakage rate, airway resistance, air volume loss coefficient, operating status, equipment failure status, violation operation, and manual intervention status remain unchanged. Then, the updated feature data is input into the target random forest model, which outputs the second gas concentration corresponding to the second future preset time. This process is iterated to finally obtain the predicted gas concentration value for the future preset time.

[0084] In this way, by updating the gas concentration predicted in the previous step to the historical correlation features of the next time step, and combining it with other dynamic features available at the next prediction time, continuous prediction of gas concentration at multiple time scales can be achieved through rolling prediction. This allows each prediction step to utilize the updated time series information, reduces the loss of intermediate information in direct multi-step prediction, and provides continuous data support for graded early warning.

[0085] In some embodiments, the warning level can be determined comprehensively based on the first gas concentration, the second gas concentration, and the rate of change of gas concentration, and a warning operation matching the warning level can be triggered.

[0086] For example, when the target random forest model outputs a predicted gas concentration of 0.85% for the next 10 minutes, and the rate of increase is 0.06% / min (which has reached the preset threshold of 0.05% / min), a Level 1 (blue) warning is triggered. At this time, the edge computing node sends a command to the equipment monitoring system to automatically increase the data collection frequency from the current value to once per minute for encrypted monitoring; at the same time, the warning information is pushed to the ground monitoring center, which then notifies the on-site safety officer to go to the target coal mine work site for inspection and verification.

[0087] When the model further predicts that the gas concentration will reach or exceed 0.9% in the next 30 minutes, the warning level is upgraded from Level 1 to Level 2 (yellow). At this time, the control system automatically adjusts the extraction negative pressure from 20 kPa to 24 kPa (an increase of 20%), and simultaneously increases the air supply of the blower from 800 m³ / min to 920 m³ / min (an increase of 15%) to enhance the gas dilution and extraction capacity.

[0088] When the target random forest model outputs a predicted methane concentration of 1.0% or higher for the next 10 minutes, a Level 3 (orange) warning is triggered directly. At this time, the system automatically cuts off the intrinsically safe power supply to the working face, stops coal cutting operations, and activates the personnel positioning system to guide workers to evacuate in an orderly manner along the predetermined disaster avoidance route via broadcast.

[0089] It should be noted that the above embodiments are only illustrative examples of a three-level warning and do not represent a limitation on the warning level. For example, other embodiments may include more or fewer warning levels.

[0090] In this way, by determining the warning level based on the first gas concentration, the second gas concentration, and the rate of change of gas concentration, and triggering the warning operation corresponding to the warning level, the gas concentration prediction result and the rate of change of gas concentration can be combined for joint warning judgment. This effectively overcomes the defects of existing technologies where alarms triggered by a single concentration threshold are prone to false alarms and missed alarms. At the same time, it realizes deep linkage between the warning level and downhole equipment control, management process, and emergency system, forming a full-process risk closed loop of "prediction-control-emergency".

[0091] In summary, the gas concentration prediction method provided in this application obtains multi-dimensional feature data of the target coal mine operation site at the current moment, and inputs the multi-dimensional feature data into a target random forest model trained to obtain the gas concentration at a preset future time. It can apply the improved random forest model trained based on the core features identified by the benchmark model and assigned feature incentive weights to the actual gas concentration prediction, so that the prediction process can make full use of the dominant role of the core features, realize accurate gas concentration prediction driven by multi-dimensional features, effectively overcome the defects of prediction lag and inability to predict the concentration change trend in advance in the existing technology, and provide a reliable data foundation for early warning of gas.

[0092] It is understood that the above embodiments are merely examples, and modifications can be made to the above embodiments in actual implementation. Those skilled in the art will understand that any modifications to the above embodiments that do not require creative effort fall within the protection scope of this application, and will not be described in detail in the embodiments.

[0093] Based on the same inventive concept, embodiments of this application also provide a training apparatus for a random forest model. For example... Figure 3 As shown, the training device 300 for the random forest model includes: The acquisition module 301 is used to acquire feature data of the target coal mine operation site over a preset historical time period. The feature data includes feature data of multiple dimensions corresponding to different working conditions. The first training module 302 is used to train a baseline random forest model using the feature data; The determination module 303 is used to determine the core features in the feature data and the feature activation weights corresponding to each core feature based on the benchmark random forest model. The second training module 304 is used to train a target random forest model for predicting gas concentration based on the feature data. The target random forest model includes multiple decision trees, and the optimal splitting feature of each node in each decision tree is determined based on the core feature and the feature incentive weight.

[0094] Based on the same inventive concept, embodiments of this application also provide a gas concentration prediction device. For example... Figure 4As shown, the gas concentration prediction device 400 includes: The acquisition module 401 is used to acquire multi-dimensional feature data of the target coal mine work site at the current moment; The inference module 402 is used to input the multidimensional feature data into the target random forest model trained by the above-mentioned random forest model training method to obtain the gas concentration at a future preset time.

[0095] Based on the same inventive concept, embodiments of this application also provide an electronic device, which may include a processor and a memory. The memory may be used to store computer programs, such as programs / code pre-installed at the time of manufacture, or code for execution by the processor. The processor may be used to call and execute the computer program in the memory to enable the electronic device to implement the random forest model training method or gas concentration prediction method described in embodiments of this application, such as those mentioned above. Figure 1 or Figure 2 The method shown.

[0096] It should be understood that electronic devices may also include other components, such as displays and transceivers. Displays can be used to show user interfaces, and transceivers can be used to receive various user inputs.

[0097] This electronic device can correspond to the electronic device provided in the above embodiments.

[0098] Since the principle by which the electronic device solves the problem is similar to the training method of the aforementioned random forest model or the gas concentration prediction method, the implementation of the electronic device can refer to the implementation of the aforementioned random forest model training method and gas concentration prediction method. Repeated parts will not be repeated.

[0099] The processor in the above embodiments can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0100] The memory in the above embodiments can be volatile memory or non-volatile memory, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0101] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when run on an electronic device, causes the electronic device to implement the methods described in the above method embodiments.

[0102] Those skilled in the art will recognize that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0103] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0104] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices, modules, and methods can be implemented in other ways. For example, the electronic device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0105] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0106] In addition, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit.

[0107] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0108] It should be understood that in the various embodiments of this application, the execution order of each step should be determined by its function and internal logic, and the size of each step number does not mean the order of execution, and does not constitute a limitation on the implementation process of the embodiments.

[0109] The various parts of this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referred to interchangeably. Each embodiment focuses on the differences from other embodiments. In particular, the embodiments for electronic devices, chip systems, computer-readable storage media, and computer program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant details can be found in the descriptions within the method embodiments.

[0110] While numerous embodiments of this application have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will arise for those skilled in the art without departing from the spirit and intent of this application. It should be understood that various alternatives to the embodiments of this application described herein may be employed in the practice of this application. The appended claims are intended to define the scope of protection of this application and therefore cover equivalents or alternatives within the scope of these claims.

Claims

1. A training method for a random forest model, characterized in that, The method includes: Acquire feature data of the target coal mine work site over a preset historical time period, the feature data including feature data of multiple dimensions corresponding to different working conditions; A baseline random forest model is obtained by training using the aforementioned feature data; Based on the benchmark random forest model, determine the core features in the feature data and the feature activation weights corresponding to each core feature; Based on the feature data, a target random forest model for predicting gas concentration is trained, wherein the target random forest model includes multiple decision trees, and the optimal splitting feature of each node in each decision tree is determined based on the core feature and the feature incentive weight.

2. The method according to claim 1, characterized in that, The determination of the core features in the feature data and the feature activation weights corresponding to each core feature based on the benchmark random forest model includes: Based on the reduction in mean squared error caused by the participation of each dimension of features in the node splitting of each decision tree in the benchmark random forest model, the basic importance score of each dimension of features in the feature data is calculated. Based on the basic importance score, the core features in the feature data are determined; Based on the basic importance score, feature incentive coefficient, average and maximum value of the basic importance score of each dimension feature, the feature incentive weight corresponding to each core feature is determined.

3. The method according to claim 1, characterized in that, The objective random forest model, trained based on the feature data, including multiple decision trees, includes: When splitting at each decision tree node, obtain the mean squared error corresponding to the candidate splitting features randomly selected from the training samples of the current node; Based on the ratio of the mean square error corresponding to each of the candidate splitting features to the feature activation weight, the corrected mean square error corresponding to each of the candidate splitting features is obtained. The feature with the smallest corrected mean square error among the candidate splitting features is used as the optimal splitting feature for the current node to train the target random forest model.

4. The method according to claim 1, characterized in that, The target random forest model also includes prediction incentive weights corresponding to each decision tree, which are obtained in the following way: Determine the prediction error for each decision tree; The prediction incentive weights for each decision tree are determined based on the prediction error.

5. The method according to claim 1, characterized in that, Before acquiring characteristic data of the target coal mine's operating site over a preset historical time period, the method further includes: Obtain candidate feature data for a preset historical time period of the target coal mine's work site; Feature data that meets preset conditions is determined from the candidate feature data, and the preset conditions are used to characterize the contribution to the prediction of gas concentration. The feature data includes at least one of continuous features, discrete features, or historical correlation features. Continuous features refer to features with continuous change characteristics, discrete features refer to features of non-continuous variables with a finite number of discrete states in the value space, and historical correlation features refer to features that reflect the concentration level or trend information at historical moments and are constructed statistically based on gas concentration time series data. The continuous features include at least one of the following: current gas concentration, basic gas emission, mining advance speed, geological disturbance value, temperature change, extraction negative pressure, number of effective extraction boreholes, coal seam permeability coefficient, instantaneous gas emission increment, fan air supply, air leakage rate, airway resistance, and air volume loss coefficient. The discrete features include at least one of the following: operating status, equipment failure status, and abnormal operation status. The historical correlation features include at least one of the following: gas concentration at the previous sampling time, average gas concentration in the previous window, and maximum gas concentration in the previous window.

6. A method for predicting gas concentration, characterized in that, The method includes: Obtain multidimensional feature data of the target coal mine's work site at the current moment; The multidimensional feature data is input into the target random forest model trained using the method described in any one of claims 1-5 to obtain the gas concentration at a future preset time.

7. The method according to claim 6, characterized in that, The multidimensional feature data is input into a target random forest model trained using the method described in any one of claims 1-5 to obtain the gas concentration at a future preset time, including: The multidimensional feature data is input into the target random forest model trained by the method described in any one of claims 1-5 to obtain the first gas concentration corresponding to the first future preset time. Based on the first gas concentration, the historical correlation features in the multidimensional feature data are updated to obtain the updated feature data; The updated feature data is input into the target random forest model trained by the method described in any one of claims 1-5 to obtain the second gas concentration corresponding to the second future preset time, wherein the second future preset time is the time after the first future preset time; The warning level is determined based on the first gas concentration, the second gas concentration, and the rate of change of gas concentration; Trigger the execution of the warning operation corresponding to the warning level.

8. A training device for a random forest model, characterized in that, The device includes: The acquisition module is used to acquire feature data of the target coal mine operation site over a preset historical time period. The feature data includes feature data of multiple dimensions corresponding to different working conditions. The first training module is used to train a baseline random forest model using the feature data; The determination module is used to determine the core features in the feature data and the feature activation weights corresponding to each core feature based on the benchmark random forest model. The second training module is used to train a target random forest model for predicting gas concentration based on the feature data. The target random forest model includes multiple decision trees, and the optimal splitting feature of each node in each decision tree is determined based on the core feature and the feature incentive weight.

9. A gas concentration prediction device, characterized in that, The device includes: The acquisition module is used to acquire multi-dimensional feature data of the target coal mine work site at the current moment; The inference module is used to input the multidimensional feature data into a target random forest model trained using the method described in any one of claims 1-5, and obtain the gas concentration at a future preset time.

10. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-5, or implement the method of any one of claims 6-7.