Dam seepage prediction method based on multi-sensor networking and space-time diagram attention network

Through the combination of multi-sensor networking and space-time map attention network, a dam seepage prediction method is constructed, which solves the shortcomings of traditional methods in data sparsity and dynamic coupling modeling, realizes high-precision seepage prediction, and improves the reliability of dam safety management.

CN120508802APending Publication Date: 2025-08-19ZHEJIANG UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510601687.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The prior art is difficult to effectively capture the complex state change laws of dam seepage, especially in terms of data sparseness and dynamic coupling modeling. Traditional methods are difficult to comprehensively characterize the potential correlation characteristics of structure and environment, and the space-time graph attention network has limited ability to capture long-term dynamic features.

Method used

Through the combination of multi-sensor networking and space-time graph attention network, a dam sensor network is built, the trend and seasonal characteristics of the sensor are extracted, and a multi-dimensional correlation relationship is constructed. The graph convolution and the Transformer model are used to jointly model the spatial dependence relationship and the law of temporal evolution to achieve seepage prediction.

Benefits of technology

It significantly improves the accuracy and reliability of seepage prediction, provides strong support for dam safety management, solves the shortcomings of data sparsity and dynamic coupling modeling, and improves the accuracy of seepage prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508802A_ABST
    Figure CN120508802A_ABST
Patent Text Reader

Abstract

The invention discloses a dam seepage prediction method based on a multi-sensor network and a time-space diagram attention network, and the method comprises the steps: firstly collecting the time sequence monitoring data of each node in a dam sensor network, and extracting the trend characteristics and seasonal characteristics of each node through seasonal-trend decomposition; then, constructing a multi-dimensional sensor association relationship, wherein the association relationship comprises a geographic distance, a type matching degree and semantic correlation; then, taking trend features, seasonal features and original observation values as node features, taking a multi-dimensional association relationship as edge features, and constructing a daily sensor space-time diagram network; and finally, inputting a time-space diagram network sequence of multiple consecutive days into a Transform model, and realizing precise prediction of the current-day seepage value based on the data of the first 7 days through combined modeling of a spatial dependency relationship and a time evolution rule. According to the method, the defects of a traditional method in the aspects of data sparsity and dynamic coupling modeling are effectively overcome, the accuracy and reliability of seepage prediction are remarkably improved, and powerful support is provided for dam safety management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent prediction of geographic information, and specifically relates to a dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network. Background Art

[0002] In the field of dam safety monitoring, multi-source sensor networking technology has been widely used to collect and analyze key dam information, such as seepage and stress, in real-time. However, the data sparsity, spatiotemporal heterogeneity, and dynamic evolution characteristics of real-world engineering scenarios make it difficult for traditional prediction methods to effectively capture the complex state changes of dam structures. For example, in the monitoring data of Shanxi Reservoir from 2010 to 2025, only 45% of the sensor nodes were able to obtain complete, high-precision, synchronous observations. Furthermore, the sampling frequency and data distribution of different sensor types (such as seepage meters, stress gauges, and displacement meters) vary significantly. When data at key measurement points is missing, existing methods typically rely on independent modeling of single physical quantities (such as seepage flow, water level, and temperature) or employ static statistical models (such as multivariate regression and time series analysis) for prediction. However, the evolution of dam seepage is essentially the result of the coupling of multiple physical fields, and relying solely on local observation indicators cannot fully characterize the potential correlation characteristics between the structure and the environment. While current graph neural network (GNN)-based methods can model the spatial dependencies of sensor networks, their ability to capture long-term dynamic features is limited. Time series prediction models (such as LSTM and Transformer), while adept at processing trends in single-point data, struggle to effectively integrate spatial correlation information across multiple sensors. Building a dynamic graph attention network to adaptively learn the spatiotemporal dependencies of sensor nodes and achieve high-precision seepage prediction in collaborative modeling of spatiotemporal features of dam monitoring data has become a core challenge in improving the reliability of dam safety warnings. Summary of the Invention

[0003] The purpose of the present invention is to provide a dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network. By constructing a dam sensor network and feature engineering calculation, and constructing a spatiotemporal graph attention network, the feature associations presented by the historical dam sensor network are fully mined to effectively predict the predicted value of the seepage sensor.

[0004] To achieve the above objectives, the present invention adopts a technical solution: a dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network, which includes the following steps:

[0005] Step 1: Sensor data input and hyperparameter initialization;

[0006] Step 2: Construction of the dam sensor network and feature engineering calculation, including calculation of the edge features of the dam sensor network and calculation of the node features of the dam sensor network;

[0007] Step 3: Construction of the spatiotemporal graph attention network, including construction of spatial features of dam monitoring and extraction of temporal features of dam monitoring;

[0008] Step 4: Model training process design and model application.

[0009] Furthermore, in step 1, the historical monitoring data of each sensor of the dam is input, the number of sensors is N, the sampling frequency is daily, and the length of the time series is SL; if there is any missing historical data, linear interpolation is performed according to formula (1):

[0010]

[0011] In formula (1), v represents the sensor number, v = {1, 2, ..., N}; t miss Indicates missing date and time, t prev With t next are the dates of the most recent valid data before and after the missing time t; X v (t prev ), X v (t next ) are the sensor v at t prev , t next The value at the moment; X v (t) is the sensor v at time t miss The interpolation result of

