Reservoir water level prediction and early warning method based on neural network and GCN deep learning model
The reservoir water level prediction method, which combines neural networks and GCN deep learning models, solves the problem of traditional reservoir water level scheduling relying on human experience, realizes accurate prediction of future water levels and safe scheduling, and improves the reservoir's health monitoring capabilities.
Patent Information
- Application Number
- CN202210940746.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-06
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-08-06
AI Technical Summary
Existing reservoir water level control technology relies on human experience and simple mathematical formulas, which cannot scientifically and rationally control reservoir water levels, nor can it predict future water level change trends, resulting in a waste of data resources and potential safety hazards to reservoirs.
A reservoir water level prediction method based on neural networks and GCN deep learning models is adopted. The features of reservoir water level data are extracted by a hybrid CNN and GCN model to predict future water levels. Multi-step prediction is carried out by combining rainfall and flood discharge data.
It improves the accuracy and timeliness of reservoir water level prediction, enabling the prediction of water level changes one to three days in advance, reducing reliance on human experience, minimizing resource waste, and enhancing reservoir safety.
Smart Images

Figure CN115310536B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of reservoir water level prediction and early warning, in particular to a reservoir water level prediction and early warning method based on a neural network and a GCN deep learning model. BACKGROUND
[0002] A reservoir refers to a water conservancy building for flood detention and water regulation, and has the functions of flood control, water supply, agricultural irrigation, power generation, etc. Reservoir safety has always been a difficulty and focus of flood control and flood fighting in China. However, most of the small and medium-sized reservoirs lack the necessary reservoir water level detection means, so the health monitoring of the reservoir is very important. Reservoir water level monitoring has always been one of the most important monitoring targets in reservoir health monitoring projects, and directly affects the health of the reservoir, so it is necessary to scientifically and reasonably regulate the reservoir water level for maintaining the health of the reservoir.
[0003] The existing reservoir water level regulation technology is based on sensors to collect real-time reservoir water level, and then relies on artificial experience and simple mathematical derivation formula to regulate the real-time reservoir water level. This method is one-sided in the use of data, ignores the collected reservoir indicators, resulting in the collection of reservoir data being deposited at a huge cost, and resources need to be invested for maintenance. In the process of regulating the reservoir water level, artificial experience and simple mathematical derivation formula are usually used, which cannot be scientific and reasonable, and can only regulate the real-time reservoir water level, and cannot regulate the reservoir water level according to the future change trend of the reservoir water level to cope with future extreme weather. The traditional method has three shortcomings:
[0004] 1. The calculation method of the mathematical formula is relatively fixed. The traditional reservoir water level regulation method directly uses the formula according to the real-time collected reservoir data to obtain the feedback of the reservoir flood discharge, which has a time delay defect and cannot predict the reservoir water level in the next day or several days.
[0005] 2. It is largely dependent on practical experience. The reservoir water level must be adjusted quickly when natural disasters occur, and there is currently a lack of objective and effective future water level prediction.
[0006] 3. The traditional method has low utilization rate of the collected reservoir data, causing waste of data resources, and cannot use the data of future rainfall and future flood discharge. The former can obtain a relatively accurate estimate through weather forecasting, and the latter is controllable by humans. SUMMARY
[0007] Therefore, the purpose of the present application is to provide a reservoir water level prediction and early warning method based on a neural network and a GCN deep learning model, which can reduce the number of neural network layers and the training difficulty of model deep learning, and improve the accuracy of reservoir water level prediction of the model.
[0008] To achieve the above object, the application adopts the following technical scheme: a reservoir water level prediction and early warning method based on a neural network and a GCN deep learning model, comprising the following steps:
[0009] Step S1: Obtain reservoir rainfall data and sort them according to collection time;
[0010] Step S2: Model input data are extracted by two main modules of a CNN encoder and a GCN encoder;
[0011] Step S3: Train a reservoir water level dataset based on a one-dimensional convolutional neural network and a GCN hybrid deep learning model;
[0012] Step S4: Read the reservoir water level prediction model stored in the cloud or locally in step S3 to predict the reservoir water level.
[0013] In a preferred embodiment, step S1 specifically uses reservoir water level, flood discharge and rainfall characteristics as model training data, and sequentially performs maximum and minimum value normalization preprocessing on the water level, flood discharge and rainfall three variable data in the dataset:
[0014]
[0015] In formula (1), x is the data to be normalized, x' is the normalized data, x max and x min respectively represent the maximum and minimum values of the data to be normalized, and finally the data is mapped between 0 and 1 as feature data input to the model for training.
[0016] In a preferred embodiment, the input data needs to perform two tasks:
[0017] Task 1: Use today's reservoir water level, today's rainfall and today's flood discharge as a time point feature, and complete the prediction of the reservoir water level for the next day through the data of the past N time points;
[0018] Task 2: Use today's reservoir water level, rainfall in the next three days and flood discharge in the next three days as a time point feature, and complete the prediction of the reservoir water level for the next three days through the data of the past N time points.
[0019] In a preferred embodiment, step S2 specifically comprises the following steps:
[0020] Step S21: One-dimensional CNN encoder feature extraction;
[0021] Step S22: Construct a GGL generated graph data structure;
[0022] Step S23: GCN encoder feature extraction.
[0023] In a preferred embodiment, the step S21 specifically comprises:
[0024] A first one-dimensional convolutional layer is constructed; the size of the model input data is reshaped into (B*D, 1, H), and the batch dimension is combined with the variable dimension, so that the CNN performs convolution on each vector as the input of the first one-dimensional convolutional layer. The one-dimensional convolutional layer Conv1d(1, 8, 3, 1, 1) uses a 1*3 convolution kernel and a convolution step of 1. After obtaining the data, the feature is extracted while the original sequence length is preserved. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 8, H).
[0025] A second one-dimensional convolutional layer is constructed. The one-dimensional convolutional layer Conv1d(8, 16, 3, 1, 1) uses a 1*3 convolution kernel and a convolution step of 1. The feature is extracted while the length is preserved by taking the feature vector of the size (B*D, 8, H) output by the upper layer as the input. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 16, H).
[0026] A third one-dimensional convolutional layer is constructed. The one-dimensional convolutional layer Conv1d(16, 32, 3, 1, 1) uses a 1*3 convolution kernel and a convolution step of 1. The feature is extracted while the length is preserved by taking the feature vector of the size (B*D, 16, H) output by the upper layer as the input. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 32, H).
[0027] A fourth one-dimensional convolutional layer is constructed. The one-dimensional convolutional layer Conv1d(32, 64, 3, 1, 1) uses a 1*3 convolution kernel and a convolution step of 1. The feature is extracted while the length is preserved by taking the feature vector of the size (B*D, 32, H) output by the upper layer as the input. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 64, H).
[0028] A one-dimensional adaptive maximum pooling layer is constructed. The maximum value of each channel of the feature vector of the size (B*D, 64, H) is retained, and the output size is a feature vector of (B*D, 64, 1). The redundant dimension is removed, the feature vector matrix is reduced in dimension, the output size is a feature vector of (B*D, 64), and finally a feature dimension normalization layer is passed through.
[0029] In a preferred embodiment, the step S22 specifically comprises:
[0030] The graph generation layer is constructed, and first, the input and output dimensions of the linear transformation layer are defined as linear(64, 10), which converts the input feature vector with a size of (B*D, 64) into an output feature vector with a size of (B*D, 10). The process is represented as:
[0031]
[0032] In formula (2), X is the feature vector matrix after the CNN encoder feature extraction, X i is the input feature vector, W ji is the i-th input weight parameter of the j-th output, b j is the bias parameter of the j-th output, and the Relu function is activated, is the output feature matrix, and n represents the number of input weight parameters.
[0033] The graph generation layer generates a dynamic graph data structure from the feature map. The index of the edge is calculated by traversing the values and indices in the first dimension of the feature vector matrix with a size of (B*D, B*D), and the edge index adjacency matrix with a size of (2, B*D / *B*D) is obtained. Each forward propagation produces dynamic changes, and each round is iteratively updated. First, transpose the feature vector, calculate the similarity between variables by inner product, normalize by maximum value, and set the dimension to 1. Then, the number of nodes is set to the value of the first dimension of the feature map, and the function expression is:
[0034]
[0035] In formula (3), X represents the feature vector after the fully connected layer output, T is the transpose symbol, normlize represents the normalization function, A is the adjacency matrix of the generated graph data structure, is the feature vector after the fully connected layer output of the X feature vector in formula (2), i.e., X represents the transpose vector of the feature vector, and further by retaining the Top-k cosine distance edges, only the edges with the top k similarity are retained, to obtain the sparse adjacency matrix A - , and the function expression is shown in formula (4).
[0036] A - = TOP-k(A) (4).
[0037] In a preferred embodiment, the step S23 specifically comprises:
[0038] The MRF_GCN module is constructed, Dropout is used to randomly inactivate to prevent overfitting, the dynamic graph data structure generated by the graph generation layer is input into the MultiChev layer for graph neural convolution operation, the Chevnet order is set to 1, the related information between nodes is mined from the graph data structure, the output channel dimension is set to 50, and then the regularization layer is entered to reshape the feature vector to a size of batch*variable, 50, and output a feature vector with a size of (B*D, 50); the extracted feature vector finally passes through a linear layer with a ReLU activation function for feature transformation, the input and output dimensions of the linear layer are (50, 64), and the output size of the feature vector is (B*D, 64); finally, the size of the feature vector is reshaped and spliced back according to the original batch, and the output size of the feature vector is (B, 64*D);
[0039] The linear regression prediction layer is constructed, and different networks are defined for task one and task two. When task one is executed, the input and output dimensions of the linear layer are set to (64*3, 1); when task two is executed, the input and output dimensions of the linear layer are set to (64*5, 1); finally, the model outputs a feature vector with a size of (B, 1), thereby obtaining a hybrid deep learning model based on a one-dimensional convolutional neural network and GCN;
[0040] The calculation formula (5) of the full connection layer is as follows:
[0041]
[0042] Where, D j is the jth output, f() is the activation function, W ji is the ith input weight parameter of the jth output, ε j is the bias parameter of the jth output, and n is the total number of inputs.
[0043] In a preferred embodiment, the step S3 is specifically:
[0044] The hybrid deep learning model based on the one-dimensional convolutional neural network and GCN is loaded; the real-time reservoir rainfall data and the rainfall and flood discharge data are obtained, and then input into the model for reservoir water level prediction to obtain the reservoir water level prediction value; the mean square error MSE is used as the optimization target of the hybrid deep learning model based on the one-dimensional convolutional neural network and GCN, and the MSE value becomes smaller and smaller in the iteration process, indicating that the model performance gradually improves; the model loss curve reflects the fitting condition of the model to the data set and the iteration loss process, and the hybrid deep learning model based on the one-dimensional convolutional neural network and GCN is iterated for 300 times for training and testing on the reservoir water level data set;
[0045] The evaluation indexes adopted include MAE (Mean Absolute Error), MSE (Mean Square Error) and MAPE (Mean Absolute Percentage Error), which are defined as follows:
[0046]
[0047]
[0048]
[0049] In the formulas (6) to (8), y i and t i respectively represent the predicted value and the true label of the i-th sample, and n represents the total number of samples in the test set.
[0050] In a preferred embodiment, the step S4 is specifically: reading the reservoir water level prediction model stored in the cloud or locally in step 3, performing reservoir water level prediction, comparing the obtained reservoir water level prediction value in the next one to three days with the reservoir water level standard, judging whether the predicted water level is in the safe interval, if yes, storing the obtained data into the database, and normally performing reservoir water level regulation, otherwise, comparing the reservoir water level warning standard, outputting the reservoir parameter information and the warning level, and then combining the output parameters, including rainfall, flood discharge, reservoir water level, warning level, to perform reservoir water level regulation to regulate the reservoir water level to the safe interval.
[0051] Compared with the prior art, the present application has the following beneficial effects:
[0052] 1. The reservoir water level prediction and warning method based on a one-dimensional convolutional neural network and a GCN hybrid deep learning model adopts a convolutional neural network (CNN) and a graph convolutional neural network (GCN) hybrid model, wherein the use of the CNN aims to respectively mine the time correlation features of each variable; the use of the GCN aims to model the correlation between the current variable and the historical variable, and mine the mutual influence law between the variables. The model has the characteristics of high accuracy and fast operation, and can consider the historical adjustment factors of the gate, specifically predict the water level that needs to be warned in advance, timely adjust the flood discharge, and realize the prevention of the flood season. Compared with other linear models, the hybrid model is a nonlinear multidimensional prediction, and rich features are input, utilized and constructed in the training of the model; in addition, the model is a time series prediction model and has a certain robustness, and the use of the model for reservoir water level prediction can grasp the change trend of the reservoir water level in the next one to three days, so as to adjust the reservoir water level in advance.
[0053] 2. In the model, the CNN is combined with the GCN model. Through the CNN encoding model, the model feature layer is deepened layer by layer, and the model feature dimension is increased, so that the model can obtain more complete features. After obtaining sufficient features, it can fully prepare for the prediction of the downstream model. After feature extraction and key information extraction, the model obtains information related to reservoir warning. Then, the 64-dimensional deep features are converted in dimension by using the linear layer, and then input into the Gen-edge model to predict the future. Finally, the prediction output of the model is obtained through the linear layer.
[0054] 3. The model uses a graph convolutional neural network as a prediction model and uses ChebNet to implement it. Because SCNN has the disadvantages of high computational complexity and inability to guarantee local links, ChebNet uses Chebyshev polynomials instead of spectral domain convolution kernels, greatly reducing the complexity of parameters. After using Chebyshev polynomials instead of spectral domain convolution kernels, ChebNet does not need to do feature decomposition on the Laplacian matrix, greatly reducing the time. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 The overall execution process diagram of the scheme of the preferred embodiment of the application;
[0056] Figure 2 The data set remodeling process of the preferred embodiment of the application;
[0057] Figure 3 The one-dimensional CNN+GCN model flowchart of the preferred embodiment of the application;
[0058] Figure 4 The one-dimensional CNN encoder model diagram of the preferred embodiment of the application;
[0059] Figure 5 The task one loss curve of the preferred embodiment of the application;
[0060] Figure 6 The task two loss curve of the preferred embodiment of the application;
[0061] Figure 7 The task one prediction fitting curve of the preferred embodiment of the application;
[0062] Figure 8 The task two prediction fitting curve of the preferred embodiment of the application
[0063] Figure 9 The task two prediction fitting curve of the preferred embodiment of the application
[0064] Figure 10 The task two prediction fitting curve of the preferred embodiment of the application
[0065] Figure 11 The method of the preferred embodiment of the present application implements a flowchart; DETAILED DESCRIPTION
[0066] The present application will be further described below with reference to the accompanying drawings and embodiments.
[0067] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise indicated, all technical and scientific terms used herein have the same meaning as would be commonly understood by one of ordinary skill in the art to which this application belongs.
[0068] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application; as used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and furthermore, it should be understood that when the terms "comprise" and / or "include" are used in the specification, they indicate the presence of a feature, step, operation, device, component, and / or combination thereof.
[0069] A reservoir water level prediction and early warning method based on a neural network and a GCN deep learning model, the execution process is as shown in Figure 1 The technical solution extracts and constructs dynamic graph data structure for data information affecting the change of reservoir water level by using CNN encoder and GGL graph generation layer, maximizes important features and extracts them, and then inputs them into GCN encoder for further feature extraction and model training. Moreover, the method uses a one-dimensional convolutional neural network and GCN hybrid deep learning model architecture, i.e. using GCN encoder to further mine information from the vector matrix set output by CNN encoder, which can effectively extract information features and structural features of the vector matrix, thereby obtaining more accurate data information for reservoir water level prediction, and improving the reservoir water level prediction accuracy of the model. The specific implementation steps are as follows:
[0070] Step S1: Obtain reservoir rainfall data and sort them according to the collection time;
[0071] Step S2: Model input data are extracted by CNN encoder and GCN encoder two main modules;
[0072] Step S3: Train the reservoir water level dataset based on a one-dimensional convolutional neural network and GCN hybrid deep learning model;
[0073] Step S4: Read the reservoir water level prediction model stored in the cloud or locally in step S3 to predict the reservoir water level.
[0074] In step S1, the reservoir rain data is acquired, sorted according to the collection time, and the reservoir water level, flood discharge and rainfall characteristics are taken as the model training data to form a data set as shown in Table 1; taking the reservoir water level data set (containing 321 groups of data) as an example, the specific data format is shown in Table 2:
[0075] Table 1 Water level data set of reservoir after desensitization
[0076]
[0077] Table 2 Reservoir water level data set
[0078]
[0079]
[0080] The maximum and minimum value normalization preprocessing is performed on the water level, flood discharge and rainfall data in the data set in sequence:
[0081]
[0082] In formula (1), x is the data to be normalized, x' is the normalized data, x max and x min represent the maximum and minimum values in the data to be normalized, respectively. After mapping the data to between 0 and 1, the data is input into the model as feature data for training.
[0083] The input data needs to perform two tasks:
[0084] Task one: taking the reservoir water level, rainfall and flood discharge of the day as the characteristics of a time point, the future one-day water level of the reservoir is predicted through the data of the past N time points.
[0085] Task two: taking the reservoir water level, rainfall and flood discharge of the future three days as the characteristics of a time point, the future three-day water level of the reservoir is predicted through the data of the past N time points.
[0086] Among them, task one aims to make a prediction completely through historical data. In actual application, the future rainfall can be estimated more accurately through weather forecast, and the future flood discharge is artificially controlled, so task two is introduced to assist the prediction through future weather and self-defined flood discharge, and the task is expanded to multi-step prediction.
[0087] When performing task one, the reservoir water level dataset is taken as an example, three variables at the past N (default 8) time points: reservoir water level, rainfall, and flood discharge are taken as features, so the input feature vector size is an 8*3 array, N is the number of past days, and the step size is 1, which is calculated 313 times in turn, and the label value is set as the water level at the current time point; when performing task two, the reservoir water level of the day and the rainfall and flood discharge of the next three days are taken as the features of a time point, the past N (default 8) time points are used to predict the water level of the next three days, so the input feature vector size is an 8*7 array, the step size is 1, which is calculated 311 times in turn, and the label value is set as the water level value of the three days.
[0088] The dataset is divided into a training set and a test set in a ratio of 7:3, wherein the first 70% of the dataset is taken as the training set, and the last 30% is taken as the test set, and the data is reshaped into 3D data as shown in Figure 2 ; finally, the form of the model input data can be represented as a feature vector with a size of (B, H, D). Wherein B is the batch size; H is the time length; D is the feature dimension of the reservoir, which is set to 3 or 7 according to the specific task. Finally, the training set and the test set are encapsulated by the TensorDataset class.
[0089] In step S2, the model input data is extracted by the CNN encoder and the GCN encoder two main modules, referring to Figure 3 , the main steps are implemented by the following steps:
[0090] Step 2.1 One-dimensional CNN encoder feature extraction
[0091] The first one-dimensional convolutional layer is constructed; the size of the model input data is reshaped to (B*D, 1, H), and the batch dimension is combined with the variable dimension, so that the CNN performs convolution on each vector as the input of the first one-dimensional convolutional layer. The one-dimensional convolutional layer Conv1d(1, 8, 3, 1, 1) uses a 1*3 convolution kernel, the convolution step is 1, and the original sequence length is preserved after extracting the features after obtaining the data. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 8, H). The second one-dimensional convolutional layer is constructed, and the one-dimensional convolutional layer Conv1d(8, 16, 3, 1, 1) uses a 1*3 convolution kernel, the convolution step is 1, and the length is preserved after extracting the features of the feature vector of (B*D, 8, H) output by the upper layer. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 16, H). The third one-dimensional convolutional layer is constructed, and the one-dimensional convolutional layer Conv1d(16, 32, 3, 1, 1) uses a 1*3 convolution kernel, the convolution step is 1, and the length is preserved after extracting the features of the feature vector of (B*D, 16, H) output by the upper layer. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 32, H). The fourth one-dimensional convolutional layer is constructed, and the one-dimensional convolutional layer Conv1d(32, 64, 3, 1, 1) uses a 1*3 convolution kernel, the convolution step is 1, and the length is preserved after extracting the features of the feature vector of (B*D, 32, H) output by the upper layer. After convolution, one-dimensional batch normalization operation and ReLU function activation are performed, and the output size is a feature vector of (B*D, 64, H), as shown in Figure 4
[0092] The one-dimensional adaptive maximum pooling layer is constructed, which retains the maximum value of each channel of the feature vector of size (B*D, 64, H), outputs a feature vector of size (B*D, 64, 1), and then removes the redundant dimensions to reduce the dimension of the feature vector matrix, outputting a feature vector of size (B*D, 64). Finally, the feature dimension normalization layer is used to prevent gradient vanishing or gradient explosion.
[0093] Step 2.2GGL generates a graph data structure
[0094] The graph generation layer is constructed. First, define the input and output dimensions of the linear transformation layer linear(64, 10), and convert the input feature vector of size (B*D, 64) to an output feature vector of size (B*D, 10). The process is represented as:
[0095]
[0096] In formula (2), X is the feature vector matrix after CNN encoder feature extraction, Xi W is the input feature vector, ji b is the i-th input weight parameter of the j-th output, j is the bias parameter of the j-th output, using the Relu function activation, is the output feature matrix.
[0097] The graph generation layer generates a dynamic graph data structure from the feature map, calculates the index of the edge by stacking and splicing between the values and indexes of the first dimension of the feature vector matrix with size (B*D, B*D), and obtains an edge index adjacency matrix with size (2, B*D / *B*D). Each forward propagation produces dynamic changes, and each round is iteratively updated. First, transpose the feature vector, calculate the similarity between variables by inner product, normalize by maximum value, and set the dimension to 1, then set the number of nodes to the value of the first dimension of the feature map, and the function expression is:
[0098]
[0099] In formula (3), X is the feature vector after the full connection layer output, T is the transpose symbol, A is the adjacency matrix of the generated graph data structure, and further by retaining the edge with Top-k cosine distance, only the edges with the top k similarity are retained, and a sparse adjacency matrix A is obtained - The function expression is shown in formula (4), to prevent the generated graph from being too dense, and to prevent overfitting during training, Dropout is added during training, and part of the edges are randomly discarded during training.
[0100] A - = TOP-k(A) (4)
[0101] Step 2.3 GCN encoder feature extraction
[0102] The MRF_GCN module is constructed, Dropout is used to prevent overfitting, the dynamic graph data structure generated by the graph generation layer is input into the MultiChev layer for graph neural convolution operation, the Chevnet order is set to 1 (GCN is K=1 Chebnet), the related information between nodes is mined from the graph data structure, the output channel dimension is set to 50, and then enters the regularization layer to reshape the feature vector to a feature vector with size (batch*variable, 50), and outputs a feature vector with size (B*D, 50). The extracted feature vector finally passes through a linear layer with ReLU activation function for feature transformation, the input and output dimensions of the linear layer are (50, 64), and the output size of the feature vector is (B*D, 64). Finally, the size of the feature vector is reshaped and spliced back to the original batch, and the output size of the feature vector is (B, 64*D).
[0103] The linear regression prediction layer is constructed, and different networks are defined for task one and task two. When task one is executed, the input and output dimensions of the linear layer are set to (64*3, 1); when task two is executed, the input and output dimensions of the linear layer are set to (64*5, 1). Finally, the model outputs a feature vector of size (B, 1), thereby obtaining a hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN.
[0104] The full connection layer calculation formula (5) is as follows:
[0105]
[0106] where D j is the jth output, f(x) is an activation function, W ji is the ith input weight parameter of the jth output, ε j is the bias parameter of the jth output, and n is the total number of inputs.
[0107] Step 3 model training
[0108] The hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN is loaded, real-time reservoir rainwater condition monitoring data and rainfall and flood discharge data are obtained, and then the model is input for reservoir water level prediction to obtain reservoir water level prediction values for one or several days in the future. The mean square error (MSE) is used as the optimization target of the hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN, and the MSE value becomes smaller and smaller in the iteration process, indicating that the model performance gradually improves. The model loss curve reflects the fitting of the model to the data set and the iteration loss process. The MSE results of the hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN for 300 times of iteration training and testing of the reservoir water level data set are shown in Figures 5 to 6 , train_MSE and test_MSE. It can be seen that the loss is getting smaller and smaller, i.e., the MSE is getting closer and closer to 0, indicating that the water level values predicted by the hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN for one or several days in the future are closer to the actual situation, and the accuracy is higher.
[0109] The hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN is used to predict the reservoir water level for one or several days in the future, and the prediction result fitting is shown in Figures 7-10 .
[0110] The model is used to predict the reservoir water level for several days in the future, and the evaluation index and fitting curve shown in Figures 7 to 10 indicate that even if the water level for three days in the future is predicted, the prediction by the hybrid deep learning model based on a one-dimensional convolutional neural network and a GCN is relatively accurate and can achieve a relatively good result.
[0111] The reason for the poor fitting of the specific value of the highest point for the overall fitting curve is that the GCN network needs to know the structure information of the entire graph during training, including the nodes to be predicted, such as the rainfall and flood discharge data of the reservoir in the next three days when predicting the prediction value of the reservoir water level in the next three days. Although the future rainfall can be estimated by weather forecast, the future flood discharge is artificially controlled, but in reality, it is difficult to accurately estimate the specific value of rainfall through weather forecast, especially in the face of sudden severe weather. In addition, some weather with excessive rainfall in the data set appears less frequently and some extreme weather does not appear within the data collection date, resulting in fewer samples for model training, which cannot learn the characteristics of such special weather. Finally, if the number of one-dimensional convolutional neural network layers is small, the deep features of the data will be ignored, and the network will be deep and prone to overfitting, so the number of one-dimensional convolutional neural network layers needs to be balanced.
[0112] The evaluation indexes used by the method include MAE average absolute error, MSE mean square error, and MAPE average absolute percentage error, which are defined as follows:
[0113]
[0114]
[0115]
[0116] In formulas (6) to (8), y i and t i represent the prediction value and the true label of the i-th sample, respectively, and n represents the total number of samples in the test set.
[0117] Using MAE average absolute error, MSE mean square error, and MAPE average absolute percentage error, the results of task one and task two on the reservoir water level data set are shown in Table 3:
[0118] Table 3 Model index evaluation results
[0119]
[0120]
[0121] The mixed deep learning model based on one-dimensional convolutional neural network and GCN is used for water level prediction in the next one or several days, MAE and MSE are two commonly used evaluation indexes of regression model, and the value is closer to 0, indicating that the model fitting is better. The value is closer to 0, indicating that the model fitting is better. MAE=0.5525, which indicates that after n(n=1, 2, 3,...) times of prediction, the error produced by the model is stable at about 0.5525 meters. MAPE indicates that after n times of prediction, the predicted value is averagely deviated from the true label by 0.5117%, indicating that the model has good prediction effect.
[0122] Step 4 model uses
[0123] The reservoir water level prediction model stored in the cloud or locally in step 3 is read to predict the reservoir water level, and the predicted water level of the reservoir in the next one to three days is compared with the reservoir water level standard to determine whether the predicted water level is in the safe interval, if yes, the obtained data is stored in the database, and the reservoir water level is normally dispatched, otherwise, the reservoir water level warning standard is compared, and the reservoir parameter information and warning level are output, and then the output parameters (including rainfall, flood discharge, reservoir water level, warning level, etc.) are combined to dispatch the reservoir water level to the safe interval.
[0124] The application provides a one-dimensional convolutional neural network and GCN mixed deep learning model capable of predicting reservoir water level data in the next one or three days, and a specific implementation manner is as shown in the figure. Figure 11
[0125] The reservoir water level prediction and warning method and system based on the one-dimensional convolutional neural network and GCN mixed deep learning model. The convolutional neural network (CNN) and the graph convolutional neural network (GCN) mixed model are adopted, wherein the use of the CNN aims to respectively mine the time correlation characteristics of each variable; the use of the GCN aims to model the correlation between the current variable and the historical variable and mine the mutual influence law between the variables. The model has the characteristics of high accuracy and fast operation, and can consider the historical adjustment factors of the gate, specifically predict the water level that needs to be warned in advance, timely adjust the flood discharge, and realize the prevention of the flood season. Compared with other linear models, the mixed model is a nonlinear multidimensional prediction, and rich features are input, utilized and constructed in the model training; in addition, the model belongs to a time series prediction model and has a certain robustness, and the model is used for reservoir water level prediction, so that the change trend of the reservoir water level in the next one to three days can be grasped to adjust the reservoir water level in advance.
[0126] In the model, the CNN is combined with the GCN model. Through the CNN encoding model, the model feature layer is deepened layer by layer, and the model feature dimension is increased, so that the model can obtain more complete features. After obtaining sufficient features, the model can fully prepare for the prediction of the downstream model. After feature extraction and key information extraction, the model obtains information related to reservoir early warning. Then, the 64-dimensional deep features are converted in dimension by using a linear layer, and then input into the Gen-edge model to predict the future. Finally, the prediction output of the model is obtained through a linear layer.
[0127] The model uses a graph convolutional neural network as a prediction model and is implemented using ChebNet. Because SCNN has the disadvantages of high computational complexity and inability to guarantee local links, ChebNet uses Chebyshev polynomials instead of spectral domain convolution kernels, greatly reducing the complexity of parameters. After using Chebyshev polynomials instead of spectral domain convolution kernels, ChebNet does not need to do feature decomposition on the Laplacian matrix, greatly reducing the time.
[0128] The one-dimensional convolutional neural network and GCN hybrid deep learning model can complete reservoir water level prediction according to historical reservoir water level, rainfall, flood discharge, and future rainfall and flood discharge, has less influence from external environment, has certain robustness, and can greatly reduce the workload of operation and maintenance.
[0129] The one-dimensional convolutional neural network and GCN hybrid deep learning model architecture is used, that is, the vector matrix set output by the CNN is further used to mine information by using GCN. This architecture can effectively extract the information features and structure features of the vector matrix, so as to obtain more accurate data information for reservoir water level prediction and improve the reservoir water level prediction accuracy of the model.
[0130] The one-dimensional convolutional neural network and GCN hybrid deep learning model can be effectively applied to predict the reservoir water level in the next one or three days, mine the data structure features containing the prediction of the reservoir water level in the next one or three days, and obtain the multi-point water level prediction value of each watershed in the next one or several days. Not only the data of future rainfall and future flood discharge are effectively used, but also the defects of the existing method, such as delay and inability to predict the water level of the watershed in the next one or several days, are solved. At the same time, the method provides an end-to-end automatic prediction model, reduces the dependence on experience, and effectively improves the robustness, generalization ability and accuracy.
[0131] Eight, other technical materials helpful for understanding the proposal of the present application
[0132] Specifically, the multi-receptive field GCN (MRF_GCN) has a function expression as shown in formula (9):
[0133]
[0134] where, are learnable parameters, [·] is a feature concatenation, H is the fused feature, K represents the order of Chebyshev polynomials, which determines the range of node neighborhood, and K1 to Kv represent different orders of Chebyshev polynomials. v are learnable parameters, [·] is a feature concatenation, H is the fused feature, K represents the order of Chebyshev polynomials, which determines the range of node neighborhood, and K1 to Kv represent different orders of Chebyshev polynomials.
[0135] Given a graph G (A, X), where A represents its adjacency matrix and X represents its node features. L = I N -D -1 / 2 AD -1 / 2 is a symmetric normalized graph Laplacian matrix, where the diagonal matrix D can be obtained from the adjacency matrix, that is, D i,i =∑ j A i,j , I N represents a unit matrix. Spectral graph convolution (GConv) uses a graph spectral filter g θ =diag(θ) to smooth the input signal x ∈ RN, which is mathematically defined as: g θ *Gx = Ug θ U T x, where θ is a learnable parameter, *G is a GConv operator, U is an eigenvector of the Laplacian matrix, and Ug T x represents the Fourier transform of the signal x on the graph. In addition, the convolution kernel gθ is limited to the form in the expansion of Chebyshev polynomials as follows:
[0136]
[0137] In formula (10), K is the order of Chebyshev polynomials, which also determines the range of node neighborhood. λ is the eigenvalue of the Laplacian matrix. By using the defined GConv operation, the node information within k distances is aggregated to achieve graph smoothing. Therefore, compared with the standard GCN which can only collect information in a fixed receptive field, the above applied multi-receptive field GCN (MRF-GCN) can obtain a more powerful feature representation and embed the data structure information into the feature representation.
Claims
1. A reservoir water level prediction and early warning method based on neural networks and GCN deep learning models, characterized in that... Includes the following steps: Step S1: Obtain reservoir rainfall and water level data and sort them according to the collection time; Step S2: The model input data is processed through two main modules, the CNN encoder and the GCN encoder, to extract features. Step S3: Train the reservoir water level dataset based on a hybrid deep learning model of one-dimensional convolutional neural network and GCN; Step S4: Read the reservoir water level prediction model stored in the cloud or locally in step S3, and perform reservoir water level prediction; Step S2 specifically includes the following steps: Step S21: Feature extraction from a one-dimensional CNN encoder; Step S22: Construct the GGL-generated graph data structure; Step S23: Feature extraction from the GCN encoder; Step S21 specifically includes: Construct the first one-dimensional convolutional layer; reshape the size of the model input data to (B*D,1,H), merge the batch dimension and variable dimension, so that the CNN convolves each vector as the input of the first one-dimensional convolutional layer. The one-dimensional convolutional layer Conv1d(1,8,3,1,1) uses a 1*3 convolutional kernel and a convolution stride of 1. After acquiring the data, extract features while retaining the original sequence length. After convolution, perform one-dimensional batch normalization and ReLU activation, and output a feature vector of size (B*D,8,H). Construct a second one-dimensional convolutional layer, Conv1d(8,16,3,1,1), using a 1*3 convolutional kernel with a stride of 1. The feature vector of size (B*D,8,H) output from the previous layer is used as input to extract features while preserving the length. After convolution, one-dimensional batch normalization and ReLU activation are performed, and the output is a feature vector of size (B*D,16,H). A third one-dimensional convolutional layer is constructed. The one-dimensional convolutional layer Conv1d(16,32,3,1,1) uses a 1*3 convolutional kernel and a convolutional stride of 1. It extracts features from the feature vector of size (B*D,16,H) output from the previous layer while preserving the length. After convolution, one-dimensional batch normalization and ReLU activation are performed, and the output feature vector is of size (B*D,32,H). A fourth one-dimensional convolutional layer is constructed. The one-dimensional convolutional layer Conv1d(32,64,3,1,1) uses a 1*3 convolutional kernel and a convolutional stride of 1. It extracts features from the feature vector of size (B*D,32,H) output by the upper layer while preserving the length. After convolution, one-dimensional batch normalization and ReLU activation are performed. The final output is a feature vector of size (B*D,64,H). Construct a one-dimensional adaptive max pooling layer, retain the largest value in each channel of the feature vector of size (B*D,64,H), and output a feature vector of size (B*D,64,1). Then remove redundant dimensions to reduce the dimensionality of the feature vector matrix and output a feature vector of size (B*D,64). Finally, pass through a feature dimension normalization layer. Step S22 specifically includes: To construct the graph generation layer, we first define the input and output dimensions of the linear transformation layer as linear(64,10), which transforms the input feature vector of size (B*D,64) into the output feature vector of size (B*D,10). The process is represented as follows: In formula (2), X is the feature vector matrix after feature extraction by the CNN encoder. i Given the input feature vector, W ji b is the i-th input weight parameter for the j-th output. j The bias parameter for the j-th output is activated using the ReLU function. The output feature matrix is n, which represents the number of input weight parameters. The graph generation layer generates a dynamic graph data structure from the feature map. It calculates edge indices by stacking and concatenating the values and indices of the first dimension of the feature vector matrix of size (B*D, B*D), resulting in an edge index adjacency matrix of size (2, B*D / *B*D). Each forward propagation generates dynamic changes, and each round is iteratively updated. First, the feature vectors are transposed, and the similarity between variables is calculated using the inner product. Normalization is performed using the maximum value, and the dimension is set to 1. Then, the number of nodes is set to the value of the first dimension of the feature map, and its function expression is: In formula (3), Let X represent the feature vector output after passing through a fully connected layer, T be the transpose, normalize denotes the normalization function, and A be the adjacency matrix of the generated graph data structure. The feature vector of X in formula (2) is the feature vector output after passing through the fully connected layer. That is to say The transpose of the eigenvectors is further processed by preserving the top-k edges by cosine distance, retaining only the k edges with the highest similarity, to obtain a sparsed adjacency matrix A. - Its functional expression is shown in formula (4); A - =TOP-k(A) (4) Step S23 specifically includes: An MRF_GCN module is constructed, using Dropout to randomly deactivate the graph and prevent overfitting. The dynamic graph data structure generated by the graph generation layer is input into the MultiChev layer for graph neural convolution operations. The Chevnet order is set to 1 to extract relevant information between nodes from the graph data structure. The output channel dimension is set to 50, and then the regularization layer is used to reshape the feature vector into a feature vector of size (batch * variable, 50), outputting a feature vector of size (B * D, 50). The extracted feature vector is then passed through a linear layer with ReLU activation function for feature transformation. This linear layer has an input-output dimension of (50, 64) and an output feature vector of size (B * D, 64). Finally, the feature vector is reshaped and concatenated back to its original batch size, outputting a feature vector of size (B, 64 * D). A linear regression prediction layer is constructed, and different networks are defined for Task 1 and Task 2 respectively. When Task 1 is executed, the input and output dimensions of the linear layer are set to (64*3, 1); when Task 2 is executed, the input and output dimensions of the linear layer are set to (64*5, 1). Finally, the model outputs a feature vector with a size of (B, 1), thus obtaining a deep learning model based on a hybrid deep learning model of one-dimensional convolutional neural network and GCN. The calculation formula (5) for the fully connected layer is as follows: Among them, D j For the j-th output, f() is the activation function, W ji ε is the i-th input weight parameter for the j-th output. j Here, n is the bias parameter for the j-th output, and n is the total number of inputs.
2. The reservoir water level prediction and early warning method based on neural networks and GCN deep learning models according to claim 1, characterized in that, Step S1 specifically uses the reservoir water level, discharge volume, and rainfall characteristics as model training data, and performs maximum and minimum value normalization preprocessing on the three variables of water level, discharge volume, and rainfall in the dataset in sequence: In formula (1), x is the data to be normalized, and x' is the normalized data. max and x min These represent the maximum and minimum values in the data to be normalized, respectively. Finally, the data is mapped to the range between 0 and 1 and used as feature data to input into the model for training.
3. The reservoir water level prediction and early warning method based on neural networks and GCN deep learning models according to claim 2, characterized in that, The input data needs to perform two tasks: Task 1: Using the reservoir water level, rainfall, and discharge volume of the day as characteristics of a specific time point, predict the reservoir water level for the next day using data from the past N time points. Task 2: Using the reservoir water level of the day, the rainfall in the next three days, and the flood discharge in the next three days as characteristics of a time point, predict the reservoir water level for the next three days using data from the past N time points.
4. The reservoir water level prediction and early warning method based on neural networks and GCN deep learning models according to claim 1, characterized in that, Step S3 specifically involves: Load a hybrid deep learning model based on a one-dimensional convolutional neural network and GCN; acquire real-time monitoring data of reservoir rainfall and water conditions, as well as rainfall and flood discharge data, and then input them into the model to predict the reservoir water level, obtaining the predicted water level value; use the mean squared error (MSE) as the optimization objective of the hybrid deep learning model based on the one-dimensional convolutional neural network and GCN, and the MSE value becomes smaller and smaller during the iteration process, indicating that the model performance is gradually improving; The model loss curve reflects the model's fit to the dataset and the iterative loss process. The reservoir water level dataset was trained and tested 300 times based on a hybrid deep learning model of one-dimensional convolutional neural network and GCN. The evaluation metrics used include three types: Mean Absolute Error (MAE), Mean Squared Error (MSE), and Mean Absolute Percentage Error (MAPE), which are defined as follows: In formulas (6) to (8), y i and t i Let represent the predicted value and the true label of the i-th sample, respectively, and n represent the total number of samples in the test set.
5. The reservoir water level prediction and early warning method based on neural networks and GCN deep learning models according to claim 1, characterized in that, Step S4 specifically involves: reading the reservoir water level prediction model stored in the cloud or locally in step 3, predicting the reservoir water level, comparing the obtained water level prediction values for the next one to three days with the reservoir water level standard, determining whether the predicted water level is within a safe range, storing the obtained data in the database if yes, and carrying out normal reservoir water level scheduling; otherwise, comparing with the reservoir water level warning standard, outputting various reservoir parameter information and warning level, and then combining the output parameters, including rainfall, flood discharge, reservoir water level, and warning level, to schedule the reservoir water level to a safe range.
Citation Information
Patent Citations
Reservoir level prediction and early warning method and system based on mixed deep learning model
CN114648170A