Foundation pit collapse risk intelligent prediction method based on stress monitoring

By constructing a foundation pit collapse risk prediction model based on adjustable Morlet wavelet basis functions and adaptive frequency band weight matrix, the problems of insufficient feature extraction and class imbalance in existing technologies are solved, and early identification and reliable warning of foundation pit collapse risk are realized.

CN121302128APending Publication Date: 2026-01-09JIANGSU UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511489417.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing early warning technologies for foundation pit collapse risks are ill-suited to complex working conditions, suffer from insufficient feature extraction, fail to accurately capture early risk signals, and lack predictive reliability in imbalanced scenarios.

Method used

By combining adjustable Morlet wavelet basis functions with adaptive frequency band weight matrices, and through a dual-path attention mechanism and improved residual time series units, a foundation pit collapse risk prediction model is constructed to achieve multi-scale feature extraction and uncertainty assessment.

Benefits of technology

It improves the accuracy and reliability of foundation pit collapse risk prediction, enables early identification of mild or severe risks, adapts to complex working conditions, and enhances the practical value of the early warning system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121302128A_ABST
    Figure CN121302128A_ABST
Patent Text Reader

Abstract

The invention discloses a foundation pit collapse risk intelligent prediction method based on stress monitoring, and the method comprises the steps: constructing a data set according to collected foundation pit stress monitoring data, and dividing the data set; adaptive time-frequency characteristic decomposition is carried out on data of the data set, and dynamic matching of a stress data local frequency domain structure and effective extraction of multi-scale time-frequency characteristics are realized; inputting the extracted multi-scale time-frequency features into a constructed foundation pit collapse risk prediction model for training; and outputting a prediction result through the foundation pit collapse risk prediction model according to the foundation pit stress monitoring data acquired in real time. According to the method, the problem that a fixed basis function method is insufficient in frequency domain adaptation under different working conditions is solved, the defect that early collapse symptoms cannot be effectively captured due to the fact that a conventional threshold denoising method is prone to losing low-frequency risk information is overcome, and the defect that long-term dependence and a sudden change mode cannot be considered at the same time is overcome; the limitation that an existing method is biased to majority classes under class imbalance and is lack of prediction reliability quantization is broken through.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology and relates to the prediction of foundation pit collapse risk, specifically to an intelligent prediction method for foundation pit collapse risk based on stress monitoring. Background Technology

[0002] As a crucial component of urban underground space development and infrastructure construction, the safety of foundation pit engineering directly impacts the protection of the surrounding environment and the safety of people and property. However, due to complex geological conditions, frequent environmental disturbances, and uncertainties in the construction process, foundation pits are highly susceptible to risks such as displacement, cracking, and even collapse during excavation.

[0003] In recent years, although stress monitoring and displacement monitoring systems have been widely deployed at engineering sites, most existing technologies rely on single threshold judgments or experience-based statistical analysis, making it difficult to capture early risk signals in stress data in a timely and accurate manner. When faced with non-stationary, multi-scale, and high-noise stress monitoring data, these methods often suffer from insufficient feature extraction, insensitivity to sudden anomalies, and an inability to quantify prediction reliability, leading to delayed or false alarms in collapse warnings. Especially in risk identification scenarios with extremely imbalanced categories, conventional classification models tend to favor normal states, neglecting the learning of samples with mild or severe risks, further weakening the practical value of early warning systems.

[0004] Therefore, there is an urgent need for an intelligent prediction method that can adapt to complex working conditions, achieve multi-scale feature extraction, improve the accuracy of risk identification, and have uncertainty assessment capabilities, so as to make up for the shortcomings of existing technologies in early warning of collapse risks. Summary of the Invention

[0005] Purpose of the invention: In order to overcome the shortcomings of the existing technology, this invention provides an intelligent prediction method for foundation pit collapse risk based on stress monitoring. It overcomes the problem of insufficient frequency domain adaptation of the fixed basis function method under different working conditions, avoids the defects of conventional threshold denoising method which easily loses low-frequency risk information and causes early signs of collapse to be unable to be effectively captured, effectively solves the shortcomings of conventional LSTM / GRU in not being able to take into account both long-term dependence and abrupt change patterns, and breaks through the limitations of existing methods that are biased towards the majority class and lack prediction reliability quantification under class imbalance.

[0006] Technical Solution: To achieve the above objectives, this invention provides an intelligent prediction method for foundation pit collapse risk based on stress monitoring, comprising the following steps:

[0007] S1: Based on the collected foundation pit stress monitoring data, construct a dataset and divide it into a training set, a validation set, and a test set;

[0008] S2: Perform adaptive time-frequency feature decomposition on the dataset to achieve dynamic matching of the local frequency domain structure of stress data and effective extraction of multi-scale time-frequency features;

[0009] S3: Input the extracted multi-scale time-frequency features into the constructed foundation pit collapse risk prediction model for training;

[0010] S4: Based on the real-time collected foundation pit stress monitoring data, the prediction results are output through the trained foundation pit collapse risk prediction model.

[0011] Further, step S2 specifically includes:

[0012] A1: Constructing an adjustable Morlet wavelet basis function

[0013] To address the non-stationary nature of stress data, a set of Morlet wavelet basis functions with adjustable bandwidth and center frequency is constructed to achieve multi-scale time-frequency analysis. These basis functions control the time-domain support width through the bandwidth parameter, control the main oscillation frequency through the center frequency, construct the envelope shape through the exponential function, and provide oscillation characteristics through the cosine function, thus adapting to the time-frequency feature extraction requirements at different scales. This is expressed as:

[0014]

[0015] In the formula, Indicates the first A basis function at a wavelet scale is used to extract time-frequency features at that scale; The time offset controls the translation position of the wavelet function on the time axis; For the first The bandwidth parameter of the scale controls the time-domain support width of the wavelet function; For the first The center frequency of the scale controls the main oscillation frequency of the wavelet function; This represents an exponential function used to construct the envelope shape of wavelets; This represents the cosine function, used to provide the oscillatory characteristics of wavelets;

[0016] A2: Generate an adaptive frequency band weight matrix

[0017] Based on the local features of the input stress data, an adaptive weight vector for each frequency band is generated by calculating the learnable parameter vector and the original stress time series data. This weight vector is then mapped to the zero-to-one interval using an activation function to normalize the weights, thereby enhancing the features of key frequency bands and suppressing noise interference. This can be expressed as:

[0018]

[0019] In the formula, Indicates the first An adaptive weight vector for the scale frequency band, used to enhance key frequency band features and suppress noise, has a length of T; is the first learnable parameter vector, used to extract the frequency band characteristics of the input data, with a length of T; For the first The original stress time series data of each sample, with a length of T; This represents the length of the time series, i.e., the number of time steps. As the activation function, the output is mapped to the (0,1) interval to achieve the normalized product of the weights;

[0020] A3: Perform weighted continuous wavelet transform

[0021] By combining adjustable wavelet basis functions with adaptive weight vectors, a weighted continuous wavelet transform is applied to the original stress data. Through element-wise multiplication and scale summation operations, a feature tensor containing multi-scale time-frequency information is obtained, expressed as:

[0022]

[0023] In the formula, This represents the decomposed time-frequency feature tensor, which contains multi-scale time-frequency information and has a dimension of . ; This is a continuous wavelet transform operation used to convert time-series data to the time-frequency domain; This represents the Hadamard product, which is the product of elements. The total number of wavelet scales controls the number of scales used in the decomposition.

[0024] Furthermore, the construction of the foundation pit collapse risk prediction model in step S3 includes:

[0025] B1: Attention-Guided Spatiotemporal Noise Reduction

[0026] By calculating the attention weights in the time domain and frequency domain respectively through a dual-path attention mechanism, the time-frequency features are adaptively weighted and fused to achieve noise suppression and enhance key features related to collapse risk.

[0027] B2: Weighted weighting of dynamic feature importance

[0028] The feature importance vector is calculated by using a differentiable feature selection gate mechanism, and the time-frequency features of the noise reduction are channel-weighted to highlight key frequency band features and suppress interference from redundant or noise features.

[0029] B3: Improved residual timing unit

[0030] By designing a dual-gated residual time series unit, trend gating and mutation gating are used to capture slow and abrupt features respectively. Combined with layer normalization operation, the training stability is improved and the ability to model complex time series patterns is enhanced.

[0031] B4: Multi-scale Risk Characteristic Pyramid