[0012] According to formula (2), the monitoring value matrix of all sensors in the dam at date time t is formed as input data;

[0013] X v (t)={X1(t),X1(t),…,X N (t)} (2).

[0014] Furthermore, the hyperparameters in step 1 include:

[0015] The total number of dam sensors N, the number of seepage sensors in the dam M, the total number of historical monitoring days SL, and the seasonal period K s , trend term neighborhood bandwidth h T , seasonal term neighborhood bandwidth h S , the number of graph convolution operations L, the hidden layer dimension d in the graph convolution gcn , Transformer model input dimension d m , the number of Transformer attention heads nh, the key and query dimension d of each attention head k , the value dimension of each attention head is d v , the dimension d of the feedforward network ff, a very small constant ξ used to avoid division by 0, the number of training iterations E, the learning rate Lr, the ratio of the training set to the total data set rate, and the sliding window size SQ.

[0016] Furthermore, in step 2, the calculated edge features of the dam sensor network include type weight, distance weight, and semantic weight. The specific calculation steps are as follows:

[0017] Step 2.1.1. Calculation of geographical distance weight and type-related weight

[0018] According to formula (3), the normalized Euclidean distance between two sensors is calculated as the geographical distance weight According to formula (4), the type correlation weight between two sensors is calculated

[0019]

[0020] In formulas (3) and (4), i and j are the numbers of the sensors in the dam; exp(·) represents the natural exponential function; d i,j represents the Euclidean distance between two sensors; max(·) represents finding the maximum value in the matrix; is a matrix representing the Euclidean distance between two sensors in the dam; type(·) represents the type of a sensor;

[0021] Step 2.1.2 Calculation of semantic relevance weight

[0022] According to formula (5), calculate the Pearson correlation r between the two sensors in the historical monitoring data i,j ; According to formula (6), calculate the value of T test And look up the T distribution table to get the p-value for significance test; calculate the semantic relevance weight according to formula (7)

[0023]

[0024] In formula (5), X i (t) and X j (t) represents the monitoring values of sensors i and j at time t respectively; and are the average values monitored by sensors i and j from t=1 to t=SL respectively.

[0025] Furthermore, in step 2, calculating the characteristics of the dam sensor network nodes includes: using local quadratic weighted regression to fit the trend characteristics presented by the monitoring values of the dam sensor network nodes and using Gaussian convolution kernel function to fit the seasonal characteristics presented by the monitoring values of the dam sensor network nodes.

[0026] Furthermore, the steps for extracting the trend component of the dam sensor node are as follows:

[0027] First, according to formula (8), define the neighborhood time t of time t m The trend weight function ω T (t i ,t); Then, according to formula (9), use weighted least squares to solve the trend coefficients β0 and β1; finally, according to formula (10), the final trend component T is obtained v (t);

[0028]

[0029] T v (t)=β0+β1t (10)

[0030] In formulas (8)-(10), h T is the bandwidth value of the trend item, and its unit is day; arg min β0,β1 Indicates the β0 and β1 values corresponding to finding the minimum value of the objective function.

[0031] Furthermore, the steps to extract the seasonal component of the dam sensor node are as follows:

[0032] First, by cycle K s According to formula (11), define the neighborhood time t within time t m The seasonal weight function ω S (t m ,t); Finally, according to formula (12), the seasonal component S is calculated by Gaussian kernel convolution v (t);

[0033]

[0034] In formulas (11)-(12), mod represents the remainder operation; exp(·) represents the natural exponential function; h s is the seasonal item bandwidth value, and its unit is day.

[0035] Furthermore, in step 3, the steps of constructing the spatial features of dam monitoring are as follows:

[0036] Step 3.1.1. Input feature definition

[0037] The daily dam sensor network is modeled as a weighted directed graph G(t) = (V, E, W); where the node set V = {v1, v2, ..., v N} represents N sensors, among which there are M seepage sensors, namely {f1,f2,…,f M}; Edge set Represents the logical edge connection between sensors, and the weight of each edge According to formula (13), weighted summation is performed to obtain: the characteristics of each sensor node include the sensor monitoring value X v (t), trend characteristics T v (t), seasonal characteristics S v (t);

[0038]

[0039] In formula (13), α, β, and Υ are the training fusion coefficients, which are obtained through subsequent training; w ij is the value of row i and column j of W;

[0040] Step 3.1.2, Graph Convolution Operation Definition

[0041] In order to effectively extract the multidimensional correlation between the sensors deployed in the dam, a graph convolutional neural network is used. According to formula (14), L graph convolution operations are performed on the monitoring values of the sensors deployed in the dam, and the features of each sensor are updated to obtain the sensor feature matrix The sensor feature matrix processed by the graph convolution layer reflects the position and connection characteristics of the sensors in the dam sensor network structure;

[0042]

[0043] In formula (14), is the set of sensors connected to sensor i, is the learnable weight matrix of layer l, d gcn is the hidden layer dimension, is the feature vector of the l-th layer node; σ1(·) is the sigmoid function;

[0044] Perform graph convolution operation on the dam sensor network at each time t to obtain the final result

[0045] Furthermore, in step 3, extracting the time series features of dam monitoring includes three steps: position encoding injection, multi-head attention calculation, and time series feature output; the details are as follows:

[0046] Step 3.2.1. Positional encoding injection

