Tunnel rock mass water burst and mud burst prediction method and system based on XGBoost-RF fusion algorithm

By using the XGBoost-RF fusion algorithm to extract multi-dimensional features from seismic wave data and perform model fusion, the problem of predicting water inrush and mudslide disasters in tunnel construction was solved, and the ability to identify key risk categories and the overall prediction accuracy were improved.

CN121615017APending Publication Date: 2026-03-06中国水利水电第七工程局有限公司 +1

Patent Information

Application Number
CN202610131618.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing methods for predicting water inrush and mudslide disasters during tunnel construction suffer from problems such as strong subjectivity in feature extraction, insufficient model fitting ability, weak generalization ability, and insufficient identification of key risk categories, making it difficult to meet the actual needs of engineering projects.

Method used

The XGBoost-RF fusion algorithm is adopted to extract multi-dimensional geological response features by preprocessing seismic wave data. Combined with hierarchical cross-validation and weighted scanning, soft voting fusion of XGBoost and random forest models is achieved to optimize the recall and stability of the model in key risk categories.

Benefits of technology

It significantly improved the recall rate and model stability for medium- and high-risk categories, enhanced the accuracy and reliability of water inrush and mud inrush prediction, reduced missed detections, and provided reliable data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121615017A_ABST
    Figure CN121615017A_ABST
Patent Text Reader

Abstract

The invention discloses a tunnel rock mass water burst and mud burst prediction method and system based on an XGBoost-RF fusion algorithm, and belongs to the technical field of geological disaster prediction. The method comprises the following steps: firstly, preprocessing seismic wave data, and extracting various geological response characteristics including longitudinal wave velocity, wave velocity variation coefficient, Poisson's ratio and the like; then respectively training an XGBoost model and a random forest model, and carrying out probability fusion through a soft voting strategy; and finally, outputting a risk level classification result based on the weighted probability. The core innovation of the invention lies in that the feature fine recognition capability of the XGBoost model and the anti-noise characteristic of the random forest model are effectively combined through algorithm fusion, and the probability calibration and weight optimization mechanism is adopted, so that the recognition precision of middle and high risk categories is remarkably improved. Experiments show that according to the method, the average recall rate of key categories on a test set reaches 0.9925, the overall accuracy rate is 0.990, and the problems that a traditional method is high in high-risk geologic body missed judgment rate and insufficient in generalization ability are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geological disaster prediction technology, and in particular to a method and system for predicting water inrush and mudslide in tunnel rock mass based on the XGBoost-RF fusion algorithm. Background Technology

[0002] With the rapid development of infrastructure construction in my country, the scale and complexity of underground engineering, especially tunnel engineering, have reached among the highest in the world. During tunnel construction, water inrush and mudslides are common geological hazards, occurring frequently and causing significant damage. Statistics show that they account for over 40% of all geological hazards during tunnel construction. These hazards can not only lead to casualties among construction workers, project delays, and huge economic losses, but also trigger secondary disasters such as landslides, surface subsidence, and water loss, seriously threatening project safety and social stability.

[0003] Currently, advanced geological prediction for tunnels mainly relies on comprehensive geophysical methods (such as seismic wave methods and electromagnetic wave methods) combined with expert experience for risk identification. Existing technologies mostly employ manual feature extraction and linear discrimination models, such as empirical formulas or statistical methods based on single indicators like seismic wave velocity and amplitude. However, these methods have significant limitations: First, the feature extraction process is highly dependent on expert subjective judgment, making it difficult to standardize and easily affected by individual experience differences; second, traditional linear models have insufficient fitting ability for nonlinear features under complex geological conditions, especially in high-risk areas such as water-bearing fractured zones and faults, where the identification accuracy is low; furthermore, existing models have weak generalization ability and cannot adapt to the large-scale application needs of different geological environments and construction conditions.

[0004] In recent years, although machine learning methods have been gradually applied to geological disaster prediction, single models (such as support vector machines and decision trees) still suffer from poor stability and high risk of overfitting. For example, while the gradient boosting tree (XGBoost) model performs excellently in fine-grained feature fitting, it is sensitive to noisy data; while the random forest (RF) model is robust, it lacks accuracy in identifying complex boundaries. This complementary performance has not been effectively utilized, resulting in existing prediction methods failing to meet the actual engineering needs in terms of recall and overall stability for key risk categories (such as medium- and high-risk water inrush and mudslides).

[0005] In addition, some studies have attempted to combine multiple geological indicators for prediction, such as the water inrush and mud inrush prediction method based on comprehensive advanced geological prediction of fault fracture zones disclosed in Chinese invention patent CN119270384B. This method collects multiple geological indicators such as the probability level of the existence of fault fracture zones, the level of nearby precursors, and the level of rock mass integrity. First, it uses a multinomial naive Bayes model to predict the scale level of fault fracture zones, and then combines a support vector machine model optimized by a genetic algorithm to predict the level of water inrush and mud inrush. Although this method incorporates machine learning algorithms and considers comprehensive geological factors, thus improving the systematic nature of predictions to some extent, it still has the following shortcomings: First, relying on manually divided discrete level indicators, the feature extraction process remains subjective and may lose subtle information of continuous features, resulting in limited model fitting ability for complex nonlinear relationships; second, the models used, such as multinomial Naive Bayes and support vector machines, while simple and easy to use, lack modern fusion strategies (such as probability calibration and weight optimization), making it difficult to fully utilize the complementarity between models, especially when dealing with imbalanced data; finally, this method does not perform specific optimization for key risk categories (such as medium and high risk), which may lead to a high false negative rate in high-risk scenarios, and its generalization ability is limited by the rigid structure of the level division.