[0032] Features at different temporal resolutions are extracted by stacking improved residual temporal unit blocks, and multi-scale feature fusion is achieved through upsampling and stitching operations to cover the dynamic features of the entire collapse process.

[0033] B5: Adaptive Class Equalization Loss

[0034] The loss function is adjusted by calculating the class frequency weight and the hard sample adaptive weight;

[0035] B6: Uncertainty Calibration Output

[0036] By constructing a dual-branch output structure to simultaneously predict class probability and variance, and using variance-calibrated loss terms to quantify prediction uncertainty, the final output is the risk level and its corresponding confidence level.

[0037] Further, step B1 specifically includes:

[0038] B1-1: Calculate the temporal attention weights

[0039] By performing a one-dimensional convolution operation on the time axis to extract query and key vectors of time-frequency features, calculating attention scores in the time dimension, and then processing them through scaling and normalization exponential functions, a time-domain attention weight matrix is ​​generated to capture continuous important features in the time dimension, represented as:

[0040]

[0041]

[0042] In the formula, This represents the temporal attention weight matrix, used to emphasize important features that are continuous over time. This represents a one-dimensional convolution operation performed on the time axis, used to extract temporal features; This represents the query vector generated through convolution operations, used to calculate the attention score; This represents the key vector generated through convolution operations, used for matching with the query vector; The dimension scaling factor for the query and key vectors, used to control the distribution of attention weights; The attention score is converted into a probability distribution by using a normalized exponential function;

[0043] B1-2: Calculate the frequency domain attention weights

[0044] Global average pooling is used to compress the temporal dimension of time-frequency features, obtaining a global representation of each frequency band. Then, the saliency weights of each frequency band are calculated using learnable parameter vectors and activation functions to highlight key frequency bands related to collapse risk, as shown below:

[0045]

[0046] In the formula, This represents the frequency domain attention weight vector, used to evaluate the importance of features in different frequency bands; This represents a global average pooling operation, used along the time dimension. Compress the features; This is the second learnable parameter vector, used to calculate the weights for each frequency band; for transpose; The activation function compresses the output value to the (0,1) interval, representing the activation intensity of each frequency band;

[0047] B1-3: Generating Denoising Time-Frequency Features

[0048] The time-domain attention weight matrix and frequency-domain attention weight vector are multiplied element-wise with the original time-frequency feature tensor, and then fused using a dual-path weighted fusion method to highlight important time-frequency regions and suppress noise, resulting in the denoised time-frequency feature tensor, expressed as:

[0049]

[0050] In the formula, The time-frequency feature tensor for denoising has dimensions of . ; This represents the tensor broadcast multiplication operation, which implements the element-wise multiplication of attention weights with feature tensors.

[0051] Further, step B2 specifically includes:

[0052] B2-1: Calculate the feature importance vector

[0053] The denoising time-frequency feature tensor is flattened into a one-dimensional vector, mapped to the importance score space through a learnable parameter matrix, and then transformed into a sparse probability distribution through a sparse maximization activation function. This generates a feature importance vector representing the contribution weight of each frequency band feature to the classification, expressed as:

[0054]

[0055] In the formula, Indicates the first The feature importance vector of each sample, whose element values ​​represent the contribution weight of each frequency band feature to the collapse risk classification; This indicates a tensor flattening operation, which flattens the input tensor. Convert to dimension A one-dimensional vector; The third learnable parameter matrix is ​​used to map the flattened feature vectors to... The importance score space has a dimension of 1. ; for transpose; The sparse maximization activation function transforms the input vector into a sparse probability distribution, thereby enabling feature selection.

[0056] B2-2: Perform feature channel weighting

[0057] The feature importance vector is channel-weighted with the denoised time-frequency feature tensor. By multiplying each element of the importance vector by the feature values ​​of all time steps of the corresponding frequency band, the representation strength of key frequency band features is enhanced, and the influence of unimportant features is suppressed. This can be expressed as:

[0058]

[0059] In the formula, This represents the weighted time-frequency feature tensor, which serves as the input to subsequent network modules; This represents a feature channel weighting operation, which assigns weights to the importance vector. Each element in The tensor is the product of the eigenvalues ​​of all time steps corresponding to the frequency band.

[0060] Furthermore, step B3 specifically includes:

[0061] B3-1: Calculate the trend gating value

[0062] The hidden state from the previous time step is concatenated with the current input features. A trend gating vector is calculated using a learnable weight matrix and bias, and then processed by an activation function to control the proportion of gradual transformation features that pass through. This is expressed as:

[0063]

[0064] In the formula, This represents the trend gating vector, used to control the proportion of gradual deformation features that can pass through. The weight matrix for trend gating is used to learn the combined relationship between hidden states and input features; This indicates that the previous state will be hidden. With the current input Perform the splicing operation; This is the bias vector for trend gating, used to adjust the baseline level of the gating value; for The input features at time step are derived from the output of the dynamic feature importance weighting step. ; for The hidden state at any given moment;

[0065] B3-2: Calculating the mutation gating value

[0066] The acceleration characteristics of stress change are represented by calculating the absolute value of the second-order difference of the input features. Then, the abrupt change gating vector is calculated using a learnable weight matrix and bias. After processing with an activation function, the abrupt change features in the stress data are detected and enhanced, as shown below:

[0067]

[0068] In the formula, This represents a mutation gating vector, used to detect and enhance mutation features in stress data; This represents the absolute value of the second-order difference of the input feature, used to characterize the acceleration feature of stress change; The weight matrix for mutation gating is used to learn the mapping relationship of mutation features and is a trainable parameter. The bias vector for mutation gating is a trainable parameter;

[0069] B3-3: Update cell state

[0070] Combining the outputs of trend gating and mutation gating, the gradual change features and mutation features are weighted separately, and the cell state at the current time step is updated through a weighted fusion method, serving as the internal memory state of the unit, represented as:

[0071]

[0072] In the formula, express The cell state is constantly updated, serving as the unit's internal memory state. The hyperbolic tangent activation function compresses the input values ​​to the (-1, 1) interval; The weight matrix for updating cell states;

[0073] B3-4: Output hidden state

[0074] The updated cell state is added to the previous hidden state adjusted by the residual connection weight matrix, and then the current hidden state is output through layer normalization, represented as:

[0075]

[0076] In the formula, express The hidden state output at each time step is used as the input for subsequent network layers; The representation layer normalization operation is used to improve training stability and convergence speed; This is the weight matrix for the residual connection, used to adjust the contribution ratio of the hidden state in the previous time step.

[0077] Further, step B4 specifically includes:

[0078] B4-1: Multi-scale Feature Extraction

[0079] The residual temporal unit blocks improved by three-layer stacking downsample the weighted features with different time lengths, progressively extracting low-temporal-resolution feature maps to capture long-term slow-changing trends, medium-temporal-resolution feature maps to capture mid-term evolutionary features, and high-temporal-resolution feature maps to retain short-term detailed information, represented as:

[0080]

[0081]

[0082]

[0083] In the formula, This indicates the first stacked improved residual timing cell block, which consists of multiple improved residual timing cells, and is time-downsampled with a step size of 4. This indicates the second stacked improved residual timing unit block, which consists of multiple improved residual timing units and is time-downsampled with a step size of 2. This indicates the third stacked improved residual timing unit block, which consists of multiple improved residual timing units and performs time downsampling with a stride of 1; stride indicates the step size in the time dimension, controlling the downsampling ratio; It generates low-temporal-resolution feature maps to capture long-term, slowly changing trends. This is a feature map with medium temporal resolution, capturing mid-term evolutionary features; To preserve short-term details in high temporal resolution feature maps;

[0084] B4-2: Multi-scale feature fusion

[0085] High-level features are upsampled along the temporal dimension to match the temporal resolution of mid-level features, and low-level features are averaged and pooled along the temporal dimension to compress the temporal dimension. Finally, these three features are concatenated along the feature dimension to form a feature tensor that integrates multi-scale information, represented as:

[0086]

[0087] In the formula, For the time dimension upsampling operation, The time resolution has been improved to the same level as Consistent; For time-dimensional average pooling operations, compression The time dimension is used to match the fusion requirements; This indicates a concatenation operation along the feature dimension; To fuse multi-scale feature tensors.

[0088] Further, step B5 specifically includes:

[0089] B5-1: Calculating Category Frequency Weights