[0047] In order to correspond the time t to the position encoding PE of the Transformer model t , so that the model can understand the order and relative position of time; first, position encoding is performed according to formula (15) and formula (16), and PE t ; Then, according to formula (17), position PE tInject the input features and get

[0048]

[0049] In formulas (17)-(16), sin(·) and cos(·) represent the sine and cosine functions respectively; pos is the position index corresponding to time t; d m The feature vector S representing the model input t The dimension of ; 2p represents the input feature vector S t Even dimension index; 2p+1 represents the input feature vector S t Odd dimension index;

[0050] The feature vector sequence after injection position encoding As the input of the Transformer model, SQ is the size of the sliding window;

[0051] Step 3.2.2, multi-head attention calculation

[0052] In order to capture the multidimensional correlation of dam sensor data from different representation subspaces, the query vector Q, key vector K, and value vector V are calculated according to formulas (18)-(20); then the self-attention A of the h-th head is calculated according to formula (21): h (Q, K, V), and merge the multi-head attention features according to formula (22); finally, capture the different feature representations of multi-head attention according to formula (23) and output them;

[0053]

[0054] A=[A1,A2,…,A h ] (twenty two)

[0055] H=A·W O (twenty three)

[0056] In formulas (18)-(23), σ2(·) represents the softmax function, h represents the attention head number, h∈[1,nh]; nh represents the number of attention heads; is a learnable weight matrix;

[0057] Step 3.2.3, Time Series Feature Output

[0058] After multi-head attention calculation, the final temporal feature output is generated through the feedforward network and layer normalization; first, the output of the feedforward network is calculated according to formula (24) Then, according to formula (25), layer normalization is performed to obtain Output as time series features;

[0059]

[0060] In formulas (24)-(25), ξ is a very small constant used to avoid division by zero; var and μ are The variance and mean of ; max(0,x) is the ReLU activation function; and is a learnable weight matrix; b1 and b2 are bias terms, whose dimensions are d ff with d m ;

[0061] Step 3.2.4: Seepage prediction

[0062] In order to predict the seepage value, the predicted values of all sensors in the dam are calculated according to formula (26):

[0063]

[0064] In formula (26), is a learnable weight matrix; b3 is a bias term with dimension N.

[0065] Furthermore, the step 4 includes:

[0066] Step 4.1: Generate training data and validation data;

[0067] For any date and time t(t∈[SQ+1,SL]), the monitoring results of the dam sensor nodes in the previous SQ days X(t-SQ), X(t-SQ+1), ..., X(t-1) are used as input, and the monitoring results of the dam sensor nodes on the current day X(t) are used as label values to form an input-label pair dataset; rate is randomly selected from the dataset as the training set, and the remaining 20% is used as the validation set;

[0068] Step 4.2, loss function design;

[0069] In order to achieve rapid convergence of the model during the E-round training process and improve the prediction accuracy of the model, a staged function strategy is adopted; In the first round of training, the mean absolute error (MAE) is used as the loss function to quickly guide the model parameters to adjust in the correct direction, as shown in formula (27); In the round, the mean square error (MSE) is switched to the loss function to adjust the model parameters more carefully, thereby improving the model prediction accuracy, as shown in formula (28); when calculating the loss function, only the observation values and input values of all the seepage sensors f are selected to participate in the calculation, so as to further improve the model's prediction performance for the seepage sensor data;

[0070]

[0071] X in formulas (27)-(28) f (t) is the observation value of the seepage sensor; is the predicted value of the seepage sensor;

[0072] Step 4.3: Model training and application;

[0073] Randomly initialize the spatiotemporal graph attention network; input the training dataset into the spatiotemporal graph attention network for forward propagation calculation; perform the backpropagation process by calculating the gradient of the loss function, and use the Adam optimizer to update the model parameters, where the learning rate is set to lr to minimize the loss value; repeat the process of forward propagation, loss calculation, backpropagation and validation set evaluation until the scheduled E rounds of training are completed or the loss of the validation set remains Stop training when the wheel does not drop;

[0074] After the model training is completed, all sensor data of the dam on the previous SQ day of the date and time t of the seepage data to be predicted are input to obtain the predicted values of all seepage sensors at the date and time t.

[0075] The beneficial effects of the present invention are as follows: This method first collects time-series monitoring data from each node in the dam sensor network and uses Seasonal and Trend Decomposition using Loess (STL) to extract trend and seasonal characteristics of each node; then constructs multidimensional sensor association relationships, including geographic distance, type matching, and semantic relevance; then uses trend characteristics, seasonal characteristics, and original observations as node features, and multidimensional association relationships as edge features to construct a daily sensor spatiotemporal graph network; finally, the spatiotemporal graph network sequence for multiple consecutive days is input into the Transformer model, and through the joint modeling of spatial dependency and temporal evolution laws, an accurate prediction of the daily seepage value based on the previous seven days' data is achieved. This method can effectively address the shortcomings of traditional methods in data sparsity and dynamic coupling modeling, significantly improving the accuracy and reliability of seepage prediction, and providing strong support for dam safety management. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 is a flow chart of the present invention;

[0077] Figure 2 This is a schematic diagram of the sensor layout for Shanxi Reservoir;

[0078] Figure 3 This paper compares and analyzes the actual results of the seepage sensor in Shanxi Reservoir with the experimental results. DETAILED DESCRIPTION

[0079] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0080] like Figure 1 A dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network is proposed. The steps are as follows:

[0081] Step 1: Sensor data input and hyperparameter initialization

