An integrated water level prediction method including virtual stations based on graph and sequence decomposition technology
By constructing a graph and sequence decomposition module GSD and combining it with the virtual site water level prediction module VS-WLP, the problem of insufficient adaptability of water level prediction in complex river and lake systems is solved, water level prediction with higher accuracy and wider coverage is achieved, and the applicability and robustness of the model are enhanced.
Patent Information
- Application Number
- CN202510067545.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-01-16
AI Technical Summary
Existing water level prediction methods have poor adaptability in complex river and lake systems, especially in areas where there are no monitoring stations, where there are prediction blind spots. In addition, existing spatiotemporal combined models are not adaptable enough in the middle and lower reaches of the Yangtze River.
An integrated water level prediction method based on graph and sequence decomposition technology is adopted. By constructing a graph and sequence decomposition module GSD, combined with the virtual site water level prediction module VS-WLP, the graph convolution layer GCN and the graph attention layer GAT are used to capture spatial relationships, and the time series decomposition module GAT extracts trend and periodic characteristics. The hierarchical ensemble learning method is used to improve the model applicability and robustness.
It improves the adaptability and accuracy of the water level prediction system in complex river and lake systems, enhances the prediction capability of long-term water level changes, expands the coverage of water level prediction, and improves the applicability and robustness of the model.
Smart Images

