A multi-point prediction and early warning method for river basins based on a spatio-temporal correlation hybrid deep learning model
By using a spatiotemporal correlation hybrid deep learning model based on LSTM and GCN, combined with multi-point water level data of the basin, accurate prediction of the water level of the basin for the next day or three days was achieved. This solves the problems of latency and low data utilization in existing technologies and improves the ability to prevent natural disasters.
Patent Information
- Application Number
- CN202210935318.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-04
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-08-04
AI Technical Summary
Existing water level control methods for river basins suffer from delays, low data utilization, and reliance on experience. They cannot accurately predict future water level changes at multiple points in the water basin, leading to resource waste and an inability to effectively prevent natural disasters.
A spatiotemporal correlation-based hybrid deep learning model, combining LSTM and GCN, is adopted to mine the future water level change characteristics of multiple points in the basin using historical and future reservoir rainfall and flood discharge data. A multi-point water level prediction model for the basin is constructed, and water level prediction for the next day or three days is achieved through training and prediction.
It improves the accuracy and robustness of multi-point water level prediction in the basin, reduces reliance on experience, and enables early prediction of water levels exceeding warning levels and their geographical locations, thus achieving flood prevention during the flood season.
Smart Images

Figure CN115310532B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent reservoirs and multi-point water level prediction and early warning in river basins, and particularly relates to a multi-point prediction and early warning method for river basins based on a spatio-temporal correlation hybrid deep learning model. Background Art
[0002] The existing river basin water level control methods mainly collect the real-time water levels of multiple points in the lower reaches of the river basin based on sensors. According to the existing water levels, combined with the real-time rainfall and the water level changes of flood discharges, manual experience or mathematical formula derivation is relied on to control the flood discharge volume to control and adjust the water levels of the lower reaches of the river basin. This method has a certain delay, and the utilization of data is relatively one-sided, ignoring various indicators of multiple points in the collected river basin, resulting in the shelving of a large amount of resources and the data of multiple points in multiple lower reaches and multiple river basins collected, and at the same time, resources need to be invested to maintain the river basin environment. During the process of adjusting the water levels of multiple points in the river basin, only real-time regularization can be carried out, and the water levels of multiple points in the river basin cannot be adjusted according to the changing trends of the future water levels of multiple points in the river basin, and it is impossible to predict specifically the water level values and their geographical locations that will exceed the warning level, so as to realize the prevention of flood seasons and other natural disasters.
[0003] The existing river basin water level prediction models focus on the water level prediction work of multiple monitoring points in the river basin waters. Traditional methods for river basin water level control can only adjust the water volume of the source reservoir by combining fixed practical experience and mathematical formulas with the real-time rainfall and flood discharge water level values to regularize the river basin water level, and can only achieve real-time regularization. It is impossible to make full use of the future rainfall and flood discharge data of the source reservoir to adjust the water levels of multiple points in the river basin according to the changing trends of the future water levels of multiple monitoring points in the river basin. Therefore, this technical solution has three disadvantages:
[0004] 1. The calculation method of the mathematical formula is relatively fixed. The traditional method for regularizing the water levels of multiple points in the river basin directly applies the formula according to the real-time collected data of the source reservoir and the river basin water levels to obtain the feedback on the flood discharge volume of the source reservoir, which has the defect of delay and cannot predict the water levels of the river basin in the next day or several days.
[0005] 2. It depends to a great extent on practical experience. When natural disasters occur, the rise of the river basin water level has a certain suddenness and unpredictability, lacking an objective and effective future water level prediction.
[0006] 3. The utilization rate of the collected data of the source reservoir and the river basin water levels is relatively low, resulting in a waste of data resources. Traditional methods cannot utilize the data of future rainfall and future flood discharge. The former can obtain a relatively accurate estimate through weather forecasts, and the latter is controllable by humans. Summary of the Invention
[0007] In view of the deficiencies and gaps in the existing technology, the present invention proposes a method for multi-point prediction and early warning in a river basin based on a spatio-temporal correlation hybrid deep learning model, aiming to solve the problems existing in the existing technology and achieve the merger of the time-correlation characteristics and geographical location characteristics of the water levels at multiple monitoring points in the river basin. This method realizes the accuracy of the water level prediction for one day or three days in the future at multiple points in the river basin.
[0008] The present invention specifically adopts the following technical solutions:
[0009] A method for multi-point prediction and early warning in a river basin based on a spatio-temporal correlation hybrid deep learning model, characterized in that: according to the information of the reservoir aspect including historical and future reservoir rainfall and flood discharge and the water level data of multiple points in the river basin, data structure features that can predict the water level changes of multiple points in the river basin in the next day or three days are mined, and the characteristic water level information data of multiple points in the river basin is used as the input feature of the spatio-temporal correlation hybrid model of the water levels of multiple points in the river basin based on LSTM and GCN. After training is completed, the water level prediction of the river basin is carried out for one day or multiple days, where the input data fields include the rainfall, flood discharge of the source reservoir after time normalization for each measuring point and the water levels of multiple points in the river basin, and the model returns the predicted values of the water levels of the river basin for these measuring points.
[0010] Further, the input data of the model is the rainfall and flood discharge data of the source reservoir of the river basin, and the water level data of multiple monitoring points in the river basin includes the water level value data of K river basin monitoring points; and the data in the data set is sorted, useless features are deleted, missing values are filled, and normalization processing is carried out, and it is divided into a training set and a test set, which are respectively reshaped into 3D data, and then the training set and the test set are encapsulated.
[0011] Further, the data is processed into a format that conforms to the model input: the features of multiple monitoring points including the source reservoir and K monitoring points in the river basin are respectively processed into matrices with the shape of F*D, where F is the feature dimension and D is the total number of days; then an input sliding window with a size of N is used and slides in the direction of time passing, with a sliding step of 1, and N is the number of past days. Each time a step is slid, new sample features are formed as the input of the model; a label sliding window with a size of 1 or 3 is used and slides in the direction of time passing, and each time a step is slid, new sample labels are formed, and the label value is the water level value of the monitoring point features for one day or three days.
[0012] Further, in the map, the K monitoring points are regarded as nodes in the graph structure. Each monitoring point is traversed, and it is connected to the monitoring point with the closest Euclidean distance to it. If this edge already exists, the next monitoring point is traversed, and in this way, an adjacency matrix is constructed, and then the degree matrix and the Laplacian matrix are calculated to obtain a topological structure graph containing geographical location information and geographical space dependence relationships, and finally an adjacency matrix with a size of (K,K) is output.
[0013] Further, the process of feature extraction by the hybrid model for spatio-temporal association of multi-point water levels in a river basin based on LSTM and GCN includes:
[0014] LSTM feature encoding: It includes the processing of three LSTM layers; the feature vectors obtained after the representation learning of the three LSTM networks are concatenated in the time dimension without generating new dimensions, and finally a time-associated feature vector containing the historical attributes of each monitoring point is output.
[0015] GCN feature encoding: Copy the geographic information map, take the topological structure map with a size of (K, K) containing geographical location information and geographical spatial dependence relationships as the input, perform a replication operation according to the batch quantity value, and finally output a feature vector matrix with a size of (B, K, K), where B is the batch size; and obtain a feature vector matrix with a size of (B, 3, F') after concatenation as the feature matrix, where F' is the output dimension of the LSTM network. At the same time, take the geographic information map with a size of (B, K, K) as the adjacency matrix and input it into this layer to obtain a topological structure map containing time feature information and geographical location information, and input it together with the topological structure map as the feature matrix of the graph convolution layer to perform feature extraction on the topological structure map, and finally output a feature vector matrix with a size of (B, 3, F'); after graph convolution, reshape the obtained feature vector matrix; take the feature vector matrix with a size of (B, 3, F') output after feature extraction as the object to be reshaped, set the dimension to the product of the first dimension of the concatenated vector matrix and the last two dimensions for feature vector reshaping, and merge the feature variable dimensions, and finally output a vector matrix with a size of (B, 3 * F'); next, construct a fully connected regression prediction layer: Take the reshaped feature vector matrix with a size of (B, 3 * F') as the feature matrix input of the fully connected regression prediction layer, and output the predicted values of the multi-point features in the river basin calculated by the fully connected neural network. By setting the number of neurons K * Z at the output end, finally output a predicted vector matrix with a size of (B, K * Z).
[0016] Further, the training process of the hybrid model for spatio-temporal association of multi-point water levels in a river basin based on LSTM and GCN is specifically as follows:
[0017] Input the features after extracting time characteristics and spatial characteristics into the model, specify the corresponding output of the input, that is, clarify the water levels predicted for one day or multiple days corresponding to each output, and use the model for training and fitting. The fitting process uses the mean square error MSE as the optimization objective of the hybrid model for spatio-temporal association of multi-point water levels in a river basin based on LSTM and GCN.
[0018] The beneficial effects of the present invention and its preferred solutions include:
[0019] 1. A geographical information map is proposed. An adjacency relationship matrix is constructed using geographical location points on the map, and then a graph data structure is obtained. A GCN is used to model the geospatial features between monitoring points, and the time correlation features of the historical attributes of each monitoring point are mined in cooperation with an LSTM, so as to obtain more accurate data feature information for the water level prediction of multiple points in the basin.
[0020] 2. Based on the historical and future rainfall and flood discharge amounts of the source reservoir and the water level data of multiple monitoring points in the basin, the data structure features that can predict the changes in the water levels of multiple points in the basin in the next day or three days are mined, and the predicted values of the water levels of multiple points in each basin in the next day or several days are obtained. It not only effectively utilizes the data of future rainfall and future flood discharge amounts, but also solves the defect that the existing method has a delay and cannot predict the water levels of the basin in the next day or several days. At the same time, an end-to-end automatic prediction model is provided, which reduces the dependence on experience and effectively improves the robustness, generalization ability and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The present invention will be further described in detail below in conjunction with the drawings and specific embodiments:
[0022] Figure 1 It is the overall execution process diagram of the embodiment scheme of the present invention;
[0023] Figure 2 It is the schematic diagram of the data reading process when Task 1 is executed in the embodiment of the present invention;
[0024] Figure 3 It is the schematic diagram of the data reading process when Task 2 is executed in the embodiment of the present invention;
[0025] Figure 4 It is the topological structure diagram generated in the embodiment of the present invention;
[0026] Figure 5 It is the schematic diagram of the adjacency matrix in the embodiment of the present invention;
[0027] Figure 6 It is the flow chart of the LSTM+GCN model in the embodiment of the present invention;
[0028] Figure 7 It is the schematic diagram of the first LSTM feature encoding layer in the embodiment of the present invention;
[0029] Figure 8 It is the schematic diagram of the second LSTM feature encoding layer in the embodiment of the present invention;
[0030] Figure 9 It is the schematic diagram of the third LSTM feature encoding layer in the embodiment of the present invention;
[0031] Figure 10 It is the schematic diagram of the GCN network feature encoding in the embodiment of the present invention;
[0032] Figure 11 Schematic diagram of the loss curve of Task 1 in the embodiment of the present invention;
[0033] Figure 12 Schematic diagram of the loss curve of Task 2 in the embodiment of the present invention;
[0034] Figure 13 Schematic diagram of the fitting curve of Task 1 in the embodiment of the present invention - upstream;
[0035] Figure 14 Schematic diagram of the fitting curve of Task 1 in the embodiment of the present invention - downstream;
[0036] Figure 15 Schematic diagram of the fitting curve of Task 2 in the embodiment of the present invention - predicting one day later - upstream;
[0037] Figure 16 Schematic diagram of the fitting curve of Task 2 in the embodiment of the present invention - predicting one day later - downstream;
[0038] Figure 17 Schematic diagram of the fitting curve of Task 2 in the embodiment of the present invention - predicting two days later - upstream;
[0039] Figure 18 Schematic diagram of the fitting curve of Task 2 in the embodiment of the present invention - predicting two days later - downstream;
[0040] Figure 19 Schematic diagram of the fitting curve of Task 2 in the embodiment of the present invention - predicting three days later - upstream;
[0041] Figure 20 Schematic diagram of the fitting curve of Task 2 in the embodiment of the present invention - predicting three days later - downstream;
[0042] Figure 21 Flowchart of the implementation of the method in the embodiment of the present invention. Detailed implementation manners
[0043] To make the features and advantages of this patent more obvious and understandable, specific embodiments are given below and described in detail as follows:
[0044] The overall execution flowchart of the technical solution model proposed by the present invention is as Figure 1As shown in the figure, a hybrid model of Long Short-Term Memory Network (LSTM) and Graph Convolutional Neural Network (GCN) is adopted. The use of LSTM aims to mine the time-correlation features of the historical attributes of each monitoring point; the use of GCN aims to model the geospatial dependencies between monitoring points, so as to realize the association of spatio-temporal information. This model has the characteristics of high accuracy and fast operation, and can take into account the historical adjustment factors of the sluice gates, and specifically predict the water levels exceeding the warning level and their geographical locations, so as to adjust the flood discharge volume in time and achieve the prevention of flood season. This model conducts multi-point water level prediction in the basin, and can grasp the changing trends of the reservoir water levels at multiple points in the basin in the next one to three days, so as to adjust the reservoir water levels in advance to regularize the water levels at multiple points in the basin. The specific implementation steps are as follows:
[0045] Step 1: Input of basin water level data
[0046] The input data are the rainfall and flood discharge data of the reservoir at the head of the basin, and the water level data of multiple monitoring points in the basin include the water level value data of K basin monitoring points. Sort the data in the dataset according to the collection time, and the sorting method is ascending. Read the original data and delete the useless features such as time and the water level of the upper reaches of the basin the previous day. For the data with missing values, use the previous value of the missing value to fill in the missing value, and fill it manually in the case of a small amount of missing values. Perform normalization preprocessing on all variables of each monitoring point in the dataset, map the data to between 0 and 1, then divide the dataset into a training set and a test set, reshape them into 3D data respectively, and then encapsulate the training set and the test set for future calls; perform maximum-minimum normalization preprocessing on each feature variable data in the dataset in turn. After sorting, the dataset is a time series with values between 0 and 1, and its collection time is set to T i where (i = 0, 1, 2, …, N). The specific data format is shown in Table 1:
[0047] Table 1 Basin water level data structure
[0048]
[0049] Maximum-minimum normalization preprocessing:
[0050]
[0051] In formula (1), X is the data to be normalized, X min and X max respectively represent the maximum and minimum values in the data to be normalized. Finally, after mapping the data to between 0 and 1, it is used as feature data to input the model for training;
[0052] The input data needs to perform two tasks:
[0053] Task 1: Using the flood discharge volume of the source reservoir, rainfall, and water levels at K monitoring points in multiple locations in the basin on the same day as the characteristics of a time point (day), predict the water levels at K monitoring points in the next day through the characteristics of the past N days.
[0054] Task 2: Using the flood discharge volume and rainfall in the next three days of the source reservoir and K monitoring points in multiple locations in the basin as the characteristics of a time point, complete the prediction of the water levels at K monitoring points in the basin in the next three days through the characteristics of the past N time points.
[0055] Among them, Task 1 aims to make predictions entirely based on historical data. In practical applications, the future rainfall can be estimated more accurately through weather forecasts, and the future flood discharge volume is artificially controlled. Therefore, Task 2 is introduced to assist in the prediction through future weather and custom flood discharge volume, and the task is extended to multi-step prediction.
[0056] Furthermore, as Figures 2 to 3 shown, the data is processed into a format that conforms to the model input: the characteristics of multiple monitoring points (the source reservoir and K monitoring points in the basin) are respectively processed into matrices of the shape F*D, where F is the feature dimension (K + 2 for Task 1, including the reservoir characteristics of rainfall and flood discharge volume, and the characteristics of water levels at K monitoring points; K + 6 for Task 2, including the rainfall and flood discharge volume of the reservoir in the next three days, and the characteristics of water levels at K monitoring points), and D is the total number of days. Subsequently, an input sliding window of size N (default is 8) is used to slide in the direction of time flow with a sliding step of 1. N is the number of past days. Each time it slides one step, a new sample feature is formed as the input of the model; a label sliding window of size 1 (for Task 1) or 3 (for Task 2) is used to slide in the direction of time flow. Each time it slides one step, a new sample label is formed, and the label value is the water level value of the monitoring point features for one day or three days. For the basin water level dataset (containing 611 groups of data): for Task 1, it is calculated by sliding 603 times in sequence; for Task 2, it is calculated by sliding 601 times in sequence; as Figure 4 shown. Then, the dataset is split into a training set and a test set at a ratio of 7:3, where the first 70% of the dataset is used as the training set, and the last 30% is used as the test set.
[0057] Table 2 Basin Water Level Dataset
[0058]
[0059]
[0060] Step 2 Construct the Geographic Information Map
[0061] In the map, consider K monitoring points as nodes in the graph structure. Traverse each monitoring point and connect it to the monitoring point with the closest Euclidean distance. If such an edge already exists, then traverse the next monitoring point. In this way, construct the adjacency matrix, and then calculate the degree matrix and the Laplacian matrix to obtain a topological structure graph containing geographical location information and geographical spatial dependence relationships. Finally, output the adjacency matrix of size (K, K).
[0062] Take Figure 4 as an example. There are K monitoring points (K = 6 in the example) in the river basin. Consider the monitoring points as nodes in the graph structure, and consider the connection between a monitoring point and the monitoring point with the closest Euclidean distance as an edge in the graph structure. Traverse and calculate each monitoring point to obtain its topological structure graph. The adjacency matrix represents the edge relationship between each node and is a K-order square matrix (K is the number of monitoring points). When there is a connected edge between two monitoring points m and n (0 < m < K, 0 < n < K), the values of the m-th row and n-th column and the n-th row and m-th column of the K-order square matrix are 1. If there is no connected edge, the values of the m-th row and n-th column and the n-th row and m-th column are 0. Calculate all monitoring points pairwise to finally obtain an adjacency matrix of size (6, 6), as shown in Figure 5 shown.
[0063] The topological structure graph is represented as G = G(V, E), where V and E are the sets of nodes and edges respectively. The meaning of the nodes is the source reservoir and K basin monitoring points, and the edges are the connections with the shortest Euclidean distance between two points. Let v i ∈V be a node, and e ij =(v i , v j )∈E represents an edge between v i and v j . Then, the neighborhood of a node v can be defined as N(v) = {u ∈ V|(v, u) ∈ E}. Therefore, a geographical information graph can be described by the generated adjacency matrix A ∈ R N×N , where N is the number of nodes, that is, N = |V|. In an undirected graph, A ij represents the edge connection between nodes v i and v j . In practical applications, the geographical information graph has a node feature matrix (also called an attribute) X ∈ R N×c , where c is the dimension of a node feature vector, which is the data information of the source reservoir and the basin water level in the dataset after being processed by the model.
[0064] Step 3 Feature extraction
[0065] The input data of the model extracts features through two main modules, the LSTM encoder and the GCN encoder. The main steps are implemented through the following process, Figure 6 which is the flowchart of the model module.
[0066] Step 3.1 LSTM Feature Encoding
[0067] Obtain the processed data, construct the first LSTM layer, and input a feature vector with the size of (B, H, F), which contains the characteristic rainfall and flood discharge data information of the source reservoir. Here, B is the batch size; H is the time length; F is the feature dimension of the source reservoir, which is set to 2 or 6 according to the specific task. Set the input dimension of the LSTM network layer according to the input data, and at the same time, specify the output dimension F' of the LSTM network. After the input data passes through the LSTM network layer, take the feature representation at the last moment as the output of the network, and finally output a feature vector with the size of (B, 1, F').
[0068] Construct the second LSTM layer, and input the characteristic water level data of the upper reaches of the basin with a feature vector of size (B, H, 0.5*K). Here, B is the batch size; H is the time length; K is the characteristic water level of all K points at multiple points in the basin. It is assumed that the basin is divided into upper and lower parts, and the number of monitoring points in each part is the same. Therefore, 0.5*K is the feature dimension of the monitoring points in the upper half of the basin. Set the input dimension of the LSTM network layer according to the input data, and at the same time, specify the output dimension F' of the LSTM network. After the input data passes through the LSTM network layer, take the feature representation at the last moment as the output of the network, and its output size is a feature vector of (B, 1, F');
[0069] Construct the third LSTM layer, and input the characteristic water level data of the lower reaches of the basin with a feature vector of size (B, H, 0.5*K). Here, B is the batch size; H is the time length; K is the characteristic water level of all K points at multiple points in the basin. It is assumed that the basin is divided into upper and lower parts, and the number of monitoring points in each part is the same. Therefore, 0.5*K is the feature dimension of the monitoring points in the upper half of the basin. Set the input dimension of the LSTM network layer according to the input data, and at the same time, specify the output dimension F' of the LSTM network. After the input data passes through the LSTM network layer, take the feature representation at the last moment as the output of the network, and its output size is a feature vector of (B, 1, F').
[0070] Concatenate the feature vector representations obtained after the three LSTM network representation learnings along the time dimension (the second dimension) without generating new dimensions, and finally output a time-correlated feature vector containing the historical attributes of each monitoring point, with a size of (B, 3, F').
[0071] Step 3.2 GCN Feature Encoding
[0072] Copy the geographical information map, take the topological structure map of size (K, K) containing geographical location information and geographical spatial dependencies as input, perform the copy operation according to the batch quantity value, and finally output the feature vector matrix of size (B, K, K). And obtain the feature vector matrix of size (B, 3, F') after splicing as the feature matrix. At the same time, take the geographical information map of size (B, K, K) as the adjacency matrix and input it into this layer to obtain the topological structure map containing time feature information and geographical location information, and input it together as the feature matrix of the graph convolutional layer. Extract features from the topological structure map, and finally output the feature vector matrix of size (B, 3, F'), as Figure 10 shown.
[0073] After graph convolution, reshape the shape of the obtained feature vector matrix. That is, take the feature vector matrix of size (B, 3, F') output after feature extraction as the object to be reshaped, and set the dimension to the product of the first dimension of the spliced vector matrix and the last two dimensions for feature vector reshaping, merge the feature variable dimensions, and finally output the vector matrix of size (B, 3 * F').
[0074] Next, construct a fully connected regression prediction layer. Take the feature vector matrix of size (B, 3 * F') after reshaping as the feature matrix input of the fully connected regression prediction layer, and predict the number of days Z as 1 or 3 according to specific task 1 or 2. Calculate the feature prediction values of multiple points in the watershed through a fully connected neural network, and finally output the prediction vector matrix of size (B, K * Z) by setting the number of neurons K * Z at the output end. When performing task 1, the final output feature vector size is (B, K), and when performing task 2, the final output feature vector size is (B, K * 3).
[0075] The calculation formula of the fully connected layer is as follows:
[0076]
[0077] In formula (2), D j is the j-th output, f(x) is the activation function, W ji is the i-th input weight parameter of the j-th output, ε j is the bias parameter of the j-th output, and n is the total number of inputs.
[0078] Reshape the feature vector matrix, and obtain the feature vector prediction matrix with the size of (B, K*Z) output by the fully connected regression prediction layer as the input of the reshaped feature vector matrix. Set the dimension to the value of the first dimension of the concatenated vector matrix, the number of days of prediction required by the task, and the multi-point characteristics of the basin. Reshape the feature matrix vector in its original form, and finally output a prediction vector matrix with the size of (B, Z, K). When task 1 is executed, a feature vector with the size of (B, 1, K) is output. When task 2 is executed, a feature vector with the size of (B, 3, K) is output. Finally, a spatio-temporal correlation hybrid model of multi-point water levels in the basin based on LSTM and GCN is obtained.
[0079] output = reshape(x') (3)
[0080] where x' ∈ R B*(K*Z) , output ∈ R B*Z*K . When task 1 is executed, Z = 1. When task 2 is executed, Z = 3.
[0081] Step 4 Model training
[0082] Input the features after extracting time characteristics and spatial characteristics into the model, and specify the corresponding output of the input, that is, clarify the water levels predicted for one day or multiple days corresponding to each output. Use the LSTM+GCN model for training and fitting. The fitting process is as follows:
[0083] Take the mean squared error (MSE) as the optimization objective of the spatio-temporal correlation hybrid model of multi-point water levels in the basin based on LSTM and GCN. During the iteration process, the MSE value becomes smaller and smaller, indicating that the model performance is gradually improving. The model loss curve reflects the fitting situation of the model to the dataset and the iterative loss process. Figures 11 to 12 It is the display of the MSE results of 300 iterations of training and testing on the basin water level dataset using the spatio-temporal correlation hybrid model of multi-point water levels in the basin based on LSTM and GCN, train_MSE and test_MSE. It can be seen that the loss is getting smaller and smaller, that is, the MSE is getting closer and closer to 0, indicating that the water level values predicted for one day or several days in the future by the spatio-temporal correlation hybrid model of multi-point water levels in the basin based on LSTM and GCN are closer to the real situation and the accuracy is higher.
[0084] Use the spatio-temporal correlation hybrid model of multi-point water levels in the basin based on LSTM and GCN to predict the multi-point water levels in the basin for one day or several days in the future. The prediction results are fitted as Figures 13 to 20 shown.
[0085] Use this model to predict the multi-point water levels in the basin for multiple days in the future. Figures 13 to 20From the displayed evaluation metrics and the fitted curve, it can be seen that even when predicting the basin water level for the next three days, the spatio-temporal correlation hybrid model of multi-point water levels in the basin based on LSTM and GCN can predict accurately and achieve considerable results.
[0086] For the overall fitted curve, the reason why the specific value of the highest point is not well fitted is that the GCN network needs to know the structural information of the entire graph during training, including the nodes to be predicted. For example, when predicting the water level of the basin in the next three days, it is necessary to know the rainfall and flood discharge data of the source reservoir in the next three days. Although the future rainfall can be estimated through weather forecasts, and the future flood discharge is controlled by humans, in reality, it is difficult for weather forecasts to accurately predict the specific value of rainfall, especially in the face of sudden bad weather. In addition, the frequency of some days with excessive rainfall in the dataset is relatively low, and some extreme weather conditions did not occur during the data collection period, resulting in a small number of samples for model training and the inability to learn the characteristics of such special weather. There are 4 fully connected layers (MLP) in each cell of each LSTM encoder. If the time span of the LSTM is large and the network is deep, the computational complexity will increase accordingly, and it is easy to cause the problem of gradient disappearance.
[0087] The evaluation metrics used in this method include MAE (Mean Absolute Error), MSE (Mean Squared Error), and MAPE (Mean Absolute Percentage Error), and their definitions are as follows:
[0088]
[0089]
[0090]
[0091] In formulas (4) to (6), where y i and t i represent the predicted value and the true label of the i-th sample respectively, and n represents the total number of samples in the test set.
[0092] Using MAE (Mean Absolute Error), MSE (Mean Squared Error), and MAPE (Mean Absolute Percentage Error), the results of the model on the basin water level dataset for tasks 1 and 2 are shown in Table 3:
[0093] Table 3 Model Metric Evaluation Results
[0094] Evaluation items Indicators MAE_1 0.3658 MSE_1 0.3633 MAPE_1 0.4065 MAE_2 0.6249 MSE_2 0.9537 MAPE_2 0.7606
[0095] Use the spatio-temporal correlation hybrid model of multi-point water levels in the watershed based on LSTM and GCN to predict the water levels in the watershed dataset for the next one or several days. MAE and MSE are two commonly used evaluation indicators for regression models. The closer this value is to 0, the better the model fitting. MSE = 0.3633. The closer this value is to 0, the better the model fitting. MAE = 0.3658. This value indicates that for n (n = 1, 2, 3,...) predictions, the error generated by the model is stable at about 0.3658 meters. MAPE indicates that after n predictions, the predicted value deviates from the true label by 0.4065% on average, indicating that the model has a good prediction effect. Finally, obtain the water level prediction model for multiple monitoring points in the watershed and store it in the cloud or locally for subsequent deployment.
[0096] Step 5 The model uses
[0097] Read the spatio-temporal correlation hybrid model of multi-point water levels in the watershed based on LSTM and GCN stored in the cloud or locally in Step 4 to predict the water levels in the watershed for one or more days. The input data fields include the rainfall, flood discharge, and multi-point water levels in the source reservoir after time normalization for each measuring point. The model will return the predicted water level values for these measuring points.
[0098] In summary, it can be obtained that the main design points of the present invention include:
[0099] 1. Construct a geographic information map. Consider K monitoring points as nodes in the graph structure on the map. Traverse each monitoring point and connect it to the monitoring point with the closest Euclidean distance to it. If this edge already exists, then traverse the next monitoring point. In this way, construct an adjacency matrix and then calculate the degree matrix and Laplacian matrix to obtain a topological structure diagram containing geographical location information and geographical space dependence relationships. Finally, output an adjacency matrix with a size of (K, K).
[0100] G = G(V, E), where V and E are the sets of nodes and edges respectively. The meaning of the nodes is the source reservoir and K watershed monitoring points, and the edges are the shortest connections of the Euclidean distance between two points. Let v i ∈V be a node, and e ij =(v i , v j )∈E represents an edge between v i and v j . Then, the neighborhood of a node v can be defined as N(v) = {u ∈ V|(v, u) ∈ E}. Therefore, a geographic information map can be described by the generated adjacency matrix A ∈ R N×N , where N is the number of nodes, that is, N = |V|. In an undirected graph, A ij represents that nodes v i and v jConnected by edges. In practical applications, the node feature matrix (also known as attributes) X ∈ R of the geographic information map N×c , where c is the dimension of a node feature vector, which is the data information of the source reservoir and the basin water level in the dataset after being processed by the model.
[0101] 2. A hybrid model based on LSTM and GCN for spatio-temporal correlation of water levels at multiple points in a basin that can predict the water level data at multiple points in the basin for the next day or three days is proposed. The specific implementation method is as Figure 21 shown.
[0102] 3. Based on the historical and future information of the reservoir such as rainfall and flood discharge, as well as the water level data at multiple points in the basin, this method extracts the data structure features that can predict the water level changes at multiple points in the basin for the next day or three days, and focuses on incorporating the characteristic water level information at multiple points in the basin into the model for training. At the same time, multiple evaluations are carried out, effectively improving the generalization ability and accuracy. At the same time, the above data is used as the input features of the hybrid model for spatio-temporal correlation of water levels at multiple points in the basin based on LSTM and GCN. After training, this model is less affected by the external environment during use and has a certain robustness. This model is a hybrid model of a long short-term memory network (LSTM) and a graph convolutional neural network (GCN). The use of LSTM aims to extract the time correlation features of the historical attributes of each monitoring point; the use of GCN aims to model the geographical space dependence between monitoring points. This model has the characteristics of high accuracy and fast operation, and can take into account the historical adjustment factors of the sluice gates, and specifically predict the water levels that need to exceed the warning level and their geographical locations, so as to adjust the flood discharge volume in time to prevent floods during the flood season. Moreover, this method uses a hybrid deep learning model architecture of LSTM and GCN, that is, the vector matrix set containing time correlation information output by LSTM is further combined with the geographical location information mined by GCN. This architecture can effectively extract the time information features and spatial structure features in the vector matrix, so as to obtain more accurate data information for predicting the water levels at multiple points in the basin, and at the same time improve the prediction accuracy of the water levels at multiple points in the basin by the model.
[0103] Other relevant materials helpful for understanding the solution of the present invention:
[0104] 1. The working mechanism of LSTM is as follows:
[0105] LSTM introduces three thresholds: input gate i <t> , forget gate f <t> , output gate o <t> ; introduces the cell state c <t> that represents long-term memory, and introduces the candidate state C <t> waiting to be stored in long-term memory. All three thresholds are the input features x <t> at the current moment and the short-term memory a at the previous moment<t-1> The functions are respectively expressed as:
[0106] Input gate: i <t> = σ(W i [a <t-1> , x <t> + b i ), which determines what proportion of the information will be stored in the current cell state;
[0107] Where W i is the weight matrix and b i is the bias parameter.
[0108] Forget gate: f <t> = σ(W f [a <t-1> , x <t> + b f ), which selectively forgets the information in the cell state;
[0109] Where W f is the weight matrix and b f is the bias parameter.
[0110] Output gate: o <t> = σ(W o [a <t-1> , x <t> + b o ), which selectively outputs the information in the cell state;
[0111] Where W o is the weight matrix and b o is the bias parameter.
[0112] Candidate state: C <t> = tanh(W C [a <t-1> , x <t> + b c ), which represents the new knowledge to be stored in the cell state induced;
[0113] Where W c is the weight matrix and b c is the bias parameter.
[0114] Cell state: c <t> = i <t> * C <t> + f <t> * c <t-1> , which represents long-term memory;
[0115] Memory: a <t> = o <t> * tanh c <t> , which represents short-term memory;
[0116] 2. GCN Working Mechanism:
[0117] Suppose there is a graph G(A, X), where A is the adjacency matrix and X is the node feature, (I n is the identity matrix, and the diagonal matrix D can be obtained from the adjacency matrix), and L is the symmetric normalized graph Laplacian matrix used to describe the original topological features of the graph. Based on this, there is spectral graph convolution: g θ *Gx = Ug θ U T x, (where g θ = diag(θ), *G is an operator, U is the Laplacian eigenvector, and U T x is the Fourier transform on the graph). Its principle is to project the features into the spectral domain for convolution and then perform the inverse Fourier transform back to the original space. A graph convolution layer in the form of spectral graph convolution can be defined as:
[0118]
[0119] In formula (7), L is the current number of convolution layers, and W and b are the trainable weight matrix and bias vector respectively.
[0120] This patent is not limited to the above best implementation. Anyone inspired by this patent can obtain various other forms of the basin multi-point prediction and early warning method based on the spatio-temporal correlation hybrid deep learning model. All equivalent changes and modifications made according to the scope of the patent application of this invention shall fall within the scope covered by this patent.
Claims
1. A multi-point prediction and early warning method for river basins based on a spatio-temporal correlation hybrid deep learning model, characterized in that: Based on the reservoir information including historical and future reservoir rainfall and flood discharge, and the multi-point water level data of the basin, data structure features that can predict the changes in the multi-point water level of the basin in the next day or three days are mined, and the multi-point characteristic water level information data of the basin is used as the input features of the spatio-temporal correlation hybrid model of the multi-point water level of the basin based on LSTM and GCN. After training, the water level of the basin is predicted for one day or multiple days. The input data fields include the normalized rainfall, flood discharge of the source reservoir at each measuring point, and the multi-point water level of the basin. The model returns the predicted water level values of the basin at these measuring points; The process of feature extraction by the spatio-temporal correlation hybrid model of the multi-point water level of the basin based on LSTM and GCN includes: LSTM feature encoding: including the processing of three LSTM layers; The feature vectors obtained after the representation learning of the three LSTM networks are concatenated along the time dimension without generating new dimensions, and finally, a time-correlated feature vector containing the historical attributes of each monitoring point is output; GCN feature encoding: Copy the geographic information map, use the topological structure map of size (K, K) containing geographical location information and geographical spatial dependence as the input, perform a replication operation according to the batch quantity value, and finally output a feature vector matrix of size (B, K, K), where B is the batch size; and obtain a feature vector matrix of size (B, 3, F') after concatenation as the feature matrix, where F' is the output dimension of the LSTM network. At the same time, use the geographic information map of size (B, K, K) as the adjacency matrix and input it into this layer to obtain a topological structure map containing time feature information and geographical location information, and use it as the feature matrix input of the graph convolution layer to extract features from the topological structure map, and finally output a feature vector matrix of size (B, 3, F'); after graph convolution, reshape the obtained feature vector matrix; use the feature vector matrix of size (B, 3, F') output after feature extraction as the object to be reshaped, set the dimension to the product of the first dimension of the concatenated vector matrix and the last two dimensions for feature vector reshaping, and merge the feature variable dimensions, and finally output a vector matrix of size (B, 3 * F'); Next, construct a fully connected regression prediction layer: Use the reshaped feature vector matrix of size (B, 3 * F') as the feature matrix input of the fully connected regression prediction layer, and output the predicted values of the multi-point characteristics of the basin calculated by the fully connected neural network. By setting the number of neurons K * Z at the output end, finally output a prediction vector matrix of size (B, K * Z).
2. The method for multi-point prediction and early warning of river basins based on the spatio-temporal correlation hybrid deep learning model according to claim 1, characterized in that: The input data of the model is the rainfall and flood discharge data of the source reservoir of the basin, and the multi-point water level data of the basin contains the water level values of K basin monitoring points; and the data in the dataset is sorted, useless features are deleted, missing values are filled, and normalization processing is performed, and it is divided into a training set and a test set, which are respectively reshaped into 3D data, and then the training set and the test set are encapsulated.
3. The method for multi-point prediction and early warning of river basins based on a spatio-temporal correlation hybrid deep learning model according to claim 2, wherein: Process the data into a format that conforms to the model input: The features of multiple monitoring points, including the source reservoir and K monitoring points in the basin, are respectively processed into matrices of the shape F*D, where F is the feature dimension and D is the total number of days; subsequently, an input sliding window of size N is used to slide in the direction of time flow with a sliding step of 1. N is the number of past days. Each time a step is slid, a new sample feature is formed as the input of the model; a label sliding window of size 1 or 3 is used to slide in the direction of time flow. Each time a step is slid, a new sample label is formed, and the label value is the water level value of the monitoring point feature for one day or three days.
4. The method for multi-point prediction and early warning of river basins based on a spatio-temporal correlation hybrid deep learning model according to claim 3, characterized in that: In the map, consider the K monitoring points as nodes in the graph structure. Traverse each monitoring point and connect it to the monitoring point with the closest Euclidean distance. If this edge already exists, then traverse the next monitoring point. In this way, an adjacency matrix is constructed, and then the degree matrix and Laplacian matrix are calculated to obtain a topological structure diagram containing geographical location information and geospatial dependence relationships. Finally, an adjacency matrix of size (K, K) is output.
5. The multi-point prediction and early warning method for river basins based on the spatio-temporal correlation hybrid deep learning model according to claim 4, characterized in that: The training process of the above-mentioned hybrid model for spatio-temporal association of multi-point water levels in the basin based on LSTM and GCN is specifically as follows: Input the features after extracting time characteristics and spatial characteristics into the model, specify the corresponding output of the input, that is, clarify the water level predicted for one day or multiple days corresponding to each output, and use the model for training and fitting. The mean square error MSE is used as the optimization objective of the hybrid model for spatio-temporal association of multi-point water levels in the basin based on LSTM and GCN during the fitting process.
Citation Information
Patent Citations
Flood forecasting method based on time sequence attention mechanism
CN112785043A
Reservoir level prediction and early warning method and system based on mixed deep learning model
CN114648170A