[0090] The class frequency is calculated based on the number of samples of each class in the training set. Then, the basic weight of each class is obtained by adding a minimal constant to the reciprocal of the square root of the frequency. This weight is used to balance the contribution of different classes to the loss function, and is expressed as follows:

[0091]

[0092] In the formula, This is a category index, representing different categories in a classification task; Let c be the number of samples of the c-th class in the training set, i.e., the class frequency; It is a very small constant used to prevent the denominator from being zero, thus ensuring numerical stability; The calculated base weight for the c-th category is inversely proportional to the square root of the category frequency;

[0093] B5-2: Calculating Adaptive Weights for Hard Samples

[0094] Based on the model's predicted probabilities for each category of each sample, adaptive weights for difficult samples are calculated using an exponential function and a temperature hyperparameter. Samples with lower predicted probabilities have higher weights, allowing the model to focus on samples that are difficult to classify. This is expressed as:

[0095]

[0096] In the formula, For the model to the first The predicted probability that a sample belongs to the c-th category; This is a temperature hyperparameter used to control the distribution of weights for difficult samples; it is preferably set to 0.2. For the first The hard sample adaptive weights for each sample in the c-th class, the values ​​of which vary with... The decrease increases; For the model to the first The sample belongs to the first Predicted probability of the category; Total number of categories;

[0097] B5-3: Calculate the final loss value

[0098] Combining class frequency weights and hard sample adaptive weights, the logarithms of the predicted probabilities for each class of each sample are weighted and summed to obtain the adaptive class balance loss value, which serves as the objective function for model training, expressed as:

[0099]

[0100] In the formula, The total number of samples in a training batch; For the model to the first The logarithm of the true class predicted probability for each sample; This is the calculated adaptive class equilibrium loss value.

[0101] Furthermore, step B6 specifically includes:

[0102] B6-1: Two-branch prediction output

[0103] The multi-scale features are fed into a two-branch multilayer perceptron. One branch outputs a class probability prediction vector, and the other branch outputs a prediction variance vector for each class. This is used to quantify the uncertainty of the model for each prediction result, and is expressed as follows:

[0104]

[0105] In the formula, For the first Each sample, after undergoing feature vector fusion via a multi-scale feature pyramid, serves as the input to a two-branch multilayer perceptron. It is a two-branch multilayer perceptron, containing a shared low-level feature extraction layer and two independent output heads; This is the class probability vector output by the model; The prediction variance vector output by the model quantifies the uncertainty of the model's predictions for each category.

[0106] B6-2: Calculation of Calibration Loss Due to Uncertainty

[0107] Based on the adaptive class balance loss, the L2 norm squared of the difference between the prediction variance and the prediction correctness indicator function is added as a variance calibration term. By balancing the two terms through weighting coefficients, the total loss function is obtained, expressed as:

[0108]

[0109] In the formula, This is an indicator function; the function value is 1 when the condition inside the parentheses is met, and 0 otherwise. For the first The true category label of each sample; For the model to the first The predicted category for each sample; This is a weighting coefficient used to balance the importance of the classification loss and the variance calibration term; it is preferably set to 0.3. This is the final total loss function; The square of the L2 norm;

[0110] B6-3: Risk Level and Confidence Level Output

[0111] The category index corresponding to the highest probability in the category probability vector is taken as the risk level classification result, and the prediction variance corresponding to that category is converted into a confidence metric as an assessment of the reliability of the prediction result, expressed as:

[0112]

[0113]

[0114] In the formula, Indicates taking the probability vector The category index corresponding to the highest probability value is used as the final risk level classification result; That is, the category corresponding to the highest probability; For category The corresponding prediction variance.

[0115] Furthermore, the training of the foundation pit collapse risk prediction model in step S3 includes iterative training and parameter updates, specifically as follows:

[0116] The model training uses mini-batch gradient descent for iterative optimization, and the specific process is as follows:

[0117] First, all learnable parameters are initialized, and the Xavier method is used to ensure that the parameter distribution is reasonable. In each iteration, batch samples (batch size set to 32) are randomly selected from the training set and input into the foundation pit collapse risk prediction model. The adaptive time-frequency feature decomposition, attention-guided noise reduction, dynamic feature weighting, residual temporal unit processing, multi-scale feature fusion and dual-branch prediction output are executed in sequence.

[0118] Based on the adaptive class balance loss and uncertainty calibration loss defined in step B6, the total loss value is calculated. The gradient of this loss is calculated through the backpropagation algorithm, and the parameters are updated using the Adam optimizer. The learning rate is initially set to 0.001, and a learning rate decay strategy (such as decaying to 90% of the original value every 10 rounds) is used to improve convergence stability.

[0119] After the parameters are updated, evaluate the model performance on an independent validation set and monitor key metrics such as classification accuracy, recall and F1 score.

[0120] There are two ways to determine when to stop iteration: one is to preset the maximum number of iterations (e.g., 200 iterations), and the other is an early stopping mechanism, that is, when the validation loss does not decrease for 10 consecutive iterations (tolerance set to 0.001) or the performance index tends to stabilize, training is terminated to avoid overfitting.

[0121] After training is complete, the final model parameters are saved as a weight file for subsequent prediction tasks.

[0122] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0123] 1. Existing foundation pit stress monitoring feature extraction relies heavily on fixed wavelet basis functions or Fourier transforms, which are difficult to adapt to complex stress signals that are non-stationary and multi-scale, resulting in insufficient extraction of key information and limited prediction accuracy.

[0124] This invention combines an adjustable Morlet wavelet basis function with an adaptive frequency band weight matrix to achieve accurate extraction of multi-scale dynamic features for non-stationary stress signals, overcoming the problem of insufficient frequency domain adaptation of the fixed basis function method under different working conditions.

[0125] 2. Conventional noise reduction methods mostly use fixed threshold filtering, which can suppress noise, but often weakens low-frequency anomaly features related to collapse risk, causing the loss of early risk signals.

[0126] This invention employs a dual-path attention mechanism in the time and frequency domains to achieve a balance between noise reduction and feature preservation, avoiding the shortcomings of conventional threshold denoising methods that easily lose low-frequency risk information and fail to effectively capture early signs of collapse.

[0127] 3. Common time series modeling methods such as LSTM or GRU tend to focus on capturing smooth trends, but are not sensitive enough to abrupt changes in stress signals, making it difficult to balance the coupled modeling of long-term dependencies and sudden modes.

[0128] This invention designs an improved residual time-series unit that combines trend gating and abrupt change gating, enhancing the model's ability to jointly model slow-changing trends and abrupt change signals, effectively solving the shortcomings of conventional LSTM / GRU in not being able to take into account both long-term dependencies and abrupt change patterns.

[0129] 4. Existing risk classification models mostly use standard cross-entropy loss and only output class probabilities, which leads to bias towards the normal class when the sample classes are severely imbalanced, insufficient learning of the few risk classes, and lack of prediction reliability quantification, thus limiting the reliability of actual early warning.

[0130] This invention introduces an adaptive class balance loss and uncertainty calibration mechanism, which not only improves the identification ability of minority class risk samples, but also provides prediction confidence output, overcoming the limitations of existing methods that are biased towards the majority class and lack prediction reliability quantification under class imbalance. Attached Figure Description

[0131] Figure 1 This is a flowchart of the method of the present invention;

[0132] Figure 2 A comparison chart of recall rates for different risk categories;

[0133] Figure 3 A comparison chart of prediction confidence distributions;

[0134] Figure 4 A comparison chart of convergence characteristics during the training process;

[0135] Figure 5 This is a comparison chart of time series prediction performance. Detailed Implementation

[0136] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0137] Example 1:

[0138] like Figure 1 As shown in the figure, this embodiment provides an intelligent prediction method for foundation pit collapse risk based on stress monitoring, including the following steps:

[0139] S1: Data Acquisition and Training Dataset Construction for Foundation Pit Stress Monitoring

[0140] Based on the collected foundation pit stress monitoring data, a dataset was constructed and divided into a training set, a validation set, and a test set.

[0141] At the foundation pit construction site, data is collected by deploying a high-precision stress sensor array. Specifically, the data comes from resistive or fiber optic stress sensors installed at key structural parts of the foundation pit (such as support beams, retaining walls, and the junction of soil layers). These sensors transmit data to the central server in real time via Internet of Things (IoT) technology.

[0142] The acquisition process involves continuous monitoring, with a sampling frequency set to once per minute to ensure that subtle dynamics of stress changes are captured;