Figure CN119862998B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of time series water level prediction, and relates to an integrated water level prediction method including virtual sites based on graph and sequence decomposition technology. Background Art
[0002] Water level prediction plays a vital role in flood control and drought relief, water resources management, and navigation security. Particularly in complex river and lake systems, accurate water level prediction can improve flood control efficiency, reduce disaster losses, and ensure the sustainable development of regional economies and ecosystems. In recent years, with the rapid development of deep learning technology, water level prediction methods based on temporal and spatial data have gradually attracted widespread attention from researchers.
[0003] Currently, research methods for water level prediction fall into two main categories: those that utilize only the temporal characteristics of data, and those that combine both temporal and spatial characteristics. The first category is typically based on time series models, such as autoregressive imitation models (ARIMA), long short-term memory (LSTM), and gated recurrent units (GRU). These methods analyze historical water level data from a single monitoring station, extract temporal dynamics, and predict future water levels. However, these methods lack spatial information, limiting their performance in complex watersheds or multi-station joint prediction scenarios. The second category combines temporal and spatial characteristics, constructing cross-site correlation models to capture interactions between different regions. Typical methods include graph neural networks (GNNs) and spatiotemporal convolutional networks (STGCNs). These methods combine the spatial topology of monitoring stations with hydrological time series data, effectively improving the accuracy and robustness of prediction models. However, existing spatiotemporal combined models are poorly adapted to scenarios with complex river-lake relationships, such as the middle and lower reaches of the Yangtze River, and still suffer from prediction blind spots in areas lacking monitoring stations. Summary of the Invention
[0004] Purpose of the invention: The purpose of the present invention is to provide an integrated water level prediction method based on graph and sequence decomposition technology including virtual sites, which improves the adaptability and accuracy of the water level prediction system in complex river and lake systems, and provides more scientific technical support for regional flood control, drought relief and water resources management.
[0005] Technical solution: The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology of the present invention comprises the following steps:
[0006] S1. Divide the historical water level data from water level monitoring stations into training, validation, and test sets for subsequent training and prediction of river and lake water level prediction models; calculate the spatial relationship matrix between water level monitoring stations as another input to the river and lake water level prediction model;
[0007] S2. Construct a river and lake water level prediction model, and use a training set, a validation set, and a position-spatial relationship matrix to train the model; the river and lake water level prediction model includes a graph and sequence decomposition module GSD and a virtual site water level prediction module VS-WLP. The historical water level data of the water level monitoring site and the position-spatial relationship matrix are input into the graph and sequence decomposition module. Graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial relationship features and temporal relationship features of the historical water level data. Then, the spatiotemporal relationship features of the historical water level data of the water level monitoring site are obtained through splicing through a fully connected layer as the output of the graph and sequence decomposition module; the output of the graph and sequence decomposition module is split into a real site water level prediction result and a preliminary prediction result of the virtual site water level as needed, and input them into the virtual site water level prediction module together with the spatial distance relationship between the virtual site and the neighboring sites. The virtual site water level prediction module predicts the virtual site water level based on the real site water level prediction result, the preliminary prediction result of the virtual site water level, and the spatial distance relationship between the virtual site and the neighboring sites;
[0008] S3. Based on the trained river and lake water level prediction model, predict the test set to achieve water level prediction for a single model;
[0009] S4. Based on the trained river and lake water level prediction model, a hierarchical integration method is used to achieve integrated water level prediction.
[0010] Furthermore, the method for calculating the positional spatial relationship matrix between water level monitoring stations is as follows: constructing an adjacency matrix based on the adjacency relationship between water level monitoring stations, and calculating the spatial relationship matrix between water level monitoring stations based on the adjacency matrix, the unit matrix and the degree matrix.
[0011] Furthermore, the graph decomposition module in step S2 includes a graph convolution layer GCN, a graph attention layer GAT, a dropout layer, and a fully connected layer. The graph convolution layer aggregates the water level spatial relationship features of neighboring nodes through the location spatial relationship matrix of the water level monitoring station and the historical water level data, thereby updating the representation of each node. The formula is as follows:
[0012]
[0013] Among them, H (l) H represents the node water level spatial relationship feature matrix of the lth layer of graph convolution layer, (0) =X 0 is the spatial relationship characteristic matrix of the initial node water level, is the normalized adjacency matrix, where A, I, and D are the adjacency matrix, identity matrix, and degree matrix of the water level monitoring station network, respectively. The value of row i and column j in A is ij Indicates whether there is an edge between node i and node j. If there is an edge, then A ij =1, otherwise A ij= 0; the value D in the i-th row and i-th column of D ii =∑ j A ij , W (l) is the learnable weight matrix of the lth graph convolution layer, ReLU is the activation function, H (l+1) is the node water level spatial relationship feature matrix of the updated l+1th graph convolutional layer;
[0014] The node water level spatial relationship feature matrix output by the graph convolutional layer is randomly inactivated through the dropout layer and connected to the input of the fully connected layer. The fully connected layer maps and outputs the node water level spatial relationship feature matrix after random inactivation;
[0015] The graph attention layer uses the attention mechanism to learn the weights of different neighbor nodes. For each pair of neighbor nodes m and n, the attention coefficient α mn The calculation formula is:
[0016]
[0017] Among them, α mn Determines the importance of node m to its neighbor node n, W and h m They are the learnable weight matrix of node m and the water level spatial relationship feature vector, h n is the spatial relationship feature vector of the water level of node n, h k is the water level spatial relationship feature vector of node k, a is the learnable attention coefficient vector, a T is the transpose of a, and “||” represents the connection operation. represents the set of all nodes directly connected to node m, σ is the activation function, h′ m is the updated water level spatial relationship weight vector of node m;
[0018] The node water level spatial relationship weight vector output by the graph attention layer is randomly inactivated by the dropout layer and connected to the input of the fully connected layer. The fully connected layer maps the node water level spatial relationship weight vector after random inactivation to the output.
[0019] Furthermore, in step S2, the sequence decomposition module first decomposes the historical water level data into trend components and seasonal components, and the calculation expression is:
[0020] T t =AveragePooling(Y t )
[0021] S t =Y t -T t
[0022] Among them, Y tis the historical water level data, T t is the trend component, S t It is the seasonal component;
[0023] The trend component and the seasonal component are then merged and input into the Transformer, which captures the global temporal dependency between the seasonal component and the trend component through the self-attention mechanism.
[0024] Furthermore, the Transformer includes a normalization layer, a multi-head attention layer, a convolutional layer, a dropout layer, and a residual connection. The normalization layer stabilizes the training of the deep neural network by normalizing the input, and the convolutional layer captures the local features of the input through filters and convolution operations. The calculation formula of the attention mechanism is:
[0025]
[0026] Among them, Q i =x i W Q , K i =x i W K , V i =x i W V Represented as the input data x of Transformer i The query, key, and value vectors obtained through linear mapping are A i is the attention coefficient vector, W Q 、W K 、W V is the learned weight matrix, T is the transpose symbol, d k is the number of columns of the Q and K matrices, i.e., the vector dimension. Multi-head attention calculates different attention representations and obtains:
[0027]
[0028] Among them, head i =A i represents the output of the i-th attention head, is the output weight matrix;
[0029] The calculation expression of the dropout layer is:
[0030] r (l) ~Bernoulli(p)
[0031]
[0032] Among them, the Bernoulli function is to randomly generate a probability r (l) vector, p is the probability, y (l)is the lth output value of the activation function, is the output after random dropout, is the weight parameter of the dropout layer, is the bias parameter of the dropout layer, is the result obtained after weight multiplication and bias addition, is the output after the discard layer, and e is the e-th input;
[0033] The calculation expressions of the residual connection and normalization layer are:
[0034] LayerNorm(X+MultiHeadAttention(X))
[0035] The original input of the Transformer and the output of the multi-head attention layer are residualized and input into the normalization layer. The function of LayerNorm is to subtract the mean of the vector after the residual connection and then divide it by the variance, so that the input becomes a standard normal distribution with a mean of 0 and a variance of 1. X is the input of the multi-head attention layer, and MultiHead(X) is the output of the multi-head attention layer. Then, a one-dimensional convolutional layer is used for feature extraction. The calculation expression of the one-dimensional convolutional layer is:
[0036]
[0037] Among them, w rs is the weight of each position of the convolution kernel, x rs is the value of each position corresponding to the convolution area, k and m are the number of hidden units and the number of inputs respectively, y is the output value after convolution of each convolution area, and b is the offset.
[0038] Furthermore, the algorithm formula of the virtual site water level prediction module VS-WLP in step S3 is:
[0039] P v =concat(Y u dis+Y d (1-dis),outputs GSD )
[0040] Among them, P v represents the water level forecast of the target virtual site, Y u and Y d Represents the water level prediction of the adjacent upstream and downstream sites, dis is the distance ratio from the target virtual site to the upstream site, outputs GSD This is the preliminary prediction result of the virtual site water level output by the GSD module, and concat is a vector splicing operation.
[0041] Furthermore, step S4 includes:
[0042] Firstly, based on the error index, the N trained river and lake water level prediction models were divided into M groups according to their similarity using the K-means clustering method;
[0043] Secondly, the stacking method is used to take the divided M groups of prediction results as new training sets, and M ensemble models are trained as M weak learners respectively;
[0044] Finally, the AdaBoost algorithm is used to calculate the weight parameters of M weak learners. The final strong learner prediction result is obtained by adding the prediction results of the M weak learners according to the weights, thereby obtaining a more accurate water level prediction output.
[0045] The system corresponding to the method includes:
[0046] The data unit is used to divide the historical water level data of the water level monitoring stations into training sets, validation sets, and test sets for subsequent training and prediction of the river and lake water level prediction model; and calculate the positional spatial relationship matrix between the water level monitoring stations as another input to the river and lake water level prediction model;
[0047] The model construction and training unit is used to construct a river and lake water level prediction model and train the model using a training set, a validation set, and a location-spatial relationship matrix. The river and lake water level prediction model includes a graph and sequence decomposition module GSD and a virtual site water level prediction module VS-WLP. The historical water level data of the water level monitoring site and the location-spatial relationship matrix are input into the graph and sequence decomposition module. Graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial relationship features and temporal relationship features of the historical water level data. The spatiotemporal relationship features of the historical water level data of the water level monitoring site are then obtained through splicing through a fully connected layer as the output of the graph and sequence decomposition module. The output of the graph and sequence decomposition module is split into the real site water level prediction result and the preliminary prediction result of the virtual site water level as needed, and input into the virtual site water level prediction module together with the spatial distance relationship between the virtual site and the neighboring sites. The virtual site water level prediction module predicts the virtual site water level based on the real site water level prediction result, the preliminary prediction result of the virtual site water level, and the spatial distance relationship between the virtual site and the neighboring sites.
[0048] The single model prediction unit is used to predict the test set based on the trained river and lake water level prediction model to realize water level prediction of a single model.
[0049] An electronic device for storing and executing the method, comprising:
[0050] a memory storing executable program code;
[0051] a processor coupled to the memory;
[0052] The processor calls the executable program code stored in the memory to execute the steps of the integrated water level prediction method based on graph and sequence decomposition technology and including virtual sites.
[0053] A computer-readable storage medium for storing and executing the method, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are called, the computer instructions are used to execute the steps of the integrated water level prediction method based on graph and sequence decomposition technology including virtual sites.
[0054] Beneficial effects: Compared with the existing technology, the significant technical effects of the present invention are: combining GCN with GAT to construct a graph decomposition module GCN that adapts to complex river and lake systems, and extracting trend and periodic characteristics through the time series decomposition module GAT, thereby improving the prediction ability of long-term water level changes; in addition, the present invention also develops a VS-WLP module, which combines the water level information and distance ratio of neighboring stations to predict the water level in areas without monitoring stations, further improving the coverage and accuracy of the water level prediction system; while improving the prediction accuracy of the river and lake water level prediction model, the present invention designs a hierarchical ensemble learning method, which significantly enhances the applicability and robustness of the river and lake water level prediction model under complex hydrological environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 Flow chart of the method of the present invention;
[0056] Figure 2 A schematic diagram of the structure of the river and lake water level prediction model constructed by the present invention;
[0057] Figure 3 The Transformer framework in the GSD module is proposed for this invention;
[0058] Figure 4 The structure of the VS-WLP module proposed in the present invention;
[0059] Figure 5 The hierarchical ensemble learning method designed for the present invention is used to improve model performance and robustness. DETAILED DESCRIPTION
[0060] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0061] like Figure 1 As shown, the method of the present invention comprises the following steps:
[0062] S1. Preprocess the historical water level data collected from water level monitoring stations to address missing and outlier values. The data is then divided into training, validation, and test sets in a ratio of 7:1:2 for subsequent training and prediction of the river and lake water level prediction model. Furthermore, the adjacency relationships between water level monitoring stations are established, and an adjacency matrix is constructed. The spatial relationship matrix between the water level monitoring stations is calculated based on the adjacency matrix, the identity matrix, and the degree matrix. This spatial relationship matrix serves as another input to the model.
[0063] This example collects data from real water-level monitoring stations in a certain area of the middle reaches of the Yangtze River in China. The collected data is then divided into training, validation, and test sets. Finally, the river and lake water-level prediction model proposed in this invention is used to obtain water-level prediction results for real stations (actual water-level monitoring stations) and virtual stations (water-level monitoring stations simulated using a mathematical model).
[0064] S2. Build a river and lake water level prediction model and train the model using a training set and a validation set;
[0065] The pre-conditions of the river and lake water level prediction model are:
[0066] Definition 1: The water level monitoring station network is the spatial geographic distribution map of existing actual water level monitoring stations. The spatial relationship matrix between water level monitoring stations is calculated and preset by the adjacency matrix, identity matrix, and degree matrix. is a normalized adjacency matrix, where A, I, and D are the adjacency matrix, identity matrix, and degree matrix of the water level monitoring station network, respectively. Each water level monitoring station is considered a node, A represents the connection relationship between nodes, i.e., water level monitoring stations, D represents the number of edges connected to the node, and I represents the characteristic attributes of the node itself. The value of A in the i-th row and j-th column of A is ij Indicates whether there is an edge between node i and node j. If there is an edge, then A ij =1, otherwise A ij = 0. The value D in row i and column i of D ii =∑ j A ij .
[0067] Definition 2: River-Lake Relationship. The hydrological connectivity and unique water-sediment exchange between the Yangtze River, Poyang Lake, and Dongting Lake form a typical river-lake relationship. This relationship not only affects flood storage and prevention but also includes changes in river and lake water levels caused by this water exchange.
[0068] Definition 3. Virtual Site. A virtual site is a water level monitoring station simulated using a mathematical model. It is primarily used to estimate water levels in areas where no actual water level monitoring stations exist. Virtual sites can effectively fill gaps in the traditional water level monitoring network, especially in remote areas where actual water level monitoring stations are unavailable. This provides more comprehensive data support for water resource management and flood prevention.
[0069] The river and lake water level prediction model includes: a graph and sequence decomposition module and a virtual site water level prediction module. The input data of the model are the historical water level data of the water level monitoring stations and the spatial relationship matrix between the water level monitoring stations. The model input data is input into the graph and sequence decomposition module. Graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial dependency and temporal dependency of the historical hydrological data. Then, the spatiotemporal dependency of the historical water level data of the water level monitoring stations is obtained through splicing through the fully connected layer, which is used as the output of the graph and sequence decomposition module. The input of the virtual site water level prediction module is and the output is the virtual site water level.
[0070] S21, building a graph and sequence decomposition (GSD) module;
[0071] The Graph and Sequence Decomposition (GSD) module consists of a graph decomposition module and a sequence decomposition module adapted to complex river-lake systems. It is used to model the complex river network and unique river-lake relationship in the middle reaches of the Yangtze River. Figure 2 As shown. First, the hydrological characteristics of this area are characterized by numerous tributaries and a complex hydrological network, which form a strong spatial dependency. Therefore, the present invention designs a graph decomposition method to capture the spatial characteristics of water levels at each monitoring station. The graph decomposition module first uses the graph convolution layer GCN to model the spatial relationship of water levels between water level monitoring stations. In addition, because the water exchange between Dongting Lake, Poyang Lake and the Yangtze River accounts for more than 40% of the total annual runoff in the region, the graph attention layer GAT is used to study the impact of water exchange between rivers and lakes on water level changes. In terms of temporal characteristics, water levels have obvious seasonal and cyclical characteristics. The present invention applies time series decomposition technology to decompose historical water level data into trend components and seasonal components, thereby identifying and learning long-term patterns of water levels. Transformer is then used to extract the temporal correlation in trend components and seasonal components. When predicting water levels in river areas with complex water systems such as the middle reaches of the Yangtze River, the GSD module helps to improve the accuracy and reliability of water level predictions.
[0072] like Figure 2 As shown in the figure, the GSD module includes a graph decomposition module and a sequence decomposition module, wherein the graph decomposition module includes a graph convolution layer GCN, a graph attention layer GAT, a discard layer and a fully connected layer, and the sequence decomposition module includes a sequence decomposition layer and a Transformer.
[0073] The input of GSD is the historical water level data and the location-spatial relationship matrix of the water level monitoring station. In the graph decomposition module, the graph convolution layer aggregates the water level spatial relationship features of neighboring nodes through the location-spatial relationship matrix of the water level monitoring station and the historical water level data, thereby updating the representation of each node. The formula is as follows:
[0074]
[0075] Among them, H (l) H represents the node water level spatial relationship feature matrix of the lth layer of graph convolution layer, (0) =X 0 is the spatial relationship characteristic matrix of the initial node water level. is the normalized adjacency matrix, where A, I, and D are the adjacency matrix, identity matrix, and degree matrix of the water level monitoring station network, respectively. The value of row i and column j in A is ij Indicates whether there is an edge between node i and node j. If there is an edge, then A ij =1, otherwise A ij = 0. The value D in row i and column i of D ii =∑ j A ij .W (l) is the learnable weight matrix of the lth graph convolution layer. ReLU is the activation function. (l+1) is the node water level spatial relationship feature matrix of the updated l+1th graph convolutional layer.
[0076] The dropout layer randomly inactivates the node water level spatial relationship feature matrix output by the graph convolution layer, and the output is connected to the input of the fully connected layer. The fully connected layer maps and outputs the node water level spatial relationship feature matrix after random inactivation.
[0077] The core idea of the graph attention layer is to use the self-attention mechanism to learn the weights of different neighbor nodes, so that the graph attention layer can focus on more important neighbor nodes. This method can effectively capture the unique characteristics of the Jianghu relationship. For each pair of neighbor nodes m and n, the attention coefficient α mn The calculation formula is:
[0078]
[0079] Among them, α mn Determines the importance of node m to its neighbor node n, W and h m They are the learnable weight matrix of node m and the water level spatial relationship feature vector, h n is the spatial relationship feature vector of the water level of node n, h k is the water level spatial relationship feature vector of node k, a is the learnable attention coefficient vector, a Tis the transpose of a, and “||” represents the connection operation. represents the set of all nodes directly connected to node m. σ is an activation function, such as LeakyReLU or other nonlinear functions. h′ m is the updated water level spatial relationship weight vector of node m.
[0080] The node water level spatial relationship weight vector output by the graph attention layer is randomly inactivated by the dropout layer and connected to the input of the fully connected layer. The fully connected layer maps the node water level spatial relationship weight vector after random inactivation to the output.
[0081] The sequence decomposition module first uses average pooling and fully connected layers to decompose the time series (i.e. historical water level data) into trend components and seasonal components. The calculation is as follows:
[0082]
[0083] Among them, Y t is the historical water level data, T t is the trend component, S t is the seasonal component. By decomposing, the long-term trend and periodic pattern in the historical water level data can be effectively extracted, and finally added to provide a more stable input for the Transformer. Subsequently, the Transformer captures the global temporal dependency between the seasonal component and the trend component through the self-attention mechanism. Figure 3 As shown in Figure 1, the Transformer consists of a normalization layer, a multi-head attention layer, a convolutional layer, a dropout layer, and a residual connection. The normalization layer stabilizes the training of the water level prediction model by normalizing the input. The convolutional layer captures the local features of the convolutional layer input through filters and convolution operations. The calculation formula of the attention mechanism is as follows:
[0084]
[0085] Among them, Q i =x i W Q , K i =x i W K , V i =x i W V Represented as the input data x of Transformer i The query, key, and value vectors (i.e., the sum of the trend component and the seasonal component) are obtained through linear mapping. Softmax is a function that maps the input to a real number between 0 and 1 and normalizes it to ensure that the sum is 1. i is the attention coefficient vector, W Q 、W K 、WV is the learned query, key, and value weight matrix, T is the transpose symbol, d k is the number of columns in the Q and K matrices, i.e., the vector dimension, which is used to prevent the inner product from being too large. The multi-head attention layer calculates different attention representations and obtains:
[0086]
[0087] Among them, head i =A i represents the output of the i-th attention head, is the output weight matrix. The calculation expression of the dropout layer is:
[0088]
[0089] Among them, the Bernoulli function is to randomly generate a probability r (l) vector, p is the probability. y (l) is the lth output value of the activation function, is the output after random dropout, is the weight parameter of the dropout layer, is the bias parameter of the dropout layer, is the result obtained after weight multiplication and bias addition, is the output after the dropout layer, and e is the e-th input of the dropout layer. The calculation expression of the residual connection and normalization layer is:
[0090] LayerNorm(X+MultiHead(X)) (7)
[0091] The original input of the Transformer and the output of the multi-head attention layer are combined into a residual and then input into the normalization layer. The function of LayerNorm is to subtract the mean of the concatenated residual vector and then divide it by the variance, transforming the input into a standard normal distribution with a mean of 0 and a variance of 1. X is the input of the multi-head attention layer, and MultiHead(X) is the output of the multi-head attention layer. Feature extraction is performed using a one-dimensional convolutional layer, where the calculation expression of the one-dimensional convolutional layer is:
[0092]
[0093] Among them, w rs is the weight of each position of the convolution kernel, x rs is the value at each position of the convolution region, k and m are the number of hidden units and inputs in the convolution layer, respectively. y is the output value of the one-dimensional convolution layer, and b is the offset.
[0094] The weighted spatial relationship features of node water levels output by the graph decomposition module and the temporal relationship features of historical water level data output by the sequence decomposition module are spliced together to obtain the output of the graph and sequence decomposition module. The output of the graph and sequence decomposition module is split into the real site water level prediction results and the preliminary prediction results of the virtual site water level as needed.
[0095] The GSD module designed in this paper combines graph neural networks, time series decomposition technology, and Transformer to effectively capture spatial and temporal dependencies in spatiotemporal data. The design of the GSD module is based on two core goals: first, it can model the spatial structure of complex hydrological systems, such as the relationship between rivers and lakes and the adjacency of the middle reaches of the Yangtze River; second, through time series decomposition, it can extract trend and seasonal features from the raw data, which are important for water level prediction. This multi-level feature extraction method provides a more accurate and robust solution for water level prediction tasks.
[0096] S22, building a virtual site water level prediction (VS-WLP) module;
[0097] In traditional water level monitoring systems, some areas may lack water level monitoring stations due to geographical conditions, economic factors, or technical limitations. However, these areas still have a strong demand for water level monitoring, especially for flood forecasting, disaster prevention, and water resource management. To address this problem, the present invention proposes a Virtual Site Water Level Prediction (VS-WLP) module. This module uses real-site water level prediction results to predict water levels in areas without monitoring stations, thus filling the gap in traditional water level monitoring systems.
[0098] The structure of VS-WLP module is as follows Figure 4 As shown. This module receives the real site water level prediction results output by the GSD module and the preliminary prediction results of the virtual site water level, as well as the spatial distance relationship as input. The spatial distance relationship mainly includes the ratio of the distance between the virtual site and the upstream and downstream real sites to the total distance between the upstream and downstream sites. The VS-WLP module obtains the water level prediction results of neighboring sites (i.e., the upstream and downstream real sites closest to the virtual site) through slicing operations, and uses vector multiplication, splicing layers, and fully connected layers to integrate these input features to predict the water level of the virtual site based on spatial and temporal information. The algorithm formula can be expressed as:
[0099] P v =concat(Y u dis+Y d (1-dis),outputs GSD ) (9)
[0100] Among them, P v represents the water level forecast of the target virtual site, Yu and Y d They represent the water level prediction of the adjacent upstream and downstream real sites, the real site water level prediction results from the GSD module, dis is the distance ratio of the target virtual site to the upstream site, that is, the spatial distance relationship between the virtual site and the adjacent sites, outputs GSD This is the preliminary prediction result of the virtual site water level output by the GSD module, and concat is a vector splicing operation.
[0101] The VS-WLP module effectively addresses the issue of missing water levels in areas without monitoring stations. By leveraging spatiotemporal data from neighboring stations, the VS-WLP module flexibly predicts water levels between actual stations, ensuring the continuity and coverage of the site-based water level monitoring system. This approach contributes to improved flood forecasting, disaster preparedness, and water resource management capabilities.
[0102] S23. Use the training set and the validation set to train the constructed river and lake water level prediction model to obtain a trained river and lake water level prediction model.
[0103] S3. Based on the trained river and lake water level prediction model, predict the test set to achieve water level prediction for a single model.
[0104] Based on a trained river and lake water level prediction model, the present invention also provides a hierarchical ensemble learning method for ensemble water level prediction to improve the accuracy and robustness of the river and lake water level prediction model.
[0105] S4. Based on the trained river and lake water level prediction model, a hierarchical integration method is used to achieve integrated water level prediction; including:
[0106] Firstly, based on the error index, the N trained river and lake water level prediction models were divided into M groups according to their similarity using the K-means clustering method;
[0107] Secondly, the stacking method is used to take the divided M groups of prediction results as new training sets, and M ensemble models are trained as M weak learners respectively;
[0108] Finally, the AdaBoost algorithm is used to calculate the weight parameters of M weak learners. The final strong learner prediction result is obtained by adding the prediction results of the M weak learners according to the weights, thereby obtaining a more accurate water level prediction output.
[0109] Traditional machine learning methods can struggle to capture specific dependencies when dealing with heterogeneous data from different geographic regions. For example, in water level prediction tasks, different regions often exhibit distinct hydrological characteristics, which can lead to significant differences in the performance of machine learning models. Therefore, this paper proposes a hierarchical ensemble approach that combines clustering, stacking, and boosting techniques to improve the stability and robustness of water level prediction models.
[0110] like Figure 5 As shown, the hierarchical ensemble method first trains 36 river and lake water level prediction models. By calculating error metrics such as mean error and skewness error, the models are divided into three groups based on similarity using the K-means clustering method. The prediction results are then used as a new training set using the stacking method to train three ensemble models as weak learners. Finally, using the AdaBoost algorithm, the corresponding weights of the three weak learners are calculated. The final prediction is obtained by summing the predictions of the weak learners according to their weights, thereby obtaining the final prediction of the strong learner, resulting in a more accurate water level prediction output. The AdaBoost algorithm focuses on weighting misclassified samples, gradually optimizing the ensemble model's ability to handle difficult-to-classify samples. By employing a hierarchical ensemble approach, the model maintains strong performance and generalization capabilities when predicting water levels in areas with different characteristics, further improving the accuracy of the water level prediction system.
Claims
1. An integrated water level prediction method including virtual sites based on graph and sequence decomposition technology, characterized in that: The following steps are involved: S1. Divide the historical water level data from water level monitoring stations into training, validation, and test sets for subsequent training and prediction of river and lake water level prediction models; calculate the spatial relationship matrix between water level monitoring stations as another input to the river and lake water level prediction model; S2. Construct a river and lake water level prediction model, and use a training set, a validation set, and a position-spatial relationship matrix to train the model; the river and lake water level prediction model includes a graph and sequence decomposition module GSD and a virtual site water level prediction module VS-WLP. The historical water level data of the water level monitoring site and the position-spatial relationship matrix are input into the graph and sequence decomposition module. Graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial relationship features and temporal relationship features of the historical water level data. Then, the spatiotemporal relationship features of the historical water level data of the water level monitoring site are obtained through splicing through a fully connected layer as the output of the graph and sequence decomposition module; the output of the graph and sequence decomposition module is split into a real site water level prediction result and a preliminary prediction result of the virtual site water level as needed, and input them into the virtual site water level prediction module together with the spatial distance relationship between the virtual site and the neighboring sites. The virtual site water level prediction module predicts the virtual site water level based on the real site water level prediction result, the preliminary prediction result of the virtual site water level, and the spatial distance relationship between the virtual site and the neighboring sites; S3. Based on the trained river and lake water level prediction model, predict the test set to achieve water level prediction for a single model; S4. Based on the trained river and lake water level prediction model, a hierarchical integration method is used to achieve integrated water level prediction.
2. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 1, characterized in that: The calculation method of the position spatial relationship matrix between water level monitoring stations is as follows: construct an adjacency matrix based on the adjacency relationship between water level monitoring stations, and calculate the spatial relationship matrix between water level monitoring stations based on the adjacency matrix, unit matrix and degree matrix.
3. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 1, characterized in that: The graph decomposition module in step S2 includes a graph convolution layer (GCN), a graph attention layer (GAT), a dropout layer, and a fully connected layer. The graph convolution layer aggregates the water level spatial relationship features of neighboring nodes through the location spatial relationship matrix of the water level monitoring station and the historical water level data, thereby updating the representation of each node. The formula is as follows: Among them, H (l) H represents the node water level spatial relationship feature matrix of the lth layer of graph convolution layer, (0) =X 0 is the spatial relationship characteristic matrix of the initial node water level, is the normalized adjacency matrix, where A, I, and D are the adjacency matrix, identity matrix, and degree matrix of the water level monitoring station network, respectively. The value of row i and column j in A is ij Indicates whether there is an edge between node i and node j. If there is an edge, then A ij =1, otherwise A ij = 0; the value D in the i-th row and i-th column of D ii =∑ j A ij , W (l) is the learnable weight matrix of the lth graph convolution layer, ReLU is the activation function, H (l+1) is the node water level spatial relationship feature matrix of the updated l+1th graph convolutional layer; The node water level spatial relationship feature matrix output by the graph convolutional layer is randomly inactivated through the dropout layer and connected to the input of the fully connected layer. The fully connected layer maps and outputs the node water level spatial relationship feature matrix after random inactivation; The graph attention layer uses the attention mechanism to learn the weights of different neighbor nodes. For each pair of neighbor nodes m and n, the attention coefficient α mn The calculation formula is: Among them, α mn Determines the importance of node m to its neighbor node n, W and h m They are the learnable weight matrix of node m and the water level spatial relationship feature vector, h n is the spatial relationship feature vector of the water level of node n, h k is the water level spatial relationship feature vector of node k, a is the learnable attention coefficient vector, a T is the transpose of a, "||" represents the connection operation, represents the set of all nodes directly connected to node m, σ is the activation function, h′ m is the updated water level spatial relationship weight vector of node m; The node water level spatial relationship weight vector output by the graph attention layer is randomly inactivated by the dropout layer and connected to the input of the fully connected layer. The fully connected layer maps the node water level spatial relationship weight vector after random inactivation to the output.
4. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 1, characterized in that: In step S2, the sequence decomposition module first decomposes the historical water level data into trend components and seasonal components. The calculation expression is: T t =AveragePooling(Y t ) S t =Y t -T t Among them, Y t is the historical water level data, T t is the trend component, S t It is the seasonal component; The trend component and the seasonal component are then merged and input into the Transformer, which captures the global temporal dependency between the seasonal component and the trend component through the self-attention mechanism.
5. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 4 is characterized in that: Transformer includes normalization layers, multi-head attention layers, convolutional layers, dropout layers, and residual connections. The normalization layers stabilize the training of deep neural networks by normalizing the input, and the convolutional layers capture local features of the input through filters and convolution operations. The calculation formula of the attention mechanism is: Among them, Q i =x i W Q , K i =x i W K , V i =x i W V Represented as the input data x of Transformer i The query, key, and value vectors obtained through linear mapping are A i is the attention coefficient vector, W Q 、W K 、W V is the learned weight matrix, T is the transpose symbol, d k is the number of columns of the Q and K matrices, i.e., the vector dimension. Multi-head attention calculates different attention representations and obtains: Among them, head i =A i represents the output of the i-th attention head, is the output weight matrix; The calculation expression of the dropout layer is: r (l) ~Bernoulli(p) Among them, the Bernoulli function is to randomly generate a probability r (l) vector, p is the probability, y (l) is the lth output value of the activation function, is the output after random dropout, is the weight parameter of the dropout layer, is the bias parameter of the dropout layer, is the result obtained after weight multiplication and bias addition, is the output after the dropout layer, and e is the e-th input; The calculation expressions of the residual connection and normalization layer are: LayerNorm(X+MultiHead(X)) The original input of the Transformer and the output of the multi-head attention layer are residualized and input into the normalization layer. The function of LayerNorm is to subtract the mean of the vector after the residual connection and then divide it by the variance, so that the input becomes a standard normal distribution with a mean of 0 and a variance of 1. X is the input of the multi-head attention layer, and MultiHead(X) is the output of the multi-head attention layer. Then, a one-dimensional convolutional layer is used for feature extraction. The calculation expression of the one-dimensional convolutional layer is: Among them, w rs is the weight of each position of the convolution kernel, x rs is the value of each position corresponding to the convolution area, k and m are the number of hidden units and the number of inputs respectively, y is the output value after convolution of each convolution area, and b is the offset.
6. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 1, characterized in that: The algorithm formula of the virtual site water level prediction module VS-WLP in step S3 is: P v =concat(Y u ·dis+Y d (1-dis),outputs GSD ) Among them, P v represents the water level forecast of the target virtual site, Y u and Y d Represents the water level prediction of the adjacent upstream and downstream sites, dis is the distance ratio from the target virtual site to the upstream site, outputs GSD This is the preliminary prediction result of the virtual site water level output by the GSD module, and concat is a vector splicing operation.
7. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 1, characterized in that: Step S4 includes: Firstly, based on the error index, the N trained river and lake water level prediction models were divided into M groups according to their similarity using the K-means clustering method; Secondly, the stacking method is used to take the divided M groups of prediction results as new training sets, and M ensemble models are trained as M weak learners respectively; Finally, the AdaBoost algorithm is used to calculate the weight parameters of M weak learners. The final strong learner prediction result is obtained by adding the prediction results of the M weak learners according to the weights, thereby obtaining a more accurate water level prediction output.
8. An integrated water level prediction system including virtual sites based on graph and sequence decomposition technology, characterized in that: include: Data units are used to divide the historical water level data from water level monitoring stations into training sets, validation sets, and test sets for subsequent training and prediction of river and lake water level prediction models; Calculate the spatial relationship matrix between water level monitoring stations as another input to the river and lake water level prediction model; The model construction and training unit is used to construct a river and lake water level prediction model and train the model using a training set, a validation set, and a location-spatial relationship matrix. The river and lake water level prediction model includes a graph and sequence decomposition module GSD and a virtual site water level prediction module VS-WLP. The historical water level data of the water level monitoring site and the location-spatial relationship matrix are input into the graph and sequence decomposition module. Graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial relationship features and temporal relationship features of the historical water level data. The spatiotemporal relationship features of the historical water level data of the water level monitoring site are then obtained through splicing through a fully connected layer as the output of the graph and sequence decomposition module. The output of the graph and sequence decomposition module is split into the real site water level prediction result and the preliminary prediction result of the virtual site water level as needed, and input into the virtual site water level prediction module together with the spatial distance relationship between the virtual site and the neighboring sites. The virtual site water level prediction module predicts the virtual site water level based on the real site water level prediction result, the preliminary prediction result of the virtual site water level, and the spatial distance relationship between the virtual site and the neighboring sites. The single model prediction unit is used to predict the test set based on the trained river and lake water level prediction model to realize water level prediction of a single model.
9. An electronic device, characterized in that: The device comprises: a memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the steps of the integrated water level prediction method based on graph and sequence decomposition technology and including virtual sites as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which, when called, are used to execute the steps of the integrated water level prediction method based on graph and sequence decomposition technology and including virtual sites as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Drainage basin multi-point water level prediction and early warning method based on generative adversarial network
CN115688579A
Construction method of underground water level monitoring and early warning model based on big data
CN118094230A
Cited By
Tidal station water level prediction method based on hybrid adaptive graph structure
CN121071615A
Tide gauge water level prediction method based on hybrid adaptive graph structure
CN121071615B