A tunnel geological risk multi-step advanced prediction method and system based on a Seq2Seq model

CN123012782APending Publication Date: 2026-10-30中国水利水电第七工程局有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611519760.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]现有智能预测模型多为单步风险分类模型,仅能对当前正在开挖的循环进行风险等级识别,无超前预警窗口,无法为现场施工预留前置防控处置时间,本质是风险事后识别,而非超前预警,难以从根源上规避地质灾害

Benefits of technology

[0013]采用Seq2Seq编码器解码器架构,通过编码器压缩历史时空特征、解码器一次性输出未来5个开挖循环的风险预测结果,从根源上避免了递归预测的误差累积问题,实现了真正意义上的隧道施工地质风险超前预警,为现场施工预留了充足的前置防控处置时间,可有效降低地质灾害发生概率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012782A_ABST
    Figure CN123012782A_ABST
Patent Text Reader

Abstract

The application discloses a tunnel geological risk multi-step advanced prediction method and system based on a Seq2Seq model, and the method comprises the following steps: constructing and training a multi-step advanced prediction model, wherein the multi-step advanced prediction model comprises an encoder and a decoder; the encoder comprises at least two groups of stacked units and generates a context vector; the decoder receives the context vector and outputs the risk level probability distribution of each excavation cycle under a future prediction window length at one time; in the training stage of the multi-step advanced prediction model, a cost-sensitive loss function is adopted; the input of the multi-step advanced prediction model is an input matrix composed of the preprocessed feature vectors of a plurality of continuous historical excavation cycles, and the output is the risk level prediction result of a plurality of continuous future excavation cycles. Thus, the Seq2Seq encoder-decoder architecture is adopted, the historical space-time features are compressed through the encoder, the risk prediction result of five future excavation cycles is output at one time through the decoder, and the error accumulation problem of recursive prediction is avoided from the root.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of tunnel engineering construction safety, and in particular to a tunnel geological risk multi-step advanced prediction method and system based on a Seq2Seq model. BACKGROUND

[0002] Deeply buried long tunnels have become a key control project for highway and railway network construction in complex terrain areas. For example, in the southwest of China, the geological conditions are extremely complex, with high ground stress, karst development, dense fault structure, and wide distribution of soft surrounding rock. During tunnel construction, disasters such as face instability collapse, water and mud inrush, and rock burst are mostly directly caused by adverse geological conditions, and geological risk has become the core object of safety control for tunnel construction.

[0003] In recent years, artificial intelligence technology has provided a new technical path for intelligent prediction of tunnel construction geological risk. Existing research has achieved quantitative classification prediction of tunnel construction geological risk through machine learning and deep learning algorithms, but still has the following core technical defects:

[0004] Existing intelligent prediction models are mostly single-step risk classification models, which can only identify the risk level of the current excavation cycle, have no advanced warning window, and cannot reserve pre-control disposal time for on-site construction. The essence is risk post-identification, not advanced warning, which is difficult to avoid geological disasters from the root.

[0005] Existing models have a large number of parameters, which are prone to overfitting in small-scale data set scenarios in tunnel engineering, have poor generalization ability, and have slow model reasoning speed, which cannot adapt to the real-time deployment requirements of edge devices without high-end computing power in tunnel construction sites.

[0006] Existing models have insufficient ability to capture high-risk key features in multi-source data, do not consider the cost difference of different misjudgment types in tunnel engineering sites, and cannot meet the engineering safety requirements for high-risk sample identification accuracy.

[0007] Existing models only output risk level prediction results and do not quantitatively evaluate the reliability of the prediction results, cannot output the confidence of the prediction results, and cannot directly support on-site construction decisions. SUMMARY

[0008] The present application aims to overcome the shortcomings of the prior art and provide a tunnel geological risk multi-step advanced prediction method based on a Seq2Seq model to achieve accurate multi-step advanced warning of tunnel construction geological risk, and the model has good generalization, high-risk sample identification accuracy, and quantifiable prediction confidence, providing reliable decision-making basis for on-site construction.

[0009] The objective of this invention is achieved through the following technical solution:

[0010] In a first aspect, this application discloses a multi-step advance prediction method for tunnel geological risks based on a Seq2Seq model, comprising: constructing and training a multi-step advance prediction model, wherein the multi-step advance prediction model includes an encoder and a decoder; the encoder includes at least two sets of stacked units, wherein the stacked units include a GhostConv convolutional layer, a convolutional block attention module and a pooling layer connected in series, and a gated recurrent unit network connected after the stacked units, for extracting spatial and temporal features from the input matrix and generating a context vector; the decoder includes a gated recurrent unit layer and a fully connected output head, for receiving the context vector and outputting the probability distribution of risk levels for each excavation cycle under the future prediction window length at one time; during the training phase of the multi-step advance prediction model, a cost-sensitive loss function is adopted, wherein the cost-sensitive loss function sets differentiated class weights for different risk levels; the input of the multi-step advance prediction model is an input matrix composed of preprocessed feature vectors of multiple consecutive historical excavation cycles, and the output is the risk level prediction results for multiple consecutive future excavation cycles.