[0006] In the application of ensemble learning models, Liu Zheng, in his paper "Research on Optimization of TBM Excavation Efficiency in Deep-Buried Tunnels Based on Stacking Ensemble Learning," adopted the Stacking ensemble learning method, integrating multiple algorithms such as random forest and XGBoost to improve the accuracy of rockburst intensity prediction and tunneling rate optimization. This research confirmed the advantages of ensemble learning models over single models in terms of overall performance, but it differs from this invention in several ways: 1. Differences in fusion strategies: The Stacking ensemble learning method used by Liu Zheng et al. is a multi-layered model stacking structure, requiring a meta-learner to perform secondary learning on the output of the base learner. This invention innovatively adopts a soft-voting probability fusion mechanism, directly weighting the prediction probabilities of the XGBoost and random forest models, achieving complementary model advantages through weight optimization and probability calibration. This invention is simpler, more computationally efficient, and avoids the risk of overfitting of the meta-learner in Stacking. 2. Targeting of optimization objectives: The optimization objective of Liu Zheng et al.'s paper focuses on the overall accuracy of rockburst intensity classification and tunneling rate regression, without specifically optimizing for the omission of key risk categories. This invention explicitly proposes using the average recall rate of medium-high risk and high-risk categories as the core optimization index. Through hierarchical cross-validation and weighted scanning, it significantly improves the identification ability of key categories that have the greatest impact on engineering safety, solving the problem of high false negative rates in high-risk scenarios of traditional methods. 3. Refined processing of probability output: This invention introduces probability calibration technology (such as using equidistant monotonic calibration for random forest models) to ensure that the probability output scale of different base learners is consistent, and then fuses them through adaptive weight allocation (such as XGBoost weight 0.3 and random forest weight 0.7). In contrast, the Stacking method usually directly uses the predicted labels or uncalibrated probabilities of the base learners, failing to solve the problem of probability distortion between models, which may affect the reliability of the fusion results. 4. Feature engineering and engineering adaptability: This invention constructs a multi-dimensional feature system (such as wave velocity variation coefficient, Poisson's ratio, reflected wave energy, etc.) that is strongly correlated with water inrush and mudslide disasters based on seismic wave data, and designs feature screening and normalization processes in combination with the characteristics of geological disaster prediction. The feature system in Liu Zheng et al.'s paper is geared towards rockburst and tunneling efficiency optimization, and its feature construction differs significantly from that of this invention in both physical mechanism and engineering application scenario.

[0007] Similarly, in the field of rockburst prediction, Ma Jingang, in his study "Research on Microseismic Characteristics of Rockburst Events in Deep Tunnels and Machine Learning Evaluation Methods for Rockburst", compared seven machine learning models, including Random Forest and XGBoost, and pointed out that the RF (Random Forest) model showed a lower error rate and better overall performance in rockburst level evaluation.

[0008] Xia Yuanyou et al., in their study "Tunnel Rockburst Prediction Based on Data Preprocessing Technology and Considering the Influence of Surrounding Rock Stress Gradient," also employed five algorithms—SVM, RF, GBDT, AdaBoost, and XGBoost—to construct a comparative prediction model. These studies demonstrate that algorithm comparison and integration are effective ways to improve the performance of prediction models.

[0009] In terms of feature engineering and data preprocessing, relevant research has also made progress. Ma Jingang's research proposed a feature selection method based on the Boruta algorithm and used the SMOTE algorithm to handle the sample imbalance problem, significantly improving the model's prediction accuracy. Xia Yuanyou et al.'s research, targeting rockburst datasets, systematically introduced the Random Forest Multiple Imputation (MI-RF) method to handle missing values, integrated multiple unsupervised algorithms to identify outliers, and used the ADASYN algorithm to solve the sample imbalance problem, forming a complete data preprocessing workflow. Wang Meng et al., in "Analysis and Prediction Model of Roadway Surrounding Rock Deformation Based on Machine Learning," also integrated numerical analysis and multiple machine learning algorithms. These works highlight the decisive influence of high-quality data and carefully designed feature engineering on model performance.

[0010] While the aforementioned studies have provided valuable experience in model building and data processing, their research focuses primarily on rockburst prediction, TBM tunneling efficiency, and surrounding rock deformation. However, existing research has significant shortcomings in predicting another high-frequency and high-hazard geological hazard in tunnel construction—water inrush and mudslide. First, there is a lack of targeted feature systems, failing to systematically construct multi-source feature indicators from geological and geophysical sources that are strongly correlated with the mechanism of water inrush and mudslide disasters. Second, the models lack specificity; existing ensemble learning or model comparison studies have not specifically optimized for core pain points such as the imbalance of water inrush and mudslide risk categories and the high cost of underreporting of key categories (such as medium- and high-risk). Third, in terms of model fusion strategies, simple voting or fixed stacking are often used, lacking fine calibration of the output probabilities of the base learners and adaptive weight allocation mechanisms, making it difficult to achieve an optimal balance between accuracy and stability.

[0011] Therefore, there is an urgent need for an intelligent prediction method that can integrate the advantages of multiple models, improve feature adaptation capabilities, and have high generalization performance, in order to solve the problem of accurate early warning of water inrush and mudslide disasters in tunnel construction. Summary of the Invention

[0012] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for predicting water inrush and mud inrush in tunnel rock mass based on the XGBoost-RF fusion algorithm.

[0013] The objective of this invention is achieved through the following technical solution: The first aspect of this invention provides a method for predicting water inrush and mudslide in tunnel rock mass based on the XGBoost-RF fusion algorithm, comprising the following steps: S1: Preprocess the measured seismic wave dataset and extract various types of geological response characteristic indicators and risk labels, and divide the preprocessed dataset into training set and test set; S2: Train the XGBoost model using XGBClassifier, and train and validate the XGBoost model using the input samples; train the RF model using the Random Forest classifier, and train and validate the RF model using the input samples. S3: Use VotingClassifier to perform soft voting fusion, perform a weighted average of the predicted probabilities of the trained XGBoost model and RF model, and then take the label corresponding to the highest probability as the final risk class output, and finally obtain the XGBoost-RF fusion model; S4: Evaluate the performance of the XGBoost-RF fusion model, calculate the accuracy, F1 score and recall metrics, and use the XGBoost-RF fusion model that meets the performance requirements to predict water inrush and mud inrush.

[0014] Preferably, step S1 further includes the following sub-steps: S11: Identify the first arrival time of the waveform in each receiver. Calculate the P-wave velocity along the target path by dividing the known geometric distance between the source and the receiver by the first arrival time. Calculate the P-wave velocity across all receivers and take the average value to obtain the average P-wave velocity. Vp ; S12: Calculate the average shear wave velocity by identifying the arrival time of the S-wave. Vs Thus, the average wave velocity ratio is obtained. Vp / Vs ; S13: Extract the maximum reflected wave amplitude by taking a preset time window after the P wave in the waveform; S14: Calculate the wave velocity variation coefficient by dividing the standard deviation of the P-wave velocity by the mean. CVvp ; S15: Group the receivers on the left and right sides into a group, divide the wave velocity difference between the two receivers in each group by the vertical distance between them, calculate the gradient and compare them to obtain the maximum wave velocity gradient. S16: Extract the reflected wave energy by calculating the square of the integrator receiver amplitude; S17: Calculate the wave impedance based on the longitudinal wave velocity and density values ​​of the surrounding rock; S18: Poisson's ratio is calculated based on the relationship between the average wave velocity ratio and the rock mass deformation characteristics; S19: The dataset is divided into training and test sets using stratified sampling, and the extracted features are normalized using Min-Max. The training and test sets are then transformed independently.