[0082] Step 1.1 Input of dam sensor data

[0083] Input the historical monitoring data of each sensor of the dam, the number of sensors is N, the sampling frequency is daily, and the length of the time series is SL. If there is any missing historical data, linear interpolation is performed according to formula (1);

[0084]

[0085] In formula (1), v represents the sensor number, v = {1, 2, ..., N}; t miss Indicates missing date and time, t prev With t next are the dates of the most recent valid data before and after the missing time t; X v (t prev ), X v (t next ) are the sensor v at t prev , t next The value at the moment; X v (t) is the sensor v at time t miss The interpolation result of

[0086] According to formula (2), a monitoring value matrix of all sensors of the dam at date time t is formed as input data of the present invention;

[0087] X v (t)={X1(t),X1(t),…,X N (t)} (2).

[0088] Step 1.2 Hyperparameter Initialization

[0089] Initialize the hyperparameters of the present invention, as shown in Table 1:

[0090] Table 1 Hyperparameters used in the present invention

[0091]

[0092]

[0093] Step 2: Building a dam sensor network and calculating feature engineering

[0094] Step 2.1 Calculation of edge features of dam sensor network

[0095] In order to construct the correlation feature model of the dam sensor network, for any two sensor nodes in the network, their multi-dimensional correlation relationship is calculated according to the following steps:

[0096] Step 2.1.1 Calculation of geographical distance weight and type-related weight

[0097] According to formula (3), the normalized Euclidean distance between two sensors is calculated as the geographical distance weight According to formula (4), the type correlation weight between two sensors is calculated

[0098]

[0099] In formulas (3) and (4), i and j are the numbers of the sensors in the dam; exp(·) represents the natural exponential function; d i,j represents the Euclidean distance between two sensors; max(·) represents finding the maximum value in the matrix; is a matrix representing the Euclidean distance between two sensors in the dam; type(·) represents the type of a sensor;

[0100] Step 2.1.2 Calculation of semantic relevance weight

[0101] According to formula (5), calculate the Pearson correlation r between the two sensors in the historical monitoring data i,j ; According to formula (6), calculate the value of T test And look up the T distribution table to get the p-value for significance test; calculate the semantic relevance weight according to formula (7)

[0102]

[0103] In formula (5), X i (t) and X j (t) represents the monitoring values of sensors i and j at time t respectively; and are the average values monitored by sensors i and j from t = 1 to t = SL;

[0104] Step 2.2 Calculation of node characteristics of dam sensor network

[0105] For the monitoring data of each node v in the dam sensor network, feature engineering is performed according to the following steps:

[0106] Step 2.2.1 Extraction of trend components of embankment sensor nodes

[0107] The trend characteristics of the monitoring values of the dam sensor network nodes are fitted using local quadratic weighted regression. First, according to formula (8), the neighborhood time t of time t is defined as m The trend weight function ω T (t i ,t); Then, according to formula (9), use weighted least squares to solve the trend coefficients β0 and β1; finally, according to formula (10), the final trend component T is obtained v (t);

[0108]

[0109] T v (t)=β0+β1t (10)

[0110] In formulas (8)-(10), h T is the bandwidth value of the trend item, and its unit is day; Indicates the corresponding β0 and β1 values when seeking the minimum value of the objective function;

[0111] Step 2.2.2 Extraction of seasonal components of dam sensor nodes

[0112] The Gaussian convolution kernel function is used to fit the seasonal characteristics of the monitoring values of the dam sensor network nodes. First, according to the period K s According to formula (11), define the neighborhood time t within time t m The seasonal weight function ω S (t m ,t); Finally, according to formula (12), the seasonal component S is calculated by Gaussian kernel convolution v (t);

[0113]

[0114] In formulas (11)-(12), mod represents the remainder operation; exp(·) represents the natural exponential function; h s is the seasonal item bandwidth value, and its unit is day.

[0115] Step 3: Construction of spatiotemporal graph attention network

[0116] Step 3.1 Construction of spatial features for dam monitoring

[0117] Step 3.1.1 Input feature definition

[0118] The daily dam sensor network is modeled as a weighted directed graph G(t) = (V, E, W); where the node set V = {v1, v2, ..., v N} represents N sensors, among which there are M seepage sensors, namely {f1,f2,…,f M}; Edge set Represents the logical edge connection between sensors, and the weight of each edge According to formula (13), weighted summation is performed to obtain: the characteristics of each sensor node include the sensor monitoring value X v (t), trend characteristics T v (t), seasonal characteristics S v (t);

[0119]

[0120] In formula (13), α, β, and Υ are the training fusion coefficients, which are obtained through subsequent training; w ij is the value of row i and column j of W;

[0121] Step 3.1.2 Graph Convolution Operation Definition

[0122] In order to effectively extract the multidimensional correlation between the sensors deployed in the dam, this step uses a graph convolutional neural network. According to formula (14), L graph convolution operations are performed on the monitoring values of the sensors deployed in the dam, and the features of each sensor are updated to obtain the sensor feature matrix The sensor feature matrix processed by the graph convolution layer can well reflect the position and connection characteristics of the sensors in the dam sensor network structure.

[0123]

[0124] In formula (14), is the set of sensors connected to sensor i, is the learnable weight matrix of layer l, d gcn is the hidden layer dimension, is the feature vector of the l-th layer node; σ1(·) is the sigmoid function;