[0143] The sensors are installed and calibrated before the foundation pit is excavated, and external noise is reduced through anti-interference measures (such as electromagnetic shielding and environmental temperature and humidity compensation) to ensure data quality.

[0144] After the data collection is completed, when constructing the training dataset, the original stress time series data is divided into fixed time windows (each sample is 6 hours in this embodiment), and each sample contains a stress value sequence of T time steps;

[0145] The labeling process is based on historical engineering records and expert evaluation: combining the pit collapse event log (such as displacement monitoring reports, crack development records or video surveillance) and safety assessment reports, multiple geotechnical engineering experts independently determine the risk status corresponding to each sample, and the final label is determined by majority vote to ensure the objectivity and consistency of the labeling.

[0146] The labeling categories are defined as three types: normal (no signs of risk), slightly risky (abnormal stress but not reaching the critical value), and severely risky (sudden stress changes indicate collapse).

[0147] The dataset was divided into training, validation, and test sets in a ratio of 7:2:1, and then standardized to eliminate differences in units.

[0148] S2: Adaptive Time-Frequency Eigendecomposition

[0149] Foundation pit stress monitoring data typically exhibits strong non-stationary characteristics, is subject to a large amount of noise interference, and has multi-scale fluctuation characteristics. Conventional processing methods mainly use wavelet transform with fixed basis functions, which is difficult to adapt to the frequency domain feature distribution under different foundation pit working conditions, resulting in insufficient extraction of key risk features and affecting prediction accuracy.

[0150] This embodiment constructs an adjustable bandwidth and center frequency Morlet wavelet basis function, generates an adaptive frequency band weight matrix, and performs a weighted continuous wavelet transform to achieve dynamic matching of the local frequency domain structure of stress data and effective extraction of multi-scale time-frequency features. The specific steps are as follows:

[0151] A1: Constructing an adjustable Morlet wavelet basis function

[0152] To address the non-stationary nature of stress data, a set of Morlet wavelet basis functions with adjustable bandwidth and center frequency is constructed to achieve multi-scale time-frequency analysis. These basis functions control the time-domain support width through the bandwidth parameter, control the main oscillation frequency through the center frequency, construct the envelope shape through the exponential function, and provide oscillation characteristics through the cosine function, thus adapting to the time-frequency feature extraction requirements at different scales. This is expressed as:

[0153]

[0154] In the formula, Indicates the first A basis function at a wavelet scale is used to extract time-frequency features at that scale; The time offset controls the translation position of the wavelet function on the time axis; For the first The bandwidth parameter of the scale controls the time-domain support width of the wavelet function; For the first The center frequency of the scale controls the main oscillation frequency of the wavelet function; This represents an exponential function used to construct the envelope shape of wavelets; This represents the cosine function, used to provide the oscillatory characteristics of wavelets;

[0155] A2: Generate an adaptive frequency band weight matrix

[0156] Based on the local features of the input stress data, an adaptive weight vector for each frequency band is generated by calculating the learnable parameter vector and the original stress time series data. This weight vector is then mapped to the zero-to-one interval using an activation function to normalize the weights, thereby enhancing the features of key frequency bands and suppressing noise interference. This can be expressed as:

[0157]

[0158] In the formula, Indicates the first An adaptive weight vector for the scale frequency band, used to enhance key frequency band features and suppress noise, has a length of T; is the first learnable parameter vector, used to extract the frequency band characteristics of the input data, with a length of T; For the first The original stress time series data of each sample, with a length of T; This represents the length of the time series, i.e., the number of time steps. As the activation function, the output is mapped to the (0,1) interval to achieve the normalized product of the weights;

[0159] A3: Perform weighted continuous wavelet transform

[0160] By combining adjustable wavelet basis functions with adaptive weight vectors, a weighted continuous wavelet transform is applied to the original stress data. Through element-wise multiplication and scale summation operations, a feature tensor containing multi-scale time-frequency information is obtained, expressed as:

[0161]

[0162] In the formula, This represents the decomposed time-frequency feature tensor, which contains multi-scale time-frequency information and has a dimension of . ; This is a continuous wavelet transform operation used to convert time-series data to the time-frequency domain; This represents the Hadamard product, which is the product of elements. The total number of wavelet scales controls the number of scales used in the decomposition.

[0163] S3: Construction and Training of a Foundation Pit Collapse Risk Prediction Model

[0164] The extracted multi-scale time-frequency features are input into the constructed foundation pit collapse risk prediction model for training.

[0165] The construction of the foundation pit collapse risk prediction model includes:

[0166] B1: Attention-Guided Spatiotemporal Noise Reduction

[0167] In stress monitoring data, equipment noise and actual deformation characteristics are mixed in the time and frequency domain. Conventional threshold denoising methods, while suppressing noise, are prone to losing low-frequency risk characteristics related to foundation pit collapse, making it difficult to meet the needs of both denoising and feature preservation.

[0168] This embodiment calculates the attention weights in the time domain and frequency domain separately through a dual-path attention mechanism, and performs adaptive weighted fusion of time-frequency features to achieve noise suppression and enhance key features related to collapse risk. The specific steps are as follows:

[0169] B1-1: Calculate the temporal attention weights

[0170] By performing a one-dimensional convolution operation on the time axis to extract query and key vectors of time-frequency features, calculating attention scores in the time dimension, and then processing them through scaling and normalization exponential functions, a time-domain attention weight matrix is ​​generated to capture continuous important features in the time dimension, represented as:

[0171]

[0172]

[0173] In the formula, This represents the temporal attention weight matrix, used to emphasize important features that are continuous over time. This represents a one-dimensional convolution operation performed on the time axis, used to extract temporal features; This represents the query vector generated through convolution operations, used to calculate the attention score; This represents the key vector generated through convolution operations, used for matching with the query vector; The dimension scaling factor for the query and key vectors, used to control the distribution of attention weights; The attention score is converted into a probability distribution by using a normalized exponential function;

[0174] B1-2: Calculate the frequency domain attention weights

[0175] Global average pooling is used to compress the temporal dimension of time-frequency features, obtaining a global representation of each frequency band. Then, the saliency weights of each frequency band are calculated using learnable parameter vectors and activation functions to highlight key frequency bands related to collapse risk, as shown below:

[0176]

[0177] In the formula, This represents the frequency domain attention weight vector, used to evaluate the importance of features in different frequency bands; This represents a global average pooling operation, used along the time dimension. Compress the features; This is the second learnable parameter vector, used to calculate the weights for each frequency band; for transpose; The activation function compresses the output value to the (0,1) interval, representing the activation intensity of each frequency band;

[0178] B1-3: Generating Denoising Time-Frequency Features

[0179] The time-domain attention weight matrix and frequency-domain attention weight vector are multiplied element-wise with the original time-frequency feature tensor, and then fused using a dual-path weighted fusion method to highlight important time-frequency regions and suppress noise, resulting in the denoised time-frequency feature tensor, expressed as:

[0180]

[0181] In the formula, The time-frequency feature tensor for denoising has dimensions of . ; This represents the tensor broadcast multiplication operation, which implements the element-wise multiplication of attention weights with feature tensors.

[0182] B2: Weighted weighting of dynamic feature importance

[0183] The contribution of stress characteristics at different sensor locations to the risk of foundation pit collapse varies significantly. Conventional equal-weighted feature input methods cannot accurately reflect the importance of each feature, resulting in insufficient sensitivity of the model to key signals.

[0184] This embodiment calculates the feature importance vector through a differentiable feature selection gate mechanism, and performs channel weighting on the noise reduction time-frequency features to highlight key frequency band features and suppress interference from redundant or noise features. The specific steps are as follows:

[0185] B2-1: Calculate the feature importance vector

[0186] The denoising time-frequency feature tensor is flattened into a one-dimensional vector, mapped to the importance score space through a learnable parameter matrix, and then transformed into a sparse probability distribution through a sparse maximization activation function. This generates a feature importance vector representing the contribution weight of each frequency band feature to the classification, expressed as:

[0187]

[0188] In the formula, Indicates the first The feature importance vector of each sample, whose element values ​​represent the contribution weight of each frequency band feature to the collapse risk classification; This indicates a tensor flattening operation, which flattens the input tensor. Convert to dimension A one-dimensional vector; The third learnable parameter matrix is ​​used to map the flattened feature vectors to... The importance score space has a dimension of 1. ; for transpose; The sparse maximization activation function transforms the input vector into a sparse probability distribution, thereby enabling feature selection.