[0015] Preferably, the training of the XGBoost model includes the following steps: A hierarchical 5-fold cross-validation scheme is set up on the training set, which divides the data into 5 parts in a balanced manner according to the category ratio, and trains and validates them in turn to reduce the impact of randomness. The average recall rate of the medium- and high-risk categories and the high-risk category is used as the core optimization index for model parameter tuning and selection. Build an XGBoost model and configure the output probability format, random seed, and tree construction method to improve training speed; Define the hyperparameter search range, including the number of trees, maximum depth, learning rate, sample sampling ratio, feature sampling ratio, and minimum weight of child nodes; Perform parameter search and model training, train and validate each parameter combination through 5-fold cross-validation, calculate the average recall of medium- and high-risk categories and high-risk categories, and select the parameter combination that performs most stably on the validation set as the optimal parameter combination; The XGBoost model is retrained on the training set using the optimal parameter combination to check whether the mean and fluctuations between different folds are stable, thus obtaining a well-trained XGBoost model.

[0016] Preferably, the training of the RF model includes the following steps: Establish a hierarchical cross-validation scheme, using hierarchical K-fold cross-validation to ensure that the proportion of classes in each fold is consistent with the overall proportion, and use shuffled random seeds and fixed random seeds to make the results reproducible; Construct a random forest base learner, instantiate a random forest classifier, enable class weight balancing to alleviate class imbalance, set the parallelism according to resources, and fix the random seed; Define the hyperparameter search space, including the number of trees, maximum depth, minimum number of split samples, minimum number of leaf samples, and feature subsampling strategy; Perform cross-validation to tune hyperparameters, using a preset primary metric as the scoring function, and perform grid search or Bayesian search on the training set for hyperparameter combinations; save the mean score and fluctuation of each combination at each fold, and select the optimal hyperparameter combination with robustness as the priority. Use a calibrator to perform probabilistic calibration on the optimal RF model; The RF model is retrained on the training set using the optimal combination of hyperparameters and calibration scheme to obtain a well-trained RF model.

[0017] Preferably, step S3 further includes the following steps: S31: Instantiate VotingClassifier, pass in the trained XGBoost model and RF model as base learners, fuse them according to class probabilities, and reserve a set of weights to be optimized so that the contribution of each model in the weighted average is adjustable; S32: The average recall rate of medium-high risk categories and high risk categories is used as the optimization target. Weight scanning is performed through hierarchical cross-validation. Weight search is used as the outer loop and cross-validation score is used as the inner evaluation to ensure that the selected weights perform stably on different segments. S33: Using the selected optimal weight combination, the soft voter is refitted on the training set. Internally, each base learner is cloned and retrained to ensure that the fusion unit carries parameters that match the current data and weights. For each sample to be predicted, the predict_proba function of each base learner is called to obtain the vector from category to probability. First, the vectors are aligned according to a unified category order, and then these probability vectors are weighted by category according to preset weights to obtain the final probability distribution after fusion. S34: Select the category with the highest probability from the final probability distribution after fusion as the output label, and finally obtain the XGBoost-RF fusion model.

[0018] Preferably, step S4 further includes the following step: S41: Load the XGBoost-RF fusion model, feature list, label mapping, random seed and cross-validation configuration; construct the test feature matrix according to the saved feature list order, and extract the true label vector from the test set; S42: Call the predict_proba function of the XGBoost-RF fusion model to obtain the predicted probability distribution of each category for the test features, and then call predict to obtain the discrete category labels based on the maximum probability decision; ensure that the category order is consistent with the label mapping; S43: Calculate the overall accuracy using the true labels and predicted labels of the entire sample; S44: Calculate category-specific recall and aggregate recall in two levels; S45: Calculate the F1 score for each category and select an averaging method consistent with the business to obtain the overall F1 score; S46: Output a classification report containing precision, recall, F1 score, and support value for each category, and use a confusion matrix to check the sources of confusion and misclassification between categories; at the same time, plot PR curves, analyze the changes in recall and precision of each category under different thresholds using a one-vs-rest method, and combine PR-AUC to quantitatively evaluate the model's probabilistic discrimination ability on the target category, thereby forming performance evaluation results.

[0019] Preferably, the first arrival time is identified using the amplitude threshold method or the moving average method.

[0020] The second aspect of this invention provides: a tunnel rock mass water inrush and mud inrush prediction system based on the XGBoost-RF fusion algorithm, used to implement any of the above-mentioned tunnel rock mass water inrush and mud inrush prediction methods based on the XGBoost-RF fusion algorithm, comprising: The data acquisition module is used to acquire seismic wave data and extract geological response characteristic indicators and risk labels; The feature processing module is used for preprocessing, normalizing, and partitioning seismic wave data. The model training module is used to train the XGBoost model and the RF model respectively, and to optimize the hyperparameters. The fusion prediction module is used to perform soft-vote fusion, outputting a weighted average risk category label and an XGBoost-RF fusion model; The performance evaluation module is used to calculate the accuracy, recall, and F1 score of the XGBoost-RF fusion model and generate a visual report.

[0021] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, the aforementioned method for predicting tunnel rock mass water inrush and mud inrush based on the XGBoost-RF fusion algorithm is implemented.

[0022] The beneficial effects of this invention are: 1) Introduce a custom key category average recall rate in model fusion. 23 This invention optimizes the target, weight scanning, and probability calibration mechanisms, achieving a significant improvement in the detection capability of key risk categories while enhancing overall accuracy. Compared to a single model, this invention better balances the recognition performance of different categories, particularly demonstrating superior recall and stability in medium- and high-risk categories.

[0023] 2) Traditional seismic wave risk identification methods often fail to adequately identify key risk categories (such as medium- and high-risk categories) when the distribution of category samples is uneven or the characteristics of categories differ significantly. This invention introduces a custom Recall mechanism. 23 As an optimization metric, layered 5-fold cross-validation, system weight scanning, and fusion strategies are employed to improve recall while maintaining overall accuracy. 23 The accuracy reached 0.9925 (standard deviation 0.01), which significantly improved the recognition accuracy and model stability of key categories and reduced the number of missed detections.

[0024] 3) Significant differences in the probability scales output by individual models can easily lead to unbalanced weights during fusion. This invention introduces isotonic probability calibration into the random forest model before fusion, ensuring it maintains the same dimensions as the probability output of XGBoost. This improves the reliability and interpretability of soft-voting fusion, avoids performance degradation due to probability distortion, and ensures high recall and precision across different thresholds.

[0025] 4) This invention employs a weighted scanning method to systematically evaluate multiple combinations of XGBoost weights ranging from 0.3 to 0.7 (step size 0.1), and performs a Recall... 23 The optimal configuration (XGBoost weight 0.3, Random Forest weight 0.7) was selected in terms of metrics, which effectively combined the advantages of the two types of algorithms in terms of nonlinear feature fitting and robustness, and achieved accurate and stable fusion decision-making.