[0125] Perform graph convolution operation on the dam sensor network at each time t to obtain the final result

[0126] Step 3.2 Extraction of time series features of dam monitoring

[0127] In order to effectively extract the time series information presented by the monitoring values of the sensors deployed in the dam body, this step uses the Transformer dam monitoring time series feature extraction, which specifically includes three steps: position code injection, multi-head attention calculation, and time series feature output;

[0128] Step 3.2.1 Positional encoding injection

[0129] In order to correspond the time t to the position encoding PE of the Transformer model t , so that the model can understand the order and relative position of time; first, position encoding is performed according to formula (15) and formula (16), and PE t ; Then, according to formula (17), position PE t Inject the input features and get

[0130]

[0131] In formulas (17)-(16), sin(·) and cos(·) represent the sine and cosine functions respectively; pos is the position index corresponding to time t; d m The feature vector S representing the model input t The dimension of ; 2p represents the input feature vector S t Even dimension index; 2p+1 represents the input feature vector S t Odd dimension index;

[0132] The feature vector sequence after injection position encoding As the input of the Transformer model, SQ is the size of the sliding window;

[0133] Step 3.2.2 Multi-head attention calculation

[0134] In order to capture the multidimensional correlation of dam sensor data from different representation subspaces, this step calculates the query vector Q, key vector K, and value vector V according to formulas (18)-(20); then calculates the self-attention A of the h-th head according to formula (21) h (Q, K, V), and merge the multi-head attention features according to formula (22); finally, capture the different feature representations of multi-head attention according to formula (23) and output them;

[0135]

[0136]

[0137] A=[A1,A2,…,A h ] (twenty two)

[0138] H=A·W O (twenty three)

[0139] In formulas (18)-(23), σ2(·) represents the softmax function, h represents the attention head number, h∈[1,nh]; nh represents the number of attention heads; is a learnable weight matrix;

[0140] Step 3.2.3 Time series feature output

[0141] After multi-head attention calculation, this step generates the final temporal feature output through the feedforward network and layer normalization; first, the output of the feedforward network is calculated according to formula (24) Then, according to formula (25), layer normalization is performed to obtain Output as time series features;

[0142]

[0143] In formulas (24)-(25), ξ is a very small constant used to avoid division by zero; var and μ are The variance and mean of ; max(0,x) is the ReLU activation function; and is a learnable weight matrix; b1 and b2 are bias terms, whose dimensions are d ff with d m ;

[0144] Step 3.2.4 Seepage prediction

[0145] In order to predict the seepage value, this step calculates the predicted values of all sensors in the dam according to formula (26):

[0146]

[0147] In formula (26), is a learnable weight matrix; b3 is a bias term with dimension N.

[0148] Step 4: Model training process design and model application

[0149] Step 4.1 Training data and validation data generation

[0150] For any date and time t(t∈[SQ+1,SL]), the monitoring results of the dam sensor nodes in the previous SQ days are taken as input, and the monitoring results of the dam sensor nodes on the current day are taken as label values to form an input-label pair dataset; a rate is randomly selected from the dataset as the training set, and the remaining 20% is used as the validation set.

[0151] Step 4.2 Loss function design

[0152] In order to achieve rapid convergence of the model during the E-round training process and improve the prediction accuracy of the model, the present invention adopts a staged function strategy; In the first round of training, the mean absolute error (MAE) is used as the loss function to quickly guide the model parameters to adjust in the correct direction, as shown in formula (27); In the round, the mean square error (MSE) is switched to the loss function to adjust the model parameters more carefully, thereby improving the model prediction accuracy, as shown in formula (28). When calculating the loss function, the present invention only selects all the observation values and input values of the seepage sensor f to participate in the calculation, so as to further improve the model's prediction performance for the seepage sensor data.

[0153]

[0154] X in formulas (27)-(28) f (t) is the observation value of the seepage sensor; is the predicted value of the seepage sensor;

[0155] Step 4.3 Model training and application

[0156] Randomly initialize the spatiotemporal graph attention network described in step 3; input the training data set into the spatiotemporal graph attention network for forward propagation calculation; perform backpropagation by calculating the gradient of the loss function, and use the Adam optimizer to update the model parameters, where the learning rate is set to lr to minimize the loss value; repeat the process of forward propagation, loss calculation, backpropagation, and validation set evaluation until the scheduled E rounds of training are completed or the loss of the validation set remains Stop training when the wheel does not drop;

[0157] After the model training is completed, all sensor data of the dam on the previous SQ day of the date and time t of the seepage data to be predicted are input to obtain the predicted values of all seepage sensors at the date and time t.

[0158] The following is an explanation with specific examples:

[0159] This example uses sensor monitoring data from the Shanxi Reservoir Dam in Zhejiang Province from January 2015 to December 2023. A total of 245 sensors, including stress, displacement, and seepage sensors, are deployed within the Shanxi Reservoir Dam, including 7 seepage sensors. Figure 2 An embodiment of the present invention is given for sensor data input and hyperparameter initialization, dam sensor network construction and feature engineering calculation, spatiotemporal graph attention network construction, model training process design and model application.

[0160] (1) Sensor data input and hyperparameter initialization