[0011] Secondly, this application discloses a multi-step advanced prediction system for tunnel geological risks based on a Seq2Seq model, including a memory and a processor. The memory stores a computer program for implementing the multi-step advanced prediction method for tunnel geological risks based on a Seq2Seq model, and the processor performs read and write operations on the memory.

[0012] The beneficial effects of this invention are:

[0013] By adopting a Seq2Seq encoder-decoder architecture, the encoder compresses historical spatiotemporal features and the decoder outputs risk prediction results for the next five excavation cycles at once. This fundamentally avoids the problem of error accumulation in recursive prediction, realizes true early warning of geological risks in tunnel construction, and reserves sufficient time for on-site prevention and control, which can effectively reduce the probability of geological disasters.

[0014] The encoder adopts a CBAM-GhostConv-GRU fusion structure, replacing traditional ordinary convolution with GhostConv. Without sacrificing feature extraction capabilities, it compresses the number of convolutional layer parameters and computational cost by 50%, significantly improving model inference speed and adapting to the real-time deployment requirements of edge devices at tunnel construction sites. At the same time, it effectively alleviates the model overfitting problem in small-scale datasets in tunnel engineering. Through the CBAM convolutional attention module, it automatically strengthens the weights of key features that contribute significantly to high-risk prediction and suppresses noise interference from on-site detection data, thereby improving the recognition accuracy of high-risk samples from the model structure level.

[0015] Based on MC-Dropout, the confidence level of the prediction results is quantified. Without modifying the main model architecture, Monte Carlo sampling of the Dropout layer is enabled during the inference phase to output the confidence level and uncertainty of each prediction result. This effectively alleviates the black box effect of deep learning models, allowing on-site technicians to intuitively judge the reliability of the prediction results, which can directly support on-site construction decisions.

[0016] All data sources used are routinely available at tunnel construction sites, requiring no additional testing equipment or construction costs. The method is highly adaptable and has good generalization ability, and can be directly applied to the construction safety management of complex geological mountain tunnels, making it highly practical for engineering implementation. Attached Figure Description

[0017] Figure 1 This is a simplified flowchart illustrating a multi-step advance prediction method for tunnel geological risks based on a Seq2Seq model, according to some embodiments of this application. Detailed Implementation

[0018] 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.

[0019] Before we begin, let's explain some technical terms:

[0020] Principle: An outlier identification method based on normal distribution is proposed. The mean and standard deviation of the feature data are calculated, and values ​​that exceed the mean ± 3 times the standard deviation are identified as extreme outliers and replaced.

[0021] Full data: A complete data set covering all continuous excavation cycles of the target tunnel without omitting any construction sections.

[0022] Adjacent mileage in the same cycle: refers to the data corresponding to the mileage position that is spatially adjacent to the current mileage station within the same excavation cycle.

[0023] Adjacent forecast mileage: refers to the mileage number corresponding to two adjacent forecast sections along the longitudinal direction of the tunnel in the TSP elastic wave advance forecast results.

[0024] One-Hot encoding is an encoding method that converts category labels into one-hot vectors. Each category corresponds to one dimension, and only the dimension containing that category is set to 1, while the other dimensions are set to 0.

[0025] Seq2Seq model: Sequence-to-Sequence deep learning model, a classic encoder-decoder architecture. The encoder encodes the input sequence into a fixed-length context vector, and the decoder generates the output sequence bit by bit based on this vector. It is commonly used for time series prediction.

[0026] Combination Figure 1 According to an embodiment of this application, a multi-step advanced prediction method for tunnel geological risk based on a Seq2Seq model includes the following steps:

[0027] S1. Multi-source data acquisition:

[0028] Using the standard excavation advance of a single tunnel cycle as the smallest data acquisition unit, the system comprehensively covers all continuous excavation cycles of the target tunnel. Four types of native data sources are simultaneously acquired: geological sketches, exploration data, field measurements, and TSP elastic wave advance prediction. All data are strictly matched to the mileage markers of the corresponding excavation cycles to ensure a one-to-one correspondence in time and space. The geological sketch data acquisition content includes at least the degree of groundwater development, rock mass structural characteristics, degree of tectonic influence, and lithology. For example, technicians complete the on-site tunnel face sketch and data recording, and the data records must simultaneously indicate the corresponding mileage markers and acquisition time.

[0029] The data collection for the exploration includes rock mass strength indicators, dip angle of the main controlling structural surface, and equivalent tunnel diameter. The data sources are detailed preliminary exploration data and supplementary exploration data from the construction phase. The data is precisely matched to the corresponding cycle according to the excavation cycle mileage, and updated synchronously after each excavation cycle is completed. The field measurement data collection includes rock mass strength-stress ratio and initial support stiffness. Data collection is completed after the initial support is applied in each excavation cycle, and is simultaneously collected and recorded by on-site monitoring and measurement personnel. The data must comply with the relevant technical specifications for tunnel construction monitoring and measurement. The TSP elastic wave advance prediction data collection includes the density of the tunnel surrounding rock structure's reflective surface. The collection frequency is one full-section advance prediction after each fixed mileage of tunnel excavation is completed. The prediction results are distributed to each cycle according to the corresponding excavation cycle mileage, ensuring a one-to-one match between data and excavation cycles.