[0189] B2-2: Perform feature channel weighting

[0190] The feature importance vector is channel-weighted with the denoised time-frequency feature tensor. By multiplying each element of the importance vector by the feature values ​​of all time steps of the corresponding frequency band, the representation strength of key frequency band features is enhanced, and the influence of unimportant features is suppressed. This can be expressed as:

[0191]

[0192] In the formula, This represents the weighted time-frequency feature tensor, which serves as the input to subsequent network modules; This represents a feature channel weighting operation, which assigns weights to the importance vector. Each element in The tensor is the product of the eigenvalues ​​of all time steps corresponding to the frequency band.

[0193] B3: Improved residual timing unit

[0194] Conventional LSTM or GRU elements are unable to effectively capture the complex relationship between long-term dependencies and abrupt changes in stress data, and cannot simultaneously model the gradual trend and sudden stress change signals during the deformation process of the foundation pit, thus limiting the ability to provide early risk warnings.

[0195] This embodiment designs a residual temporal unit with a dual-gating mechanism, utilizing trend gating and abrupt change gating to capture slow and abrupt changes respectively. Combined with layer normalization, it improves training stability and enhances the ability to model complex temporal patterns. The specific steps are as follows:

[0196] B3-1: Calculate the trend gating value

[0197] The hidden state from the previous time step is concatenated with the current input features. A trend gating vector is calculated using a learnable weight matrix and bias, and then processed by an activation function to control the proportion of gradual transformation features that pass through. This is expressed as:

[0198]

[0199] In the formula, This represents the trend gating vector, used to control the proportion of gradual deformation features that can pass through. The weight matrix for trend gating is used to learn the combined relationship between hidden states and input features; This indicates that the previous state will be hidden. With the current input Perform the splicing operation; This is the bias vector for trend gating, used to adjust the baseline level of the gating value; for The input features at time step are derived from the output of the dynamic feature importance weighting step. ; for The hidden state at any given moment;

[0200] B3-2: Calculating the mutation gating value

[0201] The acceleration characteristics of stress change are represented by calculating the absolute value of the second-order difference of the input features. Then, the abrupt change gating vector is calculated using a learnable weight matrix and bias. After processing with an activation function, the abrupt change features in the stress data are detected and enhanced, as shown below:

[0202]

[0203] In the formula, This represents a mutation gating vector, used to detect and enhance mutation features in stress data; This represents the absolute value of the second-order difference of the input feature, used to characterize the acceleration feature of stress change; The weight matrix for mutation gating is used to learn the mapping relationship of mutation features and is a trainable parameter. The bias vector for mutation gating is a trainable parameter;

[0204] B3-3: Update cell state

[0205] Combining the outputs of trend gating and mutation gating, the gradual change features and mutation features are weighted separately, and the cell state at the current time step is updated through a weighted fusion method, serving as the internal memory state of the unit, represented as:

[0206]

[0207] In the formula, express The cell state is constantly updated, serving as the unit's internal memory state. The hyperbolic tangent activation function compresses the input values ​​to the (-1, 1) interval; The weight matrix for updating cell states;

[0208] B3-4: Output hidden state

[0209] The updated cell state is added to the previous hidden state adjusted by the residual connection weight matrix, and then the current hidden state is output through layer normalization, represented as:

[0210]

[0211] In the formula, express The hidden state output at each time step is used as the input for subsequent network layers; The representation layer normalization operation is used to improve training stability and convergence speed; This is the weight matrix for the residual connection, used to adjust the contribution ratio of the hidden state in the previous time step.

[0212] B4: Multi-scale Risk Characteristic Pyramid

[0213] The process of foundation pit collapse involves a multi-stage evolution from slow settlement to accelerated failure. Modeling methods with a single time scale are difficult to fully capture the dynamics of the entire process, which can easily lead to early missed detections or delayed warnings.

[0214] This embodiment extracts features at different temporal resolutions by stacking improved residual temporal unit blocks, and achieves multi-scale feature fusion through upsampling and stitching operations to cover the dynamic features of the entire collapse process. The specific steps are as follows:

[0215] B4-1: Multi-scale Feature Extraction

[0216] The residual temporal unit blocks improved by three-layer stacking downsample the weighted features with different time lengths, progressively extracting low-temporal-resolution feature maps to capture long-term slow-changing trends, medium-temporal-resolution feature maps to capture mid-term evolutionary features, and high-temporal-resolution feature maps to retain short-term detailed information, represented as:

[0217]

[0218]

[0219]

[0220] In the formula, This indicates the first stacked improved residual timing cell block, which consists of multiple improved residual timing cells, and is time-downsampled with a step size of 4. This indicates the second stacked improved residual timing unit block, which consists of multiple improved residual timing units and is time-downsampled with a step size of 2. This indicates the third stacked improved residual timing unit block, which consists of multiple improved residual timing units and performs time downsampling with a stride of 1; stride indicates the step size in the time dimension, controlling the downsampling ratio; It generates low-temporal-resolution feature maps to capture long-term, slowly changing trends. This is a feature map with medium temporal resolution, capturing mid-term evolutionary features; To preserve short-term details in high temporal resolution feature maps;

[0221] B4-2: Multi-scale feature fusion

[0222] High-level features are upsampled along the temporal dimension to match the temporal resolution of mid-level features, and low-level features are averaged and pooled along the temporal dimension to compress the temporal dimension. Finally, these three features are concatenated along the feature dimension to form a feature tensor that integrates multi-scale information, represented as:

[0223]

[0224] In the formula, For the time dimension upsampling operation, The time resolution has been improved to the same level as Consistent; For time-dimensional average pooling operations, compression The time dimension is used to match the fusion requirements; This indicates a concatenation operation along the feature dimension; To fuse multi-scale feature tensors.

[0225] B5: Adaptive Class Equalization Loss

[0226] The task of classifying the risk of foundation pit collapse has a serious class imbalance problem, with normal samples far outnumbering risk samples. Conventional cross-entropy loss function will cause the model to be biased towards the majority class and will not learn enough about the minority class samples.

[0227] This embodiment adjusts the loss function by calculating class frequency weights and adaptive weights for difficult samples, making the model training process pay more attention to minority class samples and samples that are difficult to classify, thereby improving the overall classification performance. The specific steps are as follows:

[0228] B5-1: Calculating Category Frequency Weights

[0229] The class frequency is calculated based on the number of samples of each class in the training set. Then, the basic weight of each class is obtained by adding a minimal constant to the reciprocal of the square root of the frequency. This weight is used to balance the contribution of different classes to the loss function, and is expressed as follows:

[0230]

[0231] In the formula, This is a category index, representing different categories in a classification task; Let c be the number of samples of the c-th class in the training set, i.e., the class frequency; It is a very small constant used to prevent the denominator from being zero, thus ensuring numerical stability; The calculated base weight for the c-th category is inversely proportional to the square root of the category frequency;

[0232] B5-2: Calculating Adaptive Weights for Hard Samples

[0233] Based on the model's predicted probabilities for each category of each sample, adaptive weights for difficult samples are calculated using an exponential function and a temperature hyperparameter. Samples with lower predicted probabilities have higher weights, allowing the model to focus on samples that are difficult to classify. This is expressed as:

[0234]

[0235] In the formula, For the model to the first The predicted probability that a sample belongs to the c-th category; This is a temperature hyperparameter used to control the distribution of weights for difficult samples; it is preferably set to 0.2. For the first The hard sample adaptive weights for each sample in the c-th class, the values ​​of which vary with... The decrease increases; For the model to the first The sample belongs to the first Predicted probability of the category; Total number of categories;

[0236] B5-3: Calculate the final loss value

[0237] Combining class frequency weights and hard sample adaptive weights, the logarithms of the predicted probabilities for each class of each sample are weighted and summed to obtain the adaptive class balance loss value, which serves as the objective function for model training, expressed as:

[0238]

[0239] In the formula, The total number of samples in a training batch; For the model to the first The logarithm of the true class predicted probability for each sample; This is the calculated adaptive class equilibrium loss value.

[0240] B6: Uncertainty Calibration Output

[0241] The data on foundation pit stress monitoring are subject to inherent uncertainties due to factors such as sensor errors and environmental interference. Conventional classification models only output category probabilities and cannot provide a measure of prediction reliability, which may lead to misjudgments in high-risk early warnings.

