Graph and sequence decomposition technology-based integrated water level prediction method containing virtual sites
By adopting an integrated method based on graph and sequence decomposition technology in the water level prediction system, a river and lake water level prediction model is constructed and combined with a virtual site water level prediction module, the problems of poor water level prediction adaptability and lack of monitoring sites in complex river and lake systems are solved, and higher prediction accuracy and coverage are achieved.
Patent Information
- Application Number
- CN202510067545.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-01-16
AI Technical Summary
The existing water level prediction methods have poor adaptability in complex river and lake systems and there are blind spots in prediction in areas where monitoring sites are lacking.
Using an integrated water level prediction method based on graph and sequence decomposition technology, a river and lake water level prediction model is constructed, including graph decomposition module and sequence decomposition module, combined with the virtual site water level prediction module, and using graph convolutional layer, graph attention layer, Transformer and other technologies to extract spatiotemporal features and make predictions.
It improves the adaptability and accuracy of the water level prediction system in complex Jianghu systems, fills the prediction blind spots in the unmonitored site area, and enhances the coverage and accuracy of the model.
Smart Images

Figure CN119862998A_ABST
Abstract
Description
Technical Field
[0001] The 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 an important role in flood control and drought relief, water resources management and shipping security. Especially 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 economy and ecological environment. In recent years, with the rapid development of deep learning technology, water level prediction methods based on time and space data have gradually attracted widespread attention from researchers.
[0003] At present, the research methods of water level prediction are mainly divided into two categories: one is the prediction method that only uses the temporal characteristics of data, and the other is the comprehensive prediction method that combines temporal characteristics and spatial characteristics. The first type of method is usually based on time series models, such as autoregressive model (ARIMA), long short-term memory network (LSTM), gated recurrent unit (GRU), etc. These methods analyze the historical water level data of a single monitoring station, extract the dynamic change law in time, and predict the future water level; this type of method lacks the participation of spatial information, and its performance is limited in complex basins or multi-site joint prediction scenarios. The second type of method combines temporal characteristics and spatial characteristics, and captures the interactive relationship between different regions by constructing a cross-site association model; typical methods include graph neural network (GNN), spatiotemporal convolutional network (STGCN), etc.; these methods combine the spatial topological structure between monitoring sites and hydrological time series data, which can effectively improve the accuracy and robustness of the prediction model. However, the existing spatiotemporal combined models are poorly adaptable to scenarios with complex river-lake relationships (such as the middle and lower reaches of the Yangtze River), and there are still prediction blind spots in areas where there are no monitoring sites. 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 training set, validation set and test set according to the historical water level data of the water level monitoring stations for the subsequent training and prediction of the river and lake water level prediction model; calculate the position spatial relationship matrix between the water level monitoring stations as another input of 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, and graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial relationship characteristics and temporal relationship characteristics of the historical water level data, and then the spatiotemporal relationship characteristics 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 is 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 according to 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, the test set is predicted to achieve water level prediction of 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: construct an adjacency matrix according to the adjacency relationship between water level monitoring stations, and calculate the spatial relationship matrix between water level monitoring stations according to 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 discard 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 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 the i-th row and j-th column 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 convolutional 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 convolution 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 are the learnable weight matrix of node m and the spatial relationship feature vector of water level, h n is the spatial relationship feature vector of the water level of node n, h k is the spatial relationship feature vector of the water level of node k, a is the learnable attention coefficient vector, a T is the transpose of a, and “||” represents the concatenation operation. represents the set of all nodes directly connected to node m, σ is the activation function, h′ m is the water level spatial relationship weight vector after node m is updated;
[0018] The node water level spatial relationship weight vector output by the graph attention layer is randomly inactivated through the discard 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 dependencies between the seasonal component and the trend component through a self-attention mechanism.
[0024] Furthermore, Transformer includes a normalization layer, a multi-head attention layer, a convolution 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 convolution 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 transposed 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 discard layer is:
[0030] r (l) ~Bernoulli(p)
[0031]
[0032] Among them, the Bernoulli function is used to randomly generate a probability r (l) vector, p is the probability, y is (l)is the lth output value of the activation function, is the output after random dropout, is the weight parameter of the discard layer, is the bias parameter of the discard 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 residual connection and normalization layer are:
[0034] LayerNorm(X+MultiHeadAttention(X))
[0035] Among them, the original input of Transformer and the output of the multi-head attention layer are input into the normalization layer after residual. The role of LayerNorm is to subtract the mean of the vector after residual connection and divide it by the variance, so as to convert 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. Then, a one-dimensional convolutional layer is used for feature extraction, and 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 It is the preliminary prediction result of the water level of the virtual site output by the GSD module, and concat is a vector concatenation operation.
[0041] Further, 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 integrated 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, thus 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 training set, validation set and test set according to the historical water level data of the water level monitoring stations for the subsequent training and prediction of the river and lake water level prediction model; calculate the position spatial relationship matrix between the water level monitoring stations as another input of the river and lake water level prediction model;
[0047] The model building and training unit is used to build a river and lake water level prediction model, and train the model using a training set, a validation set, and a position-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 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, and the spatial relationship characteristics and temporal relationship characteristics of the historical water level data are obtained, and then the spatiotemporal relationship characteristics 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 is input into the virtual site water level prediction module together with the spatial distance relationship between the virtual site and the neighboring site; the virtual site water level prediction module predicts the virtual site water level according to 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 site;
[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 including virtual sites based on graph and sequence decomposition technology.
[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, they 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 prior art, 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 has also developed 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 is a 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 framework of Transformer in the GSD module is proposed for the present invention;
[0058] Figure 4 The structure of the VS-WLP module proposed by the present invention;
[0059] Figure 5 The hierarchical ensemble learning method designed for the present invention is used to improve the model performance and robustness. DETAILED DESCRIPTION
[0060] The present invention is 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 solve the problem of missing values and outliers in water level, and divide them into training set, validation set and test set according to 7:1:2 for the subsequent training and prediction of river and lake water level prediction model. In addition, set the adjacency relationship between water level monitoring stations, construct the adjacency matrix, and calculate the spatial relationship matrix between water level monitoring stations based on the adjacency matrix, unit matrix and degree matrix, and use the spatial relationship matrix as another input of the model.
[0063] This embodiment collects real water level monitoring station data in a certain area of the middle reaches of the Yangtze River in China, and then divides the data into training set, validation set and test set according to the collected data. Finally, the river and lake water level prediction model proposed in the present invention is used to solve the water level prediction results of real sites (actual water level monitoring sites) and virtual sites (water level monitoring sites simulated by mathematical models).
[0064] S2, construct a river and lake water level prediction model, and use the training set and validation set to train the model;
[0065] The preset conditions of the river and lake water level prediction model are:
[0066] Definition 1: Water level monitoring station network, i.e., the existing actual water level monitoring station spatial geographic distribution map. The spatial relationship matrix between water level monitoring stations is preset by calculating the adjacency matrix, the identity matrix, and the 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 regarded as 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 attribute of the node itself. The value 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 the i-th row and i-th column of D ii =∑ j A ij .
[0067] Definition 2: River-lake relationship. The hydrological connectivity and unique water-sediment exchange between the Yangtze River and Poyang Lake and Dongting Lake constitute a typical river-lake relationship. This relationship is not only related to flood storage and prevention, but also includes changes in river and lake water levels caused by water exchange.
[0068] Definition 3: Virtual site. A virtual site is a water level monitoring station simulated by a mathematical model, which is mainly used to estimate the water level in areas where there are no actual water level monitoring stations. Virtual sites can effectively fill the gaps in the traditional water level monitoring station network, especially in remote areas or areas where it is impossible to build actual water level monitoring stations, providing more comprehensive data support for water resource management and flood prevention and control.
[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 site and the spatial relationship matrix between the water level monitoring sites. 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 site is obtained through splicing through the fully connected layer as the output of the graph and sequence decomposition module; the virtual site water level prediction module input 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 the region are characterized by numerous tributaries and a complex hydrological network, forming a strong spatial dependency. Therefore, the present invention designs a graph decomposition method to capture the spatial characteristics of the water level 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, the water level has obvious seasonal and periodic characteristics. The present invention uses time series decomposition technology to decompose historical water level data into trend components and seasonal components, thereby identifying and learning the long-term pattern of water level. Then, Transformer is used to extract the temporal correlation in the trend component and the seasonal component. 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 prediction.
[0072] like Figure 2 As shown, 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 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 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 the i-th row and j-th column 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 convolutional layer. ReLU is the activation function. (l+1) It 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 are the learnable weight matrix of node m and the spatial relationship feature vector of water level, h n is the spatial relationship feature vector of the water level of node n, h k is the spatial relationship feature vector of the water level of node k, a is the learnable attention coefficient vector, a Tis the transpose of a, and “||” represents the concatenation 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 through the discard 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 Transformer. Subsequently, 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, Transformer consists of a normalization layer, a multi-head attention layer, a convolution 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 convolution layer captures the local features of the convolution 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 trend component and the seasonal component after addition) are obtained through linear mapping. Softmax is a function used to map the input to a real number between 0 and 1 and normalize 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 of 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 discard layer is:
[0088]
[0089] Among them, the Bernoulli function is used to randomly generate a probability r (l) vector, p is the probability. (l) is the lth output value of the activation function, is the output after random dropout, is the weight parameter of the discard layer, is the bias parameter of the discard 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 of the discard layer. The calculation expression of the residual connection and normalization layer is:
[0090] LayerNorm(X+MultiHead(X)) (7)
[0091] Among them, the original input of Transformer and the output of the multi-head attention layer are input into the normalization layer after residual. The role of LayerNorm is to subtract the mean of the vector after residual connection and divide it by the variance, so as to convert 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. The one-dimensional convolution layer is used for feature extraction, and the calculation expression of the one-dimensional convolution layer is:
[0092]
[0093] Among them, w rs is the weight of each position of the convolution kernel, x rs is the value of each position in the corresponding convolution area, k and m are the number of hidden units and the number of 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 concatenated to obtain the output of the graph and sequence decomposition module. The output of the graph and sequence decomposition module is split into real site water level prediction results and preliminary prediction results of virtual site water levels as needed.
[0095] The GSD module designed by the present invention combines graph neural networks, time series decomposition technology and Transformer, which can effectively capture the spatial and temporal dependencies in spatiotemporal data. The design of the GSD module is based on two core goals: on the one hand, it can model the spatial structure of complex hydrological systems, such as the river-lake relationship and adjacency relationship in the middle reaches of the Yangtze River; on the other hand, through time series decomposition, it can extract trend and seasonal features from the original data, which are of great help to water level prediction. This multi-level feature extraction method provides a more accurate and robust solution for water level prediction tasks.
[0096] S22, constructing 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 in flood forecasting, disaster prevention and water resource management. In order to solve this problem, the present invention proposes a virtual site water level prediction (VS-WLP) module. This module uses the real site water level prediction results to predict the water level in the area without monitoring stations, thereby filling the gap in the traditional water level monitoring system.
[0098] The structure of the 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, integrates these input features using vector multiplication, concatenation layer, and fully connected layer, and predicts 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 result from the GSD module output, dis is the distance ratio from the target virtual site to the upstream site, that is, the spatial distance relationship between the virtual site and the adjacent site, outputs GSD It is the preliminary prediction result of the water level of the virtual site output by the GSD module, and concat is a vector concatenation operation.
[0101] The VS-WLP module effectively solves the problem of missing water levels in areas without monitoring stations. By utilizing the spatiotemporal data of neighboring stations, the VS-WLP module can flexibly predict water levels between actual stations, ensuring the continuity and coverage of the station water level monitoring system. This approach helps improve flood forecasting, disaster prevention and water resources 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, the test set is predicted to achieve water level prediction of a single model.
[0104] Based on the 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 integrated 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, thus obtaining a more accurate water level prediction output.
[0109] Traditional machine learning methods may have difficulty capturing specific dependencies when dealing with heterogeneous data from different geographical regions. For example, in the water level prediction task, different regions usually exhibit different hydrological characteristics, which may lead to significant differences in the performance of machine learning models. Therefore, the present invention proposes a hierarchical ensemble method that combines clustering, stacking and boosting techniques to improve the stability and robustness of the water level prediction model.
[0110] like Figure 5 As shown in the figure, the first step of the hierarchical integration method is to train 36 river and lake water level prediction models. By calculating the error indicators such as average error and skew error, the K-means clustering method is used to divide them into three groups according to similarity. The stacking method is used to use the prediction results as new training sets to train three integrated models as weak learners. Finally, according to the Adaboost algorithm, the corresponding weights of the three weak learners are calculated. The final prediction is to obtain the final strong learner prediction result by adding the prediction results of the weak learners according to the weights, so as to obtain a more accurate water level prediction output. The AdaBoost algorithm focuses on weighted adjustment of misclassified samples and gradually optimizes the processing ability of the integrated model for difficult-to-classify samples. By adopting the hierarchical integration method, the model can maintain strong performance and generalization ability when predicting water levels in areas with different characteristics, thereby 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 training set, validation set and test set according to the historical water level data of the water level monitoring stations for the subsequent training and prediction of the river and lake water level prediction model; calculate the position spatial relationship matrix between the water level monitoring stations as another input of 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, and graph decomposition and sequence decomposition are performed in the graph and sequence decomposition module respectively to obtain the spatial relationship characteristics and temporal relationship characteristics of the historical water level data, and then the spatiotemporal relationship characteristics 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 is 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 according to 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, the test set is predicted to achieve water level prediction of 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 is 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 is characterized in that: The graph decomposition module in step S2 includes a graph convolution layer GCN, a graph attention layer GAT, a discard 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 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 the i-th row and j-th column 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 convolutional 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 convolution 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 are the learnable weight matrix of node m and the spatial relationship feature vector of water level, 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 water level spatial relationship weight vector after node m is updated; The node water level spatial relationship weight vector output by the graph attention layer is randomly inactivated through the discard 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, and 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 dependencies between the seasonal component and the trend component through a 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 layer, multi-head attention layer, convolution layer, dropout layer and residual connection; the normalization layer stabilizes the training of deep neural network by normalizing the input, and the convolution layer captures the 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 L , K i =x i W M , V i =x i W N 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 transposed 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 discard layer is: Among them, the Bernoulli function is used to randomly generate a probability r (l) vector, p is the probability, y is (l) is the lth output value of the activation function, is the output after random dropout, is the weight parameter of the discard layer, is the bias parameter of the discard 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; The calculation expressions of residual connection and normalization layer are: LayerNorm(X+MultiHeadAttention(X)) Among them, the original input of Transformer and the output of the multi-head attention layer are input into the normalization layer after residual. The role of LayerNorm is to subtract the mean of the vector after residual connection and divide it by the variance, so as to convert 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. Then, a one-dimensional convolutional layer is used for feature extraction, and 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 It is the preliminary prediction result of the water level of the virtual site output by the GSD module, and concat is a vector concatenation operation.
7. The integrated water level prediction method including virtual sites based on graph and sequence decomposition technology according to claim 1 is 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 integrated 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, thus 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 unit, used to divide the training set, validation set and test set according to the historical water level data of the water level monitoring station for the subsequent training and prediction of the river and lake water level prediction model; The spatial relationship matrix between water level monitoring stations is calculated as another input to the river and lake water level prediction model; The model building and training unit is used to build a river and lake water level prediction model, and train the model using a training set, a validation set, and a position-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 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, and the spatial relationship characteristics and temporal relationship characteristics of the historical water level data are obtained, and then the spatiotemporal relationship characteristics 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 is input into the virtual site water level prediction module together with the spatial distance relationship between the virtual site and the neighboring site; the virtual site water level prediction module predicts the virtual site water level according to 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 site; 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
River water level prediction method and system based on LSTM model
CN117390387A
Construction method of underground water level monitoring and early warning model based on big data
CN118094230A
Basin multi-site runoff prediction method based on space-time diagram convolutional network
CN118551877A
Artificial-intelligence-based waterway information system
US20210334650A1
Cited By
Interpretable lake space water level simulation method and system considering space-time correlation
CN120105926A
An interpretable lake spatial water level simulation method and system considering spatio-temporal correlation
CN120105926B