[0030] For ease of description, the groundwater development level, rock mass structure characteristics, degree of tectonic influence, and lithology category in the above data sources are defined as qualitative characteristic data, while rock mass strength index, dip angle of the main control structural plane, equivalent tunnel diameter, rock mass strength-stress ratio, initial support stiffness, and density of the tunnel surrounding rock structure reflective surface are defined as quantitative characteristic data.

[0031] S2. Basic Data Preprocessing:

[0032] use The principle is to identify and remove outliers from all quantitative feature data, including:

[0033] For each quantitative characteristic data obtained from S1, the following methods are used: Outlier identification and removal are performed according to the following principles: The mean and standard deviation of all valid data for each quantitative feature are calculated. Extreme outliers exceeding the mean ± 3 times the standard deviation are replaced with the median of the corresponding feature at adjacent mileages within the same excavation cycle. This replacement process does not alter the overall data distribution of that feature. For a small number of missing data points with a feature missing rate not exceeding 30% in a single excavation cycle, linear interpolation of the corresponding feature at adjacent mileages within the same cycle is used for filling. For uniformly distributed data within the TSP elastic wave advance prediction segment, linear allocation of adjacent prediction mileages is used for filling. The filled data excludes abrupt changes that violate geological evolution patterns to ensure temporal continuity and engineering rationality. After outlier replacement and missing value filling, a complete quantitative feature dataset is obtained.

[0034] Subsequently, quantitative coding was carried out on all qualitative feature data collected by S1: according to the unified rule that the larger the code value, the stronger the adverse impact on tunnel construction risk, all qualitative feature data were continuously coded at levels 1-5. The coding rules were fixed throughout the process, and the same description of the same geological feature corresponded to a unique fixed code value to ensure the consistency and reproducibility of the coding results, thus obtaining the coded qualitative feature data.

[0035] For example, the encoding rule is:

[0036] Based on the degree of groundwater development: 1 point (dry, no water seepage marks on the wall), 2 points (damp, the wall is generally wet with no obvious water flow), 3 points (dripping, localized dripping water), 4 points (linear water flow, multiple fissures with linear flow), 5 points (gushing water, high-pressure jet-like gushing water or large-area rain-like water outflow).

[0037] Regarding the characteristics of the rock mass structure: 1 point (integral structure, the rock mass is in the form of a giant block, and the joints are extremely underdeveloped), 2 points (blocky structure, the joints are underdeveloped, and the rock mass has good integrity), 3 points (layered structure, the joints are relatively developed, and the rock mass has moderate integrity), 4 points (fragmented structure, the joints are developed, and the rock mass is relatively broken), 5 points (dispersed structure, the rock mass is broken into fragments, and the integrity is extremely poor).

[0038] Regarding the degree of tectonic influence: 1 point (no tectonic influence, intact surrounding rock), 2 points (slight tectonic influence, minor development of joints and fissures), 3 points (moderate tectonic influence, presence of small faults or densely jointed zones), 4 points (relatively strong tectonic influence, adjacent to fault fracture zones), 5 points (strong tectonic influence, located in the core area of ​​fault fracture zones).

[0039] Based on lithology: 1 point (hard rock, such as granite and dense limestone), 2 points (relatively hard rock, such as sandstone and dolomite), 3 points (relatively soft rock, such as argillaceous sandstone and shale), 4 points (soft rock, such as mudstone and coal-bearing strata), and 5 points (extremely soft rock, such as expansive mudstone and fault gouge).

[0040] The complete quantitative feature dataset is merged with the encoded qualitative feature data to obtain the full feature data. The full feature data is then normalized using the Min-Max normalization method to linearly map all feature values ​​to the [0,1] interval, eliminating dimensional and numerical differences between different features, resulting in preprocessed feature vectors. This preprocessing process is then executed sequentially for each of the target tunnel's continuous excavation cycles, forming a preprocessed feature vector sequence corresponding to each excavation cycle.

[0041] S3, Time Series Dataset Construction:

[0042] Based on the preprocessed feature vectors obtained from S2 for each excavation cycle, they are arranged in chronological order of tunnel excavation to form a continuous temporal feature sequence. The historical input window length is determined to be 5, that is, the preprocessed feature vectors of the first 5 consecutive excavation cycles that have been completed are used as the input samples of the model; the future prediction window length is determined to be 5, that is, the risk level label sequence of the subsequent 5 consecutive excavation cycles that have not yet been excavated is used as the prediction target of the model.