[0026] 5) During the testing phase, this invention simultaneously outputs a classification report (Accuracy=0.990, Macro avgPrecision / Recall / F1=0.990), a confusion matrix (intuitively displaying the main sources of error), and PR curves for each category (all four categories have PR-AUC of 1.000). By combining visualization and quantification, the model performance is comprehensively evaluated, providing reliable data support for tunnel construction risk prediction. Attached Figure Description

[0027] Figure 1 This is a flowchart of the method of the present invention; Figure 2 The diagrams are schematics of the models, where (a) is a schematic of the XGBoost model and (b) is a schematic of the Random Forest (RF) model. Figure 3 The diagram shows a comparison between the confusion matrix and the normalized confusion matrix, where (a) is the confusion matrix and (b) is the normalized confusion matrix. Figure 4 This is a graph of the Precision–Recall Curve. Detailed Implementation

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

[0029] See Figures 1-4The first aspect of this invention provides: a method for predicting water inrush and mudslide in tunnel rock mass based on the XGBoost-RF fusion algorithm, comprising the following steps: S1: Preprocess the measured seismic wave dataset and extract various types of geological response characteristic indicators and risk labels, and divide the preprocessed dataset into training set and test set; S2: Train the XGBoost model using XGBClassifier, and train and validate the XGBoost model using the input samples; train the RF model using the Random Forest classifier, and train and validate the RF model using the input samples. S3: Use VotingClassifier to perform soft voting fusion, perform a weighted average of the predicted probabilities of the trained XGBoost model and RF model, and then take the label corresponding to the highest probability as the final risk class output, and finally obtain the XGBoost-RF fusion model; S4: Evaluate the performance of the XGBoost-RF fusion model, calculate the accuracy, F1 score and recall metrics, and use the XGBoost-RF fusion model that meets the performance requirements to predict water inrush and mud inrush.

[0030] In this embodiment, the present invention integrates two complementary machine learning models—extreme gradient boosting (XGBoost) and random forest (RF)—based on a fusion strategy to improve recognition accuracy and generalization ability.

[0031] The XGBoost and RandomForest algorithms are naturally complementary in performance: XGBoost uses a boosting training method (serialized error correction), aiming to reduce bias and resulting in a stronger model, but it is sensitive to outliers / noise and prone to overfitting, thus its predictions are more precise; while RandomForest aims to reduce bias and results in a more stable model, it is less sensitive to outliers / noise and has better robustness, thus its predictions are more conservative. The robustness of RandomForest offsets the overfitting risk of XGBoost. Further fusion of the two algorithms can, to some extent, offset the bias and variance of a single model, improving the model's accuracy in classifying water and mud inrush risks under complex disturbance conditions. Therefore, this model performs stably in engineering verification of actual tunnel sections and has good potential for widespread application.

[0032] In some embodiments, S1 further includes the following sub-steps: S11: Identify the first arrival time of the waveform in each receiver. Calculate the P-wave velocity along the target path by dividing the known geometric distance between the source and the receiver by the first arrival time. Calculate the P-wave velocity across all receivers and take the average value to obtain the average P-wave velocity. Vp ; S12: Calculate the average shear wave velocity by identifying the arrival time of the S-wave. Vs Thus, the average wave velocity ratio is obtained. Vp / Vs ; S13: Extract the maximum reflected wave amplitude by taking a preset time window after the P wave in the waveform; S14: Calculate the wave velocity variation coefficient by dividing the standard deviation of the P-wave velocity by the mean. CVvp ; S15: Group the receivers on the left and right sides into a group, divide the wave velocity difference between the two receivers in each group by the vertical distance between them, calculate the gradient and compare them to obtain the maximum wave velocity gradient. S16: Extract the reflected wave energy by calculating the square of the integrator receiver amplitude; S17: Calculate the wave impedance based on the longitudinal wave velocity and density values ​​of the surrounding rock; S18: Poisson's ratio is calculated based on the relationship between the average wave velocity ratio and the rock mass deformation characteristics; S19: The dataset is divided into training and test sets using stratified sampling, and the extracted features are normalized using Min-Max. The training and test sets are then transformed independently.

[0033] In this embodiment, the preprocessing and feature extraction of the seismic wave dataset specifically includes the following steps: S11, identifying the first arrival time in the waveform of each receiver, typically achieved using the amplitude thresholding method or the moving average method. The P-wave velocity along the path can be estimated by dividing the known geometric distance between the source and the receiver by the first arrival time. The average P-wave velocity estimated from all receivers is then taken as the average P-wave velocity for the model region. Vp ; S12, by identifying the arrival time of the S-wave or by using empirical relationships, calculates the average shear wave velocity. Vs Thus, the average wave velocity ratio is obtained. Vp / Vs ; S13, the maximum reflected wave amplitude is obtained by taking a time window after the P-wave in the waveform and statistically analyzing the maximum value within that interval. This feature can characterize the intensity of wave reflection at the structural boundary and is often used to determine strong structural changes or the presence of cavities. S14, Wave velocity variation constant CVvpThe dispersion of P-wave velocity among multiple receiving points is characterized by the standard deviation of P-wave velocity divided by the average value, which can reflect the non-uniformity and complexity of rock mass structure. S15. The receivers on the left and right sides are grouped into two sets. The wave velocity difference between the two receivers in each set is divided by the vertical distance between them to calculate the gradient. The two gradients calculated for the left and right walls are compared, and the maximum value is taken as the "maximum wave velocity gradient" characteristic value of the model. This value represents the location where the local structural changes in the tunnel face area are most drastic. S16, the energy of the reflected wave is extracted by the square of the amplitude of the integrator receiver. The integration interval is set within a certain time window after the first wave, which represents the overall intensity of the reflected wave and is particularly sensitive to the presence of water or cavity structures. S17, by combining the longitudinal wave velocity of the surrounding rock with the density value obtained from drilling sampling or empirical relationships, the wave impedance reflecting the overall stiffness of the rock mass is obtained by multiplying these two physical quantities. S18, using the average wave velocity ratio, and then based on the relationship between the velocity ratio and the deformation characteristics of the rock mass, the Poisson's ratio, which reflects the elastic characteristics of the surrounding rock, is calculated. S19 employs stratified sampling, splitting the data into a "training + validation" set and a "test" set to ensure that the sample proportions of each category (low risk, medium-high risk, high risk, and extremely high risk) in each set are consistent with the original data. The training + validation set is used for modeling and parameter tuning, while the test set is reserved for final one-time verification. Due to the nine extracted features (mean P-wave velocity...), ... Vp Mean transverse wave velocity Vs average wave velocity ratio Vp / Vs Wave impedance Maximum wave velocity gradient, Poisson's ratio Wave velocity variation coefficient CVvp Since the features have different dimensions and orders of magnitude, in order to avoid the influence of feature bias on model training, the Min-Max normalization method is used to linearly compress each feature to the [0, 1] interval. The normalization is only based on the training set data for fitting, and the training set and test set are transformed and processed independently.

