A concrete gravity dam deformation prediction method and system based on an SSA-Transformer-BiLSTM model and a storage medium
By optimizing hyperparameters using an improved Transformer-BiLSTM model and a sparrow search algorithm, the problems of insufficient nonlinear fitting and weak long-term feature capture ability in dam deformation prediction were solved, achieving efficient and accurate deformation prediction results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING NARI WATER RESOURCES & HYDROPOWER TECH CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-05
Smart Images

Figure CN122153379A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deformation prediction technology for concrete gravity dams, and in particular to a method, system, and storage medium for predicting deformation of concrete gravity dams based on the SSA-Transformer-BiLSTM model. Background Technology
[0002] To monitor the operational status of dams, various monitoring instruments are typically deployed inside the dam body to collect real-time data on environmental parameters such as water level, temperature, and rainfall, as well as effects such as displacement, seepage, stress, and strain, resulting in a massive dataset. Dam deformation is one of the most direct and important indicators reflecting its structural behavior. Utilizing monitoring data to uncover the complex nonlinear relationships between deformation and various influencing factors, and achieving accurate prediction of deformation, is of great significance for ensuring the safe operation of dams.
[0003] Currently, dam deformation prediction methods mainly include statistical models, deterministic models, and hybrid models. Statistical models often employ linear or simple nonlinear regression, which can only fit low-order linear relationships and struggles to capture the strong nonlinear coupling characteristics between dam deformation and multiple influencing factors. Deterministic models, based on finite element and mechanical principles, require a large number of precise physical parameters such as the dam's elastic modulus, Poisson's ratio, and boundary constraints. However, these parameters are difficult to obtain completely in actual engineering, thus significantly limiting their application. Hybrid models (a combination of statistical and deterministic models) combine the advantages of the former two, but they lack the ability to express features effectively when faced with high-dimensional, non-stationary monitoring data such as water level, temperature, time, and rainfall, making accurate fitting difficult.
[0004] With the development of deep learning technology, recurrent neural networks (RNNs) and their variants, such as long short-term memory networks (LSTMs) and gated recurrent units (GRUs), have been introduced into the field of dam deformation prediction. These models can fit the complex relationship between deformation and influencing factors using nonlinear network structures, thus addressing to some extent the limitations of statistical and deterministic models in terms of expressive power. However, RNN models suffer from the vanishing / exploding gradient problem and can only perform sequential computations, resulting in low training efficiency. When faced with long-term, high-duration, and high-dimensional monitoring data sequences for dams, their ability to capture long-term temporal dependencies is significantly insufficient.
[0005] Transformer models can process sequential data in parallel through self-attention mechanisms, giving them a stronger ability to model long-range dependencies and making them outstanding in the field of time series prediction. However, the native Transformer uses an encoder-decoder structure, which results in structural redundancy when used for single-step regression prediction of dam deformation. Furthermore, its generalized location encoding is difficult to adapt to the strong periodicity and seasonality of dam monitoring data, leading to insufficient accuracy and limited generalization ability when directly applied to dam deformation prediction tasks.
[0006] Meanwhile, the prediction accuracy of deep learning models is highly dependent on the selection of hyperparameters. Traditional hyperparameter adjustment methods such as manual trial and error and grid search are inefficient and time-consuming, making it difficult to obtain the optimal combination. Furthermore, intelligent optimization algorithms such as PSO and GA are prone to premature convergence and getting trapped in local optima, which further limits the improvement of the accuracy of dam deformation prediction models.
[0007] In summary, existing dam deformation prediction methods generally suffer from problems such as insufficient nonlinear fitting, weak ability to capture long-term features, poor adaptability of model structure to dam monitoring data, and inefficient hyperparameter optimization, ultimately resulting in low prediction accuracy and difficulty in meeting actual engineering needs. Summary of the Invention
[0008] Purpose of the invention: The purpose of this invention is to provide a method for predicting the deformation of concrete gravity dams based on the SSA-Transformer-BiLSTM model. Based on the improved Transformer architecture, a bidirectional long short-term memory network (BiLSTM) is introduced to construct a Transformer-BiLSTM dam deformation prediction model. By using the sparrow search algorithm to optimize the model hyperparameters, efficient and accurate prediction of concrete gravity dam deformation can be achieved.
[0009] Another objective of this invention is to provide a deformation prediction system and storage medium for concrete gravity dams based on the SSA-Transformer-BiLSTM model.
[0010] Technical Solution: To achieve the above objectives, the present invention provides a method for predicting the deformation of concrete gravity dams based on the SSA-Transformer-BiLSTM model, comprising the following steps:
[0011] S1. Construct the influencing factors of dam displacement and deformation from the dimensions of timeliness, temperature, rainfall, and water level. Obtain dam safety monitoring data within the observation period, including upstream water level, downstream water level, temperature, rainfall, and dam displacement and deformation monitoring values. Calculate the values of the influencing factors based on the monitoring data.
[0012] S2. Time alignment preprocessing is performed on the values of all influencing factors and the monitoring values of dam displacement and deformation. Based on the time-aligned influencing factors, the influencing factors with the highest correlation to dam displacement and deformation are selected from the dimensions of timeliness, temperature, rainfall, and water level. A dataset of dam deformation influencing factors is constructed based on the selected influencing factor values and the monitoring values of dam displacement and deformation.
[0013] S3. Construct a Transformer-BiLSTM dam deformation prediction model and train it using a dam deformation influencing factor dataset. The optimal hyperparameter combination of the Transformer-BiLSTM dam deformation prediction model is determined using the Sparrow Search Algorithm (SSA).
[0014] S4. Re-collect dam safety monitoring data, calculate the values of the selected influencing factors, and use the Transformer-BiLSTM dam deformation prediction model to predict the dam displacement and deformation.
[0015] Preferably, the influencing factors of the timeliness dimension include: b, ln(b+1), , , , , , The factors influencing temperature include: , , , , , , , The influencing factors of rainfall dimension include: r, ra v The influencing factors of water level include water: ul, tl, ula v ule w tla v tle w ;
[0016] Let T0 be the initial measurement date, b be the number of days from the observation date to the initial measurement date T0, r be the rainfall, and ra be the total rainfall. v The average rainfall over the preceding v days from the observation date to the initial measurement date; ul is the upstream water level, tl is the downstream water level, and ula is the downstream water level. v tla is the average upstream water level of the preceding v days from the observation date to the initial measurement date. v The ule represents the average downstream water level over the preceding v days from the observation date to the initial measurement date. w To represent the upstream water level raised to the power of w, tle w Let w represent the downstream water level raised to the power of w; v = {1, 3, 7, 15, 30, 60, 90}; w = {1, 2, 3, 4, 5}. When v ≤ b, we take v = b.
[0017] Preferably, the time-aligned preprocessing of all influencing factors includes: compressing and merging or interpolating all influencing factor values and dam displacement deformation monitoring values at daily time intervals to form a multivariate time series influencing factor matrix and a dam displacement deformation monitoring vector; the compression and merging refers to compressing and merging multiple data of the same type obtained within one day into one data for the same monitoring point; the interpolation refers to interpolating for missing data at a certain monitoring point; wherein, missing values of influencing factors in the rainfall dimension are interpolated using "0", and influencing factors in the time, temperature, and water level dimensions, as well as dam displacement deformation monitoring values, are interpolated based on a linear relationship;
[0018] The time-aligned impact factor matrix is represented as follows: ,
[0019] In this table, rows represent the number of days, columns represent the number of impact factors, and M represents the number of impact factors. Indicates the first A column vector consisting of the values of various influencing factors over 1 to b days;
[0020] The dam displacement and deformation monitoring vector is characterized as follows: =[ ] T , Indicates the first The dam displacement and deformation monitoring values for the day.
[0021] Preferably, the step of selecting the influencing factors with the highest correlation to dam displacement and deformation from the dimensions of timeliness, temperature, rainfall, and water level includes: calculating the relationship between each influencing factor vector in the influencing factor matrix X and the dam displacement and deformation monitoring vector. The Pearson correlation coefficient, denoted as the vector formed by the m-th influencing factor. = , =[ ] T , , Then, the Pearson correlation coefficient between the m-th influencing factor and the dam displacement deformation is:
[0022]
[0023] in, express The Middle Each element value The value Y in the dam displacement and deformation monitoring data represents the first... Each element value express The arithmetic mean of all elements in the given set. The arithmetic mean of all elements in the dam displacement and deformation monitoring vector Y is represented. All calculated Pearson correlation coefficients are sorted, and the influencing factors with the highest correlation to dam displacement and deformation are selected from the dimensions of timeliness, temperature, rainfall, and water level.
[0024] The Pearson correlation coefficient ranges from -1 to 1: the closer the absolute value is to 1, the stronger the linear correlation; a positive value indicates a positive correlation, a negative value indicates a negative correlation; and a value close to 0 indicates no linear correlation.
[0025] Preferably, the top-ranking influencing factors are selected based on the timeliness dimension, the temperature dimension, the rainfall dimension (including factors related to 'r' and other selected top-ranking influencing factors), and the water level dimension (including factors related to 'ul', 'tl', and 'ula'). v ule w tla v tle w The top 1 impact factor.
[0026] Preferably, all the selected influencing factor vectors and dam displacement deformation monitoring vectors are normalized to construct the dam deformation influencing factor dataset, including the input feature matrix. , The target feature vector is ;
[0027] in, This represents the vector consisting of the normalized values of the n selected influence factors on day j. For normalization .
[0028] Preferably, the Transformer-BiLSTM dam deformation prediction model includes an input projection layer, an encoding layer, a BiLSTM layer, and a fully connected layer. The encoding layer includes a multi-head attention mechanism, residual connections and layer normalization, and a feedforward neural network. The BiLSTM layer includes two independent LSTM networks, forming a bidirectional LSTM layer. Each LSTM network includes a forget gate, an input gate, a cell state update, and an output gate. The bidirectional LSTM layer is used to further extract the sequential dependencies in the temporal features.
[0029] The input projection layer will 3D input feature matrix Mapping to d m A high-dimensional feature space with an output dimension of 1. Feature matrix , as input to the coding layer, where d m This is used to increase the dimensionality of the feature dimension and perform preliminary feature purification for the attention dimension in the model hyperparameters.
[0030] The multi-head self-attention mechanism of the encoding layer is used to extract the feature matrix. The global dependencies of different influencing factors on the feature dimension are shown in the output dimension. Global fusion features As input to the BiLSTM layer, it is used to characterize the comprehensive contribution of each influencing factor to the dam displacement and deformation;
[0031] The BiLSTM layer globally fuses features using forward LSTM and backward LSTM respectively. Perform forward and reverse traversal to further explore the historical evolution patterns and dependencies of dam deformation, with the output dimension being... bidirectional fusion features , as the input to the fully connected layer, where h s The number of neurons in each LSTM network is adjusted to fully utilize the forward and backward sequence information of historical data, thereby improving the model's ability to capture dynamic changes over time.
[0032] The fully connected layer supports bidirectional fusion features. Weighted fusion and dimensionality compression are performed, and high-dimensional temporal features are mapped to single-dimensional displacement prediction values through a linear activation function, completing the transformation from multi-factor spatiotemporal feature extraction to dam displacement deformation prediction output; target feature vector As a supervisory signal, it is used to calculate the error between the predicted value and the true value, and to guide the learning of model parameters.
[0033] Preferably, the target feature vector As a supervisory signal, it is used to calculate the error between the predicted and true values, guiding the learning of model parameters, including:
[0034] The dataset of dam deformation influencing factors was divided into training, validation, and test sets. Predictions from the training set were normalized to obtain predicted values, and the error between the predicted and actual values was calculated. Backpropagation was used to adjust the model's internal parameters (weights and biases). The validation set was used to optimize hyperparameters to obtain the optimal combination. The predicted values from the test set were then compared with the actual values to calculate the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). 2 The accuracy of the model is comprehensively evaluated using three evaluation indicators, and the calculation formula is as follows:
[0035] ,
[0036] ,
[0037] ,
[0038] in, These are the model's predicted values. For the true value, The average of the true values is N, and the sample size is N.
[0039] Preferably, the Sparrow Search Algorithm (SSA) is used to determine the optimal combination of hyperparameters for the Transformer-BiLSTM dam deformation prediction model, including:
[0040] S301. Select the attention dimension, number of heads in the multi-head attention mechanism, number of Transformer encoder layers, number of BiLSTM layers, and number of BiLSTM neurons per layer in the Transformer-BiLSTM dam deformation prediction model as hyperparameter optimization variables to form a 5-dimensional hyperparameter combination to be optimized.
[0041] Define the sparrow population size and set the SSA algorithm parameters, including: maximum number of iterations T, discoverer ratio PD, vigilant ratio SD, and safety threshold ST; the sparrow population size is independent of the number of optimization variables, and the population size is a preset manually set value; each sparrow represents a set of hyperparameter combinations to be optimized.
[0042] S302. Substitute each sparrow representing a hyperparameter combination into the Transformer-BiLSTM dam deformation prediction model, and use the training set for training and prediction. Calculate the model's coefficient of determination R on the validation set. 2 This serves as the fitness value for the sparrow.
[0043] Calculate the fitness values of all sparrows and determine the current best and worst fitness values. The higher the fitness value, the better the corresponding hyperparameter combination. Divide the sparrows into discoverers, followers, and scouts according to their fitness. The globally optimal sparrow position is the hyperparameter combination represented by the sparrow with the highest fitness value.
[0044] S304. Update the sparrow's position according to the position update strategy of the sparrow search algorithm. The update formula is as follows:
[0045] Discoverer location update formula:
[0046] ,
[0047] Follower position update formula:
[0048] ,
[0049] Scout position update formula:
[0050] ,
[0051] in, Let t represent the value of the s-th sparrow in the z-th hyperparameter at the t-th iteration, where z = 1~5 and t is the current iteration number; This represents the maximum number of iterations. This is the alarm value; This is a safety threshold; These are random numbers that follow a normal distribution. It is a matrix of all 1s; It is a random number; The best location for the discoverer; For a matrix where each element is 1 or -1, ; K is the step size control parameter; K is a random number in the range [-1, 1]. , and Let be the fitness value of the s-th sparrow, the best fitness value globally, and the worst fitness value globally, respectively. It should be a very small constant to avoid the denominator being zero;
[0052] S305. Calculate the new fitness value corresponding to the updated sparrow position. If the new position has better fitness, update the sparrow position according to S305.
[0053] S304. Determine whether the maximum number of iterations has been reached or the convergence condition has been met. If yes, output the hyperparameter combination corresponding to the globally optimal sparrow position as the optimal hyperparameter combination; this optimal hyperparameter combination corresponds to the globally highest fitness value. If no, return to S302 and continue iterating.
[0054] The present invention discloses a concrete gravity dam deformation prediction system based on the SSA-Transformer-BiLSTM model, comprising the following steps:
[0055] Impact Factor Calculation Module: Used to acquire dam safety monitoring data, including upstream water level, downstream water level, temperature, rainfall, and dam displacement and deformation monitoring values. Based on the monitoring data, it calculates impact factors, including time factor, temperature factor, rainfall factor, and water level factor. Each impact factor includes multiple factors.
[0056] Dataset construction module: This module is used to perform time-aligned preprocessing on all influencing factors and dam displacement and deformation monitoring values, and to select factors from all time-aligned influencing factors that have a higher correlation with dam displacement and deformation monitoring values than a set threshold, in order to construct a dam deformation influencing factor dataset.
[0057] Prediction model building module: used to build a Transformer-BiLSTM dam deformation prediction model and train it using a dam deformation influencing factor dataset. The optimal hyperparameter combination of the Transformer-BiLSTM dam deformation prediction model is determined by the Sparrow Search Algorithm (SSA).
[0058] Dam displacement and deformation prediction module: used to re-collect dam safety monitoring data, calculate dam deformation influence factor values, and use the Transformer-BiLSTM dam deformation prediction model to predict dam displacement and deformation.
[0059] The present invention discloses a computer-readable storage medium comprising a stored computer program that, when executed by a processor, implements the above-described method for predicting the deformation of a concrete gravity dam based on an SSA-Transformer-BiLSTM model.
[0060] Beneficial effects: The present invention has the following advantages: 1. The present invention is based on the improved Transformer architecture and introduces the bidirectional long short-term memory network BiLSTM to construct the Transformer-BiLSTM dam deformation prediction model. It not only utilizes the global feature capture capability of Transformer, but also leverages the temporal modeling advantages of BiLSTM, which can better handle the complex spatiotemporal dependencies in dam deformation monitoring data.
[0061] 2. Taking into account various influencing factors such as upstream and downstream water levels, temperature, timeliness, and rainfall, a comprehensive feature system was constructed, which improved the accuracy and robustness of the prediction data of the Transformer-BiLSTM dam deformation prediction model.
[0062] 3. The Sparrow Search algorithm is used for hyperparameter optimization, which overcomes the problems of existing model optimization methods such as being prone to getting trapped in local optima and slow convergence speed, thus improving model performance and efficiency. Attached Figure Description
[0063] Figure 1 A schematic diagram of the process for predicting the deformation of a concrete gravity dam.
[0064] Figure 2 A schematic diagram showing the layout of measuring points for a gravity dam;
[0065] Figure 3 Here is a diagram of the Transformer-BiLSTM model structure;
[0066] Figure 4 The image shows the prediction results of the EX-12 right measuring point model on the dam crest using the prediction method of this invention. Detailed Implementation
[0067] The technical solution of the present invention will be described in detail below with reference to the embodiments and accompanying drawings.
[0068] This invention takes a concrete gravity dam as an example and proposes a method for predicting the deformation of a concrete gravity dam based on the SSA-Transformer-BiLSTM model.
[0069] like Figure 2 As shown, a concrete gravity dam has a crest elevation of 252.00m, a maximum dam height of 107m, a total crest length of 371m, a crest width of 16m-20m, and a total reservoir capacity of 971 million m³. 3 The total installed capacity is 510MW, comprising 22 dam sections. A tension line system is installed in the cable trench downstream of the dam crest to monitor the horizontal displacement of the dam crest. The tension line on the dam crest is at 2... # ~7 # 7 # ~16 # 16 # ~22 # The dam section is divided into three sections, with measuring points numbered EX-03~EX-07, EX-08 (right / left) to EX-13 (right / left), EX-14~EX-15, and EX-17~EX-21, totaling 24 measuring points. The distribution of the measuring points is as follows: Figure 2 As shown. The actual measurement data from the right measuring point of EX-12 from March 28, 2012 to June 19, 2024 were used for training and prediction, with reference to... Figure 1 Specifically, it includes the following:
[0070] 1. Receive monitoring data from the EX-12 right side point of the dam crest and the dam monitoring instruments from March 28, 2012 to June 19, 2024; wherein the monitoring equipment is environmental monitoring equipment for upstream and downstream water levels, rainfall, temperature and other parameters, and the corresponding monitoring data is upstream and downstream water level, rainfall and temperature data; calculate multiple influencing factors (referred to as time factor, temperature factor, rainfall factor and water level factor) in the dimensions of timeliness, temperature, rainfall and water level from January 1, 2013 to June 19, 2024 based on the monitoring data.
[0071] Second, all influencing factors and dam displacement deformation monitoring values were aligned, compressed, merged, or interpolated to form a multivariate time series influencing factor matrix on a daily basis, as well as a dam displacement deformation monitoring vector. Missing values of rainfall response factors were interpolated using "0". Time, temperature, water level factors, and dam displacement deformation monitoring values were interpolated based on linear relationships, resulting in a total of 4188 data points.
[0072] Third, normalize the obtained data and construct a dataset.
[0073] The data is standardized using min-max normalization, expressed as:
[0074] ;
[0075] To further improve the accuracy of dam deformation prediction, the influencing factors with the highest correlation to dam displacement and deformation were selected from all influencing factors. These included the top-ranked time factor, top-ranked temperature factor, rainfall factor related to 'r', and the top-ranked rainfall factor related to ul, tl, and ula. v ule w tla v tle w The water level factor. A dataset is constructed by combining the time series vectors of the selected influencing factor values with the time series vectors of the dam displacement and deformation data.
[0076] The dataset was randomly divided into training, validation, and test sets in an 8:1:1 ratio; the training set contained 3350 data points, while the validation and test sets each contained 418 data points. The training set was used for model parameter training, the validation set was used for SSA hyperparameter optimization and selecting the best model, and the test set was strictly reserved for the final calculation of MSE, RMSE, and R. 2 Three evaluation indicators.
[0077] IV. Using the Sparrow Search Algorithm (SSA) to find the optimal parameters of the Transformer-BiLSTM dam deformation prediction model. The structure of the SSA-Transformer-BiLSTM dam displacement and deformation prediction model is as follows: Figure 3 As shown, it consists of an input projection layer, an encoding layer, a BiLSTM layer, and a fully connected layer. The encoding layer is composed of a multi-head attention mechanism, residual connections and layer normalization, and a feedforward neural network. The BiLSTM layer consists of two independent LSTM networks forming a bidirectional structure. Each LSTM includes a forget gate, an input gate, a cell state update, and an output gate. The bidirectional LSTM layer is used to further extract the sequential dependencies in the temporal features.
[0078] The coefficient of determination R on the model validation set 2 The hyperparameters of the fitness function of the sparrow search algorithm are optimized to obtain the optimal combination of hyperparameters, the optimal model is saved, and predictions are made on the dataset.
[0079] The Transformer-BiLSTM network model was trained using the Sparrow Search Algorithm (SSA), including:
[0080] 4.1 Five variables in the Transformer-BiLSTM network model—attention dimension, number of multi-head attention heads, number of Transformer encoder layers, number of BiLSTM layers, and number of neurons per layer—were used as hyperparameters. The search range of the hyperparameters is set as shown in Table 1. The population size was set to 10, the maximum number of iterations to 100, the epoch to 50, the warning value ST to 0.6, the proportion of discoverers PD to 0.7, and the proportion of sparrows aware of danger SD to 0.2, and the population was initialized accordingly.
[0081] Table 1. Search range of model hyperparameters
[0082] hyperparameters Attention dimension Bullish attention head count Encoder layers BiLSTM layers Number of neurons per layer Range of values [64,256] [6,32] [1,8] [1,8] [10,100]
[0083] 4.2 Substitute the hyperparameter values into the model parameters for modeling and prediction, and calculate the determination coefficient of the validation set data as the sparrow fitness;
[0084] 4.3 Calculate the fitness value of each sparrow according to the objective function, find the current best fitness value and worst fitness value, determine the roles of the discoverer, follower and scout sparrow, and record the current global best position;
[0085] 4.4 Update the sparrow's position according to the position update strategy of the sparrow search algorithm;
[0086] 4.5 Calculate the fitness of the new position; if the new position is better, update the sparrow's position.
[0087] 4.6 Determine whether the maximum number of iterations has been reached or the convergence condition has been met. If yes, output the optimal hyperparameter combination; otherwise, return to step 4.2 to continue iterating.
[0088] To verify the predictive performance of the established model, prediction results based on the model described in this invention are as follows: Figure 4 As shown, the predicted results fit the measured values well, and the prediction accuracy is high. Simultaneously, other deep learning models such as LSTM, Transformer, and BP neural networks were used to predict the same measurement point, and the statistical indicators of the prediction results are shown in Table 2 below.
[0089] Table 2 Comparison of prediction performance of various models
[0090] Predictive Model MAE / mm RMSE / mm <![CDATA[R 2 / %]]> BP 0.9518 1.2143 95.35 LSTM 0.9013 1.0145 95.89 Transformer 0.8846 0.9756 96.12 Transformer-BiLSTM 0.8514 0.9615 96.83 SSA-Transformer-BiLSTM 0.6243 0.7516 98.15
[0091] As shown in Table 2, compared with BP, LSTM, and Transformer, SSA-Transformer-BiLSTM has higher R... 2 The performance improved by 2.93%, 2.35%, and 2.11% respectively. After hyperparameter optimization using the Sparrow Search Algorithm (SSA), compared to the Transformer-BiLSTM model built with default parameters, R...2 It improved by 1.36%; the MAE and RMSE values of the model in this invention are closer to 0, and R... 2 It is closer to 1 and shows improvement compared to other models, verifying the rationality and scientific validity of the present invention.
[0092] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Those skilled in the art should understand that various modifications or substitutions can be made to the present invention without departing from the spirit and scope of the claims, and such modifications and substitutions all fall within the protection scope of the present invention.
Claims
1. A method for predicting the deformation of concrete gravity dams based on the SSA-Transformer-BiLSTM model, characterized in that, Includes the following steps: S1. Construct the influencing factors of dam displacement and deformation from the dimensions of timeliness, temperature, rainfall, and water level. Obtain dam safety monitoring data within the observation period, including upstream water level, downstream water level, temperature, rainfall, and dam displacement and deformation monitoring values. Calculate the values of the influencing factors based on the monitoring data. S2. Time alignment preprocessing is performed on the values of all influencing factors and the monitoring values of dam displacement and deformation. Based on the time-aligned influencing factors, the influencing factors with the highest correlation to dam displacement and deformation are selected from the dimensions of timeliness, temperature, rainfall, and water level. A dataset of dam deformation influencing factors is constructed based on the selected influencing factor values and the monitoring values of dam displacement and deformation. S3. Construct a Transformer-BiLSTM dam deformation prediction model and train it using a dam deformation influencing factor dataset. The optimal hyperparameter combination of the Transformer-BiLSTM dam deformation prediction model is determined using the Sparrow Search Algorithm (SSA). S4. Re-collect dam safety monitoring data, calculate the values of the selected influencing factors, and use the Transformer-BiLSTM dam deformation prediction model to predict the dam displacement and deformation.
2. The method for predicting the deformation of a concrete gravity dam according to claim 1, characterized in that, The influencing factors for the timeliness dimension include: b, ln(b+1) , , , , , The factors influencing temperature include: , , , , , , , The influencing factors of rainfall dimension include: r, ra v The influencing factors of water level include: ul, tl, and ula. v ule w tla v tle w ; Let T0 be the initial measurement date, b be the number of days from the observation date to the initial measurement date T0, r be the rainfall, and ra be the total rainfall. v The average rainfall over the preceding v days from the observation date to the initial measurement date; ul is the upstream water level, tl is the downstream water level, and ula is the downstream water level. v tla is the average upstream water level of the preceding v days from the observation date to the initial measurement date. v The ule represents the average downstream water level over the preceding v days from the observation date to the initial measurement date. w To represent the upstream water level raised to the power of w, tle w Let w represent the downstream water level raised to the power of w; v = {1, 3, 7, 15, 30, 60, 90}; w = {1, 2, 3, 4, 5}. When v ≤ b, we take v = b.
3. The method for predicting the deformation of a concrete gravity dam according to claim 2, characterized in that, The time-aligned preprocessing of all influencing factors includes: compressing and merging or interpolating all influencing factor values and dam displacement deformation monitoring values at daily time intervals to form a multivariate time series influencing factor matrix and a dam displacement deformation monitoring vector. The compression and merging refers to compressing and merging multiple data points of the same type obtained within a day into one data point for the same monitoring point. The interpolation refers to interpolating missing data for a specific monitoring point. Specifically, missing values for rainfall-related influencing factors are interpolated using "0", while influencing factors for timeliness, temperature, and water level, as well as dam displacement deformation monitoring values, are interpolated based on linear relationships. The time-aligned impact factor matrix is represented as follows: , In this table, rows represent the number of days, columns represent the number of impact factors, and M represents the number of impact factors. Indicates the first A column vector consisting of the values of various influencing factors over 1 to b days; The dam displacement and deformation monitoring vector is characterized as follows: =[ ] T , Indicates the first The dam displacement and deformation monitoring values for the day.
4. The method for predicting the deformation of a concrete gravity dam according to claim 3, characterized in that, The process of selecting the most relevant influencing factors to dam displacement and deformation from the dimensions of timeliness, temperature, rainfall, and water level includes: calculating the relationship between each influencing factor vector in the influencing factor matrix X and the dam displacement and deformation monitoring vector. The Pearson correlation coefficient, denoted as the vector formed by the m-th influencing factor. = , =[ ] T , , Then, the Pearson correlation coefficient between the m-th influencing factor and the dam displacement deformation is: , in, express The Middle Each element value The value Y in the dam displacement and deformation monitoring data represents the first... Each element value express The arithmetic mean of all elements in the given set. The arithmetic mean of all elements in the dam displacement and deformation monitoring vector Y is represented. All calculated Pearson correlation coefficients are sorted, and the influencing factors with the highest correlation to dam displacement and deformation are selected from the dimensions of timeliness, temperature, rainfall, and water level.
5. The method for predicting the deformation of a concrete gravity dam according to claim 4, characterized in that, All selected influencing factor vectors and dam displacement deformation monitoring vectors are normalized to construct the dam deformation influencing factor dataset, including the input feature matrix. , The target feature vector is ; in, This represents the vector consisting of the normalized values of the n selected influence factors on day j. For normalization .
6. The method for predicting the deformation of a concrete gravity dam according to claim 5, characterized in that, The Transformer-BiLSTM dam deformation prediction model includes an input projection layer, an encoding layer, a BiLSTM layer, and a fully connected layer. The encoding layer includes a multi-head attention mechanism, residual connections and layer normalization, and a feedforward neural network. The BiLSTM layer consists of two independent LSTM networks, forming a bidirectional LSTM layer. Each LSTM network includes a forget gate, an input gate, a cell state update, and an output gate. The bidirectional LSTM layer is used to further extract the sequential dependencies in the temporal features. The input projection layer will 3D input feature matrix Mapping to d m A high-dimensional feature space with an output dimension of 1. Feature matrix , as input to the coding layer, where d m This is used to increase the dimensionality of the feature dimension and perform preliminary feature purification for the attention dimension in the model hyperparameters. The multi-head self-attention mechanism of the encoding layer is used to extract the feature matrix. The global dependencies of different influencing factors on the feature dimension are shown in the output dimension. global fusion features As input to the BiLSTM layer, it is used to characterize the comprehensive contribution of each influencing factor to the dam displacement and deformation; The BiLSTM layer globally fuses features using forward LSTM and backward LSTM respectively. Perform forward and reverse traversal to further explore the historical evolution patterns and dependencies of dam deformation, with the output dimension being... bidirectional fusion features , as the input to the fully connected layer, where h s The number of neurons in each LSTM network is adjusted to fully utilize the forward and backward sequence information of historical data, thereby improving the model's ability to capture dynamic changes over time. The fully connected layer supports bidirectional fusion features. Weighted fusion and dimensionality compression are performed, and high-dimensional temporal features are mapped to single-dimensional displacement prediction values through a linear activation function, thus completing the transformation from multi-factor spatiotemporal feature extraction to dam displacement deformation prediction output. Target feature vector As a supervisory signal, it is used to calculate the error between the predicted value and the true value, and to guide the learning of model parameters.
7. The method for predicting the deformation of a concrete gravity dam according to claim 6, characterized in that, The target feature vector As a supervisory signal, it is used to calculate the error between the predicted and true values, guiding the learning of model parameters, including: The dataset of dam deformation influencing factors was divided into training, validation, and test sets. Predictions from the training set were normalized to obtain predicted values, and the error between the predicted and actual values was calculated. Backpropagation was used to adjust the model's internal parameters (weights and biases). The validation set was used to optimize hyperparameters to obtain the optimal combination. The predicted values from the test set were then compared with the actual values to calculate the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). 2 The accuracy of the model is comprehensively evaluated using three evaluation indicators, and the calculation formula is as follows: , , , in, These are the model's predicted values. For the true value, is the average of the true values, and N is the sample size.
8. The method for predicting the deformation of a concrete gravity dam according to claim 7, characterized in that, The Sparrow Search Algorithm (SSA) was used to determine the optimal combination of hyperparameters for the Transformer-BiLSTM dam deformation prediction model, including: S301. Select the attention dimension, number of heads in the multi-head attention mechanism, number of Transformer encoder layers, number of BiLSTM layers, and number of BiLSTM neurons per layer in the Transformer-BiLSTM dam deformation prediction model as hyperparameter optimization variables to form a 5-dimensional hyperparameter combination to be optimized. Define the sparrow population size and set the SSA algorithm parameters, including: maximum number of iterations T, discoverer ratio PD, vigilant ratio SD, and safety threshold ST; the sparrow population size is independent of the number of optimization variables, and the population size is a preset manually set value; each sparrow represents a set of hyperparameter combinations to be optimized. S302. Substitute each sparrow representing a hyperparameter combination into the Transformer-BiLSTM dam deformation prediction model, and use the training set for training and prediction. Calculate the model's coefficient of determination R on the validation set. 2 This serves as the fitness value for the sparrow. Calculate the fitness values of all sparrows and determine the current best and worst fitness values. The higher the fitness value, the better the corresponding hyperparameter combination. Divide the sparrows into discoverers, followers, and scouts according to their fitness. The globally optimal sparrow position is the hyperparameter combination represented by the sparrow with the highest fitness value. S304. Update the sparrow's position according to the position update strategy of the sparrow search algorithm. The update formula is as follows: Discoverer location update formula: , Follower position update formula: , Scout position update formula: , in, Let t represent the value of the s-th sparrow in the z-th hyperparameter at the t-th iteration, where z = 1~5 and t is the current iteration number; This represents the maximum number of iterations. This is the alarm value; This is a safety threshold; These are random numbers that follow a normal distribution. It is a matrix of all 1s; It is a random number; The best location for the discoverer; For a matrix where each element is 1 or -1, ; K is the step size control parameter; K is a random number in the range [-1, 1]. , and Let be the fitness value of the s-th sparrow, the best fitness value globally, and the worst fitness value globally, respectively. It should be a very small constant to avoid the denominator being zero; S305. Calculate the new fitness value corresponding to the updated sparrow position. If the new position has better fitness, update the sparrow position according to S305. S304. Determine whether the maximum number of iterations has been reached or the convergence condition has been met. If yes, output the hyperparameter combination corresponding to the globally optimal sparrow position as the optimal hyperparameter combination; this optimal hyperparameter combination corresponds to the globally highest fitness value. If no, return to S302 and continue iterating.
9. A deformation prediction system for concrete gravity dams based on the SSA-Transformer-BiLSTM model, characterized in that, Includes the following steps: Impact Factor Calculation Module: Used to acquire dam safety monitoring data, including upstream water level, downstream water level, temperature, rainfall, and dam displacement and deformation monitoring values. Based on the monitoring data, it calculates impact factors, including time factor, temperature factor, rainfall factor, and water level factor. Each impact factor includes multiple factors. Dataset construction module: This module is used to perform time-aligned preprocessing on all influencing factors and dam displacement and deformation monitoring values, and to select factors from all time-aligned influencing factors that have a higher correlation with dam displacement and deformation monitoring values than a set threshold, in order to construct a dam deformation influencing factor dataset. Prediction model building module: used to build a Transformer-BiLSTM dam deformation prediction model and train it using a dam deformation influencing factor dataset. The optimal hyperparameter combination of the Transformer-BiLSTM dam deformation prediction model is determined by the Sparrow Search Algorithm (SSA). Dam displacement and deformation prediction module: used to re-collect dam safety monitoring data, calculate dam deformation influence factor values, and use the Transformer-BiLSTM dam deformation prediction model to predict dam displacement and deformation.
10. A computer-readable storage medium comprising a stored computer program, characterized in that, The computer program, when run by a processor, implements the method for predicting the deformation of a concrete gravity dam based on the SSA-Transformer-BiLSTM model as described in any one of claims 1 to 8.