[0043] Using one excavation cycle as a fixed sliding step size, the continuous temporal feature sequence is fully traversed, generating valid sample pairs of historical inputs and future outputs one by one. The input to a single sample pair is a 5×N two-dimensional feature matrix formed by arranging five consecutive preprocessed feature vectors in rows, where N is the total number of features. The output of a single sample pair is a 5×M two-dimensional label matrix, where M is the total number of risk level categories. Invalid sample pairs with discontinuous temporal sequences or missing labels are removed during the sample pair construction process to ensure that the temporal logic of all sample pairs fully matches the actual engineering situation. Furthermore, a standardized label system is simultaneously constructed: referencing current technical specifications for railway and highway tunnel industries, a five-level geological risk level label system for tunnel construction is established. Different risk level labels are One-Hot encoded to form a standardized label matrix. The label system directly corresponds to the tunnel on-site construction classification and treatment rules, ensuring that the model output can directly guide on-site construction.

[0044] For example, the five-level tunnel construction geological risk level labeling system specifically includes:

[0045] Level I (Low Risk): The surrounding rock is stable and there are no obvious geological hazards. The principle of handling this is to carry out normal construction and conduct monitoring at the regular frequency.

[0046] Level II (lower risk): The surrounding rock is basically stable, with slight signs of deterioration in some areas. The principle of handling this is to continue normal construction while paying appropriate attention to geological changes.

[0047] Level III (Medium Risk): The surrounding rock stability is generally good, but there is a risk of local deformation or abnormal stress. The treatment principle is to strengthen monitoring and measurement and increase the frequency of geological sketching.

[0048] Level IV (Higher Risk): Poor surrounding rock stability, with potential risks of collapse, large deformation or water inrush. The handling principle is to suspend tunneling at the working face, conduct a special risk assessment, and take advanced support or surrounding rock reinforcement measures.

[0049] Level V (Extremely High Risk): The surrounding rock is extremely unstable and is highly likely to cause major disasters such as landslides, mudslides, and water inrushes. The principle of handling this is to immediately stop work, evacuate personnel, and formulate and implement a special handling plan after demonstration.

[0050] The five risk levels mentioned above correspond to a five-dimensional One-Hot encoding vector, with the level number and vector dimension corresponding one-to-one. For example, the encoding for level III risk is [0, 0, 1, 0, 0].

[0051] Finally, the dataset was partitioned temporally: strictly following the chronological order of tunnel excavation, all valid sample pairs were divided into three non-overlapping and temporally isolated subsets: a training set, a validation set, and a test set. The first 70% of consecutive sample pairs were assigned to the training set for iterative updates of model parameters; the middle 15% were assigned to the validation set for hyperparameter tuning and early stopping mechanism triggering; and the last 15% were assigned to the test set for independent validation of the model's final performance.

[0052] S4. Construction of a multi-step forward prediction model:

[0053] A multi-step forward prediction model is constructed and trained, comprising an encoder and a decoder. The encoder includes at least two stacked units, each consisting of a GhostConv convolutional layer, a convolutional block attention module, and a pooling layer connected in series, and a gated recurrent unit network connected after the stacked units, used to extract spatial and temporal features from the input matrix and generate a context vector. The decoder includes a gated recurrent unit layer and a fully connected output head, used to receive the context vector and output the probability distribution of risk levels for each excavation cycle under the future prediction window length. During the training phase of the multi-step forward prediction model, a cost-sensitive loss function is used, which sets differentiated class weights for different risk levels.

[0054] In this embodiment, the multi-step advance prediction model is a lightweight Seq2Seq model built on a deep learning framework. The multi-step advance prediction model adopts a dual-branch encoder-decoder architecture.

[0055] First, the main structure of the encoder is constructed: The encoder adopts a CBAM-GhostConv-GRU fusion structure to extract multi-source spatial correlation features and temporal evolution features of historical input samples, and compresses the features into a spatiotemporal fusion context vector for output to the decoder. Specifically, the encoder uses two sets of stacked units, each set of stacked units consisting of a GhostConv convolutional layer, a CBAM convolutional attention module, and a max pooling layer connected in series.

[0056] It is worth noting that in this embodiment, GhostCon convolutional layers are used to replace the ordinary two-dimensional convolutional layers in the traditional architecture, and the kernel compression ratio is fixed at 2. Specifically, the GhostConv convolutional layers in the first stacked unit have 32 3×3 convolutional kernels, and the GhostConv convolutional layers in the second stacked unit have 64 3×3 convolutional kernels; the kernel compression ratio of the GhostConv convolutional layers is fixed at 2, which is used to compress the number of model parameters and computational cost without losing feature extraction capabilities. In each stacked unit, the CBAM convolutional attention module is connected in series between the GhostConv convolutional layer and the max pooling layer. The CBAM convolutional attention module adopts a serial connection structure with the channel attention submodule first and the spatial attention submodule last, which is used to automatically strengthen the feature channels and spatial regions that contribute greatly to high-risk prediction and suppress redundant feature weights corresponding to on-site detection noise. The max pooling layer uses a 2×2 pooling window to downsample the feature map output by the convolution, compress the feature dimension, and reduce the risk of model overfitting.