[0034] In some embodiments, training the XGBoost model includes the following steps: A hierarchical 5-fold cross-validation scheme is set up on the training set, which divides the data into 5 parts in a balanced manner according to the category ratio, and trains and validates them in turn to reduce the impact of randomness. The average recall rate of the medium- and high-risk categories and the high-risk category is used as the core optimization index for model parameter tuning and selection. Build an XGBoost model and configure the output probability format, random seed, and tree construction method to improve training speed; Define the hyperparameter search range, including the number of trees, maximum depth, learning rate, sample sampling ratio, feature sampling ratio, and minimum weight of child nodes; Perform parameter search and model training, train and validate each parameter combination through 5-fold cross-validation, calculate the average recall of medium- and high-risk categories and high-risk categories, and select the parameter combination that performs most stably on the validation set as the optimal parameter combination; The XGBoost model is retrained on the training set using the optimal parameter combination to check whether the mean and fluctuations between different folds are stable, thus obtaining a well-trained XGBoost model.

[0035] In this embodiment, as Figure 2 As shown in (a), training an XGBoost model using XGBClassifier specifically includes the following steps: Establish a stratified 5-fold cross-validation: n_splits = 5, shuffle = True, random_state = 42, ensuring consistent class proportions across folds. During each validation, calculate the recall for class 2 and class 3 separately, and use the average as the score (0 for zero samples). All subsequent model selections will be based on this recall. 23 Main indicator; On the "training + validation" set, XGBClassifier is used for multi-class modeling. The output probability format, random seed, and appropriate tree construction method (such as the straight method) are set to improve the training speed. The fixed configuration is objective="multi:softprob", num_class=4, eval_metric="mlogloss", tree_method="hist", random_state=42. Prepare the hyperparameter search range and formulate a small and targeted parameter grid covering key parameters such as the number of trees, depth, learning rate, sample sampling ratio, feature sampling ratio, and minimum child node weight; use "2 / 3 average recall" as the scoring metric and perform a small grid search for stratified 5-fold cross-validation: n_estimators∈{300,600}, max_depth∈{3,4,5}, learning_rate∈{0.05,0.1}, subsample∈{0.8,1.0}, colsample_bytree∈{0.8,1.0}, min_child_weight∈{1,3}; Perform parameter search and model training, use 5-fold cross-validation to train and validate each parameter combination, calculate the class 2 / 3 average recall, and select the parameter combination that performs most stably on the validation set as the optimal solution; finally, the optimal parameters selected and retrained are colsample_bytree=0.8, learning_rate=0.05, max_depth=4, min_child_weight=1, n_estimators=300, subsample=0.8; The model is retrained using the optimal parameters within the same cross-validation framework. The mean and fluctuations between different folds are checked to ensure the reliability of the results. The XGBoost model is then retrained using the optimal parameters on the merged training and validation set to obtain the trained XGBoost model.

[0036] In some embodiments, training the RF model includes the following steps: Establish a hierarchical cross-validation scheme, using hierarchical K-fold cross-validation to ensure that the proportion of classes in each fold is consistent with the overall proportion, and use shuffled random seeds and fixed random seeds to make the results reproducible; Construct a random forest base learner, instantiate a random forest classifier, enable class weight balancing to alleviate class imbalance, set the parallelism according to resources, and fix the random seed; Define the hyperparameter search space, including the number of trees, maximum depth, minimum number of split samples, minimum number of leaf samples, and feature subsampling strategy; Perform cross-validation to tune hyperparameters, using a preset primary metric as the scoring function, and perform grid search or Bayesian search on the training set for hyperparameter combinations; save the mean score and fluctuation of each combination at each fold, and select the optimal hyperparameter combination with robustness as the priority. Use a calibrator to perform probabilistic calibration on the optimal RF model; The RF model is retrained on the training set using the optimal combination of hyperparameters and calibration scheme to obtain a well-trained RF model.

[0037] In this embodiment, as Figure 2 As shown in (b), training an RF model using RandomForestClassifier specifically includes the following steps: A hierarchical cross-validation scheme is established, using hierarchical K-fold cross-validation to ensure that the class ratio in each fold is consistent with the overall result; shuffling and fixed random seeds are enabled to ensure reproducibility of results; StratifiedKFold is built on the "training + validation" set with n_splits=5, shuffle=True, and random_state=42; this configuration is used for all grid search and validation evaluation, controlling randomness while ensuring the stability of class ratio in each fold.

[0038] Build an RF base learner, instantiate RandomForestClassifier, explicitly set class_weight="balanced" to alleviate class imbalance, enable n_jobs=-1 for full parallelism, and add random_state=42 to reproduce the results. The rest of the training details are left as default in the library. Define a hyperparameter search space, setting up candidate sets around key knobs affecting generalization: including the number of trees, maximum depth, minimum split samples, minimum leaf samples, feature subsampling strategy (e.g., square root or logarithmic scale of feature dimensions), etc.; define an RF grid for cross-validation search: n_estimators∈{400, 800}, max_depth∈{None,16}, min_samples_split∈{2, 5}, min_samples_leaf∈{1, 2}, max_features∈{"sqrt","log2"}; these candidates cover tree size, depth constraints, split / leaf size, and feature subsampling strategy.

[0039] Perform cross-validation hyperparameter tuning, using a preset principal metric as the scoring function, and perform grid search or Bayesian search on the training and validation sets for hyperparameter combinations; save the mean score and fluctuation of each combination at each fold, and select the optimal configuration with robustness as the priority; use GridSearchCV to perform a hierarchical 5-fold search on the "training + validation" set: scoring=recall_23_scorer, cv=cv, n_jobs=-1, refit=True, verbose=0, to obtain the optimal RF (best_rf = rf_gs.best_estimator_) and corresponding parameters; in the current experiment, the optimal parameters are: max_depth=None, max_features="sqrt", min_samples_leaf=1, min_samples_split=2, n_estimators=800, and keep the rest as default as the above settings; Probabilistic calibration is performed on the optimal RF using a calibrator (e.g., isometric monotonic or sigmoid), employing the same data splitting strategy as described above to improve the comparability of class probabilities and the availability of thresholds. The best_rf model undergoes CalibratedClassifierCV probabilistic calibration, configured with method="isotonic" and cv=5, and the calibrated rf_cal is obtained by fitting(X_trv, y_trv) over the entire "training + validation" set. This model is then used for softvoting fusion with XGB. On the merged training and validation set, the RF model is retrained with the optimal parameters to obtain the trained RF model.

