A surrounding rock stability prediction method based on hybrid spatiotemporal self-attention mechanism
Through the surrounding rock stability prediction method of mixed space-time self-attention mechanism, the problems of high computational complexity and improper feature correlation processing in the existing technology are solved, and high-precision surrounding rock stability prediction and support optimization are achieved, which is suitable for safety evaluation of coal mine tunnels.
Patent Information
- Application Number
- CN202510686496.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The prior art has problems in the prediction of surrounding rock stability, high computational complexity, difficult parameter selection, improper feature correlation processing, reduced classification accuracy and poor generalization capabilities of the model, especially in small sample data and noise environments.
The prediction method based on the mixed space-time self-attention mechanism is adopted, and the hybrid space-time self-attention mechanism is constructed, and the geological mixed space-time self-attention mechanism layer is integrated, and the hard physical constraint loss mechanism is designed, the training process is optimized, and the prediction accuracy and calculation efficiency of the model are improved.
It improves the accuracy of surrounding rock stability prediction, reduces computing resource consumption, is suitable for safety evaluation and support optimization design of mining tunnels, and is adapted to existing mine monitoring systems without hardware upgrades.
Smart Images

Figure CN120234694B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of mine safety engineering, and in particular relates to a surrounding rock stability prediction method based on a hybrid spatiotemporal self-attention mechanism. Background Art
[0002] Mining tunnels are crucial passageways for underground mining operations in coal, metal, and other mines. The stability of their surrounding rock directly impacts miner safety and productivity. Insufficient surrounding rock stability can cause tunnel deformation, rock spalling, roof collapse, and even large-scale landslides, leading to serious safety accidents. Without rock stability prediction, mining companies rely on experience or simple geophysical and manual inspection methods to determine the surrounding rock state. Manual judgment can lead to misjudgments due to lack of experience or complex environments. Furthermore, manual survey and analysis are time-consuming, potentially resulting in delayed responses and missed opportunities for reinforcement. Therefore, accurately predicting the stability category of the surrounding rock in mining tunnels helps to proactively implement reinforcement measures, optimize support schemes, reduce accident risks, and improve mine safety and economic efficiency.
[0003] In the field of rock mass stability prediction for mining roadways, three major technologies are used: Support Vector Machines (SVM), Naive Bayes, and Decision Trees. SVM is a prediction method based on statistical learning theory. Its core concept is to construct a hyperplane to optimally predict data. In rock mass stability prediction, this method can find the optimal hyperplane in a high-dimensional feature space, separating different rock mass states. Furthermore, by mapping data into the high-dimensional feature space using kernel functions (such as radial basis functions (RBFs) and polynomial kernels), it makes previously inseparable data separable, thereby improving prediction accuracy. Naive Bayes is a prediction method based on Bayes' theorem, with the core assumption being the independence of all features. This method calculates the posterior probability of rock mass data belonging to each stability category and selects the category with the highest probability as the prediction result. This method has low computational complexity and is suitable for processing long-term monitoring data (such as the massive amounts of data collected by mining rock mass sensors). Decision trees are prediction methods based on a tree structure. Their core concept is to recursively partition a dataset and construct a series of "if-then" rules. In rock mass stability prediction, the system automatically selects the features that best distinguish rock mass stability categories using metrics such as entropy gain, information gain, or the Gini coefficient. Mine engineers can intuitively understand the classification logic of the decision tree, making it easier to adjust based on engineering experience.
[0004] Regarding the three mainstream technologies mentioned above, the defects of existing technologies are as follows: (1) SVM has high computational complexity and is difficult to process large-scale data. Specifically for surrounding rock stability prediction, if the data set is large (such as long-term monitoring data), the training and prediction speed of SVM may be slow. Parameter selection relies on experience. In the problem of surrounding rock stability prediction, the surrounding rock characteristics of different mining areas vary greatly, and the selection of parameters is difficult to be universal. (2) In surrounding rock stability analysis, various characteristics (such as stress, joints and cracks, surrounding rock strength, etc.) are often interrelated. For example, high stress areas are usually accompanied by higher crack density, and the naive Bayesian assumption that these variables are independent of each other may lead to a decrease in classification accuracy. In other words, the distribution of surrounding rock parameters is often complex and may not conform to the standard distribution assumption, thus affecting the classification effect. (3) When dealing with surrounding rock stability prediction, if the amount of training data is small or there is a lot of noise, the decision tree may form an overly complex tree structure, which makes the model's generalization ability on new data worse. If there is a class imbalance in the surrounding rock stability data (e.g., the “stable” class is in the majority and the “unstable” class is less), the decision tree may tend to learn the features of the major classes, resulting in inaccurate predictions for the minority classes (e.g., extremely unstable surrounding rock). Summary of the Invention
[0005] To address these issues, the present invention proposes a surrounding rock stability prediction method based on a hybrid spatiotemporal self-attention mechanism. A hybrid spatiotemporal prediction model is designed, incorporating a geology-based hybrid spatiotemporal self-attention layer into the model construction, acting on the time decay and spatial weight calculation paths within the hybrid spatiotemporal self-attention. During model training, a hard physical constraint loss mechanism is designed to learn and adjust extreme sample predictions to achieve surrounding rock stability prediction. This method effectively exploits deep correlations between parameters and improves prediction accuracy. Furthermore, an optimized training process is employed to accelerate model convergence and reduce computational resource consumption, making it suitable for surrounding rock safety assessment and support optimization design in mining tunnels.
[0006] The technical solutions of the present invention are as follows:
[0007] A surrounding rock stability prediction method based on a hybrid spatiotemporal self-attention mechanism includes the following steps:
[0008] Step 1: Data collection and screening;
[0009] Step 2: Build a hybrid spatiotemporal prediction model; the hybrid spatiotemporal prediction model includes an embedding layer, a hybrid spatiotemporal self-attention mechanism layer, and a classification layer;
[0010] Step 3: Perform supervised learning and iterative training on the hybrid spatiotemporal prediction model, and output the trained model;
[0011] Step 4: Obtain the current coal mine tunnel surrounding rock data in real time, input the trained model, and predict the stability category.
[0012] Furthermore, the specific process of step 1 is:
[0013] Step 1.1: Collect the surrounding rock stability data of the mining roadway in the current coal mine;
[0014] Step 1.2: Select seven parameters as screening indicators: tunnel roof surrounding rock strength, tunnel side surrounding rock strength, tunnel floor surrounding rock strength, mining depth, surrounding rock integrity, mining dynamic pressure in this section, and mining dynamic pressure in adjacent sections;
[0015] Step 1.3: Screen the surrounding rock stability data of the mining roadway of the current coal mine according to the seven parameters, use the mining roadway surrounding rock stability samples obtained after screening as input data, and divide them into training samples and test samples in proportion.
[0016] Furthermore, in step 2, the specific working process of the hybrid spatiotemporal prediction model is as follows:
[0017] Step 2.1: Input the input data into the embedding layer and normalize it to form a high-dimensional input vector ;
[0018] Step 2.2: Perform attention calculation on the high-dimensional input vector based on the hybrid spatiotemporal self-attention mechanism to obtain a weighted feature matrix;
[0019] Step 2.3: Input the weighted feature matrix into the classification layer to obtain the prediction result.
[0020] Furthermore, the specific process of step 2.2 is as follows:
[0021] Step 2.2.1. Define the query weight matrix , key weight matrix , value weight matrix ;
[0022] Step 2.2.2: For the high-dimensional input vector obtained in step 2.1 Perform linear transformation to generate query matrix , key matrix , value matrix , the specific calculation formula is:
[0023] ;
[0024] ;
[0025] ;
[0026] Step 2.2.3: Based on the single-head self-attention mechanism, a time decay factor and a spatial distance weight are established to construct a hybrid spatiotemporal self-attention mechanism. The weighted feature matrix is obtained based on the hybrid spatiotemporal self-attention mechanism. The specific calculation formula is:
[0027] ;
[0028] Where, is the weighted feature matrix; It is a hybrid spatiotemporal self-attention mechanism; 、 、 Time The query matrix, key matrix, and value matrix of is the Softmax function; is the transpose symbol; is the scaling factor; 、 are two different time decay factors; 、 They are different collection timestamps respectively; is the spatial weight coefficient; For time and time The spatial distance between the two measuring points corresponding to .
[0029] Furthermore, in step 2.3, the classification layer uses a fully connected classification head to perform a fully connected calculation to obtain a classification prediction value. The specific process is as follows:
[0030] Step 2.3.1. Create a classification weight matrix right Perform linear transformation to obtain category scores , the formula is:
[0031] ;
[0032] ;
[0033] Where, It is a 7×3 matrix, each row corresponds to an input feature dimension, and each column corresponds to a certain surrounding rock stability category, which are excellent, good, and medium respectively; is the classification weight corresponding to the 7th row and 3rd column;
[0034] The specific calculation method is:
[0035] ;
[0036] ;
[0037] ;
[0038] ;
[0039] Where, 、 、 The scores are divided into three categories: excellent, good and fair; is the 7th weighted feature in the weighted feature matrix;
[0040] Step 2.3.2: Normalize the category scores into probability form. The formula is:
[0041] ;
[0042] ;
[0043] ;
[0044] ;
[0045] Where, is a probability set; 、 、 represent the probabilities of belonging to the categories excellent, good, and fair, respectively;
[0046] Step 2.3.3: Take the category corresponding to the maximum probability as the final surrounding rock stability prediction result , the formula is:
[0047] ;
[0048] in, To take the maximum value.
[0049] Furthermore, in step 3, the training objects include 4: query weight matrix , key weight matrix , value weight matrix , classification weight matrix ;
[0050] Classification weight matrix The training process is:
[0051] Introducing cross entropy loss , the formula is:
[0052] ;
[0053] in, Belong to category probability; is the number of categories; is the true label;
[0054] Introducing gradient descent for adjustment , the formula is:
[0055] ;
[0056] Where, is an update operation; is the learning rate;
[0057] The loss function for model training is:
[0058] ;
[0059] Where, is the total loss function; is the balance weight coefficient; is the norm operation; is the average of the three surrounding rock strengths: the roadway roof surrounding rock strength, the roadway side surrounding rock strength, and the roadway floor surrounding rock strength; is the elastic modulus; For strain; is Poisson's ratio;
[0060] Update the classification weight matrix for the current time step according to the decreasing direction of the total loss function. Each adjustment will generate a new cross-entropy loss. The occurrence of a new cross-entropy loss is considered a training cycle, and the complete training process requires multiple cycles. The judgment criteria for the end of training are: the loss of the dataset decreases by less than 0.001 in several consecutive rounds, or the accuracy of the dataset continues to be higher than 95% and the fluctuation does not exceed ±0.5%.
[0061] Query weight matrix , key weight matrix , value weight matrix The training process and same.
[0062] The beneficial technical effects of this invention include: Considering that traditional methods struggle to capture parameter interactions, this invention introduces a hybrid spatiotemporal self-attention mechanism for the first time into surrounding rock stability prediction, breaking through the interaction modeling bottleneck of traditional algorithms. This invention uses the hybrid spatiotemporal self-attention mechanism to replace the traditional kernel function. The weights of the hybrid spatiotemporal self-attention mechanism automatically quantify the interactions between the four parameters, addressing the drawback of traditional methods that rely on manual feature engineering. This approach eliminates the need for manual kernel design and enhances model adaptability. Building on the single-head self-attention mechanism, a time decay factor and a spatial distance weight are introduced to construct a hybrid spatiotemporal self-attention mechanism, integrating time decay with spatial correlation to better reflect the dynamic characteristics of surrounding rock stability. A "single-layer multi-head attention + fully connected classification head" approach is designed for small sample data, reducing the risk of overfitting. Finally, interpretability is enhanced because the contribution of key parameters (such as mining depth H and dynamic pressure X) to the classification results is clearly defined through visualization of attention weights. The hybrid spatiotemporal self-attention mechanism designed in this invention has a low computational footprint and can be deployed on standard industrial computers. It is compatible with existing mine monitoring systems (such as Intel i5 processors) without requiring additional hardware upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 This is a flow chart of the surrounding rock stability prediction method based on the hybrid spatiotemporal self-attention mechanism of the present invention.
[0064] Figure 2 This is a line chart comparing the accuracy of different models in the experiment of the present invention.
[0065] Figure 3 This is a comparison chart of the loss reduction curves of different models in the experiment of the present invention.
[0066] Figure 4 This is the classification error distribution diagram of different models at different time steps in the experiment of the present invention.
[0067] Figure 5 This is a ROC curve diagram of the model of the present invention used in the experiment of the present invention.
[0068] Figure 6 This is the ROC curve diagram of the support vector machine model used in the experiment of the present invention.
[0069] Figure 7 Graph showing the ROC curve of the logistic regression model used in the experiment of the present invention. DETAILED DESCRIPTION
[0070] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0071] During coal mining, the rock mass around the mining roadway is in a state of mechanical equilibrium under the combined effects of natural stress and mining disturbance. Its stability directly determines whether the roadway will experience damage such as collapse, floor heave, or lateral deformation. Figure 1 As shown in the figure, the present invention proposes a surrounding rock stability prediction method based on a hybrid spatiotemporal self-attention mechanism, which mainly includes the following steps:
[0072] Step 1: Data collection and screening; the specific process is:
[0073] Step 1.1: Collect the surrounding rock stability data of the mining roadway in the current coal mine;
[0074] Step 1.2: Select seven parameters as screening indicators: tunnel roof surrounding rock strength, tunnel side surrounding rock strength, tunnel floor surrounding rock strength, mining depth, surrounding rock integrity, mining dynamic pressure in this section, and mining dynamic pressure in adjacent sections;
[0075] The surrounding rock strength of the roadway roof, sides and floor only refers to the uniaxial compressive strength of the rock, unit: MPa;
[0076] The mining dynamic pressure in this section refers to the ratio of the immediate roof thickness to the coal seam mining height, reflecting the roof support capacity;
[0077] Mining depth refers to the vertical depth of the tunnel from the ground surface, which directly affects the ground pressure. Unit: meter;
[0078] The dynamic pressure of mining in adjacent sections refers to the width of the coal pillar protecting the roadway (X=0 when driving along the goaf, X=100 when driving solid coal);
[0079] Surrounding rock integrity refers to the quantitative index of structural defects such as cracks and faults in the rock layer, with a value range of 0 to 1 (1 means complete).
[0080] Step 1.3: Filter the surrounding rock stability data of the current coal mine's mining roadway according to the seven parameters, obtaining 100 sets of mining roadway surrounding rock stability samples as input data. These samples are divided into training samples and test samples in an 8:1 ratio. The first 80 sets serve as training samples for the model, and the last 20 sets serve as test samples. Table 1 shows examples of the first 30 sets of samples.
[0081] Table 1 Examples of the first 30 groups of samples
[0082] .
[0083] Step 2: Construct a hybrid spatiotemporal prediction model. The hybrid spatiotemporal prediction model includes an embedding layer, a hybrid spatiotemporal self-attention mechanism layer, and a classification layer. The specific working process of the hybrid spatiotemporal prediction model is as follows:
[0084] Step 2.1: To capture potential features, input data into the embedding layer and normalize it to form a high-dimensional input vector. The specific process is as follows:
[0085] The initial input of data is handled by the embedding layer, which normalizes the input data to the interval [0,1] to form a high-dimensional input vector. , this vector is used as the input vector later, is the seventh parameter after normalization. The standard "Min-Max Normalization" method is used for normalization, and the formula is as follows:
[0086] ;
[0087] Where, is the normalized data value, ranging from [0,1]; is the original data value; is the minimum value of the current parameter; is the maximum value of the current parameter;
[0088] Step 2.2: Perform attention calculation on the high-dimensional input vector based on the hybrid spatiotemporal self-attention mechanism to obtain a weighted feature matrix. The specific process is as follows:
[0089] Step 2.2.1. Define the query weight matrix , key weight matrix , value weight matrix The query weight matrix is responsible for mapping the input features to the query vector (Query) for calculating the attention score; the key weight matrix is responsible for mapping the input features to the key vector (Key) for measuring the relevance between the query and the key; the value weight matrix is responsible for mapping the input features to the value vector (Value) for weighted summation to form the final feature representation.
[0090] An example of a query weight matrix is:
[0091] ;
[0092] Where, Query the weight corresponding to the 7th row and 7th column in the weight matrix;
[0093] The structure of the key and value weight matrices is similar. In practice, we use a uniform distribution method called "small random initialization" with all positions in the three weight matrices set to the range [-0.01, 0.01]. For example, the query weight matrix can be generated by calling numpy.random.uniform(-0.01, 0.01, size=(7,7)) or a similar function.
[0094] Step 2.2.2: For the high-dimensional input vector obtained in step 2.1 Perform linear transformation to generate query matrix , key matrix , value matrix , the specific calculation formula is:
[0095] ;
[0096] ;
[0097] ;
[0098] The calculated query matrix, key matrix, and value matrix are still three 1×7 row vectors; for example, ;in, is the 7th element in the query matrix;
[0099] The queries Defined as:
[0100] ;
[0101] in, is the 7th normalized data value; The query weight matrix is the 7th row The weight corresponding to the column; the query sequence number corresponds to the column sequence number;
[0102] Step 2.2.3: The stability of the surrounding rock is affected by dynamic spatiotemporal factors, such as the temporal dimension: the accumulation of ground pressure due to increased mining depth; and the spatial dimension: the stress transfer effect between adjacent measuring points. Existing technologies (such as SVM and Naive Bayes) only focus on static parameter interactions and cannot capture the laws of spatiotemporal evolution. This invention further proposes a "Hybrid Spatio-Temporal Attention Mechanism" designed specifically for geological characteristics. Its technical solution is to establish a time decay factor and a spatial distance weight based on a single-layer self-attention mechanism to model the spatiotemporal evolution characteristics of the surrounding rock parameters.
[0103] According to the theory of single-head self-attention mechanism, calculate the attention score , and then use the Softmax function to normalize the attention score to obtain the interaction weight between parameters , the formula is:
[0104] ;
[0105] ;
[0106] ;
[0107] Where, It is a single-head attention mechanism; is the transpose symbol; is the scaling factor, yes The dimension is 7 in this invention; is the Softmax function, and the calculation formula is:
[0108] ;
[0109] Where, For the Attention score; is the total number of attention scores; It is an exponential operation, which guarantees that the result is non-negative; is the sum of all exponential values, guaranteed to be normalized (sum to 1);
[0110] Softmax is a mathematical function that converts a set of values (logits) into a probability distribution. The Softmax function is typically used to process a set of values and convert them into a probability distribution. However, when there is only a single input value, the Softmax normalization denominator only contains the exponential result of the input value, resulting in a constant output of 1. Therefore, when Softmax is applied to a single value, the result is equivalent to the effect of the unit function.
[0111] Known and are all 1×7 matrices, then Transpose it into a 7×1 matrix, that is, The result is a scalar. Divide by the scaling factor Used to prevent gradient explosion or gradient disappearance. Finally, the Softmax function obviously acts on a single value.
[0112] For the single-head self-attention mechanism, the Softmax function is multiplied by (The final output Attention is the attention weight and ), where weight is a scalar, It is a 1×7 row matrix, so the final output weighted feature is still a 1×7 row matrix. The weighted feature matrix is specifically ; is the 7th weighted feature in the weighted feature matrix.
[0113] On the basis of the single-head self-attention mechanism, a time decay factor and a spatial distance weight are established to construct a hybrid spatiotemporal self-attention mechanism. The weighted feature matrix is obtained based on the hybrid spatiotemporal self-attention mechanism. The specific calculation formula is:
[0114] ;
[0115] Where, It is a hybrid spatiotemporal self-attention mechanism; 、 、 Time The query matrix, key matrix, and value matrix of 、 are two different time decay factors used to control the time decay strength; 、 They are different collection timestamps respectively; is the spatial weight coefficient; For time and time The spatial distance between the two measuring points corresponding to the time;
[0116] The significance of the hybrid spatiotemporal self-attention mechanism lies in: specifically, in light of the present invention, the time decay factor automatically reduces the weight of historical data (for example, reducing the influence of H values from 10 days ago), while the spatial distance weighting enhances parameter interactions between adjacent measurement points (roof and sidewalls), suppressing interference from distant measurement points. This integration of time decay and spatial correlation better captures the dynamic nature of surrounding rock stability, resolving the problem of traditional self-attention methods, which only model parameter interactions while ignoring spatiotemporal correlations. This design, while existing mainstream approaches (such as SVM and Naive Bayesian) are incapable of processing both time series and spatial data, achieves the first-of-its-kind implementation of spatiotemporal joint modeling in surrounding rock prediction.
[0117] Step 2.3: Input the weighted feature matrix into the classification layer to obtain the prediction result. The classification layer uses a fully connected classification head to perform a fully connected calculation to obtain the classification prediction value. The specific process is as follows:
[0118] Step 2.3.1. Create a classification weight matrix right Perform linear transformation to obtain category scores , the formula is:
[0119] ;
[0120] ;
[0121] Where, It is a 7×3 matrix, with each row corresponding to an input feature dimension (a total of seven dimensions, namely, the strength of the surrounding rock of the roadway roof, the strength of the surrounding rock of the roadway sides, the strength of the surrounding rock of the roadway floor, the mining depth, the integrity of the surrounding rock, the dynamic pressure caused by mining in this section, and the dynamic pressure caused by mining in adjacent sections), and each column corresponding to a certain surrounding rock stability category, namely excellent, good, and medium; is the classification weight corresponding to the 7th row and 3rd column;
[0122] The specific calculation method is:
[0123] ;
[0124] ;
[0125] ;
[0126] ;
[0127] Where, 、 、 The scores are divided into three categories: excellent, good and fair;
[0128] Step 2.3.2: Category scores are not comparable and need to be normalized into probability form. The formula is:
[0129] ;
[0130] ;
[0131] ;
[0132] ;
[0133] Where, is a probability set; 、 、 represent the probabilities of belonging to the categories excellent, good, and fair, respectively.
[0134] Step 2.3.3: Take the category corresponding to the maximum probability as the final surrounding rock stability prediction result , the formula is:
[0135] ;
[0136] in, To obtain the maximum value;
[0137] For example, if the calculated probabilities of the excellent, good, and fair categories are 50%, 30%, and 20% respectively, the final prediction result is "excellent".
[0138] Step 3: Perform supervised learning and iterative training on the hybrid spatiotemporal prediction model, and output the trained model;
[0139] The above situation assumes that the output of the model is determined to be "excellent", but when it conflicts with the actual situation, such as the on-site judgment is "good" or "medium", the model of the present invention needs to be trained to maximize the approximation and adapt to the real results, so as to adjust the parameters in the model so that it tends to predict the correct category in the future.
[0140] There are four main training objects: query weight matrix , key weight matrix , value weight matrix , classification weight matrix ;
[0141] The following only shows the classification weight matrix The training process, query weight matrix , key weight matrix , value weight matrix The training process and The training principle is to use the real label and the current model prediction results To calculate the error, training is performed using cross entropy loss and gradient descent, and WFC is continuously adjusted to make the model more accurate in future predictions.
[0142] Using the previous assumptions (not real data values, just for demonstration purposes), the reason why the current model predicts "good" is that the corresponding position ( ) has the highest probability, for example ;
[0143] Assume that the real (actual on-site) category “good” is represented by , meaning "the second position is true";
[0144] Introducing cross entropy loss , the formula is:
[0145] ;
[0146] in, Belong to category probability; is the number of categories. Substitute the example values into: ; The larger the value of the cross entropy loss, the greater the prediction deviation, and vice versa, the more accurate the model prediction.
[0147] Introducing gradient descent for adjustment , the formula is:
[0148] ;
[0149] Where, is an update operation; The learning rate controls the adjustment step size. As a hyperparameter, the learning rate determines how far the weights should be moved towards the target each time they are updated. Too large a value will result in missing the optimal solution, while too small a value will result in too slow training speed. For a medium-sized dataset such as the mining roadway stability data, the initial setting is 0.01. is the cross entropy loss pair The derivative of is used to adjust the direction so that the predicted value More inclined to the true value .
[0150] It is worth noting that when designing the loss function, the present invention refers to the theory of geomechanics and defines a custom equilibrium equation as a constraint condition to ensure that the prediction results conform to physical laws:
[0151] ;
[0152] Where, is the total loss function; is the balance weight coefficient; is the norm operation; is the average of the three surrounding rock strengths: the roadway roof surrounding rock strength, the roadway side surrounding rock strength, and the roadway floor surrounding rock strength; is the elastic modulus; For strain; is Poisson's ratio;
[0153] In order to avoid the physical unreasonable predictions caused by pure data drive, it was decided to hard embed domain knowledge into the model to improve the reliability of the model under extreme working conditions (such as high stress and strong disturbance), that is, to realize the data-physics dual-driven modeling for the first time. Specifically, data drive is based on historical surrounding rock stability data, using deep neural networks to learn the mapping relationship between input and output to achieve classification or prediction tasks. This invention is reflected in the introduction of cross entropy loss in the formula This part. Physical drive is to introduce the balance relationship in geomechanics (strength-stress balance, mining impact) to construct physical constraint terms, forcing the model output to obey the known laws in the engineering context. The present invention is embodied in the construction of geophysical constraint loss terms, corresponding to the formula part.
[0154] In this way, the classification weight matrix of the current time step is updated according to the decreasing direction of the function value of the total loss function Obviously, each adjustment generates a new cross-entropy loss, and the appearance of a new cross-entropy loss is considered a training cycle (Iteration). The complete training process requires multiple cycles. The criteria for judging the end of training are: the dataset loss decreases by less than 0.001 within a number of consecutive epochs (such as 10 rounds), indicating that the model can no longer learn further; or the dataset accuracy remains above 95% and fluctuates within ±0.5%, indicating that the model performance has stabilized.
[0155] To ensure the correct functioning of the tunnel surrounding rock stability prediction model described in this invention, training on a suitable platform is required to optimize model parameters. PyTorch is recommended due to its support for dynamic graph computation, ease of debugging, and GPU parallel computing, enabling more efficient training. For GPU acceleration, an NVIDIA Tesla A100, V100, or RTX 3090 is used, utilizing CUDA for efficient matrix operations. For CPU performance, a minimum of an Intel i7 / i9 or AMD Ryzen 9 processor is recommended.
[0156] Step 4: Obtain the current coal mine tunnel surrounding rock data in real time, input the trained model, and predict the stability category.
[0157] In order to demonstrate the superiority of the present invention, the following comparative experiments were conducted.
[0158] Experiment 1: Accuracy comparison;
[0159] During the experiment, the accuracy comparison line chart served as an important visualization tool, showing the accuracy trends of different models at each training epoch. The purpose of the accuracy comparison line chart is to visually compare the accuracy improvements of the hybrid spatiotemporal prediction model, support vector machine (SVM), and logistic regression model during training. Figure 2 This is the comparison result of the three models. The horizontal axis represents the number of training epochs, starting from 1 and gradually increasing to the maximum round of training. In this experiment, the total number of simulation training rounds is 100, and the horizontal axis shows the training process from round 1 to round 100. Each training round represents the accuracy level achieved by the model after that round of training. The scale of the horizontal axis presents the time dimension of model training, which is convenient for observing the training progress and accuracy changes of each model. The vertical axis represents the accuracy of the model, which is usually a percentage value (0% to 100%). The vertical axis shows the accuracy score of each model after each training round. The accuracy value reflects the prediction accuracy of the model after the training round. High accuracy means that the model can better predict the category of surrounding rock stability in the classification task. Figure 2As shown in the figure, the data points on each broken line correspond to the accuracy of the model after a certain epoch. As the number of training rounds increases, the broken line fluctuates upward or downward, indicating an improvement or decrease in accuracy. Figure 2 It can be seen that the model of the present invention has the highest accuracy.
[0160] Experiment 2: Loss comparison;
[0161] The loss reduction curve comparison chart is a key visualization tool used in this paper to evaluate the loss trends of different models during training. By showing how the training loss of different models (the proposed model, support vector machine (SVM), and naive Bayesian) changes over time (i.e., training epochs), this chart helps visually compare the optimization efficiency of each model during training, thereby analyzing their performance in the task of classifying the surrounding rock stability of a mining roadway. Figure 3 In the figure, the vertical axis represents the loss value, which is a floating value between 0 and a larger value. The loss value measures the size of the error in the model's prediction. The smaller the value, the better the model's prediction effect. As the number of training rounds of the model of the present invention increases, the broken line shows a clear downward trend, indicating that the loss of the model of the present invention gradually decreases, indicating that it has a strong learning ability during the optimization process. Since the training process of SVM requires continuous search for the optimal hyperplane through support vectors and boundary conditions, the process of loss reduction may be relatively gentle, especially in the early stages of training. SVM may show a slow optimization process in the early stage, and the magnitude of loss reduction is small. The loss decline curve of naive Bayes is usually relatively gentle, especially when faced with complex data. The fitting ability of logistic regression is relatively limited, so its loss decline rate is relatively slow, especially in the early stages of training, where large fluctuations may occur.
[0162] Experiment 3: Confusion Matrix;
[0163] The confusion matrix is a common tool used in machine learning and deep learning model evaluation to visually demonstrate the relationship between a classification model's predictions and actual results for each category. To make comparisons between different models for different categories more intuitive, presenting confusion matrix data using a "100% stacked bar chart" effectively provides a deeper understanding of model performance.
[0164] Figure 4 The stacked bar chart shows the classification error distribution of three different models (the model of the present invention, the support vector machine model SVM, and the logistic regression model) at different time steps, specifically including:
[0165] True Positives (TP): The model predicts that the class is positive and it is actually positive.
[0166] False Positive (FP): The model predicts a positive class, but it is actually a negative class.
[0167] True Negative (TN): The model predicts that the class is negative and it is actually negative.
[0168] False Negative (FN): The model predicts a negative class, but it is actually a positive class.
[0169] Each time step corresponds to a stacked bar chart, and each part in the bar represents the classification error ratio at that time step. The height of each part is determined by the proportion of the number of each category to the total samples, and the sum of these proportions is 100%. This method eliminates the influence of the number of samples at different time steps by percentage, making the classification error of each model more comparable. If the stacked bar chart of the model of the present invention shows a larger proportion of TP and a smaller proportion of FP and FN, it means that the model has a stronger classification accuracy. Support vector machine SVM and logistic regression models may show a higher FP or FN ratio in certain epochs, which means that the model may have more classification errors, resulting in inaccurate predictions of positive or negative classes.
[0170] Experiment 4: ROC curve comparison;
[0171] The Receiver Operating Characteristic (ROC) curve is a tool used to evaluate the performance of binary classification models. It helps analyze a model's performance under different conditions by showing the trade-off between the false positive rate (FPR) and true positive rate (TPR) at different thresholds. The true positive rate (TPR), also known as sensitivity or recall, indicates the proportion of samples correctly predicted as positive by the model out of all samples that are actually positive. The false positive rate (FPR), also known as 1-specificity, indicates the proportion of samples incorrectly predicted as positive by the model out of all samples that are actually negative.
[0172] The meaning of the curve: The upper left corner indicates that the model achieves a high true positive rate while maintaining a very low false positive rate, indicating excellent model performance. The lower right corner indicates poor model performance, with a high false positive rate and a low true positive rate, similar to random guessing. The diagonal line represents the performance of a random model. Any point on the diagonal line means that the model's prediction is no different from random guessing.
[0173] like Figure 5 As shown in Figure 2, the ROC curve of the model of the present invention is usually located near the upper left corner, indicating that the model can achieve a high true positive rate while maintaining a low false positive rate. The superiority of the model is reflected in its ability to accurately classify the stability of the surrounding rock and its ability to better cope with different input characteristics. Figure 6As shown in FIG, the ROC curve of the SVM may be slightly more inclined to the diagonal line than the model of the present invention, indicating that the prediction performance of the model is slightly inferior in some cases, especially when the classification threshold is more extreme. Figure 7 As shown, the curve of the logistic regression model may be between the model of the present invention and the SVM model, indicating that its performance is moderate. Although logistic regression is a classic linear model, its performance in complex nonlinear data is often inferior to that of deep learning models.
[0174] In order to prove the feasibility of the present invention, the following set of real data cases are given. Data from a mine is collected and the numerical values are processed to facilitate demonstration to obtain the results in Table 2.
[0175] Table 2 Data processing results
[0176] .
[0177] The “min-max normalization” method is used for normalization to obtain a high-dimensional input vector , is a 1×7 matrix.
[0178] Initially defined query weight matrix , key weight matrix , value weight matrix for:
[0179] ;
[0180] In this embodiment, setting is 1; calculate the attention score:
[0181] ;
[0182] Calculate the softmax function for each row and assume that:
[0183] ;
[0184] Here is a matrix with the same number of rows as The same number, the number of columns is equal The calculation is too complex, so only one row of values is shown here.
[0185] ;
[0186] Build a classification weight matrix ;
[0187] Calculate classification scores:
[0188] ;
[0189] Normalize the classification scores to get ;
[0190] The maximum value of 0.55 corresponds to the category "excellent", so the model predicts that the stability of the surrounding rock is "excellent". If the true label is "good" (second category) or "medium", the cross entropy loss is calculated, the gradient descent is performed, and the adjustment is made. , and then proceed to the next round of training.
[0191] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the scope of protection of the present invention.
Claims
1. A surrounding rock stability prediction method based on a hybrid spatiotemporal self-attention mechanism, characterized in that: The steps include: Step 1: Data collection and screening; Step 2: Construct a hybrid spatiotemporal prediction model. The hybrid spatiotemporal prediction model includes an embedding layer, a hybrid spatiotemporal self-attention mechanism layer, and a classification layer. The specific working process of the hybrid spatiotemporal prediction model is as follows: Step 2.1: Input the input data into the embedding layer and normalize it to form a high-dimensional input vector ; Step 2.2: Perform attention calculation on the high-dimensional input vector based on the hybrid spatiotemporal self-attention mechanism to obtain a weighted feature matrix; The specific process is: Step 2.2.
1. Define the query weight matrix , key weight matrix , value weight matrix ; Step 2.2.2: For the high-dimensional input vector obtained in step 2.1 Perform linear transformation to generate query matrix , key matrix , value matrix , the specific calculation formula is: ; ; ; Step 2.2.3: Based on the single-head self-attention mechanism, a time decay factor and a spatial distance weight are established to construct a hybrid spatiotemporal self-attention mechanism. The weighted feature matrix is obtained based on the hybrid spatiotemporal self-attention mechanism. The specific calculation formula is: ; Where, is the weighted feature matrix; It is a hybrid spatiotemporal self-attention mechanism; 、 、 Time The query matrix, key matrix, and value matrix of is the Softmax function; is the transpose symbol; is the scaling factor; 、 are two different time decay factors; 、 They are different collection timestamps respectively; is the spatial weight coefficient; For time and time The spatial distance between the two measuring points corresponding to the time; Step 2.3: Input the weighted feature matrix into the classification layer to obtain the prediction result. The classification layer uses a fully connected classification head to perform a fully connected calculation to obtain the classification prediction value. The specific process is as follows: Step 2.3.
1. Create a classification weight matrix right Perform linear transformation to obtain category scores , the formula is: ; ; Where, It is a 7×3 matrix, each row corresponds to an input feature dimension, and each column corresponds to a certain surrounding rock stability category, which are excellent, good, and medium respectively; is the classification weight corresponding to the 7th row and 3rd column; The specific calculation method is: ; ; ; ; Where, 、 、 The scores are divided into three categories: excellent, good and fair; is the 7th weighted feature in the weighted feature matrix; Step 2.3.2: Normalize the category scores into probability form. The formula is: ; ; ; ; Where, is a probability set; 、 、 represent the probabilities of belonging to the categories excellent, good, and fair, respectively; Step 2.3.3: Take the category corresponding to the maximum probability as the final surrounding rock stability prediction result , the formula is: ; in, To obtain the maximum value; Step 3: Perform supervised learning and iterative training on the hybrid spatiotemporal prediction model, and output the trained model; Step 4: Obtain the current coal mine tunnel surrounding rock data in real time, input the trained model, and predict the stability category.
2. The surrounding rock stability prediction method based on the hybrid spatiotemporal self-attention mechanism according to claim 1 is characterized in that: The specific process of step 1 is: Step 1.1: Collect the surrounding rock stability data of the mining roadway in the current coal mine; Step 1.2: Select seven parameters as screening indicators: tunnel roof surrounding rock strength, tunnel side surrounding rock strength, tunnel floor surrounding rock strength, mining depth, surrounding rock integrity, mining dynamic pressure in this section, and mining dynamic pressure in adjacent sections; Step 1.3: Screen the surrounding rock stability data of the mining roadway of the current coal mine according to the seven parameters, use the mining roadway surrounding rock stability samples obtained after screening as input data, and divide them into training samples and test samples in proportion.
3. The surrounding rock stability prediction method based on the hybrid spatiotemporal self-attention mechanism according to claim 2 is characterized in that: In step 3, the training objects include 4: query weight matrix , key weight matrix , value weight matrix , classification weight matrix ; Classification weight matrix The training process is: Introducing cross entropy loss , the formula is: ; in, Belong to category probability; is the number of categories; is the true label; Introducing gradient descent for adjustment , the formula is: ; Where, is an update operation; is the learning rate; The loss function for model training is: ; Where, is the total loss function; is the balance weight coefficient; is the norm operation; is the average of the three surrounding rock strengths: the roadway roof surrounding rock strength, the roadway side surrounding rock strength, and the roadway floor surrounding rock strength; is the elastic modulus; For strain; is Poisson's ratio; Update the classification weight matrix for the current time step according to the decreasing direction of the total loss function. Each adjustment will generate a new cross-entropy loss. The occurrence of a new cross-entropy loss is considered a training cycle, and the complete training process requires multiple cycles. The judgment criteria for the end of training are: the loss of the dataset decreases by less than 0.001 in several consecutive rounds, or the accuracy of the dataset continues to be higher than 95% and the fluctuation does not exceed ±0.5%. Query weight matrix , key weight matrix , value weight matrix The training process and same.
Citation Information
Patent Citations
Convergence value parameter prediction and early warning method and device for assisting tunnel support intelligent decision
CN118013430A