Rock freeze-thaw damage prediction method based on deep learning
Through the deep learning model, the integration of multi-source data and processing missing values and combining thermally independent coding to distinguish rock samples, the problem of insufficient prediction accuracy and generalization ability of rock freeze-thaw damage in the existing technology is solved, and more efficient and accurate prediction is achieved.
Patent Information
- Application Number
- CN202411866918.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively predict rock freeze-thaw damage, especially when considering multiple physical and mechanical indicators and multiple rock types, the generalization ability and prediction accuracy of the model are insufficient.
A deep learning model is used to integrate multi-source data, process missing values, and distinguish different rock samples through thermal independent encoding, and build a fully connected neural network to predict rock freeze-thaw damage.
It improves the accuracy and applicability of rock freeze-thaw damage prediction, can more comprehensively consider the physical and chemical properties of the rock and enhances the generalization ability and robustness of the model.
Smart Images

Figure CN119830720A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of geological engineering and environmental science and technology, and specifically relates to a rock freeze-thaw damage prediction, and in particular to a rock freeze-thaw damage prediction method based on deep learning. Background Art
[0002] At present, rock freeze-thaw damage not only affects the stability and life of engineering structures, but is particularly significant in extreme climates and may cause major safety hazards. The damage mechanism of rock freeze-thaw process is very complex, and it is caused by the combined action of multiple internal and external factors, which makes its damage process highly nonlinear and difficult to predict. The key internal characteristics that determine the degree of freeze-thaw damage include the mineral composition, porosity, moisture content, joints and cracks of the rock. These characteristics affect the physical and chemical properties of the rock and the stress distribution during the freeze-thaw process. External factors, such as temperature changes and external loads, also have a significant impact on freeze-thaw damage. Generally, the prediction and evaluation of rock freeze-thaw damage requires considering these internal and external factors and establishing corresponding models, such as physical models, empirical models, and deep learning models, as follows.
[0003] Physical models: Physical models attempt to explore the microscopic mechanisms of the freeze-thaw process from the perspective of the physical and chemical properties of rocks. These models are based on the principles of rock mechanics and thermodynamics, and describe microscopic phenomena such as water migration, ice crystal formation, and the effect of expansion forces during the freeze-thaw process by establishing complex mathematical equations. For example, Neaupane et al. (1999) first proposed a three-field coupling model. Then, Neaupane and Yamabe (2001) derived the nonlinear rock freeze-thaw constitutive equation under three-field coupling by combining the equilibrium equations of temperature field, seepage field, and stress field. Tan et al. (2011) established the governing equations of the thermal-water coupling model based on the theory of continuum mechanics, thermodynamics, and segregation potential. Later, various physical models attempted to explain the mechanism of rock freeze-thaw damage theoretically. However, the establishment and solution process of physical models is very complicated, requiring professional knowledge and computing skills, and it is difficult to establish and solve them. Physical models have idealized assumptions that do not conform to realistic conditions and may not be accurate. In addition, physical models have very high requirements on the accuracy of model parameters and the setting of initial conditions. Some parameters are too abstract to be obtained, which limits their universality and flexibility in practical applications.
[0004] Empirical model: Unlike physical models, empirical models are a prediction method based on historical data and actual observations. This method establishes a prediction model by analyzing the empirical association between rock properties and freeze-thaw damage. However, although empirical models are intuitive and easy to implement, their prediction accuracy is largely limited by the quality and coverage of the data. When there are missing values or outliers in the data, the prediction results of the empirical model may have large deviations. Current research on empirical models often relies on limited, single-source experimental data, which, while valid under specific conditions, may not fully represent the behavior of different regions and different types of rocks during freeze-thaw processes. Therefore, models based on a single data source may not be able to fully capture this diversity, resulting in limited generalization of the model. When the model faces new and unknown data, its prediction performance may drop significantly.
[0005] Deep learning model: With the rapid development of artificial intelligence technology, machine learning, especially deep learning technology, has provided new solutions for the prediction of rock freeze-thaw damage. In 2020, Zhou et al. used a back propagation neural network (BPNN) to establish prediction models for permeability coefficient, dry density, porosity, surface porosity, surface fractal dimension, median pore size, and median throat size. Xiong et al. (2021) used an artificial neural network (ANN) to establish a triaxial compressive strength (TCS) prediction model for sandstone undergoing freeze-thaw cycles, including four model input parameters, namely, longitudinal wave velocity, porosity, confining pressure, and number of freeze-thaw cycles, and an output parameter, namely, the TCS of the rock. Then, a genetic algorithm (GA) was used to optimize the parameters of the ANN, and good results were achieved. In 2024, Jaiswal et al. used the test data of 32 rock samples from the Himalayas as a training set, and constructed recurrent neural networks (RNN), gated recurrent units (GRU) and bi-directional long short-term memory (Bi-LSTM) to predict the changes in the uniaxial compressive strength and Brazilian tensile strength of rocks during freeze-thaw cycles. In 2024, Zhou et al. compiled a freeze-thaw rock dynamic compressive strength (DCS) library containing 216 rock samples, selected three external load parameters (number of freeze-thaw cycles, confining pressure and impact pressure) and two rock parameters (characteristic impedance and porosity) as input variables, and used five swarm intelligence optimization algorithms to optimize the kernel scale, penalty factor and insensitive loss coefficient of the support vector regression (SVR) model, thereby developing five hybrid models to predict the DCS of rocks. These technologies are able to automatically learn complex patterns and relationships from data without the need to manually extract features or build complex mathematical models. By training the deep neural network model, the nonlinear relationship in the rock freeze-thaw damage process can be captured and accurate prediction of the damage can be achieved.
[0006] However, whether it is the derivation of traditional mathematical models or the currently popular neural network models, the parameters are often very limited. These models can only describe the relationship between the number of freeze-thaw cycles and one or several indicators, such as elastic modulus or compressive strength, and lack comprehensive consideration of multiple physical and mechanical indicators. Furthermore, there are many types of rocks and they differ significantly, and the model constructed with one rock sample lacks sufficient generalization. Ultimately, this is because these test data are based on data obtained from experiments by a certain research group. A research group has limited energy and it is difficult to conduct comprehensive test measurements on multiple rock samples at the same time. The training of traditional mathematical models and neural network models requires a large amount of data, so limited data becomes a new challenge. In order to solve this challenge, all available data need to be integrated to give full play to the powerful fitting ability of neural networks.
[0007] At present, there is still a lack of cases in the study of rock freeze-thaw using neural networks to integrate multi-source data, but some scholars have made some progress in other fields, demonstrating the potential of this method. For example, in 2022, Wang et al. proposed the first general end-to-end computing framework in the field of civil engineering-DeepSNA (Deep Structural Nonlinear Analysis), and verified it with steel plate shear wall structures. Due to the lack of experimental data for large components, the training set used is a combination of experimental data and simulation data. The main shortcomings are as follows:
[0008] 1. Few parameters: Traditional formula fitting methods can usually only handle a small number of parameters and cannot fully consider the various factors that affect rock freeze-thaw damage.
[0009] 2. Improper handling of missing values: Empirical models usually have high requirements for data integrity. When missing values occur, only some of the missing values can be estimated. The simplest way to handle missing values is linear interpolation, homonymous interpolation, and mean interpolation, but since they cannot reflect the actual variation of the data, they may lead to model bias. Using k-nearest neighbor interpolation and random forest algorithm to bootstrap data can estimate missing values using similar samples in the data set, but this method is very sensitive to outliers, and many properties of rocks are unknown in the absence of basic data. If the inferred or calculated data is used for model training, it will mislead the model, which is equivalent to artificially introducing noise.
[0010] 3. Inaccurate predictions: Due to the small number of parameters and the inability to handle missing values, traditional models have low prediction accuracy and are difficult to provide reliable results in practical applications.
[0011] 4. The physical model is complex and difficult to understand: Although the physical model can deeply explain the mechanism of the freeze-thaw process, its parameters are abstract and difficult to understand, and the requirements for initial conditions are also very high, which is not conducive to practical application.
[0012] 5. Poor generalization ability of the model: The prediction performance of the empirical model based on a single data source may drop significantly when faced with different regions and different types of rocks, limiting its scope of application.
[0013] Based on this, it is urgent to develop a rock freeze-thaw damage prediction method based on deep learning to effectively solve the above problems. Summary of the invention
[0014] The purpose of the present invention is to provide a method for predicting rock freeze-thaw damage using a deep learning model. By integrating multi-source data and processing missing values, a deep learning model is constructed to replace traditional empirical models and physical models, so as to significantly improve the prediction accuracy and applicability of the model.
[0015] The objective of the present invention is achieved through the following technical solutions:
[0016] A rock freeze-thaw damage prediction method based on deep learning includes the following steps:
[0017] Step A, data preparation: collect freeze-thaw damage test data of target rock, obtain initial parameters of rock, environmental parameters and predicted target parameters;
[0018] Step B, data preprocessing: first perform hot encoding on the origin features, then introduce a mask to mark missing values, and use extreme values as filling values for missing values;
[0019] Step C, generate a data set: use the initial rock parameters and environmental parameters as input values, and the predicted target as output values, and standardize the data; divide the data set into a 70% training set, a 10% validation set, and a 20% test set; and encapsulate the data into a data set;
[0020] Step D, model construction:
[0021] Step D1, construct a deep learning-based prediction model using a fully connected neural network to predict the damage of sandstone under freeze-thaw cycle conditions;
[0022] Step D2, using the mask mean square error loss function;
[0023] Step D3: batch normalization and activation function are added after each layer, and Dropout layer is added after some layers;
[0024] Step D4, applying the Adam optimizer for optimization, and using the regularization function of the optimizer to set the regularization coefficient;
[0025] Step E, model training: Use k-fold cross-validation to adjust hyperparameters. Divide the data set into k equal parts, use each part as the validation set, and the remaining k-1 parts as the training set, repeat k times, and evaluate the model performance. Use early stopping to stop training, and use box plots to represent all aspects of all hyperparameter combinations, including median, quartiles, whiskers, and outliers. During the training process, output and compare the performance of the loss function on the training set and validation set in real time, and finally save and use the best performing model.
[0026] Step F, model verification: verify the model performance on the test set, first use a line graph to visually display the gap between the predicted value and the target value, the horizontal axis is the sample number, the vertical axis is the predicted physical quantity, insert an absolute error bar graph in the graph to visually display the error size, and then evaluate the model indicators;
[0027] Step G, prediction output: input new initial parameters and environmental parameters through the trained model to generate the freeze-thaw damage variables that need to be predicted.
[0028] Furthermore, in step A, the initial parameters include the origin of the rock, mineral composition, saturation, pH value of the liquid soaking the rock, bedding inclination, dry density, natural density, saturated density, porosity, whether it is an artificial crack, crack angle, crack length, crack width, compressive strength, peak strain, elastic modulus, Poisson's ratio and longitudinal wave velocity; the environmental parameters include the freezing ambient temperature, freezing time, the ambient temperature during melting, melting time, the temperature drop rate during freezing, the number of freeze-thaw cycles and confining pressure; the predicted target parameters include the compressive strength after freeze-thaw, the peak strain after freeze-thaw, the elastic modulus after freeze-thaw, the Poisson's ratio after freeze-thaw, the longitudinal wave velocity after freeze-thaw, the porosity after freeze-thaw and the mass change rate after freeze-thaw.
[0029] Furthermore, in step B, when performing hot encoding, first, define the category variable, assuming that the rock origin has n different categories, represented as C1, C2,...Cn. For each category, create a binary vector of length n, in which only the position corresponding to the category is 1, and the other positions are 0;
[0030] The introduction of mask is to create an additional binary marker vector for the feature, indicating whether the feature is missing; assuming that the original feature matrix is X = [x1, x2, ..., xm], where xi may have missing values. Create a marker vector mi for each feature xi. If xi is missing, the corresponding mi value is 0, otherwise it is 1; combine the original feature matrix and the marker vector into a new feature matrix = [x1, m1, x2, m2, ..., xm, mm];
[0031] Extreme value filling is to select an extreme value that is unlikely to appear in the normal data range. This extreme value will be used to fill all missing data points. Use the for loop statement to traverse the entire data set, and for each missing data point, replace it with a predefined extreme value.
[0032] Furthermore, a mask is introduced for each feature with missing values, where 1 represents a valid value and 0 represents a missing value. A variety of interpolation techniques are used to interpolate missing data, including value interpolation, median interpolation, mode interpolation, KNN interpolation, and iterative interpolation. The mask mechanism is introduced so that the true value and the interpolated value can be distinguished during model training.
[0033] Furthermore, in step C, standardization is used to scale the features to a distribution with a mean of 0 and a standard deviation of 1; the feature matrix is fitted and transformed to obtain a standardized feature matrix, thereby achieving standardization of the features and eliminating the magnitude differences between the features. The standardization process uses the following formula:
[0034]
[0035] Among them, X is the original eigenvalue, is the mean of the feature, is the standard deviation of the feature, and is the standardized eigenvalue.
[0036] Furthermore, in step D1, the specific formula of the fully connected neural network is:
[0037] z (l) =W (l) a (l-1) +b (l)
[0038] Among them, z (l) is the linear transformation result of the lth layer, W (l) is the weight matrix of the lth layer, a (l-1) is the activation output of layer l-1, b (l) is the bias vector of the lth layer.
[0039] Furthermore, in step D2, a mean square error loss function with a mask mechanism is used to measure the difference between the model prediction value and the true value;
[0040]
[0041] Where N is the total number of samples, y i is the true value of the i-th sample, m i is the target value y i The associated mask, which takes values of 0 or 1, indicates whether the target value is interpolated.
[0042] Furthermore, in step D3, batch normalization is used to accelerate the training of deep neural networks. By normalizing the activation values after each layer, the internal covariate shift is reduced, and the stability and convergence speed of the model are improved. The specific formula is:
[0043]
[0044]
[0045] Among them, μ is the mean of the small batch data, σ 2 is the variance of the mini-batch data, ε is a small constant used to prevent the denominator from being zero, and γ and β are learnable parameters;
[0046] The ReLU activation function is used as the nonlinear activation function, and its formula is:
[0047] ReLU(x)=max(0,x)
[0048] When the input x is less than 0, the output is 0; when the input x is greater than or equal to 0, the output is x. ;
[0049] The LeakyReLU activation function is used alternately with the ReLU activation function to avoid the neuron "death" problem by introducing a small slope when x is less than 0. The formula is:
[0050]
[0051] Where α is a very small constant (for example, 0.01). When the input x is less than 0, the output is αx; when the input x is greater than or equal to 0, the output is x;
[0052] The dropout layer is used to prevent overfitting. The principle is to randomly discard some neurons and reduce the model's dependence on specific neurons. The formula is:
[0053]
[0054] y is the input after Dropout, x is the input before Dropout, and p is the probability of retaining the neuron.
[0055] Furthermore, in step D4, the Adam optimizer is used for optimization. In each iteration, the Adam optimizer accelerates the convergence process by adjusting the learning rate of each parameter. It uses the first-order momentum and the second-order momentum to dynamically adjust the learning rate. The specific steps are as follows:
[0056] D41, calculate the exponentially weighted moving average of the gradient:
[0057] m t =β1m t-1+(1-β1)g t
[0058] Among them, m t is the first-order moment estimate of the gradient, g t is the current gradient and β1 is the momentum parameter.
[0059] D42, calculate the exponentially weighted moving average of the squared gradient:
[0060]
[0061] Among them, v t is the second moment estimate of the gradient and β2 is the momentum parameter.
[0062] D43, bias correction for first- and second-order moment estimates:
[0063]
[0064]
[0065] D44, update parameters:
[0066]
[0067] Furthermore, in step E, the early stopping method monitors the loss on the validation set. When the validation loss no longer decreases significantly over several consecutive cycles, the training is stopped early to prevent overfitting.
[0068] Furthermore, in step F, the formulas for the mean absolute error, mean square error, root mean square error, mean absolute percentage error and coefficient of determination are as follows:
[0069] Mean absolute error MAE: represents the average of the absolute values of the difference between the predicted value and the true value. The calculation formula is:
[0070]
[0071] Mean square error MSE: represents the average of the squares of the differences between the predicted value and the true value. The calculation formula is:
[0072]
[0073] Root mean square error RMSE: It is the square root of MSE and provides an error assessment in the same unit as the original data. The calculation formula is:
[0074]
[0075] Mean absolute percentage error MAPE: It represents the average of the ratio of the absolute value of the difference between the predicted value and the true value to the true value, expressed as a percentage. In order to avoid infinite or uncertain values caused by the true value being zero, data points with a true value of zero are ignored in the MAPE calculation. The calculation formula is:
[0076]
[0077] Coefficient of determination R 2 : Measures the amount of variation explained by the model, calculated as:
[0078]
[0079] in, is the mean of the true values.
[0080] Compared with the prior art, the present invention has the following beneficial effects:
[0081] 1. Multi-parameter processing: Traditional models use mathematical formulas to fit experimental parameters, generally using elastic modulus and freeze-thaw times, temperature drop rate, freeze-thaw times, strength, or rock saturation, freeze-thaw times, strength to describe rock freeze-thaw damage, which are not universal between different models. The model of the present invention can input up to 20 initial parameters at the same time, comprehensively considering the physical and chemical properties of rocks and external environmental factors, improving the comprehensiveness and accuracy of the prediction, and can more accurately reflect the freeze-thaw damage of rocks in different environments. It can ultimately predict up to 6 freeze-thaw damage variables, including uniaxial compressive strength, elastic modulus, longitudinal wave velocity, etc., providing researchers with a more comprehensive analysis tool;
[0082] 2. Missing value processing: enable the model to accept data with some missing initial parameters, introduce a mask for each feature with missing values (1 represents a valid value, 0 represents a missing value), and use a variety of interpolation techniques, including value interpolation, median interpolation, mode interpolation, KNN interpolation and iterative interpolation, to interpolate missing data; by introducing a masking mechanism, the true value and the interpolated value can be distinguished during model training. Traditional methods also use various interpolation methods when dealing with missing values. However, no matter what interpolation method is used, during the training process, the network will inevitably treat the interpolated value as the true value. As a result, the final model cannot learn the true rules of the data, but learns the interpolation method. The method used in the present invention can avoid the model from learning the biased results of the interpolated data, and focus the model's attention on the true value.
[0083] 3. Multi-source data integration: Thermal unique coding distinguishes the differences between different rock samples and can integrate experimental data from various sources, enhancing the generalization ability and applicability of the model, making its prediction results in different regions and different types of rocks more reliable.
[0084] 4. Saving of energy consumption and raw materials: Since the model can accurately predict the parameters of rocks after freezing and thawing, the number of actual experiments required can be reduced, thus saving energy consumption and experimental raw materials.
[0085] 5. Deep learning model: Deep neural network is used to capture the complex nonlinear relationship between rock properties and freeze-thaw damage through batch normalization, LeakyReLU activation function, L2 regularization and Dropout technology. It significantly improves the prediction accuracy and can better simulate the changes of rocks during the freeze-thaw cycle, while ordinary machine learning cannot capture the connection between complex data.
[0086] 6. Simplicity of processing, operation and control: The introduction of deep learning technology makes the complex rock freeze-thaw damage prediction process automated and intelligent. The prediction results can be obtained directly by inputting parameters without understanding and deriving complex physical models, thus simplifying operation and control. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0088] Figure 1 This is a flowchart of the steps of the rock freeze-thaw damage prediction method based on deep learning of the present invention. DETAILED DESCRIPTION
[0089] The present invention will be further described below in conjunction with embodiments:
[0090] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0091] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0092] In the prior art, the traditional method for predicting rock freeze-thaw damage is to use a few groups of test data with a single pattern and fit them with a formula. It can only accept a few groups of parameters and has limited accuracy. If the existing deep learning method is applied to this field, it can still only accept a few groups of test data with a single pattern and a few groups of parameters. The accuracy is higher than that of formula fitting, but the existing deep learning method still cannot accept some missing data, and it does not understand the differences between different rock samples. It is just that the fitting ability of deep learning is strong, so it may be more accurate. To this end, the present invention provides a rock freeze-thaw damage prediction method based on deep learning. The method combines the processing method of missing values with deep learning and the encoding method of samples from different sources, so that it can accept any multiple data from various sources. The data pattern can be complex and change arbitrarily, and the accuracy is still relatively high, which is used to replace the traditional method.
[0093] This method integrates multi-source data and processes missing values to build a deep learning model to replace traditional empirical models and physical models, thereby improving the prediction accuracy and applicability of the model. The model design includes the following aspects:
[0094] 1. Multi-parameter processing: It can process any number of initial parameters, covering the physical and chemical properties of rocks and external environmental factors, greatly improving the comprehensiveness and accuracy of predictions.
[0095] 2. Missing value processing: Introduce a masking mechanism so that the model can accept data with some missing initial parameters and can still be used when only some parameters are obtained. Use a variety of interpolation techniques, and enable the model to only believe in the true value for back propagation without learning the interpolation technique. In this way, the trained network can accept the lack of initial values, ensuring the flexibility and robustness of data processing.
[0096] 3. Deep learning model: The deep learning model is used to capture the complex nonlinear relationship between rock properties and freeze-thaw damage, improving the prediction accuracy.
[0097] 4. Multi-source data integration: Use thermal unique coding to distinguish rock samples. It can integrate the rock freeze-thaw damage test research results from various scholars, integrate the characteristics of various existing empirical models, and make the model more generalizable.
[0098] Specifically, the rock freeze-thaw damage prediction method based on deep learning of the present invention is as follows: Figure 1 As shown, the following steps are included:
[0099] Step 1, prepare data. First, collect freeze-thaw damage test data of the target rock. These data can be obtained through experimental measurement or from existing data sets, papers, and research reports. The data include initial parameters of the rock, environmental parameters, and predicted target parameters. The initial parameters include the origin of the rock, mineral composition, saturation, pH value of the rock soaking liquid, bedding inclination, dry density, natural density, saturated density, porosity, whether it is an artificial crack, crack angle, crack length, crack width, compressive strength, peak strain, elastic modulus, Poisson's ratio, and longitudinal wave velocity. Environmental parameters include freezing ambient temperature, freezing time, melting ambient temperature, melting time, temperature drop rate during freezing, number of freeze-thaw cycles, and confining pressure. Predicted target parameters include compressive strength after freeze-thaw, peak strain after freeze-thaw, elastic modulus after freeze-thaw, Poisson's ratio after freeze-thaw, longitudinal wave velocity after freeze-thaw, porosity after freeze-thaw, and mass change rate after freeze-thaw. Summarize all collected test data in one file.
[0100] Step 2: Data preprocessing. Use Python tools to batch process data. First, perform hot encoding on the origin features. Then, introduce a mask to mark missing values, use extreme values as the filling values for missing values, and save the data file as a csv file.
[0101] Import the OneHotEncoder tool from the scikit-learn library to implement hot encoding. First, define the category variable. Assume that the rock origin has n different categories, represented as C1, C2,...Cn. For each category, create a binary vector of length n, in which only the position corresponding to the category is 1 and the other positions are 0. For example, if the origin has 3 categories C1, C2, C3, then the corresponding vector of C1 is [1, 0, 0], the corresponding vector of C2 is [0, 1, 0], and so on.
[0102] The introduction of mask is to create an additional binary marker vector for the feature, indicating whether the feature is missing. Assume that the original feature matrix is X = [x1, x2, ..., xm], where xi may have missing values. Create a marker vector mi for each feature xi. If xi is missing, the corresponding mi value is 0, otherwise it is 1. Combine the original feature matrix and the marker vector into a new feature matrix = [x1, m1, x2, m2, ..., xm, mm].
[0103] Extreme value filling is to select an extreme value that is unlikely to appear in the normal data range, such as -100. This extreme value will be used to fill all missing data points. Use the for loop statement to traverse the entire data set and replace each missing data point with a predefined extreme value.
[0104] Median interpolation uses the median of each column for filling. It is suitable for scenarios with skewed data distribution because the median has little impact on outliers.
[0105] Mode imputation uses the most frequently occurring value to fill in missing values and is often used when there are many repeated values in categorical data or numerical data.
[0106] KNN interpolation (Troyanskaya et al., 2001) uses the K-nearest neighbor algorithm to estimate missing values, based on the assumption that similar data points are also similar in other attributes. It is very important to choose an appropriate K value. In this study, it is set to 5, which means that the 5 nearest neighbors of each data point will be considered. The key to KNN interpolation is the calculation of distance, which is usually based on the Euclidean distance formula:
[0107]
[0108] The interpolation value is calculated based on the distance weighting method, and the weight is set to the inverse of the distance, so that the closer neighbors have a greater impact on the interpolation result.
[0109] Iterative interpolation (bootstrap interpolation) (Buuren and Groothuis-Oudshoorn, 2011) uses a more complex method to fill missing values in a step-by-step optimization manner, which is particularly suitable for data sets with complex relationships between variables. Iterative interpolation first initializes all missing values using a simple interpolation method (such as the mean), and then continuously optimizes these predictions through an iterative process. In each iteration, each missing feature is regarded as a response variable, and the other features are used as predictors to build a prediction model. The core formula of iterative interpolation is:
[0110]
[0111] Among them, β is the coefficient estimated by the regression model.
[0112] Step 3, generate a data set. First, use the pandas package to load the above-encoded csv file to divide the initial rock parameters and environmental parameters as input values, divide the predicted targets as output values, and standardize the data. Then use the train_test_split function in the scikit-learn package to divide the data set into three parts: training set (70%), validation set (10%) and test set (20%). The random_state parameter is set to a fixed value, such as 42, to ensure the random consistency of the division. Finally, encapsulate the data into a data set. When encapsulating, use the Dataset class provided by PyTorch. By inheriting the Dataset class, customize a class for loading data.
[0113] Use standardization to scale the features to a distribution with a mean of 0 and a standard deviation of 1. By importing the StandardScaler class in the scikit-learn library and using the fit_transform method to fit and transform the feature matrix, a standardized feature matrix is obtained, which achieves feature standardization and eliminates the magnitude differences between features. The standardization process uses the following formula:
[0114]
[0115] Among them, X is the original eigenvalue, is the mean of the feature, is the standard deviation of the feature, and is the standardized eigenvalue.
[0116] Step 4, model construction. Build a prediction model based on deep learning, using a fully connected neural network to predict the damage of sandstone under freeze-thaw cycle conditions. Use the masked mean square error loss (Masked-MSE) loss function. Batch normalization and activation function (ReLU or LeakyReLU) are added after each layer, and Dropout layer is added after some layers. Apply Adam optimizer for optimization, and use the regularization function of the optimizer to set the regularization coefficient.
[0117] Fully Connected Neural Network (FCNN) is a basic structure in deep learning models. Each neuron is connected to all neurons in the previous layer, so that complex nonlinear relationships can be captured. The specific formula is:
[0118] z (l) =W (l) a (l-1) +b (l)
[0119] Among them, z (l) is the linear transformation result of the lth layer, W (l) is the weight matrix of the lth layer, a (l-1) is the activation output of layer l-1, b (l) is the bias vector of the lth layer.
[0120] The Masked-MSE loss function with a mask mechanism is used to measure the difference between the model prediction value and the true value.
[0121]
[0122] Where N is the total number of samples, y i is the true value of the i-th sample, m i is the target value y iThe associated mask, which takes values of 0 or 1, indicates whether the target value is interpolated.
[0123] Batch normalization is used to accelerate deep neural network training. By normalizing the activation values after each layer, internal covariate shift is reduced and the stability and convergence speed of the model are improved. The specific formula is:
[0124]
[0125]
[0126] Among them, μ is the mean of the small batch data, σ 2 is the variance of the mini-batch data, ε is a small constant to prevent the denominator from being zero, and γ and β are learnable parameters.
[0127] The ReLU activation function is used as the nonlinear activation function, and its formula is:
[0128] ReLU(x)=max(0,x)
[0129] When the input x is less than 0, the output is 0; when the input x is greater than or equal to 0, the output is x.
[0130] The LeakyReLU activation function is used alternately with the ReLU activation function to avoid the neuron "death" problem by introducing a small slope when x is less than 0. The formula is:
[0131]
[0132] Where α is a small constant (for example, 0.01). When the input x is less than 0, the output is αx; when the input x is greater than or equal to 0, the output is x.
[0133] The dropout layer is used to prevent overfitting. Its principle is to randomly discard some neurons and reduce the model's dependence on specific neurons. The formula is:
[0134]
[0135] y is the input after Dropout, x is the input before Dropout, and p is the probability of retaining the neuron.
[0136] The Adam (Adaptive Moment Estimation) optimizer is used for optimization. In each iteration, the Adam optimizer accelerates the convergence process by adjusting the learning rate of each parameter. The core idea is to use the first-order momentum (the average value of the gradient) and the second-order momentum (the average value of the square of the gradient) to dynamically adjust the learning rate. The specific steps are as follows:
[0137] First, compute the exponentially weighted moving average of the gradients:
[0138] m t =β1m t-1 +(1-β1)g t
[0139] Among them, m t is the first-order moment estimate of the gradient, g t is the current gradient and β1 is the momentum parameter.
[0140] Then, we compute the exponentially weighted moving average of the squared gradients:
[0141]
[0142] where v t is the second moment estimate of the gradient and β2 is the momentum parameter.
[0143] Then bias correction is performed on the first-order and second-order moment estimates:
[0144]
[0145]
[0146] Finally, update the parameters:
[0147]
[0148] Among them, θ t is the current parameter, α is the learning rate, and ε is a small constant to prevent division by zero.
[0149] Step 5, model training. Use the DataLoader class provided by PyTorch to load the dataset and start training. Use the k-fold cross-validation method to adjust the hyperparameters. Divide the dataset into k equal parts, use each part as the validation set in turn, and the remaining k-1 parts as the training set, repeat k times, and evaluate the model performance. Use the Early Stopping method to stop training, and use box plots to represent various indicators of all hyperparameter combinations, including median, quartiles, whiskers, and outliers. During the training process, the performance of the loss function on the training set and the validation set is output and compared in real time, and the best performing model is finally saved and used.
[0150] The early stopping method monitors the loss on the validation set. When the validation loss no longer decreases significantly over several consecutive cycles, training is stopped early to prevent overfitting.
[0151] Step 6: Model verification. Verify the model performance on the test set. First, use a line graph to visually display the gap between the predicted value and the target value. The horizontal axis is the sample number and the vertical axis is the predicted physical quantity. Insert an absolute error bar graph in the graph to visually display the error size. Then evaluate the model indicators.
[0152] Mean absolute error (MAE): represents the average of the absolute values of the difference between the predicted value and the true value. The calculation formula is:
[0153]
[0154] Mean square error (MSE): represents the average of the squares of the differences between the predicted value and the true value. The calculation formula is:
[0155]
[0156] Root mean square error (RMSE): is the square root of MSE, providing an error assessment in the same units as the original data, and is calculated as:
[0157]
[0158] Mean Absolute Percent Error (MAPE): The average of the ratio of the absolute value of the difference between the predicted value and the true value to the true value, expressed as a percentage. In particular, to avoid infinite or uncertain values caused by the true value being zero, data points with a true value of zero are ignored in the MAPE calculation. The calculation formula is:
[0159]
[0160] Coefficient of determination (R-squared, R 2 ): Measures the amount of variation explained by the model, calculated as:
[0161]
[0162] in, is the mean of the true values.
[0163] Step 7, predict output (use of model)
[0164] New initial parameters and environmental parameters are input into the trained model to generate the freeze-thaw damage variables that need to be predicted.
[0165] Through the above steps, the prediction method proposed in the present invention can construct a deep learning model, which not only improves the prediction accuracy, but also enhances the robustness and generalization ability of the model, and can effectively solve many defects of traditional models. The output of the model can be used for the evaluation of rock freeze-thaw damage and engineering design, providing scientific basis and decision-making support, and has broad application prospects.
[0166] The present invention uses a deep learning model with strong learning ability and anti-overfitting ability to automatically extract the law of rock freeze-thaw damage, and has a large number of parameters, not 3 or 4 parameters of the traditional model. The missing value processing method is adopted to mark the missing values by two-dimensional vectors, so that the model can handle partially missing data instead of being unable to accept missing values. For distinguishing samples from different sources, hot unique encoding is used instead of digital encoding. In terms of masking mechanism, the model focuses on real data instead of interpolated values.
[0167] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A rock freeze-thaw damage prediction method based on deep learning, characterized in that: The following steps are involved: Step A, data preparation: collect freeze-thaw damage test data of target rock, obtain initial parameters of rock, environmental parameters and predicted target parameters; Step B, data preprocessing: first perform hot encoding on the origin features, then introduce a mask to mark missing values, and use extreme values as filling values for missing values; Step C, generate data set: take rock initial parameters and environmental parameters as input values, predict the target as output value, and standardize the data; Divide the data set into 70% training set, 10% validation set and 20% test set; encapsulate the data into a data set; Step D, model construction: Step D1, construct a deep learning-based prediction model using a fully connected neural network to predict the damage of sandstone under freeze-thaw cycle conditions; Step D2, using the mask mean square error loss function; Step D3: batch normalization and activation function are added after each layer, and Dropout layer is added after some layers; Step D4, applying the Adam optimizer for optimization, and using the regularization function of the optimizer to set the regularization coefficient; Step E, model training: Use k-fold cross-validation to adjust hyperparameters. Divide the data set into k equal parts, use each part as the validation set, and the remaining k-1 parts as the training set, repeat k times, and evaluate the model performance. Use early stopping to stop training, and use box plots to represent all aspects of all hyperparameter combinations, including median, quartiles, whiskers, and outliers. During the training process, output and compare the performance of the loss function on the training set and validation set in real time, and finally save and use the best performing model. Step F, model verification: verify the model performance on the test set, first use a line graph to visually display the gap between the predicted value and the target value, the horizontal axis is the sample number, the vertical axis is the predicted physical quantity, insert an absolute error bar graph in the graph to visually display the error size, and then evaluate the model indicators; Step G, prediction output: input new initial parameters and environmental parameters through the trained model to generate the freeze-thaw damage variables that need to be predicted.
2. The rock freeze-thaw damage prediction method based on deep learning according to claim 1 is characterized in that: Step A, initial parameters include the origin of the rock, mineral composition, saturation, pH value of the rock soaking liquid, bedding inclination, dry density, natural density, saturated density, porosity, whether it is an artificial crack, crack angle, crack length, crack width, compressive strength, peak strain, elastic modulus, Poisson's ratio and longitudinal wave velocity; environmental parameters include freezing ambient temperature, freezing time, melting ambient temperature, melting time, temperature drop rate during freezing, number of freeze-thaw cycles and confining pressure; predicted target parameters include compressive strength after freeze-thaw, peak strain after freeze-thaw, elastic modulus after freeze-thaw, Poisson's ratio after freeze-thaw, longitudinal wave velocity after freeze-thaw, porosity after freeze-thaw and mass change rate after freeze-thaw.
3. The rock freeze-thaw damage prediction method based on deep learning according to claim 1 is characterized in that: Step B: When performing hot encoding, first, define the category variable. Assume that there are n different categories of rock origin, represented as C1, C2, ... Cn. For each category, create a binary vector of length n, where only the position corresponding to the category is 1 and the other positions are 0. The introduction of mask is to create an additional binary label vector for the feature, indicating whether the feature is missing; assuming that the original feature matrix is X = [x1, x2, ..., xm], where xi may have missing values, create a label vector mi for each feature xi, if xi is missing, the corresponding mi value is 0, otherwise it is 1; combine the original feature matrix and the label vector into a new feature matrix = [x1, m1, x2, m2, ..., xm, mm]; Extreme value filling is to select an extreme value that is unlikely to appear in the normal data range, and this extreme value will be used to fill all missing data points; Use a for loop statement to iterate over the entire data set and replace each missing data point with a predefined extreme value.
4. The rock freeze-thaw damage prediction method based on deep learning according to claim 3 is characterized in that: A mask is introduced for each feature with missing values, 1 represents a valid value and 0 represents a missing value. A variety of interpolation techniques are used to interpolate missing data, including value interpolation, median interpolation, mode interpolation, KNN interpolation and iterative interpolation. The mask mechanism is introduced so that the true value and the interpolated value can be distinguished during model training.
5. The rock freeze-thaw damage prediction method based on deep learning according to claim 2 is characterized in that: Step C, using standardization processing, scales the features to a distribution with a mean of 0 and a standard deviation of 1; fits and transforms the feature matrix to obtain a standardized feature matrix, realizes feature standardization, and eliminates the magnitude differences between features. The standardization process uses the following formula: Among them, X is the original eigenvalue, is the mean of the feature, is the standard deviation of the feature, and is the standardized eigenvalue.
6. The rock freeze-thaw damage prediction method based on deep learning according to claim 2 is characterized in that: Step D1, the specific formula of the fully connected neural network is: z (l) =W (l) a (l-1) +b (l) Among them, z (l) is the linear transformation result of the lth layer, W (l) is the weight matrix of the lth layer, a (l-1) is the activation output of layer l-1, b (l) is the bias vector of the lth layer.
7. The rock freeze-thaw damage prediction method based on deep learning according to claim 2 is characterized in that: In step D2, the mean square error loss function with a mask mechanism is used to measure the difference between the model prediction value and the true value; Where N is the total number of samples, y i is the true value of the i-th sample, m i is the target value y i The associated mask, which takes values of 0 or 1, indicates whether the target value is interpolated.
8. The rock freeze-thaw damage prediction method based on deep learning according to claim 2 is characterized in that: Step D3 uses batch normalization to accelerate deep neural network training. By normalizing the activation values after each layer, the internal covariate shift is reduced and the stability and convergence speed of the model are improved. The specific formula is: Among them, μ is the mean of the small batch data, σ 2 is the variance of the mini-batch data, ε is a small constant used to prevent the denominator from being zero, and γ and β are learnable parameters; The ReLU activation function is used as the nonlinear activation function, and its formula is: ReLU(x)=max(0,x) When the input x is less than 0, the output is 0; when the input x is greater than or equal to 0, the output is x; The LeakyReLU activation function is used alternately with the ReLU activation function to avoid the neuron "death" problem by introducing a small slope when x is less than 0. The formula is: Among them, α is a very small constant. When the input x is less than 0, the output is αx; when the input x is greater than or equal to 0, the output is x; The dropout layer is used to prevent overfitting. The principle is to randomly discard some neurons and reduce the model's dependence on specific neurons. The formula is: y is the input after Dropout, x is the input before Dropout, and p is the probability of retaining the neuron.
9. The rock freeze-thaw damage prediction method based on deep learning according to claim 2 is characterized in that: Step D4, use the Adam optimizer for optimization. In each iteration, the Adam optimizer accelerates the convergence process by adjusting the learning rate of each parameter. It uses the first-order momentum and the second-order momentum to dynamically adjust the learning rate. The specific steps are as follows: D41, calculate the exponentially weighted moving average of the gradient: m t =β1m t-1 +(1-β1)g t Among them, m t is the first-order moment estimate of the gradient, g t is the current gradient, β1 is the momentum parameter; D42, calculate the exponentially weighted moving average of the squared gradient: Among them, v t is the second-order moment estimate of the gradient, and β2 is the momentum parameter; D43, bias correction for first- and second-order moment estimates: D44, update parameters: Among them, θ t is the current parameter, α is the learning rate, and ε is a small constant to prevent division by zero.
10. The rock freeze-thaw damage prediction method based on deep learning according to claim 2, characterized in that: Step E: The early stopping method monitors the loss on the validation set. When the validation loss no longer decreases significantly over several consecutive cycles, training is stopped early to prevent overfitting.
11. The rock freeze-thaw damage prediction method based on deep learning according to claim 2, characterized in that: Step F, the formulas used for mean absolute error, mean square error, root mean square error, mean absolute percentage error and coefficient of determination are: Mean absolute error MAE: represents the average of the absolute values of the difference between the predicted value and the true value. The calculation formula is: Mean square error MSE: represents the average of the squares of the differences between the predicted value and the true value. The calculation formula is: Root mean square error RMSE: It is the square root of MSE and provides an error assessment in the same unit as the original data. The calculation formula is: Mean absolute percentage error MAPE: It represents the average of the ratio of the absolute value of the difference between the predicted value and the true value to the true value, expressed as a percentage. In order to avoid infinite or uncertain values caused by the true value being zero, data points with a true value of zero are ignored in the MAPE calculation. The calculation formula is: Coefficient of determination R 2 : Measures the amount of variation explained by the model, calculated as: in, is the mean of the true values.
Citation Information
Patent Citations
Low-complexity real-time fire and smoke detection method based on deep learning
CN117496423A
Cited By
Model training method and method and device for predicting impact resistance of reinforced concrete beam
CN120470946A
Deep learning prediction method for rock freeze-thaw damage based on text embedding
CN120470950A
Bridge scouring damage identification method and system based on deep learning
CN120493081A
Large-dip-angle coal seam overlying strata fracture migration prediction method and system based on machine learning
CN120493728A
Improved deep learning-based time sequence coal reservoir permeability prediction method
CN120874554A