[0040] In some embodiments, S3 further includes the following steps: S31: Instantiate VotingClassifier, pass in the trained XGBoost model and RF model as base learners, fuse them according to class probabilities, and reserve a set of weights to be optimized so that the contribution of each model in the weighted average is adjustable; S32: The average recall rate of medium-high risk categories and high risk categories is used as the optimization target. Weight scanning is performed through hierarchical cross-validation. Weight search is used as the outer loop and cross-validation score is used as the inner evaluation to ensure that the selected weights perform stably on different segments. S33: Using the selected optimal weight combination, the soft voter is refitted on the training set. Internally, each base learner is cloned and retrained to ensure that the fusion unit carries parameters that match the current data and weights. For each sample to be predicted, the predict_proba function of each base learner is called to obtain the vector from category to probability. First, the vectors are aligned according to a unified category order, and then these probability vectors are weighted by category according to preset weights to obtain the final probability distribution after fusion. S34: Select the category with the highest probability from the final probability distribution after fusion as the output label, and finally obtain the XGBoost-RF fusion model.

[0041] In this embodiment, the soft voting fusion using VotingClassifier specifically includes the following steps: S31, instantiate VotingClassifier, pass in several base learners in the form of (name, estimator), set voting="soft" to indicate fusion according to class probability, and reserve a set of weights to be optimized so that the contribution of each model in weighted averaging is adjustable; construct a soft voter and candidate weight set, create a fusion unit with VotingClassifier in the form of estimators=[("xgb", best_xgb),("rf", rf_cal)] and voting="soft", and set the XGBoost weight candidate set w∈{0.3, 0.4, 0.5, 0.6, 0.7}, corresponding to the random forest weight 1−w∈{0.7, 0.6,0.5, 0.4, 0.3}, to prepare for subsequent weight scanning and performance comparison; S32, select the average recall rate of class 2 (medium-high risk) and class 3 (high risk). 23 The optimization objective is to formulate a hierarchical cross-validation scheme. "Weight search" is used as the outer loop, and "cross-validation scoring" is used as the inner evaluation to ensure the selected weights perform stably across different splits. On the training and validation sets, StratifiedKFold(n_splits=5, shuffle=True, random_state=42) is used to train and validate each weight w. For each fold, vote.fit(X_trv[tr_idx], y_trv[tr_idx]) is used for training, and then the label is predicted based on va_idx. A custom metric, Recall, is calculated. 23 (The mean recall of class 2 and class 3, with zero samples treated as zero_division=0), and finally the mean and standard deviation of w are obtained by summing them up; S33, using the selected optimal weights, refit the soft voting machine on the complete training and validation data. This step internally clones and retrains each base learner to ensure the fusion machine carries parameters that are strictly matched to the current data and weights. For each sample to be predicted, the `predict_proba` function of each base learner is called to obtain a vector from category to probability. These vectors are first aligned according to a uniform category order, and then weighted by category according to preset weights. Normalization is performed if necessary to obtain the final probability distribution after fusion. Based on the results of the hierarchical 5-fold CV scan, the combination of XGBoost weights of 0.3 and Random Forest weights of 0.7 is determined in Recall... 23 The optimal values ​​were found, with an average of 0.9925 and a standard deviation of 0.01. Based on this, the weights were fixed at weights=[0.3,0.7] as the final fusion configuration for retraining and external evaluation. S34, select the class with the highest probability from the final probability distribution after fusion as the output label; solidify estimators=[("xgb", best_xgb), ("rf", rf_cal)] and weights=[0.3, 0.7] into VotingClassifier(voting="soft"), and perform a complete fit(X_trv, y_trv) retraining on the entire training + validation set to obtain the final XGBoost-RF fusion model, to ensure that the fusion model carries parameters and probability scales that are strictly matched with the selected weights; S35: Piece together the predicted result blocks obtained in S34 to obtain the overall predicted result.

[0042] In some embodiments, S4 further includes the following steps: S41: Load the XGBoost-RF fusion model, feature list, label mapping, random seed and cross-validation configuration; construct the test feature matrix according to the saved feature list order, and extract the true label vector from the test set; S42: Call the predict_proba function of the XGBoost-RF fusion model to obtain the predicted probability distribution of each category for the test features, and then call predict to obtain the discrete category labels based on the maximum probability decision; ensure that the category order is consistent with the label mapping; S43: Calculate the overall accuracy using the true labels and predicted labels of the entire sample; S44: Calculate category-specific recall and aggregate recall in two levels; S45: Calculate the F1 score for each category and select an averaging method consistent with the business to obtain the overall F1 score; S46: Output a classification report containing precision, recall, F1 score, and support value for each category, and use a confusion matrix to check the sources of confusion and misclassification between categories; at the same time, plot PR curves, analyze the changes in recall and precision of each category under different thresholds using a one-vs-rest method, and combine PR-AUC to quantitatively evaluate the model's probabilistic discrimination ability on the target category, thereby forming performance evaluation results.

[0043] In this embodiment, evaluating the performance of the XGBoost-RF fusion model specifically includes the following steps: S41, load the XGBoost-RF fusion model (containing two base learners and voting weights), feature list, label mapping, and random seed and cross-validation configuration to ensure reproducible evaluation and strict consistency with the training configuration. Construct the test feature matrix according to the saved feature list order and the same cleaning / normalization steps, and extract the true label vector from the test set; if there are missing values ​​or unconventional values, handle them in the same way as the training phase; use the XGBoost-RF fusion model retrained on the training + validation set with optimal weights (XGBoost=0.3, Random Forest=0.7) to predict the 20% test set (X_te, y_te) reserved in the previous stratification, and obtain the predicted label y_pred and the prediction probability matrix proba for each category, which will be used as input for subsequent index calculation and plotting; S42, call the `predict_proba` function of the XGBoost-RF fusion model to obtain the predicted probability distribution of each category for the test features, and then call `predict` to obtain the discrete category labels based on the "maximum probability" decision; ensure that the category order is consistent with the label mapping. Call `classification_report` to generate the Precision, Recall, F1-score, and Support for each category: The results show that for class 0, Precision=1.000, Recall=1.000, F1=1.000 (50 samples); for class 1, Precision=0.962, Recall=1.000, F1=0.980 (50 samples); for class 2, Precision=1.000, Recall=0.960, F1=0.980 (50 samples); and for class 3, Precision=1.000, Recall=1.000, F1=1.000 (50 samples). Overall Accuracy = 0.990, Macroavg Precision = 0.990, Recall = 0.990, F1 = 0.990, Weighted avg Precision = 0.990, Recall = 0.990, F1 = 0.990 (total sample size 200). S43. Calculate the overall accuracy using the true and predicted labels of the entire sample. The accuracy is the most intuitive indicator of overall recognition correctness. Plot and analyze the confusion matrix. Draw the non-normalized confusion matrix based on the predicted and true labels: all diagonals are 50, the only misclassification occurs between class 2 and class 1, a total of 2 samples (class 2 predicted as class 1); all other classes have 0 misclassifications. Then draw the row normalized confusion matrix. The diagonal values ​​of class 0, class 1, and class 3 are all 1.00, the diagonal value of class 2 is 0.96, and the proportion of misclassifications to class 1 is 0.04.

