A landslide surge physical model test drag force prediction method based on AM-LSTM
Patent Information
- Application Number
- CN202511151954.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-08-18
AI Technical Summary
[0006]发明目的:针对现有技术中存在的不足之处,本发明提出一种基于AM-LSTM的滑坡涌浪物理模型试验拖曳力预测方法,通过带有注意力机制的LSTM模型捕捉滑坡涌浪引起的拖曳力时序演化规律,进而预测滑坡涌浪拖曳力的动态变化,提高预测准确度,以解决现有拖曳力研究方法不适用于坝面、考虑因素不足,传统机器学习方法梯度爆炸、无法准确预测拖曳力的问题,为滑坡涌浪灾害预警与工程防护提供技术支撑
[0083] (1) This invention constructs a three-dimensional hydrodynamic coupling physical model of landslide surge, and realistically simulates the three-dimensional dynamic changes of relevant areas during the landslide occurrence process in a controllable experimental environment, covering the process of landslide body entering water, water disturbance, surge formation, propagation and drag force generation.
Smart Images

Figure CN120950978B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data-driven and landslide surge disaster prevention, and in particular to a method for predicting drag force in landslide surge physical model tests based on AM-LSTM. Background Technology
[0002] Landslide surge disasters are common secondary geological hazards in mountain reservoirs and canyon rivers. When a landslide mass enters the water at high speed, the surge generated by its kinetic energy conversion will have a huge destructive effect on surrounding hydraulic structures, shipping facilities and riverside residential areas, causing incalculable losses.
[0003] For research on landslide surge disaster chains in reservoir areas, the research mainly focuses on the slope instability process, the generation and propagation of surges, etc., while there are very few research results on drag forces.
[0004] Currently, the main methods for studying drag force include physical model tests and empirical formulas. Physical model tests obtain hydrodynamic parameters through scaled-down experiments, but they suffer from drawbacks such as long testing cycles, high costs, and difficulty in simulating dynamics in complex terrains. Empirical formulas are based on simplified fluid dynamics equations and are only applicable to submerged objects. They do not adequately consider the coupled effects of multiple factors such as the shape of the sliding body, its entry velocity, and water viscosity. For spheres or two-dimensional cylinders, there are relatively mature methods for predicting drag force. However, for hydraulic structures in reservoir and dam areas, existing methods cannot accurately predict drag force. Therefore, based on the current state of drag force research, accurately predicting the drag force generated by landslide surges is of great value for disaster early warning, engineering protection design, and emergency response plan development.
[0005] In recent years, with the development of artificial intelligence technology, machine learning methods have begun to be applied to the field of landslide surge prediction. Some studies have attempted to use shallow models such as BP neural networks and support vector machines to predict surge parameters; however, these models have significant limitations in time series processing capabilities and cannot effectively capture the time-dependent features in the dynamic evolution of drag force. LSTM models, due to their unique gating mechanism, have shown advantages in time series data processing, and have been applied to fields such as flood prediction and wave forecasting. However, conventional LSTM models face the following technical bottlenecks in predicting landslide surge drag force: there are complex nonlinear relationships between the geometric features and motion parameters of the landslide body and other physical and mechanical parameters, making it difficult for traditional LSTM models to effectively extract deep features from multi-source heterogeneous data; the drag force evolution process involves multi-timescale coupling ranging from minutes to hours, and the neuron state update mechanism of traditional LSTM models is prone to gradient vanishing problems, resulting in poor prediction performance for data with drastic changes. For these reasons, how to introduce attention mechanisms and other measures to construct AM-LSTM models to predict the dynamic changes of landslide surge drag force, reduce research costs, and improve the accuracy of prediction results are technical issues that need to be explored. Summary of the Invention
[0006] Purpose of the invention: To address the shortcomings of existing technologies, this invention proposes a method for predicting drag force in landslide surge physical model experiments based on AM-LSTM. By using an LSTM model with an attention mechanism to capture the temporal evolution of drag force caused by landslide surge, the method can predict the dynamic changes in landslide surge drag force, thereby improving prediction accuracy. This addresses the problems of existing drag force research methods being unsuitable for dam surfaces and insufficient consideration of factors, as well as the gradient explosion and inability to accurately predict drag force in traditional machine learning methods. This provides technical support for landslide surge disaster early warning and engineering protection.
[0007] Technical solution: To achieve the above objectives, the present invention provides a method for predicting the drag force of landslide surge based on an AM-LSTM physical model test, comprising the following steps:
[0008] Step (1): Based on the spatial geometric parameters of the target landslide area, the Froude similarity criterion is adopted. According to the known constants, the Froude number and length scale of the prototype test and the model test are calculated to construct a three-dimensional hydrodynamic coupling physical model. Tests are carried out under different test conditions and test data are collected.
[0009] The process of scaling the actual scene proportionally according to the Froude similarity criterion is as follows:
[0010] To ensure that the two flow systems in the prototype and model tests are identical under gravity, the Froude numbers of the two flow systems must be equal:
[0011] Where: u is the flow velocity; g is the gravitational acceleration; F is the Froude number; the subscript f represents the prototype test, and l represents the model test.
[0012] The prototype test and the model test are in the same gravitational field, so we take g as g. f =g l The fluid properties are the same, so ρ is also taken. f =ρ l The length scale is:
[0013] After obtaining the length scale, the scales of the remaining physical quantities were calculated accordingly. A three-dimensional Rhino river channel model was constructed using topographic maps. Based on the calculated scales of each physical quantity and the actual physical parameters, the actual size of the three-dimensional hydrodynamic coupling physical model was calculated. The three-dimensional hydrodynamic coupling physical model was then constructed at the test site using cement and bricks, and drag force measurement points were arranged on the dam surface. After the experiment began, a landslide was simulated by allowing rocks to slide freely down the slope, and drag force test data were collected.
[0014] Step (2) involves performing data cleaning and standardization preprocessing on the raw experimental data output by the three-dimensional hydrodynamic coupling physical model. The dataset is divided into training and test sets according to the proportion. Based on the requirements of the LSTM model, the feature dataset X′ and label dataset Y′ are constructed by time window sliding.
[0015] Step (3): Using Python and with the help of sklearn and tensorflow libraries, define the attention layer, introduce the LSTM layer and the attention layer, build an LSTM model with integrated attention mechanism, namely the AM-LSTM model, set the input values of various model parameters and input data to train the model.
[0016] Step (4) uses the predict method to input the segmented test set data X_test as the input value into the trained AM-LSTM drag force prediction model to predict the drag force. The true value and the LSTM prediction result are compared in multiple dimensions to achieve visualization processing.
[0017] In step (2), the process of data cleaning and standardization preprocessing of the original experimental data is as follows:
[0018] Step (2.1) involves reading the experimental data into a table format containing multiple samples, and then cleaning the data using the percentile method to remove outliers. The percentile method removes outliers by setting a percentile threshold. The dataset X = {x1, x2, ..., x...} n Sort the dataset from smallest to largest to obtain the sorted dataset: X sorted ={x (1) ,x (2) ...,x (n)}
[0019] Where: X sorted X represents the sorted dataset; (n) This refers to the nth sample in the sorted dataset.
[0020] Set the percentile P up and lower percentile P low Calculate the upper and lower percentile positions in an ordered dataset:
[0021] k up =P up ×n;k low =P low ×n
[0022] Where: k is the percentile index; P is the percentile; n is the number of samples; up represents the upper limit, and low represents the lower limit; if the calculated position index k is an integer, then the upper and lower percentile thresholds are... or If k is not an integer, then the percentile threshold is calculated using linear interpolation:
[0023]
[0024] in: The integer part of the percentile position k; For an ordered dataset X sorted The middle position is Data points; For an ordered dataset X sorted The middle position is Data points;
[0025] The upper and lower percentile thresholds Q were calculated. up and Q low Then, remove those greater than Q. up and Q low Value:
[0026] X filtered ={x i ∈X∣Q low ≤x i ≤Q up}
[0027] Where: X filtered This represents the dataset after outlier removal; Q low Q represents the lower percentile threshold; up This represents the percentile threshold.
[0028] Step (2.2): After removing outliers, the ARIMA model is used to fill in the data for the sample points where outliers were removed. The ARIMA model predicts the missing parts based on the existing data before and after the outliers.
[0029]
[0030] in, Data to be filled; y t The values at time t in the time series; φ1, φ2, ..., φ p The parameters for the autoregressive component are θ1, θ2, ..., θ. q ζ represents the parameters of the moving average component. t It is a white noise error term.
[0031] Step (2.3): After completing the data, the MinMaxScaler method is used to normalize the dataset, scaling the data features to a specified interval. For the LSTM model, the specified interval is set to [0,1]. The transformation formula is as follows:
[0032] Where: x′ is the feature value after regularization; x is a feature value in the original data; min(x) is the minimum value in the dataset; max(x) is the maximum value in the dataset.
[0033] Step (2.4): Divide the dataset into training and testing sets in a 4:1 ratio, and create feature and label datasets according to the requirements of the LSTM model. The data has T time steps. The feature matrix X is a feature matrix containing T time steps, with a size of T×d, where d is the feature dimension. Y is the label matrix with a size of T×1, and the time window size is L.
[0034] A time window of size L is slid across the original input feature matrix X to generate features for each subsequence. For time step t, the corresponding feature matrix is:
[0035] X′ t ={X t ,X t+1 ,...,X t+L-1}
[0036] Where, X′ t It is a subsequence containing L time steps and of size L×d;
[0037] For each feature subsequence X′ t Each of them has a value in the label matrix Y at time t+L that corresponds to it:
[0038] Y′ t =Y t+L
[0039] Among them, Y′ t For the corresponding feature subsequence X′ t The tag value;
[0040] The constructed feature dataset X′ and label dataset Y′ are as follows:
[0041] X′={X′0,X′1,...,X′ T-L-1}, with a size of (TL)×L×d
[0042] Y′={Y′0,Y′ t ,...,Y′ T-L-1}, size is (TL)×1
[0043] In step (3), an attention layer is defined, an LSTM layer and an attention layer are introduced, an LSTM model with an integrated attention mechanism is built, the input values of various model parameters are set, and the model is trained with input data. The process is as follows:
[0044] Step (3.1) defines an attention layer. For predicting drag force magnitude, the drag force changes significantly and abruptly during the rapid decay phase of the surge, but decreases and stabilizes during the slow decay phase. This attention layer calculates the similarity between different time steps in the input time series to determine how to weight information from different time steps. This prevents the LSTM model from focusing too much on the rapid decay phase of the surge during training, thus affecting the prediction results and ensuring their accuracy.
[0045] The input feature dataset has a shape of (N, T, d), where N, T, and d are the batch size, sequence length, and feature dimension at each time step, respectively. First, the attention score e at each time step t is calculated. t :
[0046] e t =tanh(x) t W+b)
[0047] Where, x t Let W be the feature vector of the input feature dataset at time step t; W is the weight matrix; b is the bias term.
[0048] e t The attention weight α at each time step is obtained by using the softmax activation function. t :
[0049]
[0050] Wherein, exp(e tThe exponential transformation of the attention score is represented by t; by normalizing the exponential score over all time steps t, it is ensured that... Make each α t It is considered as the attention weight of this time step relative to other time steps.
[0051] The feature vector x of the input data at each time step t With the corresponding attention weight α t Multiplying them together yields the weighted eigenvector C. t :C t =α t ·x t
[0052] Finally, the weighted eigenvectors are summed to obtain the final vector C, with shape (N, d), which contains information from all time steps after weighting.
[0053] This attention mechanism dynamically weights information from different time steps by calculating the attention weights at each time step in the input sequence, thereby capturing different parts of the sequence.
[0054] Step (3.2) introduces an LSTM layer and an attention layer to build an LSTM model with an integrated attention mechanism. The input values for the various parameters of the LSTM model are set, and the model is trained using input data. The process is as follows:
[0055] An LSTM model is built using the Sequential function. LSTM layers are added to the LSTM model to process time series data. LSTM controls the flow of information through input gates, forget gates, and output gates. For each time step t, the forget gate analyzes the correlation between historical information and the current input to determine redundant data that needs to be filtered in the nerve cells, thereby optimizing the neural network's memory efficiency for time series features.
[0056] f t =σ(W f [h t-1 ,x t ]+b f )
[0057] Among them, f t Output value for the forget gate; h t-1 x is the hidden state from the previous time step. t Input the value for the current time step, W f b is the weighted term; f This is a bias term.
[0058] The input gate enhances the neural network's ability to express nonlinear relationships by evaluating the interaction between the current input and the preceding and following states, thereby helping the neural network capture the nonlinear relationships in the temporal variation of drag force.
[0059] i t =σ(W i [h t-1 ,x t ]+b i )
[0060]
[0061] Among them, i t Input a value for the input gate; The output value of the candidate memory cell;
[0062] After the input gate is determined, the memory unit is updated. The purpose of updating the memory unit is to achieve multi-scale fusion of temporal features through the interactive mapping between the gating signal and the candidate memory, thereby constructing a dynamically adaptive information storage structure.
[0063]
[0064] Among them, C t The current time step is the state of the memory unit, and the previous time step is the state of the memory unit C. t-1 It is controlled by the forget gate and the input gate;
[0065] The final output gate determines which information is output. Through the coordinated modulation of the gating signal and the nonlinear transformation of the memory state, the output gate achieves a controllable mapping from memory representation to predicted features, thereby constructing an information transmission channel with cognitive interpretability.
[0066] o t =σ(W o [h t-1 ,x t ]+b o )
[0067] h t =o t ·tanh(C t )
[0068] Among them: o t h is the output value of the output gate; t The hidden state at the current time step;
[0069] After defining the LSTM layers, a Dropout layer is added after each LSTM layer. During training, the Dropout layer selects a subset of neurons and discards them with a certain probability, improving the robustness of the neural network. The output of each neuron during training is: h′=h·Bernoulli(p)
[0070] Where Bernoulli(p) is a Bernoulli distribution, with an output of 1 for probability p and 0 for other probabilities.
[0071] After setting up all the LSTM and Dropout layers, the defined attention layer is introduced.
[0072] After passing through the LSTM layer and the attention layer, the output of the LSTM model is passed to the fully connected Dense layer, which outputs data of dimension 1. The output of the Dense layer is obtained through the following linear transformation:
[0073] y = W d z+b d
[0074] Where: z is the input value; W d b is the weight matrix; d y is the bias term matrix; y is the final output.
[0075] After building the LSTM model with integrated attention mechanism, the compile function is used to compile the built AM-LSTM drag force prediction model. The activation function of the AM-LSTM drag force prediction model is set to adam and the loss function is mse, thus completing the construction of the AM-LSTM model. The fit function is used to input the feature dataset X_train and the label dataset Y_train. A portion of the data, such as 30% of the data, is used as the validation set to calculate the change of the loss value of the AM-LSTM drag force prediction model in each training round. The training round epoch and training batch_size parameters are set to train the prediction model.
[0076] In step (4), the test dataset and the trained LSTM model are used to predict drag force, and the actual results and the LSTM model prediction results are compared in multiple dimensions to achieve visualization. The process is as follows:
[0077] The predict method is used to input the segmented test set data X_test as the input value into the trained AM-LSTM drag force prediction model to predict the drag force. Based on the prediction result Y_pred, relevant comparison charts are drawn with the help of matplotlib and seaborn libraries to achieve visualization.
[0078] Working principle: This invention is a landslide surge wave physical model test drag force prediction method based on AM-LSTM. Based on the Froude similarity criterion, a large-scale landslide surge wave physical model is constructed for the target landslide area and hydraulic structure. Dynamic data of dam surface drag force are collected by setting test groups with different landslide volume and water depth. A dataset containing time series features is constructed, and after normalization preprocessing, it is divided into training set, test set, feature dataset and label dataset.
[0079] By introducing a Long Short-Term Memory (LSTM) neural network layer and an attention mechanism AM layer, the model is trained with input data to capture the long-term and short-term dependencies between data, enabling dynamic prediction of drag force and visualization of the results. In other words, an AM-LSTM model is established using the LSTM model and attention mechanism to accurately predict the drag force at different points in the study area. Furthermore, the attention mechanism is introduced to optimize the LSTM model, which is then applied to practical engineering cases.
[0080] In step 1 of this invention, the Froude similarity criterion is used for proportional scaling, ensuring the comparability of experimental data and the broad applicability of the model, making the experimental results more accurately reflect the actual landslide surge situation. Step 2, through preprocessing operations, removes outliers, fills missing data, and performs normalization, improving data quality and usability. The preprocessed dataset is divided into training and testing sets in a 4:1 ratio, ensuring the effectiveness of model training and the independence of testing, thereby helping to improve the model's generalization ability. Step 3, by introducing the attention mechanism AM-LSTM model, avoids the gradient explosion problem and improves prediction accuracy and stability. The attention mechanism enables LSTM to better understand the key parts of the input sequence, especially when dealing with long sequences and complex relationships of drag force changing over time, demonstrating stronger capabilities. Step 4, based on the improved LSTM model, after training on the training set, accurately predicts the dynamic changes of drag force.
[0081] This invention optimizes the performance of traditional LSTM in processing long-term landslide surge data by introducing an attention mechanism, avoiding the gradient explosion problem and improving the prediction accuracy and stability of the LSTM model. Through experimental simulation of a physical model of landslide surges, data on the influence of key factors such as landslide volume and water depth on surge characteristics were collected. After preprocessing operations (including outlier removal, missing data filling, and normalization), high-quality data support was provided for the AM-LSTM model. The improved LSTM model can accurately capture the dynamic changes of landslide surge drag force over time, especially demonstrating stronger learning ability for complex relationships over long periods. Through training, this LSTM model predicts the changing trend of surge drag force after a landslide, providing effective support for real-time monitoring and early warning of landslide disaster drag force. The prediction method of this invention is applicable not only to physical model experiments but also to in-situ monitoring.
[0082] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0083] (1) This invention constructs a three-dimensional hydrodynamic coupling physical model of landslide surge, and realistically simulates the three-dimensional dynamic changes of relevant areas during the landslide occurrence process in a controllable experimental environment, covering the process of landslide body entering water, water disturbance, surge formation, propagation and drag force generation.
[0084] (2) By setting up test groups with different landslide volumes and water depths, the influence of key factors on the drag force characteristics of landslide surge was studied, providing rich experimental data support for subsequent model establishment and data analysis. In the experiment, the Froude similarity criterion was used for proportional scaling to ensure the comparability of experimental data and the wide applicability of the model, making the experimental results more accurately reflect the actual landslide surge situation.
[0085] (3) This invention effectively improves data quality and usability by removing outliers, filling in missing data, and normalizing the data through preprocessing operations. The preprocessed dataset is divided into training and testing sets in a 4:1 ratio, ensuring the effectiveness of the prediction model training and the independence of the testing, thereby helping to improve the generalization ability of the prediction model.
[0086] (4) This invention introduces an attention mechanism to build an AM-LSTM model to further optimize the prediction results. The attention mechanism enables the model to better capture long-term temporal dependencies and avoids the gradient explosion problem, while improving prediction accuracy and stability. The attention mechanism also enables LSTM to better understand the key parts of the input sequence, especially when dealing with long sequences and complex relationships where drag force changes over time, demonstrating stronger capabilities. The improved AM-LSTM model of this invention captures dependencies in long-term time series. Compared with the traditional LSTM, the AM-LSTM model has improved root mean square error and coefficient of determination evaluation parameters. The improved model outperforms the previous model in all evaluation indicators and avoids the gradient explosion problem. It shows better prediction ability and adaptability in landslide surge drag force prediction and can accurately predict the dynamic changes of drag force. Attached Figure Description
[0087] Figure 1 This is a schematic diagram of the steps in an embodiment of the landslide surge wave physical model test drag force prediction method based on AM-LSTM of the present invention.
[0088] Figure 2 This is a comparison chart of prediction results for an embodiment of the landslide surge physical model test drag force prediction method based on AM-LSTM of the present invention.
[0089] Figure 3 This is a comparison chart of loss functions for an embodiment of the landslide surge physical model test drag force prediction method based on AM-LSTM of the present invention.
[0090] Figure 4 This is a scatter plot of an embodiment of the landslide surge physical model test drag force prediction method based on AM-LSTM of the present invention. Detailed Implementation
[0091] like Figure 1 As shown, the method for predicting drag force in landslide surge physical model tests based on AM-LSTM according to an embodiment of the present invention includes the following steps:
[0092] Step (1): Based on the spatial geometric parameters of the target landslide area, the Froude similarity criterion is adopted. According to the known constants, the Froude number and length scale of the prototype test and the model test are calculated to construct a three-dimensional hydrodynamic coupling physical model. Dragging force measuring points are set up on the dam surface, and tests are conducted under different test conditions to collect test data.
[0093] Step (2) Perform data cleaning and standardization preprocessing on the original experimental data output by the three-dimensional hydrodynamic coupling physical model to obtain the dataset. Divide the dataset into training set and test set in a 4:1 ratio. According to the requirements of the LSTM model, construct the label dataset and feature dataset by using time window sliding.
[0094] Step (3): Using Python and the sklearn and tensorflow libraries, define the attention layer, introduce the LSTM layer and the attention layer, build an LSTM model with integrated attention mechanism, namely the AM-LSTM model, set the input values of various model parameters and input data to train the model.
[0095] Step (4) uses the test dataset and the trained LSTM model to predict drag force, and compares the actual results with the LSTM model prediction results in multiple dimensions to achieve visualization.
[0096] This embodiment constructs a physical model of landslide surge in step (1), realistically simulating the three-dimensional dynamic changes of the relevant area during landslide occurrence in a controlled experimental environment. This model covers the processes of landslide entry into water, water disturbance, surge formation, propagation, and drag force generation. By setting up experimental groups with different landslide volumes and water depths, the influence of these key factors on landslide surge characteristics is systematically explored, providing experimental data support for subsequent model establishment and data analysis.
[0097] Furthermore, step (1) involves using the Froude similarity criterion based on the spatial geometric parameters of the target landslide area, calculating the Froude number and length scale according to known constants, constructing a three-dimensional hydrodynamic coupled physical model, conducting experiments under different experimental conditions, and collecting experimental data. The process includes the following steps:
[0098] Step (1.1): For the target landslide area, construct a corresponding landslide surge physical model. In this embodiment, a landslide in the reservoir area of a large hydropower station is selected as an example. A physical model test is constructed according to the scale. Dragging force measuring points are arranged at different locations in the study area. Experimental groups with different landslide volumes and water depths are set up. The landslide occurrence and water entry process are modeled by the free sliding of loose rocks. The test groups and test conditions are shown in Table 1.
[0099] Table 1 Experimental Groups and Experimental Conditions
[0100]
[0101] Step (1.2): Data acquisition and analysis system of DHDAS dynamic signal acquisition and analysis system was used to collect test data. After the test was completed, the data obtained by the test was sorted out. Each set of data recorded the change of the drag force magnitude of each drag force measuring point over time, as shown in Table 2.
[0102] Table 2 Experimental Data
[0103]
[0104] Furthermore, step (2) involves data cleaning and standardization preprocessing, dividing the dataset into training and test sets in a 4:1 ratio, and constructing the label and feature datasets according to the requirements of the LSTM model. This process includes the following steps:
[0105] Step (2.1): Read the experimental data into a tabular format. Each data set contains multiple samples, and each data set consists of the corresponding feature variable and the target variable (dragging force). Use the percentile method to remove outliers.
[0106] Given the dataset X = {x1, x2, ..., x...} n Sort the dataset from smallest to largest to obtain the sorted dataset:
[0107] X sorted ={x (1) ,x (2) ...,x (n)}
[0108] Where: X sorted X represents the sorted dataset; (n) This refers to the nth sample in the sorted dataset.
[0109] Set the percentile P up and lower percentile P low Calculate the positions of the upper and lower percentiles in the ordered dataset:
[0110] k up =P up ×n
[0111] k low =P low ×n
[0112] Where: k is the percentile index; P is the percentile; n is the number of samples; and the subscripts up and low represent the upper and lower limits, respectively.
[0113] If the calculated position index k is an integer, then the upper and lower percentile thresholds are: or If k is not an integer, then the percentile threshold is calculated using linear interpolation:
[0114]
[0115] in: The integer part of the percentile position k; For an ordered dataset X sorted The middle position is Data points; For an ordered dataset X sorted The middle position is Data points;
[0116] The upper percentile threshold Q was calculated. up and lower percentile threshold Q low Then, remove all values greater than Q. up and Q low Value: X filtered ={x i ∈X∣Q low ≤x i ≤Q up}
[0117] Where: X filtered This represents the dataset after outlier removal; Q up Q represents the percentile threshold; low Indicates the lower percentile threshold;
[0118] Step (2.2): After removing outliers, the ARIMA model is used to fill in the data for the sample points where outliers were removed; the ARIMA model predicts the missing parts based on the existing data before and after:
[0119]
[0120] in: Data to be filled; y t The values at time t in the time series; φ1, φ2, ..., φ p The parameters for the autoregressive component are θ1, θ2, ..., θ. q ζ represents the parameters of the moving average component. t It is a white noise error term.
[0121] Step (2.3): After completing the data, use the MinMaxScaler method to normalize the dataset, scaling the data features to a specified interval to improve the model's generalization ability. For LSTM, the specified interval is usually set to [0,1]. The transformation formula is:
[0122] Where: x is a feature value in the original data; min(x) is the minimum value in the dataset; max(x) is the maximum value in the dataset.
[0123] Step (2.4): Divide the dataset into training and test sets in a 4:1 ratio, and construct the label and feature datasets according to the requirements of the LSTM model. The process is as follows:
[0124] The data has T time steps. The feature matrix X is a feature matrix containing T time steps, with a size of T×d, where d is the feature dimension. Y is the label matrix with a size of T×1, and the time window size is L.
[0125] A time window of size L is slid across the original input feature matrix X to generate features for each subsequence. For time step t, the corresponding feature matrix is:
[0126] X′ t ={X t ,X t+1 ,...,X t+L-1}
[0127] Where, X′ t It is a subsequence containing L time steps and of size L×d;
[0128] For each feature subsequence X′ t Each of them has a value in the label matrix Y at time t+L that corresponds to it:
[0129] Y′ t =Y t+L
[0130] Among them, Y′ t For the corresponding feature subsequence X′ t The tag value;
[0131] The constructed feature dataset X′ and label dataset Y′ are as follows:
[0132] X′={X′0,X′1,...,X′ T-L-1}, with a size of (TL)×L×d
[0133] Y′={Y′0,Y′1,...,Y′ T-L-1}, size is (TL)×1
[0134] Step (3): Using Python programming, with the help of sklearn and tensorflow libraries, define the attention layer, introduce the LSTM layer and the attention layer, build an LSTM model with integrated attention mechanism, set the input values of various parameters of the LSTM model and input data to train the model. The process is as follows:
[0135] Step (3.1) defines an attention layer. During the rapid decay phase of the surge, the drag force changes significantly and may experience abrupt numerical changes. However, during the slow decay phase, the drag force changes less and tends to stabilize. This attention layer determines how to weight information from different time steps by calculating the similarity between each time step in the input time series. This prevents the LSTM model from focusing too much on the rapid decay phase of the surge during training, thus affecting the prediction results and ensuring the accuracy of the prediction results.
[0136] The input feature dataset has a shape of (N, T, d), where N, T, and d are the batch size, sequence length, and feature dimension at each time step, respectively. First, the attention score e at each time step t is calculated. t :
[0137] e t =tanh(x) t W+b)
[0138] Where, x t Let W be the feature vector of the input feature dataset at time step t; W is the weight matrix; b is the bias term.
[0139] e t The attention weight α at each time step is obtained by using the softmax activation function. t :
[0140]
[0141] Wherein, exp(e t The exponential transformation of the attention score is represented by t; by normalizing the exponential score over all time steps t, it is ensured that... Make each α t It is considered as the attention weight of this time step relative to other time steps.
[0142] The feature vector x of the input data at each time step t With the corresponding attention weight α t Multiplying them together yields the weighted eigenvector C. t :C t =α t ·x t
[0143] Finally, the weighted feature vectors are summed to obtain the final context vector C, which has the shape (N,d) and contains information from all time steps after weighting.
[0144] This attention mechanism dynamically weights information at different time steps by calculating the attention weights at each time step in the input sequence, thereby capturing the importance of different parts of the sequence.
[0145] First, the class is defined and integrated, defining the attention layer as SelfAttention. By inheriting the Layer class from Keras, an attention layer with a custom computation process is created. The build method initializes the attention layer weights and biases; the attention score for each time step is calculated using dot product and tanh; the softmax function converts the attention score into attention weights to represent the importance of each time step; the input value and attention weights are multiplied, and then summed over all time steps to obtain a weighted context vector; finally, the weighted context vector is returned, representing the weighted representation of the input sequence.
[0146] Step (3.2) introduces an LSTM layer and an attention layer to build an LSTM model with an integrated attention mechanism:
[0147] The model is built using the Sequential function, and an LSTM layer is added to the LSTM model to process time series data. The LSTM controls the flow of information through input gates, forget gates, and output gates. For each time step t, the forget gate analyzes the correlation between historical information and the current input to identify redundant data filtered out by neurons, thereby optimizing the neural network's memory efficiency for time series features.
[0148] f t =σ(W f [h t-1 ,x t ]+b f )
[0149] Among them, f t Output value for the forget gate; h t-1 x is the hidden state from the previous time step. t Input the value for the current time step, W f b is the weighted term; f This is a bias term.
[0150] The input gate enhances the neural network's ability to express nonlinear relationships by evaluating the interaction between the current input and the preceding and following states, thereby helping the neural network capture the nonlinear relationships in the temporal variation of drag force.
[0151] i t =σ(W i [h t-1 ,x t ]+b i )
[0152] Among them, i t Input a value for the input gate; The output value of the candidate memory cell.
[0153] After the input gate is determined, the memory unit is updated. The purpose of updating the memory unit is to achieve multi-scale fusion of temporal features through the interactive mapping between the gating signal and the candidate memory, thereby constructing a dynamically adaptive information storage structure.
[0154] Among them, C t The current time step is the state of the memory unit, and the previous time step is the state of the memory unit C. t-1 It is controlled by the forget gate and the input gate.
[0155] Ultimately, the output gate determines which information is output. Through the coordinated modulation of the gating signal and the nonlinear transformation of the memory state, the output gate achieves a controllable mapping from memory representation to predicted features, thereby constructing an information transmission channel with cognitive interpretability.
[0156] o t =σ(W o [h t-1 ,x t ]+b o h t =o t ·tanh(C t )
[0157] Among them: o t h is the output value of the output gate; t The hidden state at the current time step.
[0158] After defining the LSTM layers, a Dropout layer is added after each LSTM layer. Dropout is used to prevent the LSTM model from overfitting. During training, the Dropout layer selects a subset of neurons and discards them with a certain probability, thus improving the robustness of the neural network.
[0159] During training, the output of each neuron is: h′=h·Bernoulli(p)
[0160] Where Bernoulli(p) is a Bernoulli distribution, with an output of 1 for probability p and 0 for other probabilities.
[0161] After setting up all LSTM and Dropout layers, a defined attention layer is introduced; after passing through the LSTM and attention layer, the model's output is passed to a fully connected (Dense) layer, which outputs data with dimension 1.
[0162] The output of the Dense layer is obtained through the following linear transformation: y = W d z+b d
[0163] Where: z is the input value; Wd b is the weight matrix; d y is the bias term matrix; y is the final output.
[0164] The AM-LSTM model consists of four LSTM layers, three Dropout layers, one attention layer, and one Dense layer. The first LSTM layer has 128 neurons, with the `return_sequences` parameter set to `True` and the `input_shape` parameter set to (20, 1). The second layer is a Dropout layer with a dropout rate of 0.2. The third layer is an LSTM layer with 128 neurons, and all other parameters are the same as the first layer. The fourth layer is a Dropout layer with a dropout rate of 0.2. The fifth layer is an LSTM layer with 64 neurons, and all other parameters are the same as the first layer. The sixth layer is a Dropout layer with the same dropout rate. The seventh layer is an LSTM layer with 32 neurons, and all other parameters are the same as the previous LSTM layers. The eighth layer is the attention layer, also known as SelfAttention. The final layer is a Dense layer with one neuron. The Sequential function is used to integrate these layers to form the AM-LSTM model.
[0165] Step (3.3): Determine the input values for each parameter of the model and input the data to train the model:
[0166] The LSTM model was compiled using the `compile` method. The optimizer parameter's input value was `adam` (Adaptive Moment Estimator). For large-scale time series data on drag force and complex neural networks integrating attention mechanisms, the `adam` optimization algorithm adaptively adjusts the learning rate based on the historical gradients of each parameter, eliminating the need for manual learning rate adjustment, thus reducing workload and improving the model's generalization ability. The loss function parameter's input value was `mse` (Mean Squared Error), which directly measures the difference between predicted and actual values. The `fit` method was used with the feature and label datasets as inputs. The `epoch` parameter was set to 20, and the `batch_size` parameter was set to 32, resulting in faster model convergence. The `validation_split` parameter was set to 0.3, meaning 30% of the training data was selected for evaluating model performance.
[0167] Further, in step (4), drag force is predicted using the test dataset and the trained LSTM model, and a multi-dimensional comparison is made between the actual results and the LSTM model prediction results to achieve visualization. The process is as follows:
[0168] Step (4.1) uses the predict function to predict the drag force; using the predict method, the segmented test set data X_test is input into the trained AM-LSTM drag force prediction model, and the prediction result Y_pred is used to draw relevant comparison charts with the help of matplotlib and seaborn libraries to achieve visualization.
[0169] Step (4.2) involves organizing the predicted data and the actual data, and using matplotlib and seaborn libraries to draw relevant plots to visualize the results.
[0170] Set the canvas size to (16, 8), and plot a line graph of the true value Y_test and the predicted value Y_pred with the time step as the x-axis, as shown below. Figure 2 As shown, this is a comparison chart of the prediction results of the AM-LSTM drag force prediction model.
[0171] Set the canvas size to (4,3), and use the history method to extract the training set loss and validation set loss (val_loss) of the AM-LSTM drag force prediction model. Plot a comparison graph of the loss functions with the training epoch as the x-axis, as shown below. Figure 3 As shown.
[0172] Set the canvas size to (4,3), convert the predicted result Y_pred and the test set data Y_test to DataFrame format and merge them using the concat method. Set the axis parameter to 1, i.e., merge along the columns and ignore the original index labels. Name the merged DataFrame "AM-LSTM Model Prediction Result" and "True Value". Use the regplot function to draw a scatter plot with a regression line. The horizontal axis represents the prediction result of the AM-LSTM drag force prediction model, the vertical axis represents the true value, and the regression line indicates that the predicted result and the true value are equal, making the prediction result intuitively displayed. The result is as follows. Figure 4 As shown.
[0173] The results show that the improved AM-LSTM model effectively captures dependencies in long time series. Compared with the traditional LSTM, the AM-LSTM model has improved root mean square error and coefficient of determination evaluation parameters. The improved model is better than the original model in all evaluation indicators and avoids the gradient explosion problem. It shows better predictive ability and adaptability in landslide surge drag force prediction and can accurately predict the dynamic changes of drag force.
Claims
1. A method for predicting drag force in landslide surge physical model tests based on AM-LSTM, characterized in that: Includes the following steps: Step (1): Based on the spatial geometric parameters of the target landslide area, calculate the Froude number for the prototype test and the model test. Where u is the flow velocity; g is the gravitational acceleration; F is the Froude number; L is the length; the subscript f represents the prototype test, and l represents the model test; take g f =g l , ρ f =ρ l The length ratio was obtained. A three-dimensional hydrodynamic coupled physical model was constructed, and drag force measurement points were set up on the dam surface; Step (2) involves preprocessing the experimental data output from the three-dimensional hydrodynamic coupled physical model to obtain a dataset. The dataset is then divided into a training set and a test set. A feature dataset X′ and a label dataset Y′ are constructed by time window sliding. X′={X′0,X′1,...,X′ T-L-1 }, with a size of (TL)×L×d Y′ = {Y′0, Y′ t , ..., Y′ T-L-1}, with a size of (T-L)×1 Where, X′ t ={X t ,X t+1 ,...,X t+L-1 };X′ t Y′ is a subsequence containing L time steps and of size L×d; t For the corresponding feature subsequence X′ t The label value, Y′ t =Y t+L ; Step (3): Define the attention layer, introduce the LSTM layer and the attention layer, build an AM-LSTM model with integrated attention mechanism, set the parameter input values and input data to train the model; the process is as follows: Step (3.1) Calculate the attention score e at each time step t. t :e t =tanh(x) t W+b) Where, x t Let W be the feature vector of the input feature dataset at time step t; W is the weight matrix; b is the bias term. e t The attention weight α at each time step is obtained through the softmax activation function. t : Wherein, exp(e t ) represents the exponential transformation of the attention score; the exponential score is normalized over all time steps t, such that The feature vector x of the input data at each time step t With the corresponding attention weight α t Multiplying them together yields the weighted eigenvector C. t :C t =α t ·x t Finally, the weighted eigenvectors are summed to obtain the final vector C: Step (3.2) uses the Sequential function to build an AM-LSTM model and obtains the forget gate output value: f t =σ(W f [h t-1 ,x t ]+b f ); where f t Output value for the forget gate; h t-1 x is the hidden state from the previous time step. t Input the value for the current time step, W f b is the weighted term; f For bias terms; Determine the output values of the input gate and candidate memory units: i t =σ(W i [h t-1 ,x t ]+b i ) Among them, i t Input a value for the input gate; Output values for candidate memory cells; Update memory units: Among them, C t C represents the state of the memory unit at the current time step. t-1 This is the memory unit from the previous moment; The output gate maps the memory representation to the predicted features through the coordinated modulation of the gating signal and the nonlinear transformation of the memory state: o t =σ(W o [h t-1 ,x t ]+b o );h t =o t ·tanh(C t ) Among them: o t h is the output value of the output gate; t The hidden state at the current time step; Add a Dropout layer after each LSTM layer; during training, the output of each neuron is: h′=h·Bernoulli(p); where: Bernoulli(p) is a Bernoulli distribution; After setting up the LSTM and Dropout layers, a defined attention layer is introduced; the output of the Dense layer is obtained through a linear transformation: y = W d z+b d Where: z is the input value; W d b is the weight matrix; d y is the bias term matrix; y is the final output. Set the activation function and loss function of the AM-LSTM drag force prediction model; use the fit function, input the feature dataset and label dataset, calculate the change of loss value in each training round of the AM-LSTM drag force prediction model, and set the training rounds and training batches to train the AM-LSTM drag force prediction model; Step (4) uses the predict method to input the segmented test set data X_test as the input value into the trained AM-LSTM drag force prediction model to predict the drag force. The true value and the prediction result are compared in multiple dimensions and visualized by drawing a comparison chart.
2. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (2), the experimental data undergoes data cleaning and standardization preprocessing, as follows: (2.1) The dataset of experimental data is X = {x1, x2, ..., x...} n Sort by size from smallest to largest: X sorted ={x (1) ,x (2) ...,x (n) } Where: X sorted X represents a sorted, ordered dataset; (n) This refers to the nth sample in the sorted dataset. Set the percentile P up and lower percentile P low Calculate the upper and lower percentile positions in an ordered dataset: k up =P up ×n;k low =P low ×n Where: k is the percentile index; P is the percentile; n is the number of samples; up represents the upper limit, and low represents the lower limit; if the calculated position index k is an integer, then the upper and lower percentile thresholds are... or Otherwise, use linear interpolation to calculate the percentile threshold: in: The integer part of the percentile position k; For an ordered dataset X sorted The middle position is Data points; For an ordered dataset X sorted The middle position is Data points; The result is that the elimination of values greater than Q is obtained. up and Q low Dataset X filtered : X filtered ={x i ∈X∣Q low ≤x i ≤Q up };Q low Q represents the percentile threshold. up Indicates the lower percentile threshold; (2.2) The ARIMA model is used to populate the data for the sample points after removing outliers: in: Data to be filled; y t The values at time t in the time series; φ1, φ2, ..., φ p The parameters for the autoregressive component are θ1, θ2, ..., θ. q ζ represents the parameters of the moving average component. t It is a white noise error term; (2.3) Normalize the padded data using the MinMaxScaler method: Where: x′ is the feature value after regularization; x is a feature value in the original data; min(x) is the minimum value in the dataset; max(x) is the maximum value in the dataset.
3. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (2), the dataset is divided into a training set and a test set. The feature matrix X is a feature matrix containing T time steps, with a size of T×d, where d is the feature dimension. Y is the label matrix with a size of T×1, and the time window size is L. A time window of size L is slid across the original input feature matrix X to generate features for each subsequence. For time step t, the corresponding feature matrix is: X′ t ={X t ,X t+1 ,...,X t+L-1 } Where, X′ t It is a subsequence containing L time steps, with a size of L×d; For each feature subsequence X′ t The values of the label matrix Y at time t+L are related to X′. t correspond: Y′ t =Y t+L ; where Y′ t For the corresponding feature subsequence X′ t The tag value.
4. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (3.2), an AM-LSTM model is built using the Sequential function, and an LSTM layer is added to process the time series data. The LSTM controls the flow of information through the input gate, forget gate, and output gate, yielding the forget gate output value: f t =σ(W f [h t-1 ,x t ]+b f ) Among them, f t Output value for the forget gate; h t-1 x is the hidden state from the previous time step. t Input the value for the current time step, W f b is the weighted term; f This is a bias term.
5. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM according to claim 1, characterized in that: In step (3.2), the fit function is used to input the feature dataset X_train and the label dataset Y_train as the validation set, calculate the change of loss value in each training round of the AM-LSTM drag force prediction model, and set the training round epoch and training batch_size to train the AM-LSTM drag force prediction model.
6. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (4), the predict method is used to input the segmented test set data X_test as the input value into the trained AM-LSTM drag force prediction model, and the prediction result Y_pred is visualized by plotting relevant comparison charts using matplotlib and seaborn libraries.
7. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (4), the canvas size is set, the time step is used as the horizontal axis, and a line graph of the true value Y_test and the predicted value Y_pred is drawn to obtain a comparison graph of the prediction results of the AM-LSTM drag force prediction model.
8. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (4), the canvas size is set, and the history method is used to extract the training set loss and validation set loss of the AM-LSTM drag force prediction model. The training epoch is used as the horizontal axis to draw a comparison chart of the loss functions.
9. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 1, characterized in that: In step (4), the canvas size is set, the prediction result Y_pred and the test set data Y_test are converted into DataFrame format and merged using the concat method. The column names of the merged DataFrame are named AM-LSTM model prediction result and true value. The regplot function is used to draw a scatter plot with regression lines. The horizontal axis represents the prediction result of the AM-LSTM drag force prediction model, the vertical axis represents the true value, and the regression line represents the prediction result and the true value being equal.
10. The method for predicting drag force in landslide surge physical model tests based on AM-LSTM as described in claim 9, characterized in that: In step (4), the canvas size is set, the prediction result Y_pred and the test set data Y_test are converted into DataFrame format and merged using the concat method. The parameter axis is set to 1, and the merged DataFrame is named AM-LSTM model prediction result and true value.
Citation Information
Patent Citations
Seismic surge height calculation method
CN113552628A
Landslide surge height prediction method and system based on sparrow optimization random forest model
CN119416303A