[0161] Step 11: Input the historical monitoring data of each sensor of Shanxi Reservoir from January 1, 2015 to December 31, 2023. The number of sensors N = 245, and the time series length SL = 3287. Check whether the sampling frequency of each sensor is daily. If missing, perform linear interpolation according to formula (1). For example, if the seepage meter f1 is missing on May 5, 2023, its previous effective value is 12.5m on May 3, and its subsequent effective value is 13.2m on May 7. According to formula (1), According to formula (2), the daily monitoring value matrix X of all sensors in the dam is formed v (t), as input to the invention example;

[0162] Step 12: Initialize the hyperparameters of the present invention N=245, M=7, SL=5475, K S =7,h T =3,h S =7, L=2, d gcn =64,d m =128, nh=8, d k =32,d v =32,d ff =256,ξ=10 -8 , E=200, lr=0.05, rate=0.8, SQ=7;

[0163] (2) Construction of dam sensor network and feature engineering calculation

[0164] Step 21: Calculation of edge features of the embankment sensor network

[0165] Step 211: According to formula (3), calculate the normalized Euclidean distance between the two sensors as the geographical distance weight For example, the coordinates of the seepage meter f1 are (2856.34, 4932.15, 42.8) (unit is m), and the coordinates of the strain gauge S2 are (2853.71, 4930.89, 43.2) (unit is m), then their geographical distance weight is 0.98; according to formula (4), the type correlation weight between the two sensors is calculated as For example, the seepage meter f1 and the strain meter S2 are not of the same type, so their type-related weights are 0;

[0166] Step 212: Calculate the Pearson correlation r between the two sensors in the historical monitoring data according to formulas (5)-(7). i,j For example, the Pearson correlation between the seepage meter f1 and the stress meter S2 is 0.65 and passes the significance test, so the semantic relevance weight is 0.65.

[0167] Step 22 Calculation of dam sensor network node characteristics

[0168] Step 221 extracts the trend component T of each sensor according to formulas (8)-(10): v (t); For example, the trend component of seepage meter f1 on January 1, 2023 is 159.80;

[0169] Step 222 extracts the seasonal component T of each sensor according to formulas (11)-(12): v (t); For example, the seasonal component of seepage meter f1 on January 1, 2023 is 0.05;

[0170] (3) Construction of spatiotemporal graph attention network

[0171] Step 31: Construction of spatial features for dam monitoring

[0172] Step 311 models the daily dam sensor network from January 1, 2015 to December 31, 2023 as a weighted directed graph G(t) = (V, E, W); where the node set V = {v1, v2, ..., v 245} represents 245 sensors, including 7 flow sensors, namely {f1,f2,…,f7}; the edge set Represents the logical edge connection between sensors, and the weight of each edge According to formula (13), weighted summation is performed to obtain: the characteristics of each sensor node include the sensor monitoring value X v (t), trend characteristics T v (t), seasonal characteristics S v (t); In this embodiment, the initial setting is α = 0.4, β = 0.3, and Υ = 0.3; during the training process, the parameter values are optimized by back propagation, and finally α = 0.5, β = 0.2, and Υ = 0.3;

[0173] Step 322: According to formula (14), perform two graph convolution operations on the daily monitoring values of the sensors deployed in the dam to obtain the daily sensor feature matrix For example, the input of the seepage meter f1 node is [159.79, 159.80, 0.05], and its corresponding output is is [0.42, 0.67, …, 0.78];

[0174] Step 32: Extracting time series features of dam monitoring

[0175] Step 321: First, perform position encoding according to formula (15) and formula (16); for each time position pos∈{1,2,...,7}, generate d m = 128-dimensional position encoding vector; when pos = 3, the dimension is 0, PE 3,0=-0.990; According to formula (17), position PE t Inject the input features and get For example, the node f1 of the seepage meter corresponds to

[0176] Step 322: Implement multi-head attention calculation according to formulas (18)-(23), where

[0177] Step 323: Calculate the output of the feedforward network according to formula (24) According to formula (25), layer normalization is performed to obtain Output as a time series feature; for example, the seepage meter f1 corresponds to

[0178] Step 324: Calculate the predicted values of all sensors in the dam according to formula (26) And select the seepage sensors f1, f2, ..., f M Value Output; for example, the final prediction result of seepage meter f1 on January 1, 2023 is 160.02m;

[0179] (4) Model training process design and model application

[0180] Step 41: Use the dam monitoring data from January 1, 2015 to December 31, 2023 to form input-label pairs; randomly select 80% of them as the training set and the remaining 20% as the test set;

[0181] Step 42: Set the total number of training rounds to 200; in the first 100 rounds, use MAE as the loss function according to formula (27); in the next 100 rounds, use MSE as the loss function according to formula (28); during the training and validation process, only the sensor data of 7 seepage meters are used for calculation;

[0182] Step 43: Randomly initialize the model parameters and input the training dataset into the spatiotemporal graph attention network in step 3 for forward propagation calculation; perform backpropagation by calculating the gradient of the loss function, and use the Adam optimizer to update the model parameters, where the learning rate is set to 0.05 to minimize the loss value; repeat the process of forward propagation, loss calculation, backpropagation, and validation set evaluation until the scheduled E rounds of training are completed or stop training when the loss on the validation set does not decrease for 50 rounds;

[0183] After the model training is completed, all sensor data of the dam for the previous seven days before the date of the predicted seepage data are input to obtain the predicted values of all seepage sensors at the date of the test. For example, the final prediction result of the seepage meter f1 on January 1, 2024 is 149.02m.

