A rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal
By using the space-time long and short-term memory network and tree structure traversal methods in rainfall runoff prediction, the problem of insufficient space-time and space information capture in the prior art is solved, and the accuracy and reliability of rainfall runoff prediction are significantly improved.
Patent Information
- Application Number
- CN202410329179.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-03-21
AI Technical Summary
Existing rainfall runoff prediction methods are difficult to effectively capture the spatial and temporal dynamics and spatial dependence of rainfall data, resulting in low prediction accuracy.
A rainfall runoff prediction method based on space-time long and short memory network and tree structure traversal is adopted to construct a space-time long and short memory network for rainfall runoff. Combined with the tree structure traversal method, rainfall data from meteorological stations are input to capture space-time and space information.
Through the short-term memory network and tree structure traversal method, the accuracy and reliability of rainfall runoff prediction are significantly improved, the spatial and spatial data can be better processed, and the accuracy of prediction is enhanced.
Smart Images

Figure CN118297217B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to rainfall runoff prediction, and in particular to a rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal. Background Art
[0002] Water resources planning and management are inseparable from our daily activities and correct knowledge of hydrological theory is essential to ensure sustainable management of limited water resources. Runoff prediction is very complex as typical water flows have temporal trends. However, it is one of the most useful hydrological applications. Accurate and precise runoff prediction is necessary to ensure continued economic growth for agricultural water management, industrial food and beverage packaging, domestic water supply and implementation of early warning systems for flood or drought events. Currently, it is impossible to achieve predictions that are identical to the actual values due to the complexity of runoff properties.
[0003] At present, the commonly used rainfall-runoff prediction methods can be divided into two categories according to the technical means adopted: process-driven hydrological models and data-driven models. Each type of method has its own advantages and disadvantages. The main difference between the two types of methods is that the data-driven model excludes the physical aspects of hydrological information and the complex process of rainfall-runoff mechanism. Data-driven models are more flexible and can be analyzed using various structures and parameters, making them suitable for multi-disciplinary applications. For example, in terms of runoff, rainfall and water quality prediction, data-driven models are more efficient and targeted. Data-driven models are at the forefront of adaptation, learning, promotion and data processing. Compared with statistical models or physical models, data-driven models may have higher prediction efficiency and accuracy.
[0004] The basic principle of process-driven hydrological models is based on the theory of continuum mechanics. These models require comprehensive field information and are not suitable for applications in complex scenarios. These models require the definition of each sub-process and simulate the actual hydrological process in mathematical form, which can intuitively explain the relationship between input parameters and output variables. Obviously, when there is not enough data to establish the input-output connection, the advantages of process-driven hydrological models are stronger. However, process-driven hydrological models are prone to reduced prediction accuracy due to noise in the data. Noise in the data usually comes from routine maintenance, such as calibration work, data acquisition program errors, faulty data transmission, and other unknown sources. In addition, process-driven hydrological models are also usually limited by spatiotemporal complexity and are affected by model bias.
[0005] Therefore, data-driven methods have better application prospects in the field of rainfall-runoff prediction. In particular, the basic principles of physical models are based on the theory of continuum mechanics. These models require comprehensive field information and are not suitable for complex applications. The purpose is to define subprocesses and simulate actual hydrological processes in mathematical form. It uses a transparent model structure to illustrate the relationship between input parameters and output variables. It has advantages when there is not enough data to establish input-output connections. However, such process-driven hydrological models are prone to defects due to the presence of noise. Noise usually comes from routine maintenance such as calibration work, data acquisition program errors, faulty data transmission, and other unknown sources. Physical models are also limited by spatiotemporal complexity and are affected by model bias. Therefore, physical models are more susceptible to conceptual and systematic errors caused by the uncertainty of replication results. Sometimes, the difficulty of obtaining hydrological data hinders complete physical modeling. Other disadvantages of physical models are higher costs, locality and accuracy issues limited to process detection.
[0006] In recent years, deep learning methods have been widely used in many fields, especially in computer vision and natural language processing. Most deep learning methods have the ability to process long sequence data, such as recursive neural network, which is one of the most popular neural networks in the field of deep learning and has been proven to be an effective tool for processing sequence data for time series prediction. It is worth noting that due to its inherent gradient vanishing or exploding problem, the performance of traditional recursive neural network in sequence prediction has not been significantly improved. As an improved version of recursive neural network, long short-term memory network can effectively solve this problem. Long short-term memory network uses the time series information of rainfall data from various meteorological stations in the catchment area to predict the runoff data in the catchment area.
[0007] However, the runoff in the catchment area is not only related to the time dimension of the rainfall data at each meteorological station (i.e., the contextual information of the rainfall data), but also to the spatial dimension of the rainfall data at each meteorological station (i.e., the spatial dependence of different rainfall data). Obviously, if only the time dimension information of the rainfall data at each meteorological station is considered, and the spatial dimension information of the rainfall data at each meteorological station is not considered, some information may be missed, thereby affecting the accuracy of rainfall runoff prediction. In addition, the rainfall data at each meteorological station at each moment is not necessarily completely reliable, that is, erroneous data needs to be excluded when predicting rainfall runoff.
[0008] In view of this, the present invention proposes a rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal for rainfall runoff prediction. The method constructs a rainfall runoff spatiotemporal long short-term memory network, models the dynamic and dependency relationship of rainfall data in the spatiotemporal domain, and the rainfall data of each meteorological station at each moment can receive context information from the rainfall data stored at the previous moment, or from the rainfall data at the adjacent meteorological station at the same moment. At the same time, a meteorological station structure tree traversal method is proposed, starting from the root node of the tree structure, and inputting the rainfall data at the root node and each leaf node of the tree structure into the rainfall runoff spatiotemporal long short-term memory network in turn. Summary of the invention
[0009] The technical problem to be solved by the present invention is to provide a rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal, which is used for basin rainfall runoff prediction.
[0010] In order to solve the above technical problems, the technical solution adopted by the present invention is: a rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal, comprising the following steps:
[0011] Step 1: Prepare rainfall data, runoff data and ground elevation DEM data in the catchment area, and check the quality of rainfall data and runoff data;
[0012] Step 2: divide the watershed of the prediction area according to the ground elevation of the watershed, divide the watershed into different sub-watersheds, and obtain the tree structure of the watershed according to the correlation between the sub-watersheds;
[0013] Step 3: Construct a rainfall-runoff spatiotemporal long-term and short-term memory network, and use the spatiotemporal rainfall data in the catchment area to predict the runoff data;
[0014] Step 4: Train and test the rainfall-runoff spatiotemporal long-term and short-term memory network and set the model parameters;
[0015] Step 5: Select the spatiotemporal rainfall and runoff data in a typical catchment area, use the rainfall-runoff spatiotemporal long-short-term memory network to predict the rainfall-runoff in the catchment area, and evaluate the prediction performance of the model.
[0016] In a preferred embodiment, the operation steps of step 1 are as follows:
[0017] S1.1. Collect runoff data from hydrological stations, rainfall data from meteorological stations and ground elevation DEM data of the catchment area, and select rainfall data and runoff data as influencing factors and decision variables for rainfall-runoff prediction respectively;
[0018] S1.2. After collecting the rainfall data and runoff data in each catchment area, check the quality of the rainfall data and runoff data, and use a sliding time window to replace the missing data and erroneous data in the rainfall data and runoff data.
[0019] In a preferred embodiment, the operation steps of step 2 are as follows:
[0020] S2.1. Use the ground elevation DEM data in each catchment area to divide the catchment area into sub-basins, divide the catchment area into individual sub-basins, and number each sub-basin;
[0021] S2.2, according to the location coordinates of each meteorological station in the catchment area, divide each meteorological station into its corresponding sub-basin, and number the meteorological stations according to the number of the sub-basin where each meteorological station is located;
[0022] S2.3. After traversing to the leaf node of the river network tree structure, backtracking is performed in the river network tree structure in reverse depth-first order.
[0023] In a preferred solution, the operation steps of step three are as follows:
[0024] S3.1. Construct a rainfall-runoff spatiotemporal long-short-term memory network as a rainfall-runoff prediction model, and obtain the runoff data in the catchment area by inputting the rainfall data of each meteorological station in the catchment area and considering the spatial distribution of each meteorological station;
[0025] S3.2, according to the tree structure of each meteorological station, traverse from the root node of the tree structure, and input the rainfall data at the root node and each leaf node of the tree structure into the rainfall-runoff spatiotemporal long-term memory network in turn;
[0026] S3.3, after the rainfall data of each weather station is input into the rainfall-runoff spatiotemporal long short-term memory network unit, a trust function is introduced to predict accurate and reliable rainfall data based on the available contextual information;
[0027] S3.4. At each time step, the rainfall data in each rainfall-runoff spatiotemporal long-term short-term memory network unit is feature fused, and the runoff data in the catchment area is predicted using the feature-fused rainfall data.
[0028] In a preferred embodiment, the operation steps of step S3.1 are as follows:
[0029] S3.1.1. Construct a long short-term memory network based on time series, and obtain the runoff time series data of the catchment area by inputting the spatiotemporal rainfall data of each meteorological station in the catchment area;
[0030] S3.1.2, inputting the rainfall data of each meteorological station in the catchment area into the spatiotemporal long short-term memory network unit corresponding to each meteorological station, and obtaining the spatiotemporal information of the rainfall data of each meteorological station in the catchment area;
[0031] S3.1.3. After the input data enters each rainfall-runoff spatiotemporal long-term memory network unit, each rainfall-runoff spatiotemporal long-term memory network unit processes the contextual information of the rainfall data in both time and space dimensions.
[0032] In a preferred embodiment, the operation steps of step S3.2 are as follows:
[0033] S3.2.1. Input the rainfall data of the meteorological station at the root node of the tree structure into the corresponding rainfall-runoff spatiotemporal long-term short-term memory network unit;
[0034] S3.2.2, traverse the tree structure in depth-first order, and input the rainfall data of the meteorological station at each leaf node into the corresponding rainfall-runoff spatiotemporal long-term short-term memory network unit in turn;
[0035] S3.2.3, after traversing to the leaf node of the tree structure, the tree structure is backtracked in reverse depth-first order, and the rainfall data of the meteorological station at each leaf node of the tree structure is input into the corresponding rainfall-runoff spatiotemporal long-short-term memory network unit in turn;
[0036] S3.2.4. After back-traversing to the root node of the tree structure, end the input of rainfall data of each meteorological station in the entire catchment area at this time step, continue to input rainfall data of each meteorological station in the catchment area at the next time step, and repeat steps S3.2.1 to S3.2.4.
[0037] In a preferred embodiment, the operation steps of step S3.3 are as follows:
[0038] S3.3.1. The prediction of rainfall runoff data input to each rainfall runoff spatiotemporal LSTM network unit is expressed as:
[0039]
[0040] Where M p Is to transfer data from Map to Affine transformation of h j,t-1 represents the hidden representation of the same weather station in the previous time step, h j-1,t represents the hidden representation of the neighboring weather stations at the current time step, and d represents the dimension of rainfall data;
[0041] S3.3.2. In each rainfall-runoff spatiotemporal long-term short-term memory network unit, the predicted rainfall data input value is compared with the actual rainfall data input value, and a trust gate is added to the network unit. The trust gate is trained using the error between the predicted value and the actual value of the input rainfall data. The vector in activates the trust gate, and the trust gate τ j,t The calculation of is as follows:
[0042] x′ j,t =tanh(M x (x j,t ))
[0043] τ j,t =G(p j,t -x′ j,t )
[0044] Where M x Is to transfer data from Affine transformation; x j,t Represents the input rainfall data; p j,t and x′ j,t Respectively represent the status value and update value of rainfall data;
[0045] The activation function G(·) is calculated as G(z)=exp(-λz 2 ), where λ is a parameter that controls the bandwidth of the Gaussian function, λ>0, if z has a large absolute value, a smaller response is generated; if z is close to zero, a larger response is generated; z represents the rainfall data at each moment;
[0046] After adding the trust gate in each rainfall runoff spatiotemporal long short-term memory network unit, the status of each rainfall runoff spatiotemporal long short-term memory network unit is updated as follows:
[0047]
[0048] In the formula, i j,t Represents the state value of the trust gate, u j,t Indicates the state value of the update gate, represents rainfall data in the time dimension, c j-1,t Indicates the rainfall data of the previous node, represents rainfall data in spatial dimension, c j,t-1 Indicates the rainfall data at the previous moment.
[0049] In a preferred embodiment, the operation steps of step S3.4 are as follows:
[0050] S3.4.1. In a single rainfall-runoff spatiotemporal LSTM network, the temporal and spatial information of rainfall data at each meteorological station in the catchment area is integrated to obtain the runoff prediction value of the single rainfall-runoff spatiotemporal LSTM network;
[0051] At each time step, the spatiotemporal rainfall data of each meteorological station in the catchment area are input into the rainfall-runoff spatiotemporal long-term short-term memory network unit. represents the spatiotemporal rainfall data of the jth meteorological station in the catchment area at the tth time step, where represents the rainfall value at the jth meteorological station in the catchment area at the tth time step, The location information of the jth meteorological station in the catchment area at the tth time step, and The inputs are fed into the corresponding rainfall-runoff spatiotemporal long short-term memory network units respectively;
[0052] In each rainfall runoff spatiotemporal LSTM network unit, an input gate is included About time and space The forget gate and trust gate and processing spatiotemporal rainfall data and The two sets of heterogeneous modal characteristics of the spatiotemporal rainfall data and The unit representation Put together to establish the multimodal context information of the two sets of modal features. After inputting the spatiotemporal rainfall data, the output of each rainfall runoff spatiotemporal long short-term memory network is calculated according to the multimodal context information of the two sets of modal features, and the output gate o shared by the two sets of features is used. j,t control;
[0053] S3.4.2. Use the rainfall data after the characteristics of each rainfall-runoff spatiotemporal long-term short-term memory network unit are fused to predict the runoff data of the catchment area at that time step.
[0054] In a preferred solution, the operation steps of step 4 are as follows:
[0055] S4.1. Determine the learnable parameters and hyperparameters of the rainfall-runoff spatiotemporal long short-term memory network;
[0056] S4.2. Determine the rainfall-runoff prediction performance evaluation index of the rainfall-runoff spatiotemporal long-short-term memory network;
[0057] S4.3. Input the rainfall data of each meteorological station in the catchment area into the rainfall-runoff spatiotemporal long-term memory network, and train and test the rainfall-runoff spatiotemporal long-term memory network.
[0058] In a preferred solution, in step S4.1, the learning parameter refers to the runoff value, and the hyperparameter refers to the likelihood function value;
[0059] In step S4.2, the rainfall runoff spatiotemporal long short-term memory network uses a softmax layer to predict the runoff value, and the objective function is as follows:
[0060]
[0061] In the formula, Represents the negative log likelihood loss, which is used to represent the runoff prediction value at each spatiotemporal step The difference between the actual value of runoff, J represents the number of meteorological stations in the catchment area, and T represents the total time of rainfall data of each meteorological station in the catchment area;
[0062] In step S4.3, the real observed data of k rainfall runoff in the catchment area are selected to train the proposed rainfall runoff spatiotemporal long short-term memory network, and k likelihood function values are obtained through k training. Choose the hyperparameter combination that produces the highest likelihood function value among all The median hyperparameter basis is used as the hyperparameter of the rainfall-runoff spatiotemporal long short-term memory network.
[0063] In the preferred scheme, in the step five, W real rainfall data in the catchment area are selected and input into the rainfall-runoff spatiotemporal long-short-term memory network and the rainfall-runoff long-short-term memory network respectively to predict the runoff value of the catchment area. After predicting the runoff value of the catchment area, the W real runoff data in the catchment area are used to calculate the likelihood loss values of the rainfall-runoff spatiotemporal long-short-term memory network and the rainfall-runoff long-short-term memory network respectively, and the prediction performance of the rainfall-runoff spatiotemporal long-short-term memory network is evaluated.
[0064] The present invention provides a rainfall runoff prediction method based on a spatiotemporal long short-term memory network and tree structure traversal, which constructs a rainfall runoff spatiotemporal long short-term memory network, models the dynamic and dependency relationship of rainfall data in the spatiotemporal domain, and the rainfall data of each meteorological station at each moment can receive context information from the rainfall data stored at the previous moment, or from the rainfall data at the adjacent meteorological station at the same moment. At the same time, a meteorological station structure tree traversal method is proposed, which starts from the root node of the tree structure and sequentially inputs the rainfall data at the root node and each leaf node of the tree structure into the rainfall runoff spatiotemporal long short-term memory network. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0066] Figure 1It is a flow chart of the rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal;
[0067] Figure 2 It is a schematic diagram of the structure tree of each meteorological station in the catchment area;
[0068] Figure 3 Schematic diagram of a single neuron in the rainfall-runoff spatiotemporal long short-term memory network;
[0069] Figure 4 This is a schematic diagram of the spatial-temporal long-short-term memory network of rainfall-runoff;
[0070] Figure 5 A schematic diagram of the tree traversal for each meteorological station in the catchment area;
[0071] Figure 6 It is a schematic diagram of the deep tree structure rainfall-runoff spatiotemporal long-term memory network;
[0072] Figure 7 It is the trust gate of the rainfall-runoff spatiotemporal long short-term memory network;
[0073] Figure 8 It is the internal feature fusion unit of the rainfall runoff spatiotemporal long short-term memory network. DETAILED DESCRIPTION
[0074] Combination Figures 1 to 8 The specific embodiments of the present invention are described in further detail.
[0075] like Figure 1 As shown in the figure, a rainfall-runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal is divided into five parts: (1) preparation of hydrological and meteorological data in the catchment area; (2) obtaining the tree structure of meteorological stations in the catchment area; (3) rainfall-runoff spatiotemporal long short-term memory; (4) rainfall-runoff spatiotemporal long short-term memory network training; (5) comparison and evaluation of rainfall-runoff prediction performance.
[0076] The specific steps include:
[0077] Step 1: Prepare rainfall data, runoff data and ground elevation DEM data in the catchment area, and check the quality of rainfall data and runoff data to fully ensure the prediction accuracy of rainfall runoff.
[0078] The runoff data from the hydrological stations in the catchment area, the rainfall data from the meteorological stations and the ground elevation DEM data of the catchment area are collected, and the rainfall data and runoff data are selected as the influencing factors (input) and decision variables (output) of rainfall-runoff prediction respectively.
[0079] After collecting the rainfall data and runoff data in each catchment area, the quality of the rainfall data and runoff data is checked, and the missing data and erroneous data in the rainfall data and runoff data are replaced using a sliding time window to ensure that the input data and output data quality of the rainfall-runoff prediction model meet the prediction requirements.
[0080] In this embodiment, a watershed is selected as an embodiment to elaborate on the method proposed in the present invention. The watershed has 16 meteorological stations and 1 hydrological station. Prepare the rainfall data, runoff data and ground elevation DEM data in the watershed, and check the quality of the rainfall data and runoff data to fully ensure the prediction accuracy of rainfall runoff; collect the runoff data of the hydrological station in the watershed, the rainfall data of the meteorological station and the ground elevation DEM data of the watershed, and select the rainfall data and runoff data as the influencing factors (input) and decision variables (output) of rainfall runoff prediction respectively; after collecting the rainfall data and runoff data in each watershed, check the quality of the rainfall data and runoff data, and use the sliding time window to replace the missing data and erroneous data in the rainfall data and runoff data to ensure that the quality of the input data and output data of the rainfall runoff prediction model meets the prediction requirements.
[0081] Step 2: Divide the predicted area into different sub-basins according to the ground elevation of the catchment area, such as Figure 2 As shown in the figure, the catchment area can be divided into two sub-basins, gray and white, and the tree structure of the catchment area is obtained according to the correlation between the sub-basins.
[0082] Secondly, according to the ground elevation (DEM data) of the catchment area and the location coordinate information of each meteorological station in the catchment area, the tree structure of each meteorological station in the catchment area is obtained.
[0083] The ground elevation (DEM data) in each catchment area is used to divide the catchment area into sub-basins, and the catchment area is divided into individual sub-basins, and each sub-basin is numbered, such as Figure 2 As shown, the weather stations are numbered 1-16.
[0084] According to the location coordinates of each meteorological station in the catchment area, each meteorological station is divided into its corresponding sub-basin, and the meteorological stations are numbered according to the number of the sub-basin where each meteorological station is located, such as Figure 2 As shown, the weather stations are numbered 1-16.
[0085] The catchment area is converted into a tree structure according to the correlation between each sub-basin, and each node of the tree structure is determined.
[0086] Step 3: Construct a rainfall-runoff spatiotemporal long-term and short-term memory network to predict runoff data using the spatiotemporal rainfall data in the catchment area.
[0087] S3.1. Construct a rainfall-runoff spatiotemporal long-short-term memory network as a rainfall-runoff prediction model. Each spatiotemporal long-short-term memory network unit corresponds to a meteorological station in the catchment area, and receives the hidden representation of the meteorological station's own rainfall data from the previous time step, as well as the hidden representation of the rainfall data of the meteorological station in the previous sub-basin in the catchment area at the current time step. Figure 3 Shown is a schematic diagram of the rainfall-runoff spatiotemporal long-term and short-term memory network.
[0088] The runoff data in the catchment area is obtained by inputting the rainfall data of each meteorological station in the catchment area and considering the spatial distribution prediction of each meteorological station.
[0089] The runoff in the watershed is not only related to the time dimension of the rainfall data at each meteorological station (i.e., the contextual information of the rainfall data), but also to the spatial dimension of the rainfall data at each meteorological station (i.e., the spatial dependence of different rainfall data). In order to better capture the temporal dependence of rainfall data at different times and the spatial dependence of different meteorological stations at the same time, the present invention constructs a rainfall-runoff spatiotemporal long-short-term memory network using a recursive neural network. Each spatiotemporal long-short-term memory network unit corresponds to a meteorological station in the watershed, receives the hidden representation of the rainfall data of the meteorological station itself from the previous time step, and the hidden representation of the rainfall data of the meteorological station in the previous sub-basin in the watershed at the current time step.
[0090] For a single recurrent unit, there is an input gate i t , forget gate f t , output gate o t , the internal storage unit state c t And the hidden state h t . Input gate i t Controls the contribution of newly arrived input data at time step t to update the memory cell, while the forget gate f t Determine the previous state (c t-1 ) helps to derive the current state (c t ). Output gate o t Learn how to derive the output of the LSTM cell at the current time step from the current state of the internal memory cell. These gates and states can be obtained as follows:
[0091]
[0092] c t =i t ☉μ t +f t ☉ct-1
[0093] h t =o t ☉tanh(c t )
[0094] Among them, x t is the input at time step t, μ t is the modulation input, ⊙ represents the product of elements, is an affine transformation. d is the size of the internal storage unit, D is x t size.
[0095] S3.1.2. Input the rainfall data of each meteorological station in the catchment area into the spatiotemporal long short-term memory network unit corresponding to each meteorological station to obtain the spatiotemporal information of the rainfall data of each meteorological station in the catchment area.
[0096] The rainfall data of each weather station in the catchment area are expressed as x j,t Represents, where j∈{1,…,J}, t∈{1,…,T}, j represents the jth meteorological station in the catchment area, t represents the rainfall data of each meteorological station in the catchment area at time t, J represents the total number of meteorological stations in the catchment area, and T represents the total time of rainfall data of each meteorological station in the catchment area.
[0097] The input data of each rainfall-runoff spatiotemporal LSTM network unit includes: j,t 、h j-1,t and h j,t-1 , x j,t Indicates the rainfall data of the weather station corresponding to the current time step, h j-1,t represents the hidden representation of the neighboring weather stations at the current time step, h j,t-1 represents the hidden representation of the same weather station at the previous time step.
[0098] S3.1.3. After the input data enters each rainfall-runoff spatiotemporal long-term memory network unit, each rainfall-runoff spatiotemporal long-term memory network unit processes the contextual information of the rainfall data in both time and space dimensions.
[0099] Each rainfall runoff spatiotemporal LSTM network unit has two forget gates and Forget Gate The context information of rainfall data at each meteorological station in the catchment area is processed in the time dimension, and the forget gate The contextual information of rainfall data at each meteorological station in the catchment area is processed in the spatial dimension. The transition equation of the rainfall-runoff spatiotemporal long-term memory network unit is expressed as:
[0100]
[0101]
[0102] h j,t =o j,t ☉tanh(c j,t )
[0103] S3.2, such as Figure 4 As shown, according to the tree structure of each meteorological station, the traversal starts from the root node of the tree structure, and the rainfall data at the root node and each leaf node of the tree structure are input into the rainfall-runoff spatiotemporal long-term memory network in turn.
[0104] After the meteorological stations in each sub-basin in the catchment area are converted into a tree-based graph structure, the rainfall data of each meteorological station is input into the rainfall-runoff spatiotemporal long-term memory network, which can better utilize the known interdependencies between the meteorological stations in the catchment area and improve the accuracy of rainfall-runoff prediction. However, the importance of rainfall data of meteorological stations in different sub-basins in the catchment area is different. For example, the rainfall data of meteorological stations closer to the catchment outlet has a greater impact on runoff. In the tree structure, these nodes can usually be regarded as root nodes. Although the correlation between the locations of each meteorological station can be better utilized after each meteorological station in the catchment area is converted into a tree structure, the rainfall data of the meteorological station tree structure cannot be directly input into the rainfall-runoff spatiotemporal long-term memory network. In order to better capture the spatiotemporal information of rainfall data from different meteorological stations, the present invention proposes a bidirectional tree traversal method. For the input of rainfall data of each meteorological station in a single time step, it can be divided into 4 steps.
[0105] S3.2.1. Input the rainfall data of the meteorological station at the root node of the tree structure into its corresponding rainfall-runoff spatiotemporal long-term and short-term memory network unit.
[0106] S3.2.2 traverses the tree structure in depth-first order, and inputs the rainfall data of the meteorological station at each leaf node into its corresponding rainfall runoff spatiotemporal long-short-term memory network unit in turn.
[0107] S3.2.3 After traversing to the leaf node of the tree structure, the tree structure is backtracked in reverse depth-first order, and the rainfall data of the meteorological station at each leaf node of the tree structure is input into the corresponding rainfall runoff spatiotemporal long-short-term memory network unit in turn.
[0108] S3.2.4 After traversing back to the root node of the tree structure, the input of rainfall data of each meteorological station in the entire catchment area at this time step is completed. Continue to input rainfall data of each meteorological station in the catchment area at the next time step, and repeat steps S3.2.1-3.2.4.
[0109] In the structure tree traversal scheme proposed by the present invention, the rainfall data at each meteorological station in the structure tree is input twice into the rainfall-runoff spatiotemporal long-term memory network unit, which can ensure that the context information of the rainfall data at each meteorological station is transmitted in the adjacent structure of the structure tree in two directions, from top to bottom and from bottom to top. In other words, each meteorological station can obtain context information from the ancestors and descendants in the hierarchical structure defined by the tree structure. Obviously, the tree structure traversal strategy utilizes the adjacency structure of the meteorological stations and can find stronger long-term spatial dependencies within the catchment area.
[0110] By stacking multiple layers of tree-structured rainfall runoff spatiotemporal long short-term memory networks, the network structure can be made deeper, which can further improve the representation ability of the rainfall runoff spatiotemporal long short-term memory network.
[0111] At each time step when the rainfall data is input into the rainfall-runoff spatiotemporal long short-term memory network unit, the input is limited to the rainfall data of a single meteorological station in one time step, and its dimension is smaller than that of using serial input features. Therefore, the rainfall-runoff spatiotemporal long short-term memory network proposed in the present invention has fewer learning parameters. The learning model can be regarded as a weight sharing regularization, which can generalize better when the training sample data set is relatively small. S3.3. After the rainfall data of each meteorological station is input into the rainfall-runoff spatiotemporal long short-term memory network unit, a trust function is introduced to predict accurate and reliable rainfall data based on the available contextual information, such as Figure 5 shown.
[0112] Affected by the error in rainfall data monitoring and collection, the rainfall data of each meteorological station in the catchment area may have certain errors. In order to improve the accuracy of rainfall runoff prediction in the catchment area, the present invention adds an additional gate in each rainfall runoff spatiotemporal long short-term memory network unit to estimate the reliability of rainfall input data based on the output data derived from the available context information of rainfall data at each meteorological station in the catchment area at each spatiotemporal step. In each spatiotemporal step, the context information h j-1,t and h j,t-1 To predict the input rainfall data x j,t , divided into 3 steps.
[0113] S3.3.1. Add a new mechanism to each rainfall-runoff spatiotemporal LSTM network to predict the input rainfall data of the rainfall-runoff spatiotemporal LSTM network unit at each spatiotemporal step. The prediction of the input rainfall-runoff data of each rainfall-runoff spatiotemporal LSTM network unit is expressed as:
[0114]
[0115] Where M p Is to transfer data from Map to Affine transformation of , so the dimensions are d, h j,t-1 represents the hidden representation of the same weather station in the previous time step, h j-1,t Represents the hidden representation of the neighboring weather stations at the current time step. Note that the context information of each spatiotemporal step contains not only the representation of the previous time step, but also the hidden state of the previous spatial step. This shows that the long-term context information of the same weather station in the previous time step and other weather stations in the current time step has been seamlessly merged. Therefore, the prediction function can predict reasonable input rainfall data prediction values;
[0116] S3.3.2. In each rainfall runoff spatiotemporal long short-term memory network unit, the predicted rainfall data input value is compared with the actual rainfall data input value, and a trust gate is added to the network unit. The trust gate is trained using the error between the predicted value and the actual value of the input rainfall data. After activation, the trust gate can help the rainfall runoff spatiotemporal long short-term memory network unit better decide when and how to remember or forget the contents of the storage unit. The vector in activates the trust gate, and the trust gate τ j,t The calculation of is as follows:
[0117] x′ j,t =tanh(M x (x j,t ))
[0118] T j,t =G(p j,t -x′ j,t )
[0119] In the formula, is an affine transformation, and the activation function G(·) is calculated as G(z)=exp(-λz 2 ), where λ is a parameter that controls the bandwidth of the Gaussian function (λ>0). If z has a large absolute value, a smaller response is produced; if z is close to zero, a larger response is produced.
[0120] After adding the trust gate in each rainfall runoff spatiotemporal long short-term memory network unit, the status of each rainfall runoff spatiotemporal long short-term memory network unit is updated as follows:
[0121]
[0122] In the formula, i j,t Represents the state value of the trust gate, u j,t Indicates the state value of the update gate, represents rainfall data in the time dimension, c j-1,t Represents the rainfall data of the previous node (in space), represents rainfall data in spatial dimension, c j,t-1 Indicates the rainfall data at the previous moment (in time).
[0123] If the input rainfall data x j,t is unreliable, the rainfall runoff spatiotemporal long short-term memory network relies more on its historical information and tries to organize new rainfall data input at this time step; if the input rainfall data x j,t If it is credible, the storage unit of the rainfall-runoff spatiotemporal long short-term memory network is updated according to the input rainfall data;
[0124] S3.4. At each time step, the rainfall data in each rainfall-runoff spatiotemporal long-term short-term memory network unit is feature fused, and the runoff data in the catchment area is predicted using the feature-fused rainfall data.
[0125] The specific operations are as follows:
[0126] S3.4.1. In a single rainfall-runoff spatiotemporal LSTM network, the temporal and spatial information of rainfall data at each meteorological station in the catchment area are integrated to obtain the runoff prediction value of a single rainfall-runoff spatiotemporal LSTM network.
[0127] like Figure 7 and Figure 8 As shown in Figure 2, at each time step, the spatiotemporal rainfall data of each meteorological station in the catchment area are input into the rainfall-runoff spatiotemporal long short-term memory network unit. represents the spatiotemporal rainfall data of the jth meteorological station in the catchment area at the tth time step, where represents the rainfall value at the jth meteorological station in the catchment area at the tth time step, The location information (longitude, latitude, elevation and structure tree number) of the jth meteorological station in the catchment area at the tth time step, and The inputs are fed into their corresponding rainfall-runoff spatiotemporal long short-term memory network units.
[0128] In each rainfall runoff spatiotemporal LSTM network unit, an input gate is included About time and space The forget gate and trust gate and processing spatiotemporal rainfall data and The spatiotemporal rainfall data and The unit representation After inputting the spatiotemporal rainfall data, the output of each rainfall-runoff spatiotemporal long short-term memory network is calculated based on the multimodal context information of the two sets of modal features, and the output gate (o j,t )control.
[0129] Spatiotemporal rainfall data For example, when inputting spatiotemporal rainfall data With the help of The corresponding input gate, forget gate, and trust gate can more effectively learn how to update its current unit state Specifically, for new spatiotemporal rainfall data input The spatial and temporal long short-term memory network unit of rainfall runoff needs to consider not only the spatial and temporal rainfall data when predicting contextual information, and also consider spatiotemporal rainfall data Therefore, the trust gate Evaluating spatial and temporal rainfall data Greater reliability capabilities.
[0130] The formula of rainfall-runoff spatiotemporal long short-term memory network with integrated multimodal feature fusion is as follows:
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138] S3.4.2, using rainfall data after fusion of the characteristics of each rainfall-runoff spatiotemporal long-term and short-term memory network unit,
[0139] Predict the runoff data for the catchment at this time step.
[0140] Step 4: Train and test the rainfall-runoff spatiotemporal long-short-term memory network, and set the model parameters to ensure that the model can accurately predict rainfall runoff in the catchment area.
[0141] S4.1. Determine the learnable parameters and hyperparameters of the rainfall-runoff spatiotemporal long-short-term memory network to train and test the rainfall-runoff prediction model and ensure that the rainfall-runoff prediction model can accurately output the runoff data within the catchment area.
[0142] The number of rainfall-runoff spatiotemporal long-term memory network units is determined according to the number of meteorological stations J in the catchment area. Each meteorological station in the catchment area corresponds to a rainfall-runoff spatiotemporal long-term memory network unit.
[0143] S4.2. Determine the rainfall runoff prediction performance evaluation index of the rainfall runoff spatiotemporal long short-term memory network to ensure that the rainfall runoff spatiotemporal long short-term memory network can be effectively trained to obtain a rainfall runoff prediction model that meets the accuracy requirements.
[0144] The rainfall runoff spatiotemporal long short-term memory network uses a softmax layer to predict the runoff value, and the objective function is as follows:
[0145]
[0146] In the formula, Represents the negative log likelihood loss, which is used to represent the runoff prediction value at each spatiotemporal step The difference between the actual value of runoff.
[0147] S4.3. Input the rainfall data of each meteorological station in the catchment area into the rainfall-runoff spatiotemporal long-term memory network, train and test the rainfall-runoff spatiotemporal long-term memory network, and ensure that the output data of the rainfall-runoff spatiotemporal long-term memory network (i.e., the runoff data of the catchment area) can accurately reflect the actual rainfall-runoff situation in the catchment area.
[0148] Select k real observation data of rainfall runoff in the catchment area to train the proposed rainfall runoff spatiotemporal long short-term memory network, and obtain k likelihood function values through k training. Choose the hyperparameter combination that produces the highest likelihood function value among all The median hyperparameter basis is used as the hyperparameter of the rainfall-runoff spatiotemporal long short-term memory network.
[0149] Step 5: Select the spatiotemporal rainfall and runoff data in a typical catchment area, use the rainfall-runoff spatiotemporal long-short-term memory network to predict the rainfall-runoff in the catchment area, and evaluate the prediction performance of the model.
[0150] The dimension of the rainfall runoff LSTM network unit is the number of meteorological stations J in the catchment area. The hidden state length of each rainfall runoff LSTM network unit is set to 48. In order to avoid overfitting, the exit rate of each rainfall runoff spatiotemporal LSTM network is set to 0.05, the learning rate is set to 0.01, and the number of samples of each batch of spatiotemporal rainfall data is set to 128. The rainfall runoff spatiotemporal LSTM network uses a softmax layer to predict the runoff value.
[0151] W real rainfall data in the catchment area are selected and input into the rainfall-runoff spatiotemporal long-short-term memory network and the rainfall-runoff long-short-term memory network respectively to predict the runoff value of the catchment area. After predicting the runoff value of the catchment area, the likelihood loss values of the rainfall-runoff spatiotemporal long-short-term memory network and the rainfall-runoff long-short-term memory network are calculated using the W real runoff data in the catchment area to evaluate the prediction performance of the rainfall-runoff spatiotemporal long-short-term memory network.
[0152] In order to further evaluate and analyze the rainfall-runoff prediction performance of the proposed method, the rainfall data in the catchment area were input into the rainfall-runoff spatiotemporal long-short-term memory network in different ways to predict the runoff value in the catchment area. The prediction performance of different rainfall data input methods was evaluated and analyzed based on the model prediction results.
[0153] The prediction performance of the rainfall-runoff spatiotemporal long-term memory network was further evaluated and analyzed by changing the way of inputting the spatiotemporal rainfall data of each meteorological station in the catchment area into the rainfall-runoff spatiotemporal long-term memory network. The spatiotemporal rainfall data input methods mainly include the following: ① Input the rainfall data of each meteorological station into the rainfall-runoff spatiotemporal long-term memory network in a simple chain sequence, and remove the trust gate in each rainfall-runoff spatiotemporal long-term memory network unit; ② Input the rainfall data of each meteorological station into the rainfall-runoff spatiotemporal long-term memory network in a simple chain sequence, and retain the trust gate in each rainfall-runoff spatiotemporal long-term memory network unit; ③ Input the spatiotemporal rainfall data of each meteorological station into the rainfall-runoff spatiotemporal long-term memory network in a structure tree traversal manner, and remove the trust gate in each rainfall-runoff spatiotemporal long-term memory network unit. The rainfall-runoff spatiotemporal long-term memory network was trained and tested using the real observation data of k rainfall runoff in the catchment area to ensure that the predicted value of the rainfall-runoff spatiotemporal long-term memory network unit can reflect the real runoff changes.
[0154] W real rainfall data in the catchment area are selected, and the rainfall data are input into the rainfall-runoff spatiotemporal long-term memory network in three different ways to predict the runoff value of the catchment area. After predicting the runoff value of the catchment area, the likelihood function loss values of the three different ways are calculated using the W real runoff data in the catchment area, and compared with the likelihood loss value of the rainfall-runoff spatiotemporal long-term memory network. The rainfall-runoff prediction performance of the rainfall-runoff spatiotemporal long-term memory network is evaluated and analyzed, and the likelihood function loss values are compared and evaluated. The smaller the likelihood function loss value, the higher the accuracy.
Claims
1. A rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal, characterized in that: The steps include: Step 1: Prepare rainfall data, runoff data and ground elevation DEM data in the catchment area, and check the quality of rainfall data and runoff data; Step 2: divide the watershed of the prediction area according to the ground elevation of the watershed, divide the watershed into different sub-watersheds, and obtain the tree structure of the watershed according to the correlation between the sub-watersheds; Step 3: Construct a rainfall-runoff spatiotemporal long-term and short-term memory network as a rainfall-runoff prediction model: The steps are as follows: S3.
1. Construct a rainfall-runoff spatiotemporal long-short-term memory network as a rainfall-runoff prediction model, and obtain the runoff data in the catchment area by inputting the rainfall data of each meteorological station in the catchment area and considering the spatial distribution of each meteorological station; S3.2, according to the tree structure of each meteorological station, traverse from the root node of the tree structure, and input the rainfall data at the root node and each leaf node of the tree structure into the rainfall-runoff spatiotemporal long-term memory network in turn; S3.3, after the rainfall data of each weather station is input into the rainfall-runoff spatiotemporal long short-term memory network unit, a trust function is introduced to predict accurate and reliable rainfall data based on the available contextual information; The operation steps of step S3.3 are as follows: S3.3.
1. The prediction of rainfall runoff data input to each rainfall runoff spatiotemporal LSTM network unit is expressed as: ; In the formula, Is to transfer data from Map to The affine transformation of represents the hidden representation of the same weather station in the previous time step, represents the hidden representation of the neighboring weather stations at the current time step, Represents the dimension of rainfall data; S3.3.
2. In each rainfall-runoff spatiotemporal long-term short-term memory network unit, the predicted rainfall data input value is compared with the actual rainfall data input value, and a trust gate is added to the network unit. The trust gate is trained using the error between the predicted value and the actual value of the input rainfall data. The vector in activates the trust gate, which The calculation of is as follows: ; ; In the formula, Is to transfer data from Affine transformation; Represents the input rainfall data; and Respectively represent the status value and update value of rainfall data; Activation Function is calculated as Element-wise operation, where is the parameter that controls the bandwidth of the Gaussian function, >0; Represents rainfall data at each moment; After adding the trust gate in each rainfall runoff spatiotemporal long short-term memory network unit, the status of each rainfall runoff spatiotemporal long short-term memory network unit is updated as follows: ; In the formula, Indicates the state value of the trust gate, Indicates the state value of the update gate, Represents rainfall data in the time dimension, Indicates the rainfall data of the previous node, Represents rainfall data in spatial dimensions, Indicates the rainfall data at the previous moment; S3.4, at each time step, feature fusion is performed on the rainfall data in each rainfall-runoff spatiotemporal long-term memory network unit, and the runoff data in the catchment area is predicted using the feature-fused rainfall data; Step 4: Train and test the rainfall-runoff spatiotemporal long-term and short-term memory network and set the model parameters; Step 5: Select the spatiotemporal rainfall and runoff data in a typical catchment area, use the rainfall-runoff spatiotemporal long-short-term memory network to predict the rainfall-runoff in the catchment area, and evaluate the prediction performance of the model.
2. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: The operation steps of step one are as follows: S1.
1. Collect runoff data from hydrological stations, rainfall data from meteorological stations and ground elevation DEM data of the catchment area, and select rainfall data and runoff data as influencing factors and decision variables for rainfall-runoff prediction respectively; S1.
2. After collecting the rainfall data and runoff data in each catchment area, check the quality of the rainfall data and runoff data, and use a sliding time window to replace the missing data and erroneous data in the rainfall data and runoff data.
3. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: The operation steps of step 2 are as follows: S2.
1. Use the ground elevation DEM data in each catchment area to divide the catchment area into sub-basins, divide the catchment area into individual sub-basins, and number each sub-basin; S2.2, according to the location coordinates of each meteorological station in the catchment area, divide each meteorological station into its corresponding sub-basin, and number the meteorological stations according to the number of the sub-basin where each meteorological station is located; S2.
3. After traversing to the leaf node of the river network tree structure, backtrack in the river network tree structure in reverse depth-first order.
4. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: The operation steps of step S3.1 are as follows: S3.1.
1. Construct a long short-term memory network based on time series, and obtain the runoff time series data of the catchment area by inputting the spatiotemporal rainfall data of each meteorological station in the catchment area; S3.1.2, inputting the rainfall data of each meteorological station in the catchment area into the spatiotemporal long short-term memory network unit corresponding to each meteorological station, and obtaining the spatiotemporal information of the rainfall data of each meteorological station in the catchment area; S3.1.
3. After the input data enters each rainfall-runoff spatiotemporal long-term memory network unit, each rainfall-runoff spatiotemporal long-term memory network unit processes the contextual information of the rainfall data in both time and space dimensions.
5. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: The operation steps of step S3.2 are as follows: S3.2.
1. Input the rainfall data of the meteorological station at the root node of the tree structure into the corresponding rainfall-runoff spatiotemporal long-term short-term memory network unit; S3.2.2, traverse the tree structure in depth-first order, and input the rainfall data of the meteorological station at each leaf node into the corresponding rainfall-runoff spatiotemporal long-term short-term memory network unit in turn; S3.2.3, after traversing to the leaf node of the tree structure, the tree structure is backtracked in reverse depth-first order, and the rainfall data of the meteorological station at each leaf node of the tree structure is input into the corresponding rainfall-runoff spatiotemporal long-short-term memory network unit in turn; S3.2.
4. After back-traversing to the root node of the tree structure, end the input of rainfall data of each meteorological station in the entire catchment area at that time step, continue to input rainfall data of each meteorological station in the catchment area at the next time step, and repeat steps S3.2.1 to S3.2.
4.
6. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: The operation steps of step S3.4 are as follows: S3.4.
1. In a single rainfall-runoff spatiotemporal LSTM network, the temporal and spatial information of rainfall data at each meteorological station in the catchment area is integrated to obtain the runoff prediction value of the single rainfall-runoff spatiotemporal LSTM network; At each time step, the spatiotemporal rainfall data of each meteorological station in the catchment area are input into the rainfall-runoff spatiotemporal long-term short-term memory network unit. Indicates the catchment area The weather station Spatiotemporal rainfall data of time steps, where Indicates the catchment area The weather station The rainfall value of the time step, within the catchment area The weather station The position information of each time step, and The inputs are fed into the corresponding rainfall-runoff spatiotemporal long short-term memory network units respectively; In each rainfall runoff spatiotemporal LSTM network unit, an input gate is included About time and space The forget gate and trust gate and processing spatiotemporal rainfall data and The two sets of heterogeneous modal characteristics of the spatiotemporal rainfall data and The unit representation Put together to establish the multimodal context information of the two sets of modal features. After inputting the spatiotemporal rainfall data, the output of each rainfall runoff spatiotemporal long short-term memory network is calculated according to the multimodal context information of the two sets of modal features, and the output gate shared by the two sets of features is control; S3.4.
2. Use the rainfall data after the characteristics of each rainfall-runoff spatiotemporal long-term short-term memory network unit are fused to predict the runoff data of the catchment area at that time step.
7. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: The operation steps of step 4 are as follows: S4.
1. Determine the learnable parameters and hyperparameters of the rainfall-runoff spatiotemporal long short-term memory network; S4.
2. Determine the rainfall-runoff prediction performance evaluation index of the rainfall-runoff spatiotemporal long-short-term memory network; S4.
3. Input the rainfall data of each meteorological station in the catchment area into the rainfall-runoff spatiotemporal long-term memory network, and train and test the rainfall-runoff spatiotemporal long-term memory network.
8. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 7 is characterized in that: In step S4.1, the learnable parameter refers to the runoff value, and the hyperparameter refers to the likelihood function value; In step S4.2, the rainfall runoff spatiotemporal long short-term memory network uses a softmax layer to predict the runoff value, and the objective function is as follows: ; In the formula, Represents the negative log likelihood loss, which is used to represent the runoff prediction value at each spatiotemporal step The true value of runoff The difference between Indicates the number of weather stations within the catchment area It represents the total time of rainfall data of each weather station in the catchment area; In step S4.3, the real observed data of k rainfall runoff in the catchment area are selected to train the proposed rainfall runoff spatiotemporal long short-term memory network, and k likelihood function values are obtained through k training. , select the combination of hyperparameters that produces the highest likelihood function value The median hyperparameter basis is used as the hyperparameter of the rainfall-runoff spatiotemporal long short-term memory network.
9. The rainfall runoff prediction method based on spatiotemporal long short-term memory network and tree structure traversal according to claim 1 is characterized in that: In step 5, select the catchment area The real rainfall data were input into the rainfall-runoff spatiotemporal long-short-term memory network and the rainfall-runoff long-short-term memory network respectively to predict the runoff value of the catchment area. The real runoff data were used to calculate the likelihood loss values of the rainfall-runoff spatiotemporal LSTM network and the rainfall-runoff LSTM network, and the prediction performance of the rainfall-runoff spatiotemporal LSTM network was evaluated.
Citation Information
Patent Citations
Basin pollutant flux prediction method based on LSTM-BP space-time combination model
CN111639748A
Rainfall-runoff space-time relation simulation method based on long short-term memory neural network
CN113837352A