[0242] This embodiment constructs a dual-branch output structure to simultaneously predict class probabilities and variances, uses variance-calibrated loss terms to quantify prediction uncertainty, and finally outputs the risk level and its corresponding confidence level, thereby improving the reliability of the prediction results. The specific steps are as follows:

[0243] B6-1: Two-branch prediction output

[0244] The multi-scale features are fed into a two-branch multilayer perceptron. One branch outputs a class probability prediction vector, and the other branch outputs a prediction variance vector for each class. This is used to quantify the uncertainty of the model for each prediction result, and is expressed as follows:

[0245]

[0246] In the formula, For the first Each sample, after undergoing feature vector fusion via a multi-scale feature pyramid, serves as the input to a two-branch multilayer perceptron. It is a two-branch multilayer perceptron, containing a shared low-level feature extraction layer and two independent output heads; This is the class probability vector output by the model; The prediction variance vector output by the model quantifies the uncertainty of the model's predictions for each category.

[0247] B6-2: Calculation of Calibration Loss Due to Uncertainty

[0248] Based on the adaptive class balance loss, the L2 norm squared of the difference between the prediction variance and the prediction correctness indicator function is added as a variance calibration term. By balancing the two terms through weighting coefficients, the total loss function is obtained, expressed as:

[0249]

[0250] In the formula, This is an indicator function; the function value is 1 when the condition inside the parentheses is met, and 0 otherwise. For the first The true category label of each sample; For the model to the first The predicted category for each sample; This is a weighting coefficient used to balance the importance of the classification loss and the variance calibration term; it is preferably set to 0.3. This is the final total loss function; The square of the L2 norm;

[0251] B6-3: Risk Level and Confidence Level Output

[0252] The category index corresponding to the highest probability in the category probability vector is taken as the risk level classification result, and the prediction variance corresponding to that category is converted into a confidence metric as an assessment of the reliability of the prediction result, expressed as:

[0253]

[0254]

[0255] In the formula, Indicates taking the probability vector The category index corresponding to the highest probability value is used as the final risk level classification result; That is, the category corresponding to the highest probability; For category The corresponding prediction variance.

[0256] The training of the foundation pit collapse risk prediction model includes iterative training and parameter updates, specifically:

[0257] The model training uses mini-batch gradient descent for iterative optimization, and the specific process is as follows:

[0258] First, all learnable parameters are initialized, and the Xavier method is used to ensure that the parameter distribution is reasonable. In each iteration, batch samples (batch size set to 32) are randomly selected from the training set and input into the foundation pit collapse risk prediction model. The adaptive time-frequency feature decomposition, attention-guided noise reduction, dynamic feature weighting, residual temporal unit processing, multi-scale feature fusion and dual-branch prediction output are executed in sequence.

[0259] Based on the adaptive class balance loss and uncertainty calibration loss defined in step B6, the total loss value is calculated. The gradient of this loss is calculated through the backpropagation algorithm, and the parameters are updated using the Adam optimizer. The learning rate is initially set to 0.001, and a learning rate decay strategy (such as decaying to 90% of the original value every 10 rounds) is used to improve convergence stability.

[0260] After the parameters are updated, evaluate the model performance on an independent validation set and monitor key metrics such as classification accuracy, recall and F1 score.

[0261] There are two ways to determine when to stop iteration: one is to preset the maximum number of iterations (e.g., 200 iterations), and the other is an early stopping mechanism, that is, when the validation loss does not decrease for 10 consecutive iterations (tolerance set to 0.001) or the performance index tends to stabilize, training is terminated to avoid overfitting.

[0262] After training is complete, the final model parameters are saved as a weight file for subsequent prediction tasks.

[0263] S4: Based on the real-time collected foundation pit stress monitoring data, the prediction results are output through the trained foundation pit collapse risk prediction model. The specific steps are as follows:

[0264] First, the stress sensors deployed on-site collect new stress monitoring data in real time. This data undergoes the same preprocessing as in the training phase (including sampling frequency alignment and standardization) to form the original stress time series input.

[0265] Then, the input data is processed by performing adaptive time-frequency feature decomposition to extract multi-scale dynamic features, attention-guided spatiotemporal denoising to suppress noise interference, and key frequency bands are highlighted by dynamic feature importance weighting. Improved residual time-series units and multi-scale feature pyramids are then input to capture long-term and short-term evolution patterns.

[0266] The processed feature vector is input into the dual-branch output structure, which simultaneously predicts the risk class probability and variance.

[0267] Finally, based on the uncertainty calibration output mechanism in step B6, the index corresponding to the highest probability in the category probability vector is taken as the risk level classification result (such as normal, mild risk, or severe risk), and the prediction variance corresponding to the category is converted into a confidence value.

[0268] The prediction results are displayed in real time on the monitoring platform. Combined with threshold alarms (such as triggering a verification mechanism when the confidence level is below 0.8), visual early warnings are provided to engineering managers to assist in decision-making. The entire process is automated and supports batch or streaming data processing, ensuring continuous intelligent monitoring and timely intervention of the foundation pit's safety status.

[0269] Example 2:

[0270] To verify the effectiveness and efficacy of the method of the present invention, the following comparative experiments and analyses were conducted in this embodiment:

[0271] Experiment 1: Conduct a comparative analysis of recall rates for different risk categories, focusing on the model's sensitivity in identifying three risk states, and specifically verifying its ability to capture key risks (mild / severe). The results obtained include... Figure 2 The comparative data shown depicts three risk states on the horizontal axis: normal, low risk, and high risk; the vertical axis, recall, measures the model's ability to identify true risks, and avoiding false negatives is crucial for engineering safety. Figure 2 As shown in the four sets of bar charts, for normal conditions, the recall rates of all methods exceed 0.8 (this technology reaches over 0.9); however, for mild risk, the recall rate of conventional methods is only in the range of 0.65-0.75, while this invention improves it to around 0.85; in the most important severe risk detection, this invention (0.82) improves by nearly 30% compared to the Long Short-Term Memory network (0.63). The significant difference in bar height intuitively reflects the role of the dynamic feature importance weighting mechanism, which enhances the key frequency band signal through the differentiable feature selection gate, thus solving the deficiency of conventional methods in learning minority class samples.

[0272] Experiment 2: Conduct a comparative analysis of the prediction confidence distribution to verify the effectiveness of the uncertainty calibration mechanism and evaluate the reliability of the prediction results. Obtain, for example... Figure 3 The comparative data shown illustrates this: the horizontal axis represents the prediction confidence level (0.4-1.0 range), indicating the model's confidence in its own predictions; the vertical axis density reflects the probability distribution of different confidence levels. The kernel density curves show that the correct predictions (blue solid line) of the method in this invention exhibit a peak distribution, with the peak value around 0.85, concentrated in the high confidence (>0.8) region; its incorrect predictions (orange solid line) are distributed in the low-value region around 0.55. In contrast, the conventional method (dashed line) shows that the peak value of correct predictions is only 0.75, and it largely overlaps with the incorrect prediction curve in the 0.6-0.7 range. This significant separation demonstrates the effectiveness of the variance prediction branch in the dual-branch output structure, which simultaneously outputs confidence levels when predicting risk levels, allowing low-confidence predictions to trigger a manual review mechanism.

[0273] Experiment 3: A comparison of convergence characteristics during the training process was conducted. Line graphs were used to illustrate the changes in loss values ​​for different methods during training, and the convergence speed and stability of each method were analyzed. The results obtained were as follows: Figure 4 The comparison data shown uses the horizontal axis to represent the training epochs, indicating the iterative process of model training; and the vertical axis to represent the loss value, reflecting the difference between the model's predictions and the actual values. A lower loss value indicates a better model fit. Figure 4As can be observed from the loss curves, the loss curve of the method described in this invention is consistently at the bottom and exhibits the fastest convergence speed. In the early stages of training, all methods show relatively high loss values, but the loss value of the method described in this invention decreases most rapidly, indicating that its optimization process is more efficient. More importantly, the loss curve of the method described in this invention is smoother and more stable with less fluctuation, while the curves of conventional methods exhibit more oscillations and uncertainty. This demonstrates the effectiveness of the adaptive class balance loss and uncertainty calibration mechanism in this invention, which can make the training process more stable, avoid overfitting, and ultimately achieve better convergence results.