[0184] Test analysis: Compare the percolation prediction results on the validation set with the actual results (e.g. Figure 3 As shown in the figure, it can be seen that the two have a high consistency, which shows the effectiveness of this method; the goodness of fit of the prediction combination of the present invention is 79%, and the MSE is 0.02±0.01, which proves that this method can effectively assist the prediction of the seepage meter in the dam.

[0185] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the scope of protection of the present invention in any form. All technical solutions obtained by equivalent substitution, etc., fall within the scope of protection of the present invention. Parts not covered by the present invention are the same as the existing technology or can be implemented using existing technology.

Claims

1. A dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network, characterized in that: The following steps are involved: Step 1: Sensor data input and hyperparameter initialization; Step 2: Construction of the dam sensor network and feature engineering calculation, including calculation of the edge features of the dam sensor network and calculation of the node features of the dam sensor network; Step 3: Construction of the spatiotemporal graph attention network, including construction of spatial features of dam monitoring and extraction of temporal features of dam monitoring; Step 4: Model training process design and model application.

2. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 is characterized in that: In step 1, the historical monitoring data of each sensor of the dam is input, the number of sensors is N, the sampling frequency is daily, and the length of the time series is SL; if there is any missing historical data, linear interpolation is performed according to formula (1): In formula (1), v represents the sensor number, v = {1, 2, ..., N}; t miss Indicates missing date and time, t prev With t next are the dates of the most recent valid data before and after the missing time t; X v (t prev ), X v (t next ) are the sensor v at t prev , t next The value at the moment; X v (t) is the sensor v at time t miss The interpolation result of According to formula (2), the monitoring value matrix of all sensors in the dam at date time t is formed as input data; X v (t)={X1(t),X1(t),…,X N (t)} (2)。 3. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 is characterized in that: The hyperparameters in step 1 include: The total number of dam sensors N, the number of seepage sensors in the dam M, the total number of historical monitoring days SL, and the seasonal period K s , trend term neighborhood bandwidth h T , seasonal term neighborhood bandwidth h S , the number of graph convolution operations L, the hidden layer dimension d in the graph convolution gcn , Transformer model input dimension d m , the number of Transformer attention heads nh, the key and query dimension d of each attention head k , the value dimension of each attention head is d v , the dimension d of the feedforward network ff , a very small constant ξ used to avoid division by 0, the number of training iterations E, the learning rate Lr, the ratio of the training set to the total data set rate, and the sliding window size SQ.

4. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 is characterized in that: In step 2, the calculated edge features of the dam sensor network include type weight, distance weight, and semantic weight. The specific calculation steps are as follows: Step 2.1.

1. Calculation of geographical distance weight and type-related weight According to formula (3), the normalized Euclidean distance between two sensors is calculated as the geographical distance weight According to formula (4), the type correlation weight between two sensors is calculated In formulas (3) and (4), i and j are the numbers of the sensors in the dam; exp(·) represents the natural exponential function; d i,j represents the Euclidean distance between two sensors; max(·) represents finding the maximum value in the matrix; is a matrix representing the Euclidean distance between two sensors in the dam; type(·) represents the type of a sensor; Step 2.1.2 Calculation of semantic relevance weight According to formula (5), calculate the Pearson correlation r between the two sensors in the historical monitoring data i,j ; According to formula (6), calculate the value of T test And look up the T distribution table to get the p-value for significance test; calculate the semantic relevance weight according to formula (7) In formula (5), X i (t) and X j (t) represents the monitoring values of sensors i and j at time t respectively; and are the average values monitored by sensors i and j from t=1 to t=SL respectively.

5. A dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 or 4, characterized in that: In the step 2, calculating the characteristics of the dam sensor network nodes includes: using local quadratic weighted regression to fit the trend characteristics presented by the monitoring values of the dam sensor network nodes and using Gaussian convolution kernel function to fit the seasonal characteristics presented by the monitoring values of the dam sensor network nodes.

6. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 5 is characterized in that: The steps for extracting trend components of dam sensor nodes are as follows: First, according to formula (8), define the neighborhood time t of time t m The trend weight function ω T (t i ,t); Then, according to formula (9), use weighted least squares to solve the trend coefficients β0 and β1; finally, according to formula (10), the final trend component T is obtained v (t); T v (t)=β0+β1t (10) In formulas (8)-(10), h T is the bandwidth value of the trend item, and its unit is day; arg min β0,β1 Indicates the β0 and β1 values corresponding to finding the minimum value of the objective function.

7. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 5 is characterized in that: The steps to extract the seasonal component of the dam sensor node are: First, by cycle K s According to formula (11), define the neighborhood time t within time t m The seasonal weight function ω S (t m ,t); Finally, according to formula (12), the seasonal component S is calculated by Gaussian kernel convolution v (t); In formulas (11)-(12), mod represents the remainder operation; exp(·) represents the natural exponential function; h s is the seasonal item bandwidth value, and its unit is day.

8. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 is characterized in that: In step 3, the steps of constructing the spatial features of dam monitoring are as follows: Step 3.1.

1. Input feature definition The daily dam sensor network is modeled as a weighted directed graph G(t) = (V, E, W); where the node set V = {v1, v2, ..., v N } represents N sensors, among which there are M seepage sensors, namely {f1,f2,…,f M }; Edge set Represents the logical edge connection between sensors, and the weight of each edge According to formula (13), weighted summation is performed to obtain: the characteristics of each sensor node include the sensor monitoring value X v (t), trend characteristics T v (t), seasonal characteristics S v (t); In formula (13), α, β, and Υ are the training fusion coefficients, which are obtained through subsequent training; w ij is the value of row i and column j of W; Step 3.1.2, Graph Convolution Operation Definition In order to effectively extract the multidimensional correlation between the sensors deployed in the dam, a graph convolutional neural network is used. According to formula (14), L graph convolution operations are performed on the monitoring values of the sensors deployed in the dam, and the features of each sensor are updated to obtain the sensor feature matrix The sensor feature matrix processed by the graph convolution layer reflects the position and connection characteristics of the sensors in the dam sensor network structure; In formula (14), is the set of sensors connected to sensor i, is the learnable weight matrix of layer l, d gcn is the hidden layer dimension, is the feature vector of the l-th layer node; σ1(·) is the sigmoid function; Perform graph convolution operation on the dam sensor network at each time t to obtain the final result 9. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 is characterized in that: In step 3, extracting the time series features of dam monitoring includes three steps: position encoding injection, multi-head attention calculation, and time series feature output; the details are as follows: Step 3.2.

1. Positional encoding injection In order to correspond the time t to the position encoding PE of the Transformer model t , so that the model can understand the order and relative position of time; first, position encoding is performed according to formula (15) and formula (16), and PE t ; Then, according to formula (17), position PE t Inject the input features and get In formulas (17)-(16), sin(·) and cos(·) represent the sine and cosine functions respectively; pos is the position index corresponding to time t; d m The feature vector S representing the model input t The dimension of ; 2p represents the input feature vector S t Even dimension index; 2p+1 represents the input feature vector S t Odd dimension index; The feature vector sequence after injection position encoding As the input of the Transformer model, SQ is the size of the sliding window; Step 3.2.2, multi-head attention calculation In order to capture the multidimensional correlation of dam sensor data from different representation subspaces, the query vector Q, key vector K, and value vector V are calculated according to formulas (18)-(20); then the self-attention A of the h-th head is calculated according to formula (21): h (Q, K, V), and merge the multi-head attention features according to formula (22); finally, capture the different feature representations of multi-head attention according to formula (23) and output them; <h2 style=";text-align:left;direction:ltr">A=[A1,A2,…,A<h2 style=";text-align:left;direction:ltr"> h <h2 style=";text-align:left;direction:ltr"> ] (22) H=A·W O (23) In formulas (18)-(23), σ2(·) represents the softmax function, h represents the attention head number, h∈[1,nh]; nh represents the number of attention heads; is a learnable weight matrix; Step 3.2.3, Time Series Feature Output After multi-head attention calculation, the final temporal feature output is generated through the feedforward network and layer normalization; first, the output of the feedforward network is calculated according to formula (24) Then, according to formula (25), layer normalization is performed to obtain Output as time series features; In formulas (24)-(25), ξ is a very small constant used to avoid division by zero; var and μ are The variance and mean of ; max(0,x) is the ReLU activation function; and is a learnable weight matrix; b1 and b2 are bias terms, whose dimensions are d ff with d m ; Step 3.2.4: Seepage prediction In order to predict the seepage value, the predicted values of all sensors in the dam are calculated according to formula (26): In formula (26), is a learnable weight matrix; b3 is a bias term with dimension N.

10. The dam seepage prediction method based on multi-sensor networking and spatiotemporal graph attention network according to claim 1 is characterized in that: The step 4 comprises: Step 4.1: Generate training data and validation data; For any date and time t(t∈[SQ+1,SL]), the monitoring results of the dam sensor nodes in the previous SQ days X(t-SQ), X(t-SQ+1), ..., X(t-1) are used as input, and the monitoring results of the dam sensor nodes on the current day X(t) are used as label values to form an input-label pair dataset; rate is randomly selected from the dataset as the training set, and the remaining 20% is used as the validation set; Step 4.2, loss function design; In order to achieve rapid convergence of the model during the E-round training process and improve the prediction accuracy of the model, a staged function strategy is adopted; In the first round of training, the mean absolute error (MAE) is used as the loss function to quickly guide the model parameters to adjust in the correct direction, as shown in formula (27); In the round, the mean square error (MSE) is switched to the loss function to adjust the model parameters more carefully, thereby improving the model prediction accuracy, as shown in formula (28); when calculating the loss function, only the observation values and input values of all the seepage sensors f are selected to participate in the calculation, so as to further improve the model's prediction performance for the seepage sensor data; X in formulas (27)-(28) f (t) is the observation value of the seepage sensor; is the predicted value of the seepage sensor; Step 4.3: Model training and application; Randomly initialize the spatiotemporal graph attention network; input the training dataset into the spatiotemporal graph attention network for forward propagation calculation; perform the backpropagation process by calculating the gradient of the loss function, and use the Adam optimizer to update the model parameters, where the learning rate is set to lr to minimize the loss value; repeat the process of forward propagation, loss calculation, backpropagation and validation set evaluation until the scheduled E rounds of training are completed or the loss of the validation set remains Stop training when the wheel does not drop; After the model training is completed, all sensor data of the dam on the previous SQ day of the date and time t of the seepage data to be predicted are input to obtain the predicted values of all seepage sensors at the date and time t.

Citation Information

Patent Citations

  • Square [scarf]

    WO230056