Multi-step flood forecasting method and device based on GRU-Seq2Seq
By introducing the Seq2Seq model into the GRU model and combining measured rainfall and simulated runoff data, a GRU-Seq2Seq flood forecasting model was established. This model solves the problems of overestimation of peak flow and time lag in multi-step forecasting of small watersheds in mountainous areas using the traditional GRU model, and achieves more accurate multi-step flood forecasting.
Patent Information
- Application Number
- CN202210911929.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Traditional GRU models struggle to effectively simulate longer-term correlations within watersheds, leading to overestimation of peak flow and peak lag in multi-step flood forecasting for small watersheds in mountainous areas.
Based on the GRU model, a Seq2Seq model is introduced. Measured rainfall data and simulated runoff data are input into the GRU encoder. Through the GRU-Seq2Seq flood forecasting model, a multi-step early flood forecasting model is established, and the encoder and decoder are used to learn rainfall and runoff information.
It effectively solves the time lag problem in multi-step advance prediction, improves the accuracy and precision of flood forecasting, and alleviates the phenomenon of delayed flood peaks.
Smart Images

Figure CN115330036B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flood forecasting, and in particular to a multi-step flood forecasting method and apparatus based on GRU-Seq2Seq. Background Technology
[0002] Flash floods are characterized by their suddenness, destructive power, and rapid onset, making them difficult to monitor and forecast. In small watersheds in mountainous areas, measured flow records are often lacking, and the rapid confluence time makes it difficult to achieve fast, accurate, and multi-step advance forecasting.
[0003] In recent years, deep learning networks, such as LSTM and GRU neural networks, have been widely used in flood forecasting. Compared with traditional methods, deep learning networks can achieve better prediction results with lower computational costs and simpler modeling processes. However, due to the lack of measured flow data and the rapid confluence time, forecasting small watersheds in mountainous areas is difficult and inaccurate, and the accuracy will further decrease as the forecast lead time increases. While GRU deep learning models can effectively learn the correlation between rainfall and runoff, they cannot effectively simulate longer-term correlations within the watershed, leading to overestimation of peak flow and peak lag in multi-step forecasting. Summary of the Invention
[0004] To address the technical problem that traditional GRU models cannot effectively simulate longer-term correlations within watersheds, leading to overestimation of peak flow and peak lag in multi-step forecasting, this invention improves the GRU algorithm by introducing a Seq2Seq model. Measured rainfall data and simulated runoff data are input together into the GRU encoder to obtain an encoded vector, which is then input into the GRU decoder to obtain the predicted flow. The GRU-Seq2Seq flood forecasting model can fully utilize rainfall and runoff information under typhoon influence, establishing an accurate multi-step early flood forecasting model, solving the time lag problem in multi-step early forecasting, and effectively improving the performance of flood forecasting models.
[0005] According to one aspect of the present invention, a multi-step flood forecasting method based on GRU-Seq2Seq is provided, comprising the following steps:
[0006] Based on the GRU model, Seq2Seq is introduced to build a multi-step flood forecasting model based on GRU-Seq2Seq. The multi-step flood forecasting model includes two GRU units, which are used to convert the rainfall sequence into the runoff sequence. One GRU unit acts as an encoder and the other GRU unit acts as a decoder.
[0007] The measured rainfall data With traffic data {Y} m×kCombined into the input matrix {X} (J+m)×k The input matrix is divided into k J+m dimensional vectors and then input into the encoder to calculate the reset gate r. t and update gate z t ;
[0008] According to the reset gate r t and update gate z t The encoder candidate set is calculated.
[0009] By updating gate z t Update the information and obtain the hidden state h at the current time point. t The encoding vector c represents the hidden state at the last moment;
[0010] In the decoder, the hidden state h' from the previous time step... t-1 Let c be the encoding vector, and y be the predicted flow rate at the previous time step. T+t-1 Take the measured flow rate y T ;
[0011] Based on the previous hidden state h' t-1 With predicted flow y T+t-1 Calculate the reset door and Update Gate
[0012] According to the reset door and the hidden state h' from the previous moment t-1 With predicted flow y T+t-1 The candidate set was calculated.
[0013] By updating the door Update the information memory to obtain the current hidden state h' t ;
[0014] Based on the current hidden state h' t The predicted flow rate y at the current time is calculated. T+t .
[0015] Furthermore, the input matrix {X} (J+m)×k The expression is:
[0016]
[0017] The reset gate r t and update gate z t The calculation formula is:
[0018] r t =σ(W r ·[h t-1 ,Xt ])
[0019] z t =σ(W z ·[h t-1 ,X t ])
[0020]
[0021] Where t is the t-th input time step; T is the last time step; x i,j y represents the measured rainfall data at time j of the i-th rain gauge station; i,j h represents the measured traffic data of the i-th traffic station at the j-th time. t and h t-1 These represent the hidden state of the current time node and the hidden state of the previous time node, respectively; r t Reset the door for the encoder; z t Update the door for the encoder; X t σ is the input vector at the current time point; σ is the sigmoid function, which transforms the data into values in the range of 0-1, thus acting as a gating signal; W r and W z These are the weight matrices for the control gate and update gate in the encoder, respectively.
[0022] Furthermore, the statement based on the reset gate r t and update gate z t The encoder candidate set is calculated. The specific calculation formula is as follows:
[0023]
[0024] in, It is the encoder candidate set; h t-1 The hidden state of the previous time point; r t Reset the door for the encoder; X t The input vector is the current time point; the reset gate controls how much information from the previous state was written into the current candidate set. is the candidate set weight matrix; tanh is the activation function that scales the data to the range of -1 to 1.
[0025] Furthermore, the step of updating gate z t Update the information and obtain the hidden state h at the current time point. t The specific update formula is as follows:
[0026]
[0027] in, It is the encoder candidate set, ht and h t-1 These represent the hidden state of the current time node and the hidden state of the previous time node, respectively. t Update the door for the encoder;
[0028] The encoding vector c represents the hidden state at the final time step, i.e.
[0029] c = h T
[0030] Where T represents the last moment; h T This refers to the hidden state at the last moment, i.e., the input x. T With y T The hidden state is c; c is the encoding vector.
[0031] Furthermore, the step of hiding the state h' based on the previous time step... t-1 With predicted flow y T+t-1 Calculate the reset door and Update Gate The specific calculation formula is as follows:
[0032]
[0033]
[0034] Where t is the t-th prediction time step; T is the last time step; h' t-1 The hidden state of the previous time point; y T+t-1 The predicted flow rate for the previous moment; Reset the gate for the decoder; Update the gate for the decoder; and These are the weight matrices for the control gate and update gate in the decoder, respectively.
[0035] Furthermore, the statement based on the reset door and the hidden state h' from the previous moment t-1 With predicted flow y T+t-1 The candidate set was calculated. The calculation formula is:
[0036]
[0037] in, For candidate sets; h' is the candidate set weight matrix; t is the t-th prediction time step; t-1 The hidden state of the previous time point; y T+t-1 The predicted flow rate for the previous moment; Reset the gate for the decoder.
[0038] Furthermore, the update gate Update the information memory to obtain the current hidden state h' t The updated formula is:
[0039]
[0040] Among them, h' t-1 The hidden state of the previous time point; For candidate sets; Update the gates for the decoder.
[0041] Furthermore, the step of hiding the state h' based on the current time... t The predicted flow rate y at the current time is calculated. T+t The calculation formula is:
[0042] y T+t =σ(W y h' t )
[0043] Among them, y T+t Predict the flow rate for the current moment; W y This is the output weight matrix.
[0044] Furthermore, in the process of hiding the state h' according to the current time... t The predicted flow rate y at the current time is calculated. T+t Following these steps, the following are also included:
[0045] The prediction performance of the multi-step flood forecasting model was evaluated using root mean square error and Nash efficiency coefficient.
[0046]
[0047]
[0048] Where RMSE is the root mean square error; NSE is the Nash efficiency coefficient; Q m and Q o These represent the predicted flow and the observed flow, respectively; N represents the number of observations, i = 1, 2, ..., N; It is the average of the observed values.
[0049] According to another aspect of the present invention, the present invention also provides a multi-step flood forecasting device based on GRU-Seq2Seq, comprising the following units:
[0050] The model building unit is used to introduce Seq2Seq on the basis of the GRU model to build a multi-step flood forecasting model based on GRU-Seq2Seq. The multi-step flood forecasting model includes two GRU units, which are used to convert the rainfall sequence into the runoff sequence. One GRU unit acts as an encoder and the other GRU unit acts as a decoder.
[0051] The encoder resets the door and updates the door calculation unit to incorporate measured rainfall data. With traffic data {Y} m×k Combined into the input matrix {X} (J+m)×k The input matrix is divided into k J+m dimensional vectors and then input into the encoder to calculate the reset gate r. t and update gate z t ;
[0052] The encoder candidate set calculation unit is used to calculate the candidate set based on the reset gate r. t and update gate z t The encoder candidate set is calculated.
[0053] The encoder updates the memory unit to update the door z. t Update the information and obtain the hidden state h at the current time point. t The encoding vector c represents the hidden state at the last moment;
[0054] The decoder reset gate and update gate computation units are used to calculate the hidden state h' in the decoder at the previous time step. t-1 Let c be the encoding vector, and y be the predicted flow rate at the previous time step. T+t-1 Take the measured flow rate y T ; by hiding the state h' in the previous moment t-1 With predicted flow y T+t-1 Calculate the reset door and Update Gate
[0055] Decoder candidate set computation unit, used to calculate based on the reset gate and the hidden state h' from the previous moment t-1 With predicted flow y T+t-1 The candidate set was calculated.
[0056] The decoder updates the memory cell for use via the update gate. Update the information memory to obtain the current hidden state h' t ;
[0057] The traffic prediction unit is used to predict the current hidden state h'. t The predicted flow rate y at the current time is calculated.T+t .
[0058] The technical solution provided by this invention has the following beneficial effects:
[0059] (1) The GRU unit is used to replace the traditional RNN unit as the kernel of the encoder and decoder to read the input information sequentially. This solves the gradient vanishing and gradient explosion problems that are easy to occur when using RNN units. It can convert the rainfall sequence information into the runoff sequence information through the context encoding vector c, and can also use the decoder to learn the autocorrelation of future runoff.
[0060] (2) By combining two GRU units to establish a GRU-Seq2Seq model, the continuity characteristics of river flow can be learned, which is impossible to achieve using only a single GRU unit. It also significantly improves the prediction of peak time and effectively alleviates the time lag phenomenon of flood process. Attached Figure Description
[0061] The specific effects of the present invention will be further explained below with reference to the accompanying drawings and embodiments. In the accompanying drawings:
[0062] Figure 1 This is a flowchart of a multi-step flood forecasting method based on GRU-Seq2Seq provided in an embodiment of the present invention.
[0063] Figure 2 This is a framework diagram of the training of the GRU-Seq2Seq multi-step flood forecasting model provided in this embodiment of the invention.
[0064] Figure 3 This is a basic structural diagram of the GRU unit provided in an embodiment of the present invention.
[0065] Figure 4 This is a basic structural diagram of the Seq2Seq model provided in the embodiments of the present invention.
[0066] Figure 5 This is a scatter plot of the prediction results of three models, Rain-GRU, Rain-Flow-GRU, and GRU-Seq2Seq, provided in the embodiments of the present invention.
[0067] Figure 6 This is a graph showing the prediction results of the flood process lines of Typhoon Soudelor and Typhoon Matmo based on the GRU-Seq2Seq multi-step flood forecasting model provided in this embodiment of the invention.
[0068] Figure 7 This is a structural diagram of a multi-step flood forecasting device based on GRU-Seq2Seq provided in an embodiment of the present invention. Detailed Implementation
[0069] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0070] Example 1:
[0071] The invention provides a multi-step flood forecasting method based on GRU-Seq2Seq, which is applied to rapid forecasting in small watersheds in mountainous areas. The specific process is described in [link to documentation]. Figure 1 The overall structure is shown below. Figure 2 In the diagram, T represents time, J represents the number of rain gauges, k represents the input time window length, h represents the hidden layer state, and n represents the output time step. This method is implemented through the following steps:
[0072] Step 1: To obtain more accurate predicted flow and reduce time lag in multi-step prediction, this invention uses two GRU units (see...). Figure 3 This method combines two approaches to transform rainfall sequences into runoff sequences. One is an encoder, and the other is a decoder. The key to this combination lies in obtaining the encoded vector c from the encoder and inputting it into the decoder to calculate the predicted flow.
[0073] To obtain the encoding vector c, the first step is to process the measured rainfall data. With traffic data {Y} m×k Combined into the input matrix {X} (J+m)×k The input matrix is divided into k (J+m) dimensional vectors and then input into the encoder to obtain the reset gate r. t and update gate z t :
[0074]
[0075]
[0076] r t =σ(W r ·[h t-1 ,X t (3)
[0077] z t =σ(W z ·[h t-1 ,X t (4)
[0078] Where t is the t-th input time step; x i,j y represents the measured rainfall data at time j of the i-th rain gauge station; i,j h represents the measured traffic data of the i-th traffic station at the j-th time. t and h t-1These represent the hidden state of the current time node and the hidden state of the previous time node, respectively; r t Reset the door for the encoder; z t Update the door for the encoder; X t σ is the input vector at the current time point; σ is the sigmoid function, which transforms the data into values in the range of 0-1, thus acting as a gating signal; W r and W z These are the weight matrices for the control gate and update gate in the encoder, respectively.
[0079] Step 2: The calculated reset gate r t and update gate z t Perform calculations to obtain the encoder candidate set.
[0080]
[0081] in, It is the candidate set, which determines how much information from the previous state of the reset gate control is written into the current candidate set. is the candidate set weight matrix; tanh is the activation function, which scales the data to the range of -1 to 1;
[0082] Step 3: Update gate z t Update the information and obtain the hidden state h at the current time point. t :
[0083]
[0084] The encoding vector c represents the hidden state at the final time step, i.e.
[0085] c = h T (7)
[0086] Where T represents the last moment; h T This refers to the hidden state at the last moment, i.e., the input x. T With y T The hidden state is c; c is the encoding vector.
[0087] Step 4: In the decoder, to obtain the predicted flow, the hidden state h' at the current time step is needed. t The current hidden state h' t This requires the predicted flow y from the previous moment. T+t-1 At the initial moment, i.e., t=1, the hidden state h' from the previous moment... t-1 Let c be the encoding vector, and y be the predicted flow rate at the previous time step. T+t-1 Take the measured flow rate y T .
[0088] h'0=c (8)
[0089] The hidden state h' obtained from the previous moment t-1 With predicted flow y T+t-1 The reset door can be calculated. and Update Gate
[0090]
[0091]
[0092] Where t is the t-th prediction time step; h' t-1 The hidden state of the previous time point; y T+t-1 The predicted flow rate for the previous moment; Reset the gate for the decoder; Update the gate for the decoder; and These are the weight matrices for the control gate and update gate in the decoder, respectively.
[0093] Step 5: Calculate the reset door And the hidden state h' from the previous moment t-1 With predicted flow y T+t-1 The candidate set was calculated.
[0094]
[0095] in, For candidate sets; Let be the candidate set weight matrix.
[0096] Step 6: Update the door Update the information memory to obtain the current hidden state h' t :
[0097]
[0098] Step 7: Utilize the hidden state h' t The predicted flow rate y at the current time is calculated. T+t :
[0099] y T+t =σ(W y h' t (13)
[0100] Among them, y T+t Predict the flow rate for the current moment; W y This is the output weight matrix.
[0101] Step 8: Evaluate the model's predictive performance using the root mean square error (RMSE) and Nash efficiency coefficient (NSE):
[0102]
[0103]
[0104] Among them, Q m and Q o These represent predicted flow and observed flow, respectively; N represents the number of observations. It is the average of the observed values. RMSE reflects the degree of deviation between the predicted value and the actual value; the smaller the value, the more accurate it is. NSE measures the goodness of fit between the predicted value and the actual value. NSE ranges from negative infinity to 1. The closer the value is to 1, the closer the simulation curve is to the actual value, and the better the simulation effect.
[0105] The beneficial effects of the method of the present invention are verified through a specific embodiment below:
[0106] 1) Data Characteristics: The data used in this invention example consists of 500 records from 9 controlled rain gauge stations in a certain watershed, including rainfall records from seven extreme typhoons (SAOLA, Dujuan, Megi, Nepartak, Maria, Soudelor, and Matmo) and inflow records from a reservoir within the watershed. The time interval is 1 hour. The basic characteristics of the typhoons are shown in Table 1. Typhoon rainfall in the watershed is concentrated from July to September, and the rainfall is also relatively concentrated, with more than 80% of the rainfall concentrated within 24 hours, resulting in short flood confluence time and large flood peaks in the watershed.
[0107] Table 1. Basic Characteristics of Typhoons
[0108]
[0109] This invention divides a dataset of seven typhoons. While maintaining similar statistical characteristics, the dataset is generally divided into a training set, a validation set, and a test set in a 6:2:2 ratio. Based on the cumulative rainfall and duration, this invention ultimately uses typhoons SAOLA, Dujuan, Megi, and Nepartak as the training set; Typhoon Maria as the validation set; and typhoons Matmo and Soudelor as the test set. The characteristics of each dataset are shown in Table 2.
[0110] Table 2 Dataset Features
[0111]
[0112]
[0113] 2) Model Construction: A GRU-Seq2Seq multi-step flood rapid forecasting model was constructed. The model's formulas have been explained previously and will not be elaborated here; please refer to [link to relevant documentation]. Figure 2 , Figure 2 This is a framework diagram for training the GRU-Seq2Seq multi-step flood forecasting model.
[0114] In this embodiment of the invention, the Adam optimization algorithm is used, with η set to 0.01, a batch size of 50, and 50 hidden neurons. T represents time, J represents the number of rain gauges (J = 9), k represents the input time window length (k = 12), h represents the hidden layer state, and n represents the output time step (n = 3). The input sequence consists of rainfall records from 9 rain gauges and HEC-HMS simulated runoff over the past 12 hours, and the output sequence is the inflow rate for the next 1-3 hours.
[0115] Having determined the structure and dataset of the GRU-Seq2Seq multi-step flood forecasting model, the model training process began. (See attached documentation for the training procedure.) Figure 1 .
[0116] 3) Model Validation: In this case, data from two typhoons were used to validate the forecast results. The scatter plot of the validation results is shown below. Figure 5 The graphs show: (a) is a scatter plot of the results predicted by the three models 1 hour in advance, (b) is a scatter plot of the results predicted 2 hours in advance, and (c) is a scatter plot of the results predicted 3 hours in advance. The flood hydrograph prediction results are shown below. Figure 6 (a) is the flood process curve prediction result of Typhoon Soudelor. Subplot (1) shows the rainfall of Typhoon Soudelor. (2) shows the flood process curve predicted by the three models 1 hour in advance. (3) shows the flood process curve predicted 2 hours in advance. (4) shows the flood process curve predicted 3 hours in advance. (b) is the flood process curve prediction result of Typhoon Matmo. Subplot (1) shows the rainfall of Typhoon Matmo. (2) shows the flood process curve predicted by the three models 1 hour in advance. (3) shows the flood process curve predicted 2 hours in advance. (4) shows the flood process curve predicted 3 hours in advance.
[0117] In the figure, the input data for the Rain-GRU model is only measured rainfall data, the input data for the Rain-Flow-GRU model includes both measured rainfall data and measured flow data, and the input data for the GRU-Seq2Seq model also includes both measured rainfall data and measured flow data.
[0118] At a 1-hour lead time, the Rain-Flow-GRU and GRU-Seq2Seq models showed comparable prediction performance (see...). Figure 5The GRU-Seq2Seq model outperforms the Rain-GRU model in all aspects. However, with a 2-hour lead time, the GRU-Seq2Seq model can better fit the flood hydrograph, but it tends to overestimate the peak flow compared to the other two models. With a 3-hour lead time, the GRU-Seq2Seq model can significantly improve the time lag phenomenon, and the overall flood hydrograph is closer to the measured flood process, with a significant reduction in overall offset. The performance improvement of the GRU-Seq2Seq model with a 3-hour lead time is shown in Table 3.
[0119] Table 3. Performance improvement of the GRU-Seq2Seq model in 3-hour advance prediction
[0120]
[0121] As shown in Table 3, the GRU-Seq2Seq model outperforms the Rain-GRU and Rain-Flow-GRU models in both NSE and RMSE at all time steps. Validation using Typhoon Matmo and Typhoon Soudelor demonstrates a significant improvement in efficiency for 3-hour advance forecasting. Compared to the Rain-GRU model, the GRU-Seq2Seq model achieves maximum improvements of 59% and 97% in RMSE and NSE, respectively; compared to the Rain-Flow-GRU model, the GRU-Seq2Seq model achieves maximum improvements of 52% and 61% in RMSE and NSE, respectively. This results in higher forecast accuracy and effective mitigation of the time lag phenomenon in flood events.
[0122] By analyzing the flood peak time difference and flood hydrograph, the GRU-Seq2Seq model proposed in this invention can effectively solve the time lag phenomenon in multi-step prediction. This model can ensure that the flood peak is within a controllable range in multi-step prediction, thus effectively improving the flood forecasting capability of small watersheds.
[0123] Example 2:
[0124] refer to Figure 7 This invention also provides a multi-step flood forecasting device based on GRU-Seq2Seq, comprising the following units:
[0125] Model building unit 1 is used to introduce Seq2Seq on the basis of GRU model to build a multi-step flood forecasting model based on GRU-Seq2Seq. The multi-step flood forecasting model includes two GRU units, which are used to convert the rainfall sequence into the runoff sequence. One GRU unit acts as an encoder and the other GRU unit acts as a decoder.
[0126] The encoder resets the door and updates the door calculation unit 2, which is used to process the measured rainfall data. With traffic data {Y} m×kCombined into the input matrix {X} (J+m)×k The input matrix is divided into k J+m dimensional vectors and then input into the encoder to calculate the reset gate r. t and update gate z t ;
[0127] Encoder candidate set calculation unit 3, used to calculate the candidate set based on the reset door r t and update gate z t The encoder candidate set is calculated.
[0128] The encoder updates memory unit 4 to update door z. t Update the information and obtain the hidden state h at the current time point. t The encoding vector c represents the hidden state at the last moment;
[0129] Decoder reset gate and update gate calculation unit 5 is used to calculate the hidden state h' in the decoder at the previous time step. t-1 Let c be the encoding vector, and y be the predicted flow rate at the previous time step. T+t-1 Take the measured flow rate y T ; by hiding the state h' in the previous moment t-1 With predicted flow y T+t-1 Calculate the reset door and Update Gate
[0130] Decoder candidate set calculation unit 6, used to calculate based on the reset gate and the hidden state h' from the previous moment t-1 With predicted flow y T+t-1 The candidate set was calculated.
[0131] The decoder updates memory unit 7 to access the update gate. Update the information memory to obtain the current hidden state h' t ;
[0132] Traffic prediction unit 8 is used to predict the current hidden state h'. t The predicted flow rate y at the current time is calculated. T+t .
[0133] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0134] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the unit claims listing several devices, several of these devices may be embodied by the same hardware item. The use of the terms first, second, and third, etc., does not indicate any order and can be interpreted as identifiers.
[0135] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A multi-step flood forecasting method based on GRU-Seq2Seq, characterized in that, Includes the following steps: Based on the GRU model, Seq2Seq is introduced to build a multi-step flood forecasting model based on GRU-Seq2Seq. The multi-step flood forecasting model includes two GRU units, which are used to convert the rainfall sequence into the runoff sequence. One GRU unit acts as an encoder and the other GRU unit acts as a decoder. The measured rainfall data With traffic data Merge into the input matrix Divide the input matrix into k indivual J + m The dimensional vector is then input into the encoder to calculate the reset gate. and the update gate ; The input matrix The expression is: The reset door and the update gate The calculation formula is: in, t For the first t One input time step; T For the last moment; For the first i The first rain gauge station j Measured rainfall data at specific times; For the first i The first traffic site j The measured traffic data at each moment. and These represent the hidden state of the current time node and the hidden state of the previous time node, respectively. Reset the door for the encoder; Update the door for the encoder; Input vector for the current time point; σ This is the sigmoid function, which converts data into values in the range of 0-1, thus acting as a gating signal; and These are the weight matrices for the control gate and the update gate in the encoder, respectively; According to the reset door and the update gate The encoder candidate set is calculated. ; By updating the door Update the information and obtain the hidden state at the current time point. Encoding vector c This is the hidden state at the last moment; In the decoder, the hidden state from the previous moment... Take as the encoding vector c Predicted traffic flow in the previous moment Take the actual measured flow rate ; Based on the previous hidden state With predicted flow Calculate the reset door and the update gate ; According to the reset door and the hidden state of the previous moment With predicted flow The candidate set was calculated. ; By updating the door Update the information memory to obtain the current hidden state. ; Based on the current hidden state Calculate the predicted flow at the current time. .
2. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, According to the reset door and the update gate The encoder candidate set is calculated. The specific calculation formula is as follows: in, It is the encoder candidate set; The hidden state of the previous time point; Reset the door for the encoder; The input vector is the current time point; the reset gate controls how much information from the previous state was written into the current candidate set. is the candidate set weight matrix; tanh is the activation function that scales the data to the range of -1 to 1.
3. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, The update gate Update the information and obtain the hidden state at the current time point. The specific update formula is as follows: in, It is the encoder candidate set. and These represent the hidden state at the current time point and the hidden state at the previous time point, respectively. Update the door for the encoder; Encoding vector c The hidden state at the last moment, i.e. in, T For the last moment; The hidden state at the last moment, i.e., the input and The hidden state afterwards; c This is the encoded vector.
4. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, The state based on the previous hidden state With predicted flow Calculate the reset door and the update gate The specific calculation formula is as follows: in, t For predicting time steps; T For the last moment; The hidden state of the previous time point; The predicted flow rate for the previous moment; Reset the gate for the decoder; Update the gate for the decoder; and These are the weight matrices for the control gate and update gate in the decoder, respectively.
5. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, According to the reset door and the hidden state of the previous moment With predicted flow The candidate set was calculated. The calculation formula is: in, For candidate sets; The candidate set weight matrix; t For predicting time steps; The hidden state of the previous time point; The predicted flow rate for the previous moment; Reset the gate for the decoder.
6. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, The update gate Update the information memory to obtain the current hidden state. The updated formula is: in, The hidden state of the previous time point; For candidate sets; Update the gates for the decoder.
7. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, The hidden state based on the current time Calculate the predicted flow at the current time. The calculation formula is: in, Predict traffic flow for the current moment; This is the output weight matrix.
8. The multi-step flood forecasting method based on GRU-Seq2Seq according to claim 1, characterized in that, The hidden state is based on the current time. Calculate the predicted flow at the current time. Following these steps, the following are also included: The prediction performance of the multi-step flood forecasting model was evaluated using root mean square error and Nash efficiency coefficient. in, RMSE This is the root mean square error; NSE Nash efficiency coefficient; and These are predicted flow and observed flow, respectively. N For the number of observations, i =1,2,..., N ; It is the average of the observed values.
9. A multi-step flood forecasting device based on GRU-Seq2Seq, characterized in that, Includes the following units: The model building unit is used to introduce Seq2Seq on the basis of the GRU model to build a multi-step flood forecasting model based on GRU-Seq2Seq. The multi-step flood forecasting model includes two GRU units, which are used to convert the rainfall sequence into the runoff sequence. One GRU unit acts as an encoder and the other GRU unit acts as a decoder. The encoder resets the door and updates the door calculation unit to incorporate measured rainfall data. With traffic data Merge into the input matrix Divide the input matrix into k indivual J + m The dimensional vector is then input into the encoder to calculate the reset gate. and the update gate ; The input matrix The expression is: The reset door and the update gate The calculation formula is: in, t For the first t One input time step; T For the last moment; For the first i The first rain gauge station j Measured rainfall data at specific times; For the first i The first traffic site j The measured traffic data at each moment. and These represent the hidden state of the current time node and the hidden state of the previous time node, respectively. Reset the door for the encoder; Update the door for the encoder; Input vector for the current time point; σ This is the sigmoid function, which converts data into values in the range of 0-1, thus acting as a gating signal; and These are the weight matrices for the control gate and the update gate in the encoder, respectively; Encoder candidate set calculation unit, used to calculate based on the reset door and the update gate The encoder candidate set is calculated. ; The encoder updates the memory unit to update the door. Update the information and obtain the hidden state at the current time point. Encoding vector c This is the hidden state at the last moment; The decoder reset gate and update gate computation units are used to calculate the hidden state in the decoder at the previous time step. Take as the encoding vector c Predicted traffic flow in the previous moment Take the actual measured flow rate ; through the hidden state of the previous moment With predicted flow Calculate the reset door and the update gate ; Decoder candidate set computation unit, used to calculate based on the reset gate and the hidden state of the previous moment With predicted flow The candidate set was calculated. ; The decoder updates the memory cell for use via the update gate. Update the information memory to obtain the current hidden state. ; The traffic prediction unit is used to predict the current hidden state. Calculate the predicted flow at the current time. .