[0274] Experiment 4: Comparison of time series prediction performance. The experiment uses line graphs to visually compare the prediction performance of different methods on stress time series. The results obtained are as follows: Figure 5 The comparison data shown Figure 5 The diagram shows the actual stress values ​​(black curve) and the predicted values ​​of the three methods, with the time periods of risk events marked by red shading. The horizontal axis represents time in minutes, reflecting the continuous process of stress monitoring; the vertical axis represents the stress value in megapascals, reflecting the stress condition of the foundation pit structure. Experimental results show that in the non-risk area (without red shading), the predicted curves of all methods are close to the actual values. However, in the red area where risk events occur, the predicted curve of the method of this invention has the highest fit with the actual values, accurately capturing the key features of sudden stress changes. In contrast, the predicted curves of conventional long short-term memory networks and convolutional neural networks combined with gated recurrent units deviate significantly from the actual values ​​in these areas, either showing delayed response or failing to capture the complete abrupt change. The experiment fully demonstrates the effectiveness of the adaptive time-frequency feature decomposition and attention-guided spatiotemporal noise reduction techniques in the method of this invention, which can effectively identify and enhance risk-related features, suppress noise interference, and thus achieve accurate prediction of risk events.

Claims

1. A method for intelligent prediction of foundation pit collapse risk based on stress monitoring, characterized in that, Includes the following steps: S1: Based on the collected foundation pit stress monitoring data, construct a dataset and divide it into a training set, a validation set, and a test set; S2: Perform adaptive time-frequency feature decomposition on the dataset to achieve dynamic matching of the local frequency domain structure of stress data and effective extraction of multi-scale time-frequency features; S3: Input the extracted multi-scale time-frequency features into the constructed foundation pit collapse risk prediction model for training; S4: Based on the real-time collected foundation pit stress monitoring data, the prediction results are output through the trained foundation pit collapse risk prediction model.

2. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 1, characterized in that, Step S2 specifically includes: A1: Constructing an adjustable Morlet wavelet basis function To address the non-stationary nature of stress data, a set of Morlet wavelet basis functions with adjustable bandwidth and center frequency is constructed to achieve multi-scale time-frequency analysis. These basis functions control the time-domain support width through the bandwidth parameter, control the main oscillation frequency through the center frequency, construct the envelope shape through the exponential function, and provide oscillation characteristics through the cosine function, thus adapting to the time-frequency feature extraction requirements at different scales. This is expressed as: ; In the formula, Indicates the first A basis function at a wavelet scale is used to extract time-frequency features at that scale; The time offset controls the translation position of the wavelet function on the time axis; For the first The bandwidth parameter of the scale controls the time-domain support width of the wavelet function; For the first The center frequency of the scale controls the main oscillation frequency of the wavelet function; This represents an exponential function used to construct the envelope shape of wavelets; This represents the cosine function, used to provide the oscillatory characteristics of wavelets; A2: Generate an adaptive frequency band weight matrix Based on the local features of the input stress data, an adaptive weight vector for each frequency band is generated by calculating the learnable parameter vector and the original stress time series data. This weight vector is then mapped to the zero-to-one interval using an activation function to normalize the weights, thereby enhancing the features of key frequency bands and suppressing noise interference. This can be expressed as: ; In the formula, Indicates the first An adaptive weight vector for the scale frequency band, used to enhance key frequency band features and suppress noise, has a length of T; is the first learnable parameter vector, used to extract the frequency band characteristics of the input data, with a length of T; For the first The original stress time series data of each sample, with a length of T; This represents the length of the time series, i.e., the number of time steps. As the activation function, the output is mapped to the (0,1) interval to achieve the normalized product of the weights; A3: Perform weighted continuous wavelet transform By combining adjustable wavelet basis functions with adaptive weight vectors, a weighted continuous wavelet transform is applied to the original stress data. Through element-wise multiplication and scale summation operations, a feature tensor containing multi-scale time-frequency information is obtained, expressed as: ; In the formula, This represents the decomposed time-frequency feature tensor, which contains multi-scale time-frequency information and has a dimension of . ; This is a continuous wavelet transform operation used to convert time-series data to the time-frequency domain; This represents the Hadamard product, which is the product of elements. The total number of wavelet scales controls the number of scales used in the decomposition.

3. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 1, characterized in that, The construction of the foundation pit collapse risk prediction model in step S3 includes: B1: Attention-Guided Spatiotemporal Noise Reduction By calculating the attention weights in the time domain and frequency domain respectively through a dual-path attention mechanism, the time-frequency features are adaptively weighted and fused to achieve noise suppression and enhance key features related to collapse risk. B2: Weighted weighting of dynamic feature importance The feature importance vector is calculated by using a differentiable feature selection gate mechanism, and the time-frequency features of the noise reduction are channel-weighted to highlight key frequency band features and suppress interference from redundant or noise features. B3: Improved residual timing unit By designing a dual-gated residual time series unit, trend gating and mutation gating are used to capture slow and abrupt features respectively. Combined with layer normalization operation, the training stability is improved and the ability to model complex time series patterns is enhanced. B4: Multi-scale Risk Characteristic Pyramid Features at different temporal resolutions are extracted by stacking improved residual temporal unit blocks, and multi-scale feature fusion is achieved through upsampling and stitching operations to cover the dynamic features of the entire collapse process. B5: Adaptive Class Equalization Loss The loss function is adjusted by calculating the class frequency weight and the hard sample adaptive weight; B6: Uncertainty Calibration Output By constructing a dual-branch output structure to simultaneously predict class probability and variance, and using variance-calibrated loss terms to quantify prediction uncertainty, the final output is the risk level and its corresponding confidence level.

4. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 3, characterized in that, Step B1 specifically includes: B1-1: Calculate the temporal attention weights By performing a one-dimensional convolution operation on the time axis to extract query and key vectors of time-frequency features, calculating attention scores in the time dimension, and then processing them through scaling and normalization exponential functions, a time-domain attention weight matrix is ​​generated to capture continuous important features in the time dimension, represented as: ; ; In the formula, This represents the temporal attention weight matrix, used to emphasize important features that are continuous over time. This represents a one-dimensional convolution operation performed on the time axis, used to extract temporal features; This represents the query vector generated through convolution operations, used to calculate the attention score; This represents the key vector generated through convolution operations, used for matching with the query vector; The dimension scaling factor for the query and key vectors, used to control the distribution of attention weights; The attention score is converted into a probability distribution by using a normalized exponential function; B1-2: Calculate the frequency domain attention weights Global average pooling is used to compress the temporal dimension of time-frequency features, obtaining a global representation of each frequency band. Then, the saliency weights of each frequency band are calculated using learnable parameter vectors and activation functions to highlight key frequency bands related to collapse risk, as shown below: ; In the formula, This represents the frequency domain attention weight vector, used to evaluate the importance of features in different frequency bands; This represents a global average pooling operation, used along the time dimension. Compress the features; This is the second learnable parameter vector, used to calculate the weights for each frequency band; for transpose; The activation function compresses the output value to the (0,1) interval, representing the activation intensity of each frequency band; B1-3: Generating Denoising Time-Frequency Features The time-domain attention weight matrix and frequency-domain attention weight vector are multiplied element-wise with the original time-frequency feature tensor, and then fused using a dual-path weighted fusion method to highlight important time-frequency regions and suppress noise, resulting in the denoised time-frequency feature tensor, expressed as: ; In the formula, The time-frequency feature tensor for denoising has dimensions of . ; This represents the tensor broadcast multiplication operation, which implements the element-wise multiplication of attention weights with feature tensors.

5. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 4, characterized in that, Step B2 specifically includes: B2-1: Calculate the feature importance vector The denoising time-frequency feature tensor is flattened into a one-dimensional vector, mapped to the importance score space through a learnable parameter matrix, and then transformed into a sparse probability distribution through a sparse maximization activation function. This generates a feature importance vector representing the contribution weight of each frequency band feature to the classification, expressed as: ; In the formula, Indicates the first The feature importance vector of each sample, whose element values ​​represent the contribution weight of each frequency band feature to the collapse risk classification; This indicates a tensor flattening operation, which flattens the input tensor. Convert to dimension A one-dimensional vector; The third learnable parameter matrix is ​​used to map the flattened feature vectors to... The importance score space has a dimension of 1. ; for transpose; The sparse maximization activation function transforms the input vector into a sparse probability distribution, thereby enabling feature selection. B2-2: Perform feature channel weighting The feature importance vector is channel-weighted with the denoised time-frequency feature tensor. By multiplying each element of the importance vector by the feature values ​​of all time steps of the corresponding frequency band, the representation strength of key frequency band features is enhanced, and the influence of unimportant features is suppressed. This can be expressed as: ; In the formula, This represents the weighted time-frequency feature tensor, which serves as the input to subsequent network modules; This represents a feature channel weighting operation, which assigns weights to the importance vector. Each element in The tensor is the product of the eigenvalues ​​of all time steps corresponding to the frequency band.

6. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 5, characterized in that, Step B3 specifically includes: B3-1: Calculate the trend gating value The hidden state from the previous time step is concatenated with the current input features. A trend gating vector is calculated using a learnable weight matrix and bias, and then processed by an activation function to control the proportion of gradual transformation features that pass through. This is expressed as: ; In the formula, This represents the trend gating vector, used to control the proportion of gradual deformation features that can pass through. The weight matrix for trend gating is used to learn the combined relationship between hidden states and input features; This indicates that the previous state will be hidden. With the current input Perform the splicing operation; This is the bias vector for trend gating, used to adjust the baseline level of the gating value; for The input features at time step are derived from the output of the dynamic feature importance weighting step. ; for The hidden state at any given moment; B3-2: Calculating the mutation gating value The acceleration characteristics of stress change are represented by calculating the absolute value of the second-order difference of the input features. Then, the abrupt change gating vector is calculated using a learnable weight matrix and bias. After processing with an activation function, the abrupt change features in the stress data are detected and enhanced, as shown below: ; In the formula, This represents a mutation gating vector, used to detect and enhance mutation features in stress data; This represents the absolute value of the second-order difference of the input feature, used to characterize the acceleration feature of stress change; The weight matrix for mutation gating is used to learn the mapping relationship of mutation features and is a trainable parameter. The bias vector for mutation gating is a trainable parameter; B3-3: Update cell state Combining the outputs of trend gating and mutation gating, the gradual change features and mutation features are weighted separately, and the cell state at the current time step is updated through a weighted fusion method, serving as the internal memory state of the unit, represented as: ; In the formula, express The cell state is constantly updated, serving as the unit's internal memory state. The hyperbolic tangent activation function compresses the input values ​​to the (-1, 1) interval; The weight matrix for updating cell states; B3-4: Output hidden state The updated cell state is added to the previous hidden state adjusted by the residual connection weight matrix, and then the current hidden state is output through layer normalization, represented as: ; In the formula, express The hidden state output at each time step is used as the input for subsequent network layers; The representation layer normalization operation is used to improve training stability and convergence speed; This is the weight matrix for the residual connection, used to adjust the contribution ratio of the hidden state in the previous time step.

7. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 6, characterized in that, Step B4 specifically includes: B4-1: Multi-scale Feature Extraction The residual temporal unit blocks improved by three-layer stacking downsample the weighted features with different time lengths, progressively extracting low-temporal-resolution feature maps to capture long-term slow-changing trends, medium-temporal-resolution feature maps to capture mid-term evolutionary features, and high-temporal-resolution feature maps to retain short-term detailed information, represented as: ; ; ; In the formula, This indicates the first stacked improved residual timing cell block, which consists of multiple improved residual timing cells, and is time-downsampled with a step size of 4. This indicates the second stacked improved residual timing unit block, which consists of multiple improved residual timing units and is time-downsampled with a step size of 2. This indicates the third stacked improved residual timing unit block, which consists of multiple improved residual timing units and performs time downsampling with a stride of 1; stride indicates the step size in the time dimension, controlling the downsampling ratio; It generates low-temporal-resolution feature maps to capture long-term, slowly changing trends. This is a feature map with medium temporal resolution, capturing mid-term evolutionary features; To preserve short-term details in high temporal resolution feature maps; B4-2: Multi-scale feature fusion High-level features are upsampled along the temporal dimension to match the temporal resolution of mid-level features, and low-level features are averaged and pooled along the temporal dimension to compress the temporal dimension. Finally, these three features are concatenated along the feature dimension to form a feature tensor that integrates multi-scale information, represented as: ; In the formula, For the time dimension upsampling operation, The time resolution has been improved to the same level as Consistent; For time-dimensional average pooling operations, compression The time dimension is used to match the fusion requirements; This indicates a concatenation operation along the feature dimension; To fuse multi-scale feature tensors.

8. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 7, characterized in that, Step B5 specifically includes: B5-1: Calculating Category Frequency Weights The class frequency is calculated based on the number of samples of each class in the training set. Then, the basic weight of each class is obtained by adding a minimal constant to the reciprocal of the square root of the frequency. This weight is used to balance the contribution of different classes to the loss function, and is expressed as follows: ; In the formula, This is a category index, representing different categories in a classification task; Let c be the number of samples of the c-th class in the training set, i.e., the class frequency; It is a very small constant used to prevent the denominator from being zero, thus ensuring numerical stability; The calculated base weight for the c-th category is inversely proportional to the square root of the category frequency; B5-2: Calculating Adaptive Weights for Hard Samples Based on the model's predicted probabilities for each category of each sample, the adaptive weights for hard samples are calculated using an exponential function and the temperature hyperparameter, expressed as: ; In the formula, For the model to the first The predicted probability that a sample belongs to the c-th category; This is a temperature hyperparameter used to control the distribution of weights for hard samples; For the first The hard sample adaptive weights for each sample in the c-th class, the values ​​of which vary with... The decrease increases; For the model to the first The sample belongs to the first Predicted probability of the category; Total number of categories; B5-3: Calculate the final loss value Combining class frequency weights and hard sample adaptive weights, the logarithms of the predicted probabilities for each class of each sample are weighted and summed to obtain the adaptive class balance loss value, which serves as the objective function for model training, expressed as: ; In the formula, The total number of samples in a training batch; For the model to the first The logarithm of the true class predicted probability for each sample; This is the calculated adaptive class equilibrium loss value.

9. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 8, characterized in that, Step B6 specifically includes: B6-1: Two-branch prediction output The multi-scale features are fed into a two-branch multilayer perceptron. One branch outputs a class probability prediction vector, and the other branch outputs a prediction variance vector for each class. This is used to quantify the uncertainty of the model for each prediction result, and is expressed as follows: ; In the formula, For the first Each sample, after undergoing feature vector fusion via a multi-scale feature pyramid, serves as the input to a two-branch multilayer perceptron. It is a two-branch multilayer perceptron, containing a shared low-level feature extraction layer and two independent output heads; This is the class probability vector output by the model; The prediction variance vector output by the model quantifies the uncertainty of the model's predictions for each category. B6-2: Calculation of Calibration Loss Due to Uncertainty Based on the adaptive class balance loss, the L2 norm squared of the difference between the prediction variance and the prediction correctness indicator function is added as a variance calibration term. By balancing the two terms through weighting coefficients, the total loss function is obtained, expressed as: ; In the formula, This is an indicator function; the function value is 1 when the condition inside the parentheses is met, and 0 otherwise. For the first The true category label of each sample; For the model to the first The predicted category for each sample; These are weighting coefficients used to balance the importance of the classification loss and the variance calibration term; This is the final total loss function; The square of the L2 norm; B6-3: Risk Level and Confidence Level Output The category index corresponding to the highest probability in the category probability vector is taken as the risk level classification result, and the prediction variance corresponding to that category is converted into a confidence metric as an assessment of the reliability of the prediction result, expressed as: ; ; In the formula, Indicates taking the probability vector The category index corresponding to the highest probability value is used as the final risk level classification result; That is, the category corresponding to the highest probability; For category The corresponding prediction variance.

10. The intelligent prediction method for foundation pit collapse risk based on stress monitoring according to claim 9, characterized in that, The training of the foundation pit collapse risk prediction model in step S3 includes iterative training and parameter updates, specifically: The model training uses mini-batch gradient descent for iterative optimization, and the specific process is as follows: First, initialize all learnable parameters and use the Xavier method to ensure that the parameter distribution is reasonable; in each iteration, randomly select batch samples from the training set and input them into the foundation pit collapse risk prediction model. Based on the adaptive class balance loss and uncertainty calibration loss defined in step B6, the total loss value is calculated. The gradient of this loss is calculated through the backpropagation algorithm, and the parameters are updated using the Adam optimizer. A learning rate decay strategy is also used to improve convergence stability. After the parameters are updated, evaluate the model performance on an independent validation set and monitor key metrics. After training is complete, the final model parameters are saved as a weight file for subsequent prediction tasks.

Citation Information

Cited By

  • Dam operation state intelligent prediction method based on feature fusion and model migration

    CN122196556A