[0057] The feature maps output by the two stacked units are processed into one-dimensional feature vectors by a flattening layer, and then input into a gated recurrent unit network (GRU network) with 128 neurons in each of the two layers to complete the deep encoding of temporal features. Finally, a 128-dimensional spatiotemporal fusion context vector is output to the decoder.

[0058] The main structure of the decoder is then constructed: the decoder receives the spatiotemporal fusion context vector output by the encoder and employs a lightweight GRU layer with 64 neurons per group, half the number of neurons in the encoder's GRU layer, to further compress the model parameters and avoid overfitting in scenarios with small to medium sample sizes. The decoder is coupled with a fully connected output head and a Softmax activation function. The output dimension of the fully connected output head is the product of the future prediction window length and the number of risk level categories. After processing by a reshape layer, it outputs a two-dimensional probability matrix matching the label system. The Softmax activation function normalizes the risk level probability distribution for each future excavation cycle, taking the risk level corresponding to the maximum probability as the final prediction result for that cycle. Based on the spatiotemporal fusion context vector, the decoder outputs the risk level probability distribution for the next five excavation cycles at once, fundamentally avoiding the error accumulation problem of multi-step prediction.

[0059] For example, the decoder, based on the spatiotemporal fusion context vector, outputs the risk level probability distribution for the next five excavation cycles at once, specifically including:

[0060] Traditional Seq2Seq multi-step prediction often employs an autoregressive decoding mode, where prediction results are generated incrementally, with the output of the previous step serving as the input for the next. This leads to an accumulation of error with each prediction step. This invention uses a parallel full-output decoding architecture, where all prediction steps are generated simultaneously based on the same context vector, eliminating the error accumulation effect from the architecture itself. The specific calculation process is as follows:

[0061] The decoder GRU layer receives the 128-dimensional spatiotemporal fusion context vector c from the encoder output, completes feature mapping through the update gate and reset gate mechanism of the gated recurrent unit, and outputs a 64-dimensional global decoded hidden state. :

[0062]

[0063] The fully connected output header at the end of the decoder performs a linear transformation on the hidden state, directly mapping it to the unnormalized scores of all prediction steps. The output dimension is the product of the prediction window length T and the number of risk level categories M; in this embodiment, T=5 and M=5.

[0064]

[0065] in, This is the weight matrix of the fully connected layer. This is a bias term.

[0066] The one-dimensional score vector is reconstructed into a T×M two-dimensional matrix Z by the Reshape layer, where the t-th row corresponds to the unnormalized scores of various risks in the t-th future excavation cycle; then, Softmax normalization is performed on each row to obtain the probability distribution of the risk level for each excavation cycle.

[0067]

[0068] in, Let be the probability that the t-th future excavation cycle is classified as the m-th level of risk. Let m be the unnormalized prediction score corresponding to the t-th future excavation cycle and the m-th level of risk. It is a natural exponential function. For the t-th prediction step, k is the sum of the exponential values ​​of the unnormalized scores corresponding to all M risk levels, where k is the traversal index of the risk level dimension, ranging from 1 to M. This parallel output architecture eliminates the need for iterative predictions; all prediction steps share the same context vector for parallel computation, avoiding the amplification of previous step errors in traditional autoregressive decoding and improving the accuracy and stability of multi-step predictions with a 5-step long window.

[0069] Finally, the Dropout layer is embedded: Dropout layers are set after the GRU layer of both the encoder and the decoder, with a fixed inactivation rate of 0.2. During training, the Dropout layer randomly inactivates some neurons to reduce the model's over-reliance on training samples and suppress overfitting; during inference, the Dropout layer is forcibly enabled to achieve Monte Carlo random sampling.

[0070] S5. Multi-step advance prediction model training:

[0071] Based on the time series dataset constructed in S3, the model constructed in S4 is trained using training set samples, and hyperparameter tuning and early stopping detection are performed using validation set samples.

[0072] First, complete the core hyperparameter settings: the core hyperparameters for model training are fixed at batch size 32, initial learning rate 0.0005, and maximum number of iterations 500. The optimizer used is the Adam optimizer, and the optimizer parameters are as follows: Set to 0.9 Set the value to 0.999 and the weight decay factor to 1e-4. This helps avoid gradient explosion and vanishing problems during model training.

[0073] Then, a customized loss function is set:

[0074] Cost-sensitive weighted Focal Loss is used as the global loss function for model training, and class weights are set in the loss function. To address the class imbalance issue in the dataset, the loss weights for high-risk minority class samples at levels four and five are increased, and focusing parameters are set. The value is set to 2 to reduce the contribution weight of easily classified low-risk samples to the loss function, thereby enhancing the model's learning ability for high-risk, difficult-to-classify samples. To meet the core safety requirement of zero missed detections in high-risk tunnel engineering, differentiated misclassification penalty weights are added to the loss function. A penalty weight of 15 times is applied to missed detections where a high-risk level is misclassified as a low-risk level, and a penalty weight of 1 times is applied to missed detections where a low-risk level is misclassified as a high-risk level. The mathematical expression of the standard FocalLoss loss function is as follows:

[0075]

[0076] in, This represents the model's predicted probability for the true category. As the category weights for the corresponding categories, in this embodiment, the category weights for risks of levels I to V are as follows: High-risk categories have higher weights to balance differences in sample size;

[0077] Introducing a differentiated misjudgment penalty matrix , the elements Indicates that the true category is y and the predicted category is y. The penalty coefficient at that time is determined by the following rules:

[0078] like This indicates that the actual risk level is higher than the predicted level; that is, a high-risk situation (e.g., Level IV, value 4) has been incorrectly classified as a low-risk situation (e.g., Level II, value 2), constituting a missed assessment. Such errors seriously threaten construction safety, hence a high penalty weight of 15 times. ;like At this point, classifying a low-risk situation as a higher-risk one (e.g., misreporting a Level II false alarm as a Level IV) falls under the conservative risk category of false alarms. While this type of error is undesirable, it is relatively safe and carries a relatively low cost; therefore, it is only given a base penalty weight of 1. .

[0079] The final global loss is the weighted average loss of all samples and all prediction steps within the batch:

[0080]

[0081] Where B is the batch size and T is the prediction window length. Let b be the true risk level of the b-th sample at step t. Let b be the probability that the b-th sample is predicted to be at risk level m in step t. This represents the category weight value corresponding to the true risk level of the b-th sample at the t-th prediction step.

[0082] During training, a customized data augmentation strategy was adopted, adding slight Gaussian noise with a mean of 0 and a variance of 0.01 to the training set samples to improve the model's adaptability and generalization performance to noisy data in the field.

[0083] In some embodiments, an early stopping mechanism is also set to monitor the model training process. After each complete iteration of training, the model loss value and prediction accuracy are calculated on the validation set. When the validation set loss value does not decrease for 10 consecutive iterations, the model training is automatically terminated. At the same time, the model weights corresponding to the current iteration are saved as the optimal model weights to avoid overfitting and ensure the model's generalization ability.

[0084] S6. Prediction result output:

[0085] Based on the optimal model weights trained and saved using S5, multi-step advanced prediction of geological risks in tunnel construction is carried out.

[0086] First, standardize the input data: Take the raw data from the first 5 consecutive cycles of the target tunnel that has been excavated, and follow the preprocessing procedure described in S2 to sequentially process outlier handling, missing value filling, qualitative feature encoding and normalization to obtain 5 preprocessed feature vectors. Arrange them in order to form a 5×N input feature matrix that matches the model input, and use it as the input sample for the model.

[0087] In this embodiment of the application, the multi-step forward prediction model further includes an inference stage; in the inference stage, all Dropout layers of the multi-step forward prediction model are forcibly activated to keep the random deactivation mechanism active, multiple forward inferences are performed on the target input, and the final predicted risk level is determined and its confidence level is calculated based on the prediction frequency of the risk level of each future cycle in the multiple inference results; and graded construction and disposal suggestions are output according to the final predicted risk level and confidence level.

[0088] Specifically, multiple independent forward inferences with Dropout are performed on the target input to obtain multiple sets of prediction results. For a single future excavation cycle, the frequency of risk levels in the multiple prediction results is counted, and the risk level with the highest frequency is taken as the final predicted risk level for that excavation cycle. The ratio of the frequency of the highest risk level to the number of inferences is used as the prediction confidence. The information entropy is calculated based on the probability distribution of the prediction results of all rounds as a quantitative indicator of prediction uncertainty.

[0089] In this example, Monte Carlo forward inference is performed: during the inference phase, all Dropout layers in the model are forcibly enabled, keeping the model's random deactivation mechanism active. Twenty independent forward inferences with Dropout are performed on the same set of input samples to obtain 20 sets of risk level prediction results for the next 5 excavation cycles.

[0090] Subsequently, the prediction results were integrated and confidence scores were calculated: For a single future excavation cycle, the highest frequency of predictions for the same risk level was counted among 20 forward inference results. The risk level corresponding to the highest frequency was used as the final geological risk prediction level for that excavation cycle, and the ratio of the highest frequency to the total number of inferences (20) was used as the confidence score of the prediction result for that step. At the same time, the information entropy was calculated using the probability distribution of the 20 prediction results. The information entropy value was used to measure the uncertainty of the prediction for that step. The higher the information entropy value, the greater the uncertainty of the model in the prediction for that step.

[0091] To illustrate this, let's consider an example: Define a total of K independent forward inferences with Dropout performed, where K=20 in this example; for the t-th future excavation cycle, let the prediction level of the k-th inference be denoted as... The predicted probability corresponding to the m-th level of risk is .