[0044] S44. Calculate the recall rate, which is calculated in two levels: first, the class-specific recall rate (the detection capability of each class), and second, the aggregate recall rate obtained by setting an appropriate averaging method (macro-average, micro-average, or weighted average). S45. Calculate the F1-score. First, obtain the precision and recall for each category, then calculate the F1-score for each category, and select an averaging method consistent with the business (macro average, weighted average, or micro average) to form the overall F1 index. F1, as a trade-off between recall and precision, better reflects the effectiveness of the model under imbalanced data.

[0045] S46 outputs a classification report containing Precision, Recall, F1, and Support for each category, supplemented by a confusion matrix to visually examine the main sources of confusion and misclassification between categories; simultaneously, it plots PR curves, analyzes the changes in recall and precision for each category under different thresholds using a one-vs-rest approach, and combines PR-AUC to quantitatively evaluate the model's probabilistic discrimination ability on key categories, thus forming a comprehensive and interpretable performance evaluation result. Plotting PR curves and calculating PR-AUC: For the predicted probabilities of the test set, the Precision–Recall curve and PR-AUC for each category are calculated using a one-vs-rest approach. The PR-AUC for classes 0, 1, 2, and 3 are all 1.000, and the curves are almost close to the (1,1) angle, indicating that the recall and precision for each category remain at extremely high levels under different thresholds.

[0046] In some embodiments, the first arrival time is identified using an amplitude threshold method or a moving average method.

[0047] Table 1 shows the classification performance of the XGBoost-RF fusion model on the test set. The evaluation results demonstrate excellent classification performance on the test set. The overall accuracy reaches 0.990, indicating that the model's classification predictions for the overall sample are very accurate. In terms of performance across categories, both precision and recall remain at high levels. Specifically, the precision and recall for categories 0 and 3 both reach 1.000, achieving completely correct recognition. The precision and recall for categories 1 and 2 also remain within the ranges of 0.962–1.000 and 0.960–1.000, respectively, with an F1-score of 0.980 for both categories. This shows that the model maintains high balance performance even in cases with inter-class confusion.

[0048] Table 1. Classification performance of the XGBoost-RF fusion model on the test set. The macro average and weighted average, along with precision, recall, and F1-score, all reached 0.990, indicating that the model possesses balanced recognition capabilities across all categories and is not biased by uneven distribution of class samples. Overall, this fusion model demonstrates exceptional robustness and stability in accuracy, recall, and overall balance metrics, achieving efficient, stable, and generalizable recognition results in multi-class recognition tasks.

[0049] like Figure 3 The diagram shows a comparison of the 20% confusion matrix and the normalized confusion matrix provided in this embodiment of the invention: (a) Confusion matrix (20% of the test set) and (b) Normalized confusion matrix (20% of the test set). From the confusion matrix results, the model's classification performance across the four categories is near perfect. The standard confusion matrix shows that the prediction results for categories 0, 1, and 3 are completely consistent with the true labels, with a prediction accuracy of 100%. A very small number (2 samples) of category 2 are misclassified as category 1. In the corresponding normalized confusion matrix, the correct recognition rate for this category is 96%, while the correct recognition rate for the remaining categories is 100%. This result indicates that the model possesses strong discriminative ability and generalization performance, especially achieving stable and accurate recognition in scenarios with high category discrimination. A few misclassified samples may stem from partial overlap between category 1 and category 2 in the feature space; this can be further reduced through feature enhancement or category boundary optimization. Overall, the model exhibits extremely high classification accuracy and stability on the test set, making it suitable for applications requiring extremely high precision.

[0050] like Figure 4 The diagram shows the Precision-Recall Curve (PR) provided in this embodiment of the invention. The PR curves for all four categories (Class 0, Class 1, Class 2, and Class 3) are almost perfectly rectangular, with an average precision (AP) of 1.000. This indicates that on 20% of the test set data, the model maintains 100% precision while maintaining 100% recall, meaning there are no false positives or false negatives. This result reflects the model's balanced and excellent discrimination ability across different categories, and its strong generalization performance in multi-class tasks. Since the PR curve maintains a precision close to 1.0 even in the high recall region, it demonstrates that the model can maintain a very low false prediction rate when facing high recall requirements in practical applications, exhibiting strong reliability and practical value.

[0051] The second aspect of this invention provides: a tunnel rock mass water inrush and mud inrush prediction system based on the XGBoost-RF fusion algorithm, used to implement any of the above-mentioned tunnel rock mass water inrush and mud inrush prediction methods based on the XGBoost-RF fusion algorithm, comprising: The data acquisition module is used to acquire seismic wave data and extract geological response characteristic indicators and risk labels; The feature processing module is used for preprocessing, normalizing, and partitioning seismic wave data. The model training module is used to train the XGBoost model and the RF model respectively, and to optimize the hyperparameters. The fusion prediction module is used to perform soft-vote fusion, outputting a weighted average risk category label and an XGBoost-RF fusion model; The performance evaluation module is used to calculate the accuracy, recall, and F1 score of the XGBoost-RF fusion model and generate a visual report.

[0052] A third aspect of the present invention provides: a computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are loaded and executed by a processor, the aforementioned method for predicting tunnel rock mass water inrush and mud inrush based on the XGBoost-RF fusion algorithm is implemented.

[0053] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A tunnel rock mass water gushing and mud bursting prediction method based on an XGBoost-RF fusion algorithm, characterized in that: The method comprises the following steps: S1: preprocessing the measured seismic wave data set and extracting various types of geological response feature indicators and risk labels, and dividing the preprocessed data set into a training set and a test set; S2: training an XGBoost model using XGBClassifier, training and verifying the input samples of the XGBoost model; and training an RF model using a random forest classifier, training and verifying the input samples of the RF model; S3: using VotingClassifier for soft voting fusion, weighting the prediction probabilities of the trained XGBoost model and RF model, and taking the label corresponding to the maximum probability as the final risk category output, and finally obtaining an XGBoost-RF fusion model; S4: evaluating the performance of the XGBoost-RF fusion model, calculating the accuracy, F1 score and recall rate indicators, and using the XGBoost-RF fusion model meeting the performance requirements to predict water inrush and mud.