[0092] Count the frequency of each risk level in K inferences, take the level with the highest frequency as the final prediction level, and the confidence level is the ratio of the highest frequency to the total number of inferences:

[0093]

[0094]

[0095]

[0096] in This is an indicator function that takes the value 1 when the condition is true and 0 when the condition is false. For the tth

[0097] The prediction confidence level of the step is in the range of [0,1].

[0098] The average probability distribution is obtained by averaging the probabilities of K inferences. Then, the information entropy of this distribution is calculated. The larger the entropy value, the stronger the uncertainty of the model in that step's prediction.

[0099]

[0100]

[0101] in Let be the information entropy predicted at step t, in bits.

[0102] Numerical Example: Taking the third excavation cycle ahead of a tunnel face as an example, after 20 Monte Carlo forward inferences, the prediction frequencies for each risk level are: Level I 0 times, Level II 1 time, Level III 3 times, Level IV 14 times, and Level V 2 times. The highest frequency level is Level IV, with a frequency of 14. Therefore, the final predicted risk level is Level IV; the prediction confidence level is [insert confidence level here]. The calculated information entropy corresponding to the average probability distribution is approximately 1.15 bits, indicating that there is some uncertainty in this step of the prediction, and further verification is needed on-site in conjunction with the results of advanced geological forecasts.

[0103] Finally, the engineering output of the prediction results is completed. For the next five excavation cycles, complete results are output, including corresponding mileage markers, predicted risk levels, prediction confidence levels, and prediction uncertainties. Simultaneously, based on tunnel industry standards and on-site construction management requirements, graded construction response recommendations are provided. For high-risk predictions (Level IV and V) with a confidence level of 90% or higher, recommendations include stopping face excavation, conducting a special risk assessment, and implementing proactive prevention and control measures. For predictions with a confidence level between 70% and 90%, recommendations include increasing the frequency of monitoring and measurement and strengthening on-site geological sketching. For low-reliability predictions with a confidence level less than 70%, recommendations include supplementing with advanced drilling verification and reviewing geological conditions, ensuring that the model prediction results can directly support on-site construction decisions.

[0104] S7. Incremental iteration of multi-step forward prediction model:

[0105] A long-term incremental iterative optimization mechanism is established to continuously optimize the model as the tunnel excavation progresses, thereby constantly improving the model's prediction accuracy and adaptability to the target tunnel. Specifically, after each fixed mileage of tunnel excavation is completed, the geological conditions and risk management results within that mileage segment are collected. After data verification and preprocessing, these are added to the training set as new samples. The model is then incrementally fine-tuned. During the fine-tuning process, the weights of the GhostConv convolutional layer and the convolutional block attention module in the encoder are fixed, and only the parameters of the encoder's gated recurrent unit network and the decoder are updated. The updated model is then validated using a validation set. Once the validation is successful, the original model weights are replaced for multi-step advance prediction of subsequent mileage segments.

[0106] For example, after each 100m fixed-mileage tunnel excavation cycle, the actual geological conditions revealed on-site, risk management results, and geological disaster occurrences of all excavation cycles within that mileage section are collected. After data verification and standardization preprocessing, these data are added to the training set as new labeled samples. Incremental fine-tuning is used to update and train the model. During incremental training, the weights of the GhostConv convolutional layer and CBAM convolutional attention module in the encoder are fixed, while only the parameters of the encoder GRU layer and decoder layer are fine-tuned. The initial learning rate is set to 1e-5, and the maximum number of iterations is set to 20. After incremental training, the updated model is validated using the latest validation set data. Once validation is successful, the original model weights are replaced, and the model is used for multi-step advanced prediction of geological risks during tunnel construction in subsequent mileage sections.

[0107] A multi-step advanced prediction system for tunnel geological risks based on a Seq2Seq model, as described in an embodiment of this application, includes a memory and a processor. The memory stores a computer program for implementing the multi-step advanced prediction method for tunnel geological risks based on a Seq2Seq model as described in the foregoing embodiment. The processor performs read and write operations on the memory.

[0108] 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 multi-step advanced prediction method for tunnel geological risk based on a Seq2Seq model, characterized in that, include: A multi-step forward prediction model is constructed and trained. The input of the multi-step forward prediction model is an input matrix composed of preprocessed feature vectors of multiple consecutive historical excavation cycles, and the output is the risk level prediction result of multiple consecutive future excavation cycles. The multi-step forward prediction model includes an encoder and a decoder. The encoder includes at least two sets of stacked units. Each stacked unit includes a GhostConv convolutional layer, a convolutional block attention module, and a pooling layer connected in series, as well as a gated recurrent unit network connected after the stacked units, for extracting spatial and temporal features from the input matrix and generating a context vector. The decoder includes a gated recurrent unit layer and a fully connected output head, used to receive the context vector and output the probability distribution of risk level for each excavation cycle under the future prediction window length at one time; During the training phase of the multi-step forward prediction model, a cost-sensitive loss function is used, which sets differentiated category weights for different risk levels.

2. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to claim 1, characterized in that, The time-series dataset is constructed based on feature vectors, specifically including: The system generates input sample and output label sample pairs with a historical input window length of 5 consecutive excavation cycles, a future prediction window length of 5 consecutive excavation cycles, and a sliding step size of 1 excavation cycle. The input sample is a 5×N two-dimensional feature matrix, where N is the total number of features, and the output label is a 5×M two-dimensional label matrix, where M is the total number of risk level categories. A five-level geological risk level labeling system for tunnel construction is adopted, and different risk level labels are One-Hot coded to form a standardized label matrix. All valid sample pairs are divided into training, validation, and test sets that are non-overlapping and completely isolated in time according to the order of tunnel excavation. The first 70% of the continuous samples are used as the training set, the middle 15% as the validation set, and the last 15% as the test set.

3. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to claim 2, characterized in that, The first set of stacked units in the two stacked units has 32 3×3 convolutional kernels in its GhostConv convolutional layer, and the second set of stacked units has 64 3×3 convolutional kernels in its GhostConv convolutional layer. The kernel compression ratio of the GhostConv convolutional layer is fixed at 2. The convolutional block attention module adopts a serial connection structure with the channel attention submodule first and the spatial attention submodule last; the pooling layer is 2×2 max pooling; The feature maps output by the two stacked units are processed into one-dimensional feature vectors by a flattening layer and then input into a gated recurrent unit network. The gated recurrent unit network is a two-layer GRU network with 128 neurons each, and outputs a 128-dimensional context vector. A Dropout layer is set after the encoder's GRU network.

4. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to claim 3, characterized in that, The gated recurrent unit layer of the decoder is a single GRU layer with 64 neurons, and its number of neurons is half that of the encoder's GRU layer. The output dimension of the fully connected output head is set to the product of the future prediction window length and the number of risk level categories. The Reshape layer is configured to process the output into a two-dimensional probability matrix that matches the label matrix. The risk probability distribution of each future excavation cycle is then obtained through the Softmax activation function. A Dropout layer is set after the GRU layer of the decoder, and this Dropout layer is forcibly enabled during the inference phase to achieve Monte Carlo random sampling.

5. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to claim 1, characterized in that, The cost-sensitive loss function is: in, This represents the model's predicted probability for the true category. The category weights are for the corresponding categories. For focusing parameters; Introducing a differentiated misjudgment penalty matrix , of which elements Indicates that the true category is y and the predicted category is y. The penalty coefficient at that time is determined by the following rules: like This falls under the definition of a missed detection, where a high-risk case is classified as a low-risk case. ;like At this point, the definition of a false alarm is to correctly predict or to judge a low-risk situation as high-risk. ; The final global loss is the weighted average loss of all samples and all prediction steps within the batch: Where B is the batch size and T is the prediction window length. Let b be the true risk level of the b-th sample at step t. The probability that the b-th sample is predicted to be at risk level m in step t.

6. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to any one of claims 1-5, characterized in that, The multi-step advanced prediction model also includes an inference phase; In the inference phase, all Dropout layers of the multi-step forward prediction model are forcibly enabled to keep the random deactivation mechanism active. Multiple forward inferences are performed on the target input. Based on the risk level prediction frequency of each future cycle in the multiple inference results, the final predicted risk level is determined and its confidence level is calculated. Based on the final predicted risk level and confidence level, graded construction and disposal recommendations are output.

7. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to claim 6, characterized in that, The reasoning phase also includes: Perform multiple independent forward inferences with Dropout on the target input to obtain multiple sets of prediction results; For a single excavation cycle in the future, the frequency of the risk level in multiple prediction results is counted, and the risk level with the highest frequency is taken as the final predicted risk level of the excavation cycle. The ratio of the frequency of the highest risk level to the number of inferences is used as the prediction confidence level. Information entropy is calculated based on the probability distribution of prediction results across all rounds, serving as a quantitative indicator of prediction uncertainty.

8. The method for multi-step advanced prediction of tunnel geological risk based on the Seq2Seq model according to claim 7, characterized in that, It also includes incremental iteration of the multi-step advance prediction model: After each fixed mileage of tunnel excavation is completed, the geological conditions and risk management results within the excavated mileage section are collected, and after data verification and preprocessing, they are added to the training set as new samples. The model is incrementally fine-tuned. During the fine-tuning process, the weights of the GhostConv convolutional layer and the convolutional block attention module in the encoder are fixed, and only the parameters of the gated recurrent unit network of the encoder and the decoder are updated. The updated model is validated using a validation set. Once the validation is successful, the original model weights are replaced for multi-step advance prediction of subsequent mileage segments.

9. A multi-step advanced prediction system for tunnel geological risks based on a Seq2Seq model, comprising a memory and a processor, characterized in that, The memory stores a computer program for implementing the multi-step advanced prediction method for tunnel geological risks based on the Seq2Seq model as described in any one of claims 1-8, and the processor performs read and write operations on the memory.