2. The tunnel rock mass water inrush and mud burst prediction method based on the XGBoost-RF fusion algorithm according to claim 1, characterized in that: The S1 further comprises the following sub-steps: S11: identify the first arrival time of the waveform in each receiver, calculate the P-wave velocity on the target path by dividing the known geometric distance between the source and the receiver by the first arrival time, calculate the P-wave velocity in all receivers and take the average to obtain the average P-wave velocity Vp ; S12: Calculate average S-wave velocity by identifying S-wave arrival time Vs , and further obtain average wave velocity ratio Vp / Vs ; S13: extracting the maximum reflected wave amplitude by intercepting a preset time window after the P wave in the waveform; S14: Calculate the wave velocity coefficient of variation using the longitudinal wave velocity standard deviation divided by the mean CVvp ; S15: forming a group by respectively grouping the left and right receivers, calculating the gradient by dividing the wave velocity difference between the two receivers in each group by the vertical distance between them, and comparing to obtain the maximum wave velocity gradient; S16: extracting the reflected wave energy by calculating the square value of the integral receiver amplitude; S17: calculating the wave impedance according to the P-wave velocity and density value of the surrounding rock; S18: converting the average wave velocity ratio to obtain the Poisson's ratio according to the relationship between the rock mass deformation characteristics; S19: dividing the data set into a training set and a test set by using stratified sampling, and performing Min-Max normalization processing on the extracted features, and independently transforming the training set and the test set.

3. The tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm according to claim 1, characterized in that: The training of the XGBoost model comprises the following steps: Setting stratified 5-fold cross-validation scheme on the training set, dividing the data into 5 parts according to the balanced category ratio, training and verifying in turn to reduce accidental effects, and taking the average recall rate of the medium-high risk category and the high risk category as the core optimization indicators for model parameter adjustment and selection; Building an XGBoost model, configuring the output probability form, random seed and tree construction method to improve the training speed; Formulate the search range of hyperparameters, including the number of trees, the maximum depth, the learning rate, the sample sampling ratio, the feature sampling ratio and the minimum weight of the child node; Perform parameter search and model training, train and verify each parameter combination through 5-fold cross-validation, calculate the average recall rate of the medium-high risk category and the high risk category, and select the parameter combination with the most stable performance on the validation set as the optimal parameter combination; Re-train the XGBoost model on the training set using the optimal parameter combination to check whether the mean and fluctuation between different folds are stable, and obtain the trained XGBoost model.

4. The tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm according to claim 1, characterized in that: The training of the RF model comprises the following steps: Establish a stratified cross-validation scheme, use stratified K-fold cross-validation to ensure that the class proportion of each fold is consistent with the overall proportion, and use shuffled random seeds and fixed random seeds to ensure reproducibility of the results; Construct a random forest base learner, instantiate a random forest classifier, enable class weight balancing to address class imbalance, set the parallelism according to the resources, and fix the random seed; Develop a hyperparameter search space, including the number of trees, maximum depth, minimum split sample size, minimum leaf sample size, and feature subsampling strategy; Perform cross-validation tuning, use the preset main indicator as the scoring function, and perform grid search or Bayesian search on the hyperparameter combinations on the training set; save the average score and fluctuation of each combination on each fold to prioritize the optimal hyperparameter combination based on robustness; Use the calibrator to calibrate the probabilities of the optimal RF model; Use the optimal hyperparameter combination and calibration scheme to retrain the RF model on the training set to obtain the trained RF model.

5. The tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm according to claim 1, characterized in that: The S3 further includes the following steps: S31: Instantiate a VotingClassifier, input the trained XGBoost model and RF model as base learners, fuse them according to the class probability, and reserve a set of weight lists to be optimized, so that the contribution of each model in the weighted average can be adjusted; S32: Take the average recall rate of the medium-high risk category and the high risk category as the optimization target, perform weight scanning through stratified cross-validation, and use the cross-validation score as the inner evaluation to ensure that the selected weights perform stably on different splits; S33: Use the selected optimal weight combination to re-fit the soft voter on the training set, clone and retrain each base learner internally to ensure that the fusioner carries parameters that match the current data and weights; for each sample to be predicted, call predict_proba of each base learner to get a vector of class probabilities, align them in the same order, and then perform weighted average on these probability vectors according to the preset weights to get the final probability distribution after fusion; S34: Select the class with the maximum probability from the final probability distribution after fusion as the output label to obtain the XGBoost-RF fusion model.

6. The tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm according to claim 1, characterized in that: The S4 further includes the following steps: S41: Load the XGBoost-RF fusion model, feature column list, label mapping, random seed, and cross-validation configuration; construct a test feature matrix in the order of the saved feature columns, and extract the real label vector from the test set; S42: Call predict_proba of the XGBoost-RF fusion model to get the predicted probability distribution of each category for the test features, and then call predict to get the discrete category label based on the maximum probability decision; ensure that the class order is consistent with the label mapping; S43: Calculate the overall accuracy using the real labels and predicted labels of the overall samples; S44: Calculate the recall rate and aggregate recall rate at two levels; S45: Calculate the F1 score for each category and select the average method consistent with the business to obtain the overall F1 score; S46: output the classification report containing the precision, recall, F1 score and Support value of each category, and check the confusion and misjudgment source between categories using the confusion matrix; at the same time, draw the PR curve, analyze the change of the recall rate and precision rate of each category under different thresholds through the one-vs-rest method, and combine the PR-AUC to quantitatively evaluate the probability discrimination ability of the model on the target category, so as to form the performance evaluation result.

7. The tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm according to claim 2, characterized in that: The first time is identified by using an amplitude threshold method or a sliding average method.

8. A tunnel rock mass water inrush and mud burst prediction system based on an XGBoost-RF fusion algorithm, characterized in that: The tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm as claimed in any one of claims 1-7 comprises: A data acquisition module is configured to acquire seismic wave data and extract geological response feature indexes and risk labels. A feature processing module is configured to pre-process, normalize and divide data sets for the seismic wave data. A model training module is configured to train XGBoost models and RF models respectively and optimize hyperparameters. A fusion prediction module is configured to perform soft voting fusion, output weighted average risk category labels and XGBoost-RF fusion models. A performance evaluation module is configured to calculate the accuracy, recall rate and F1 score of the XGBoost-RF fusion model and generate a visual report.

9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the tunnel rock mass water inrush prediction method based on the XGBoost-RF fusion algorithm as claimed in any one of claims 1-7 is implemented.

Citation Information

Patent Citations

  • Prediction method of water and mud inrush in fault fracture zone based on comprehensive advanced geological prediction

    CN119270384B

  • Tunnel water inrush disaster timing early warning method and system based on multi-source data fusion

    CN117711140A

  • Mine high and steep slope landslide machine learning prediction method based on unmanned aerial vehicle technology and multi-source data fusion

    CN119514744A

  • Tunnel water gushing disaster prediction method and device and storage medium

    CN119514779A

Cited By

  • A tunnel surrounding rock large deformation multi-source information fusion real-time early warning method and system

    CN122332873A