A watershed runoff forecasting method integrating attention mechanism and physical recurrent neural network

By introducing attention mechanisms and meteorological driver factors into physical recursive neural networks, the contribution weight of the water reservoir to runoff is dynamically quantified, which solves the shortcomings of the existing runoff prediction methods in intermediate flux constraints and meteorological factor modeling, and improves the prediction accuracy and adaptability of the model.

CN120258259BActive Publication Date: 2025-08-29HOHAI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510745484.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-08-29
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

The existing runoff prediction methods have shortcomings in insufficient intermediate flux constraints, lack of meteorological factor modeling and limitations in static parameter setting, which affect the model's adaptability and prediction performance in complex hydrological situations.

Method used

Fusion of attention mechanism and physical recursive neural networks, dynamically quantify the contribution weight of water reservoirs to runoff generation, and combine with a meteorologically driven dynamic parameterized network to improve the physical consistency and generalization capabilities of the model.

Benefits of technology

The model's expression ability and prediction performance of hydrological mechanisms are enhanced, and the prediction accuracy and stability in complex hydrological situations are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258259B_ABST
    Figure CN120258259B_ABST
Patent Text Reader

Abstract

This invention discloses a basin runoff forecasting method that integrates an attention mechanism with a physical recurrent neural network. The method collects historical hydrometeorological and geographic attribute data from the basin under study, selects a daily-scale hydrological model, and clarifies the model's intermediate fluxes and state variables. A PRNN recurrent network structure with physical mechanism constraints is constructed, into which a temporal attention mechanism is introduced to dynamically estimate the relative contribution weights of different water storage state variables to runoff simulation. Using hydrometeorological driving factors and basin geographic attributes as input, the model's internal physical parameters are simulated and generated, and the parameters are collaboratively optimized using a backpropagation mechanism combining attention weights and the objective function. Basin runoff forecasting is then performed based on the trained coupled PRNN model. This method enhances the model's physical consistency and hydrological process representation capabilities, effectively improving the interpretability and stability of machine learning models for basin runoff forecasting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the interdisciplinary field of hydrological simulation and machine learning, and specifically to a watershed runoff forecasting method that integrates an attention mechanism and a physical recursive neural network. Background Art

[0002] Runoff prediction is a core task in river basin hydrology, with important scientific significance and application value for water resource management, disaster prevention, and ecological protection. In recent years, global climate change and human activities have exacerbated the uncertainty of hydrological processes, leading to the frequent occurrence of extreme weather events, placing higher demands on traditional prediction methods.

[0003] Currently, runoff prediction methods mainly fall into two categories: (1) hydrological models based on physical processes, which rely on physical mechanisms to simulate key intermediate state variables. They require parameter calibration using historical observation data and perform predictions based on the calibrated models; (2) data-driven machine learning models, which achieve predictions by learning the mapping relationship between input and output variables. They have the advantages of simple modeling and high accuracy. Although both methods have their own effectiveness, they both have limitations: physical models rely on high-quality observation data, have large parameter uncertainties, and lack generalization capabilities; data-driven models lack interpretability and ignore key intermediate variables in the hydrological process, affecting their stability and physical consistency.

[0004] To bridge the gap between the two approaches, a physical-data driven coupled modeling method has been proposed in recent years. Among them, the physical recurrent neural network (PRNN) has initially achieved the integration of physical constraints and deep learning by embedding the update rules of hydrological state variables and explicit physical equations such as water conservation into the neural network structure, and has a certain degree of interpretability and prediction accuracy. However, the existing PRNN model still has the following significant deficiencies: (1) Insufficient constraints on intermediate fluxes: Although it can simulate the main hydrological state variables, it lacks strict physical constraints on intermediate fluxes such as evapotranspiration, fast flow, and base flow, which limits its ability to analyze the internal mechanism of the hydrological system; (2) Lack of meteorological factor modeling: Meteorological factors such as precipitation and temperature have an important regulatory effect on the dynamics of aquifers and runoff responses. The existing model has not effectively reflected the relationship between meteorological driving and hydrological response, which weakens its adaptability under multiple climate conditions; (3) Static parameter setting limitations: Traditional PRNN models generally use fixed parameters, which are difficult to respond to the time-varying changes of meteorological conditions and basin properties, affecting their generalization ability and physical consistency in the context of non-stationary environments and regional heterogeneity.

[0005] Therefore, there is an urgent need to construct a hydrological modeling method that inherits the structural advantages of the physical model and integrates dynamic regulation and intermediate flux analysis capabilities to explicitly characterize the dynamic contribution of the aquifer to runoff generation and improve the model's expression ability and predictive performance in complex hydrological situations. Summary of the Invention

[0006] The purpose of the present invention is to provide a basin runoff forecasting method that integrates the attention mechanism and the physical recursive neural network. The temporal attention mechanism is used to dynamically quantify the contribution weight of each aquifer to runoff generation, and combined with a meteorologically driven dynamic parameterized network to improve the physical consistency, generalization ability and interpretability of the model.

[0007] In order to solve the above technical problems, the present invention provides the following technical solution: a basin runoff forecasting method integrating an attention mechanism with a physical recurrent neural network, the steps of which include:

[0008] Quality inspection and preprocessing of historical hydrological and meteorological data within the study basin were performed to construct a set of hydrological driving factors, including precipitation, temperature, and potential evapotranspiration.

[0009] Standardize the geographic attribute data of the study basin and construct a set of basin geographic attribute factors; the basin geographic attribute factors include topography, climate, vegetation, soil and geological characteristics;

[0010] Constructing a PRNN model; the PRNN model includes an input layer, a PRNN recurrent layer and an output layer;

[0011] Based on the constructed PRNN model, the hydrological driving factor set and the basin geographical attribute factor set are used as input to simulate the internal physical parameters of the PRNN model. Combined with the attention weight allocation in the forward propagation process and the reverse correction based on the objective function, the collaborative optimization of the PRNN model parameters is achieved and the PRNN model is trained.

[0012] Use the trained PRNN model to simulate watershed runoff;

[0013] The performance of the basin runoff and total water storage anomaly simulation results was evaluated based on the trained PRNN model.

[0014] According to the above technical solution, the quality inspection uses a first-class support vector machine method to identify and eliminate outliers, and uses linear interpolation to fill in missing data; the preprocessing converts all processed data into a continuous daily time series.

[0015] According to the above technical solution, the structures of the input layer and output layer of the PRNN model are the same as those of the input layer and output layer in the recurrent neural network RNN.

[0016] According to the above technical solution, the PRNN model construction step includes:

[0017] Select a hydrological model suitable for daily-scale simulation;

[0018] Based on the calculation equations of the hydrological target variables in the selected hydrological model, the activation functions in the RNN recurrent unit in the recurrent neural network are replaced with the physical formulas of the intermediate state variables of the hydrological model and the runoff generation and sink processes, thus constructing a PRNN recurrent network architecture with physical mechanism constraints.

[0019] The weights and biases of the activation functions in the PRNN recurrent network architecture are replaced with physical parameters simulated by a physical parameterized network and updated in the RNN recurrent unit;

[0020] The attention mechanism is introduced into the PRNN recurrent network architecture to construct a PRNN model.

[0021] According to the above technical solution, the selected daily-scale hydrological conceptual model must have a clear division of state variables for aquifers and be able to more completely describe the spatiotemporal migration of water within the basin. Specifically, the selected daily-scale hydrological conceptual model should have a clear division of state variables, namely, various aquifers, such as snowwater reservoirs, snowmelt reservoirs, and water storage in the upper soil layer, to more completely describe the spatiotemporal migration of water within the basin.

[0022] According to the above technical solution, the physical parameterization network takes the hydrological driving factor set and the basin geographical attribute factor set as input, passes through three layers of fully connected layers to simulate the physical parameters inside the PRNN model, and generates dynamic physical parameters respectively. and static physical parameters , and dynamically update the combined weights of static and dynamic parameters at each time step, by weighted fusion of dynamic physical parameters and static physical parameters , to generate the final internal physical parameters of the PRNN model.

[0023] According to the above technical solution, an attention mechanism is introduced into the PRNN recurrent network architecture to learn the relative contribution weights of different state variables to the generation of the target variable at the current moment. The specific steps include:

[0024] All water storage layers involved in the PRNN recurrent network architecture are concatenated into vectors at time t-1, and the vectors are passed through a three-layer fully connected network to obtain the attention score vector. ,Will Normalized to attention weight , to calculate the attention weighted state variable ; Among them, the normalized attention weight Indicates the contribution ratio of each state variable in the current time step. The process is expressed as follows:

[0025] ;

[0026] ;

[0027] ;

[0028] ;

[0029] ;

[0030] ;

[0031] Where, represents the weight matrix of the first fully connected layer, represents the weight matrix of the second fully connected layer, represents the weight matrix of the third fully connected layer, represents the bias term of the first fully connected layer, represents the bias term of the second fully connected layer, represents the bias term of the third fully connected layer, Represents the activation value of the first fully connected layer in the process of calculating the attention weight, Represents the activation value of the second fully connected layer in the process of calculating the attention weight, To calculate the splicing vectors of all aquifers at time t-1, is the vector of the nth water reservoir at time t-1. represents the vector of the first water reservoir at time t-1, The vector representing the second water reservoir at time t-1.

[0032] To prevent the PRNN model from being misled by zero-valued state variables, a masking mechanism is used to assign weights to zero-valued state variables. Specifically, for zero-valued state variables, the corresponding attention score is is assigned a very low value to ensure that after softmax normalization, its attention weight Approaching zero. In addition, a masking mechanism is used to give extremely small weights to state variables close to zero so that they can still play a certain role in the model. The process can be expressed as follows:

[0033] ;

[0034] ;

[0035] ;

[0036] ;

[0037] ;

[0038] Where, represents a mask vector, It is expressed as calculating the splicing vector of all water storage layers at time t-1, represents the indicator function, Represents a commonly used activation function that converts a numerical vector into a probability distribution so that the sum of all elements is 1. represents a part of the masking mechanism used to adjust the raw attention score according to the value of the state variable (primarily zero or non-zero), Represents the adjustment number, which here refers to a very small positive number. Represents the adjusted attention weight.

[0039] The weighted average method is used to weight the original state variable and the attention-weighted state variable to obtain a new state variable. The process is expressed as follows:

[0040] ;

[0041] Where, represents the new state variable after weighting, represents the weighted value, represents the concatenated vector of the water reservoir after weighting by the attention mechanism, Represents the original state variables.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] 1. Existing physical-data-driven coupled models for basin runoff prediction often fail to explicitly characterize the dynamic impact of various aquifers on runoff generation, making it difficult to reveal the internal response mechanisms of complex hydrological processes. This paper introduces a temporal attention mechanism into a physical recurrent neural network (PRNN) architecture to dynamically quantify the relative contributions of different water storage state variables to runoff at each time step. This enhances the model's ability to represent hydrological mechanisms, improving the physical interpretability and modeling stability of the results.

[0044] 2. Existing PRNN models generally use static physical parameter settings, which are difficult to adapt to dynamic changes under meteorological driving conditions, affecting the model's predictive performance in the context of regional heterogeneity and non-stationary climates. This invention introduces meteorological driving factors and watershed geographic attribute factors simultaneously into a physical parameterized network to dynamically generate model parameters, and coordinates them with the attention mechanism to regulate hydrological processes, significantly enhancing the model's adaptability and generalization capabilities to different climate and watershed conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0046] Figure 1 It is a flowchart of the steps of the basin runoff forecasting method that integrates the attention mechanism and the physical recurrent neural network of the present invention. DETAILED DESCRIPTION

[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0048] Based on the historical hydrometeorological data and geographic attribute data of the basin, the present invention conducts data quality inspection and preprocessing to construct a set of hydrological driving factors and geographic attribute factors; selects a hydrological model suitable for daily-scale simulation and clarifies the intermediate process variables and state variables; then embeds the physical equations of the hydrological model into the RNN recurrent unit to construct a PRNN architecture with physical mechanism constraints; then introduces an attention mechanism to learn the contribution weights of different aquifers to runoff generation; finally, based on historical data and geographic attribute input, combines the attention mechanism with objective function correction, optimizes model parameters, and finally uses the trained PRNN model to perform runoff simulation. The specific steps include:

[0049] S1. Quality inspection and preprocessing of historical hydrological and meteorological data of precipitation, temperature, and potential evapotranspiration in the study basin to construct a set of hydrological driving factors;

[0050] Among them, the quality inspection uses the support vector machine (One-Class SVM) method to identify outliers. Specifically, its optimization goal is to minimize the distance from the hyperplane to its nearest normal point (support vector). This can be expressed as the following convex optimization problem:

[0051] ;

[0052] Where, is the normal vector of the hyperplane, is the bias of the hyperplane, is the slack variable, is a user-defined parameter, indicating the upper limit ratio of normal sample points. is the number of sample points, The average distance from the hyperplane to the support vector, i represents a general index variable here, which is used to refer to a specific element in a set (such as a sample point set or a data set).

[0053] The process of data cleaning for the identified abnormal data is expressed by the following formula:

[0054] ;

[0055] Where, is the original data point, Indicates unavailable data.

[0056] The linear interpolation method is used to fill the missing data points. This method is based on the linear relationship and estimates the value of the missing data points according to the linear changes between known data points.

[0057] The linear interpolation formula is expressed as follows:

[0058] ;

[0059] Where, is a missing data point, and are adjacent known data points, Timestamps of missing data points, and are the timestamps of adjacent data points.

[0060] S2. Standardize the geographic attribute data within the study basin and construct a set of basin geographic attribute factors. The preprocessing converts all processed data into a continuous daily time series.

[0061] S3. Build a PRNN model. The PRNN model includes an input layer, a PRNN loop layer, and an output layer.

[0062] Among them, the structure of the input layer and output layer of the PRNN model is the same as that of the input layer and output layer in the recurrent neural network RNN.

[0063] The specific steps of the PRNN cycle layer include:

[0064] S301. Select the HBV-6 daily-scale model (hydrological model) suitable for daily-scale simulations and systematically analyze its water transport processes. Clarify the various intermediate process variables involved in the model, including intermediate fluxes (such as actual evapotranspiration) and state variables (such as aquifers). The selected daily-scale conceptual hydrological model should have a clear delineation of state variables (i.e., various aquifers) and be able to fully describe the spatiotemporal migration of water within the basin, such as snowwater reservoirs, snowmelt reservoirs, and supersoil water storage.

[0065] Taking the HBV-6 daily scale model as an example, the core physical model of its hydrological process follows the water balance equation, which is expressed as follows:

[0066] ;

[0067] Where, Indicates time The hydrological reserves, Represents the inflow of the system, Represents the outflow of the system.

[0068] The model divides the hydrological system into multiple interconnected storage units to represent key hydrological processes such as precipitation, snowmelt, evapotranspiration, surface runoff, and groundwater flow. These processes interact and are described through five distinct water storage units, each corresponding to a different physical state: snowpack storage (S1), snowmelt water storage (S2), soil moisture (S3), upper soil storage (S4), and lower soil storage (S5). These storage units are each associated with specific hydrological fluxes (such as inflow and outflow) and the physical parameters that control their dynamics, which together determine the spatiotemporal evolution of the hydrological system.

[0069] (1) Snow accumulation process

[0070] In the HBV-6 model, S1 represents the accumulation and melting of snow, and its dynamic changes are controlled by the combined effects of snowfall, snowmelt, and refreezing. The water balance equation for snow storage can be expressed as:

[0071] ;

[0072] Where, To store water for snowpack, is the snowfall (mm / day), which is determined by both temperature and precipitation; is the snowmelt amount (mm / day), calculated using the degree-day factor method; is the refreezing amount (mm / day), which indicates the process of snowmelt refreezing under low temperature conditions.

[0073] Physical fluxes describe the transformation of water between different states and system components. Key hydrological fluxes in the model include: Precipitation can appear as rain or snow, depending on the temperature. Depending on the temperature threshold, precipitation is classified as rain. and snowfall , the specific expression is as follows:

[0074] ;

[0075] ;

[0076] Where, For the moment Temperature (℃); is the freezing temperature threshold (°C); is the snow correction factor used to correct snowfall data, taking into account site-specific factors such as wind effects and precipitation meter measurement errors. Indicates the melting temperature threshold (°C).

[0077] When the temperature exceeds the snowmelt threshold When , the snow begins to melt. The snowmelt flux calculation formula is as follows:

[0078] ;

[0079] Where, is the snowmelt temperature threshold (°C); It is a degree-day factor, which represents the snowmelt rate per unit temperature change.

[0080] When the air temperature is below freezing, some of the meltwater may refreeze and return to the snowpack. The refreezing flux is calculated as follows:

[0081] ;

[0082] Where, is the refreezing coefficient; The above processes jointly control the dynamic changes of snow cover and affect the hydrological response characteristics of the basin.

[0083] (2) Snow water process

[0084] When the snow melts, the meltwater enters the snow water storage (S2), and its changes are affected by rainfall, infiltration, and excess runoff. The governing equation for snow water storage can be expressed as:

[0085] ;

[0086] Where, Indicates the amount of snow water stored, Indicates rainfall (mm / day); Indicates snowmelt amount (mm / day); Indicates the infiltration rate (mm / day), which refers to the process of snow water seeping into the soil; represents excess water (mm / day), which is generated when snow water storage exceeds its water holding capacity; Indicates the amount of refreezing (mm / day).

[0087] The infiltration of snow water into the soil depends on the water holding capacity of the snowpack, which is calculated as follows:

[0088] ;

[0089] ;

[0090] Where, is the water holding capacity coefficient of snow. When the snow water storage exceeds this capacity, the excess water will form excess water. for Changes in snow water storage.

[0091] Snow water storage at the previous moment When the water holding capacity is exceeded, the excess water is calculated as follows:

[0092] ;

[0093] The generation of excess water can affect the hydrological processes in the basin, especially during periods of intense snowmelt, and has a significant impact on the formation of surface runoff.

[0094] (3) Soil water storage

[0095] Soil water storage (S3) plays a key role in regulating evapotranspiration, groundwater recharge, and surface runoff generation. Soil water is primarily recharged through infiltration and consumed by evapotranspiration and runoff. The soil water balance equation can be expressed as:

[0096] ;

[0097] Where, To store water in the soil, is the infiltration rate (mm / day); is the actual evapotranspiration (mm / day); is the amount of soil water recharged to the lower layer (mm / day).

[0098] When soil water storage exceeds its water holding capacity, excess water seeps into deeper layers and replenishes groundwater. The calculation formula for this process is as follows:

[0099] ;

[0100] Where, is the maximum soil water storage capacity (field capacity); β is the nonlinear coefficient of upper soil recharge.

[0101] Actual evapotranspiration depends on soil water availability and is related to potential evapotranspiration, which is calculated as:

[0102] ;

[0103] Where, is the soil moisture level at which evapotranspiration reaches its potential value; is the potential evapotranspiration (mm / day).

[0104] In the HBV-6 model, potential evapotranspiration is calculated using the Hamon formula, which is expressed as follows:

[0105] ;

[0106] Where, is the sunshine duration (hours); is the saturated water vapor pressure (kPa), which is calculated as follows:

[0107] ;

[0108] Where, Represents temperature (℃).

[0109] (4) Upper soil zone process

[0110] The upper soil zone (S4) is mainly responsible for fast flow and normal flow generated by infiltration. Its water balance equation is expressed as:

[0111] ;

[0112] Where, The amount of water stored in the upper soil layer, is the soil recharge (mm / day); is fast flow (mm / day); is the normal flow into the subsoil zone through infiltration (mm / day).

[0113] When the water storage capacity of the upper soil exceeds a certain threshold, the excess water forms a fast flow, which is calculated as follows:

[0114] ;

[0115] Where, is the fast flow runoff coefficient; is the soil water storage threshold that triggers fast flow.

[0116] Infiltration into the underlying soil occurs as normal flow, which is calculated as follows:

[0117] ;

[0118] Where, is the permeability coefficient.

[0119] (5) Subsoil zone process

[0120] The lower soil zone (S5) mainly controls the formation of base flow and contributes to the groundwater discharge in the basin. Its water balance equation is expressed as:

[0121] ;

[0122] Where, Stores water in the lower soil layer, is the amount of water that infiltrates from the upper soil layer into the lower soil layer (mm / day); is the base flow (mm / day).

[0123] The infiltration flux from the upper soil layer to the lower soil layer is controlled by the maximum infiltration rate, which is calculated as follows:

[0124] ;

[0125] Where, is the maximum permeability.

[0126] The base flow calculation formula for the subsoil is as follows:

[0127] ;

[0128] Where, is the base flow runoff coefficient.

[0129] (6) Total runoff calculation and confluence process

[0130] The total runoff at the basin outlet is represented by the sum of fast flow, normal flow, and base flow, which is calculated as follows:

[0131] ;

[0132] The outflow of the basin is calculated using a time delay function, which is expressed as follows:

[0133] ;

[0134] Where maxbas is the confluence parameter, which is used to characterize the time delay effect from runoff generation to outlet confluence. Represents the total runoff at the outlet of the basin.

[0135] In summary, the input variables of the HBV-6 model include precipitation, temperature, and potential evapotranspiration, and its state variables include five water storage processes: , involving 14 hydrological flux variables .

[0136] S302, constructing a PRNN recurrent layer, the specific steps include obtaining the calculation equations of the hydrological target variables in the selected hydrological model, replacing the activation functions of the RNN recurrent units in the recurrent neural network RNN ​​with the physical formulas of the intermediate state variables and runoff generation and sink processes of the hydrological model, and constructing a PRNN recurrent network architecture with physical mechanism constraints; the weights and biases of the activation functions in the PRNN recurrent network architecture are replaced with physical parameters simulated by the physical parameterized network, and are updated in the RNN recurrent units.

[0137] The basic structure of a recurrent neural network (RNN) consists of an input layer, a recurrent hidden layer, and an output layer. For a hydrological input vector (such as precipitation, temperature, and other meteorological data) at time t, the update of its hidden state follows the following recursive equation:

[0138] ;

[0139] Where, represents the hidden state at time t, is the input vector at time t, The hidden state at the previous moment, and are the input weight matrix and state transfer matrix respectively, is the bias term, Represents the activation function (usually tanh or ReLU). and Represent the transposed matrices of the input weight matrix and the state transition matrix respectively.

[0140] The output layer generates prediction results through a fully connected network:

[0141] ;

[0142] Where, is the output of the recurrent neural network RNN ​​at time t, The hidden state at the current moment, is the output layer weight matrix, which represents the contribution weight of the hidden state features to the predicted target. It is the output layer bias term, which is used to adjust the baseline offset of the predicted value and enhance the flexibility of the model.

[0143] In the loop unit of the PRNN loop layer, the activation function of the original RNN loop unit is Replaced by the physical model intermediate state variables and physical formulas of the runoff process , and the weight of the activation function 、 and deviation Replaced by physical parameters simulated by physical parameterized networks and , and updated in the cycle unit. The intermediate state variables of the physical model and the physical formula of the runoff process Refers to all HBV physical formulas, which are all encoded as components of a single PRNN recurrent unit. Specifically expressed as:

[0144] ;

[0145] ;

[0146] also, Indicates the hidden state at the moment, for physical parameters and In the parameterized network, the hydrological driving factor set Xforce and the basin geographical attribute factor set Xattributes are used as inputs, and the three-layer fully connected layer is used to simulate the physical parameters inside the model to generate dynamic physical parameters respectively. and static physical parameters .

[0147] To balance the influence of static properties and dynamic driving factors, the model sets up two independent parameter generation sub-networks and fuses their outputs through weighted fusion to avoid overfitting. Specifically, the model dynamically updates the combined weights of static and dynamic parameters at each time step to generate the final physical parameters.

[0148] ;

[0149] ;

[0150] Where, is the set of physical parameters after weight balancing in the parameterized network, and are the weights of controlling dynamic driving factors and static attribute factors respectively.

[0151] S303. Introduce an attention mechanism into the PRNN recurrent network architecture to learn the relative contribution weights of different state variables (i.e., aquifers) to the target variable (runoff) at the current moment. The specific steps are as follows:

[0152] All water reservoirs involved in the HBV-6 model are concatenated into vectors at time t-1, and these vectors are passed through a three-layer fully connected network to obtain the attention score vector , and Normalized to attention weight , to calculate the attention weighted state variable , the process can be expressed as follows:

[0153] ;

[0154] ;

[0155] ;

[0156] ;

[0157] ;

[0158] ;

[0159] Where, represents the weight matrix of the first fully connected layer, represents the weight matrix of the second fully connected layer, represents the weight matrix of the third fully connected layer, represents the bias term of the first fully connected layer, represents the bias term of the second fully connected layer, represents the bias term of the third fully connected layer, Represents the activation value of the first fully connected layer in the process of calculating the attention weight, Represents the activation value of the second fully connected layer in the process of calculating the attention weight, To calculate the splicing vectors of all aquifers at time t-1, is the vector of the nth water reservoir at time t-1. represents the vector of the first water reservoir at time t-1, The vector representing the second water reservoir at time t-1.

[0160] Furthermore, in order to prevent the PRNN model from being misled by zero-valued state variables, a masking technique is introduced into the attention mechanism. For a state variable with a value of zero, its corresponding attention score is is assigned a very low value to ensure that after softmax normalization, its attention weight Approaching zero. In addition, a masking mechanism is used to give extremely small weights to state variables close to zero so that they can still play a certain role in the model. The process can be expressed as follows:

[0161] ;

[0162] ;

[0163] ;

[0164] ;

[0165] ;

[0166] Where, represents a mask vector, It is expressed as calculating the splicing vector of all water storage layers at time t-1, represents the indicator function, Represents a commonly used activation function that converts a numerical vector into a probability distribution so that the sum of all elements is 1. represents a part of the masking mechanism used to adjust the raw attention score according to the value of the state variable (primarily zero or non-zero), Represents the adjustment number, which here refers to a very small positive number. Represents the adjusted attention weight.

[0167] Subsequently, a weighted average method is used to combine the original state variables and the attention-weighted state variables in a specific ratio to avoid the loss of key information caused by over-reliance on attention weighting. The process is expressed as follows:

[0168] ;

[0169] Where, represents the new state variable after weighting, represents the weighted value, shows the concatenated vector of the water reservoir after the weighting of the attention mechanism, Represents the original state variables.

[0170] It is directly generated in the PRNN loop, but its main function is to verify TWSA, which is itself weighted by the attention mechanism. and the original state variables The reason for this is that over-reliance on the weight offset of the attention mechanism will affect the risk of the state variables losing their original attributes and data after the attention mechanism is weighted, which may lead to errors when verifying the target variable.

[0171] The attention mechanism mainly acts in the forward transmission process of PRNN, that is, in each time step, attention is weighted for the state variable (aquifer) at that moment, so as to quantify each time period and generate the weights of different state variables, that is, different aquifers for runoff, so as to quantify their contribution to runoff generation.

[0172] Although there are two weightings, both performed in the PRNN loop, the attention mechanism weighting is mainly used to quantify the contribution and obtain the attention score, while the latter weighting is set to reduce the information loss caused by over-reliance on the attention mechanism, and mainly serves the verification of the target variable.

[0173] S4. Based on the constructed PRNN model, the hydrological driving factor set and the basin geographical attribute factor set are used as input to simulate the internal physical parameters of the PRNN model. Combined with the attention weight allocation in the forward propagation process and the reverse correction based on the objective function, the collaborative optimization of the PRNN model parameters is achieved and the PRNN model is trained.

[0174] S5. Use the trained PRNN model to simulate watershed runoff.

[0175] S6, using the Nash coefficient ( NSE ), Root Mean Square Error ( RMSE ), Bayesian relative deviation index ( PBIAS ) The performance of the trained PRNN model for simulation of basin runoff and total water storage anomalies was evaluated.

[0176] in, ;

[0177] ;

[0178] ;

[0179] Where, and represent the simulated and measured runoff values ​​at time i, respectively. is the average value of the measured runoff series, is the length of the data series. NSE reflects the goodness of fit of the simulation results to the observed data, with values ​​ranging from negative infinity to 1, with closer values ​​to 1 indicating a stronger fit. RMSE measures the simulation error; smaller values ​​indicate higher simulation accuracy, while larger deviations indicate more significant errors. PBIAS assesses systematic bias; positive values ​​indicate overestimation, negative values ​​indicate underestimation, and values ​​close to 0 indicate a small overall error.

[0180] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0181] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A basin runoff forecasting method integrating attention mechanism and physical recurrent neural network is characterized by: The steps include: Conduct quality inspection and preprocessing of historical hydrological and meteorological data in the study basin to construct a set of hydrological driving factors; Standardize the geographic attribute data in the study basin and construct a basin geographic attribute factor set; Construct a PRNN model; the PRNN model includes an input layer, a PRNN loop layer and an output layer; the PRNN loop layer construction steps include: Select a hydrological model suitable for daily-scale simulation; the selected daily-scale hydrological conceptual model must have a clear division of aquifer state variables and be able to describe the spatiotemporal migration of water within the basin; Based on the calculation equations of the hydrological target variables in the selected hydrological model, the activation functions in the RNN recurrent unit in the recurrent neural network are replaced with the physical formulas of the intermediate state variables of the hydrological model and the runoff generation and sink processes, thus constructing a PRNN recurrent network architecture with physical mechanism constraints. The weights and biases of the activation functions in the PRNN recurrent network architecture are replaced by physical parameters simulated by a physical parameterized network and updated in the RNN recurrent unit; wherein, the physical parameterized network takes the hydrological driving factor set and the basin geographical attribute factor set as input, passes through three layers of fully connected layers to simulate the physical parameters inside the PRNN model, and generates dynamic physical parameters respectively. and static physical parameters , and dynamically update the combined weights of static and dynamic parameters at each time step, by weighted fusion of dynamic physical parameters and static physical parameters , to generate the final internal physical parameters of the PRNN model; An attention mechanism is introduced into the PRNN recurrent network architecture. The attention mechanism is introduced into the PRNN recurrent network architecture to learn the relative contribution weights of different state variables to the generation of the target variable at the current moment. The specific steps include: All water storage layers involved in the PRNN recurrent network architecture are concatenated into vectors at time t-1, and the vectors are passed through a three-layer fully connected network to obtain the attention score vector. ,Will Normalized to attention weight , to calculate the attention weighted state variable ; Among them, for state variables with zero values ​​or values ​​close to zero, a masking mechanism is used to assign weights; The original state variable and the attention-weighted state variable are weighted using the weighted average method to obtain a new state variable; Based on the constructed PRNN model, the hydrological driving factor set and the basin geographical attribute factor set are used as input to simulate the internal physical parameters of the PRNN model. Combined with the attention weight allocation in the forward propagation process and the reverse correction based on the objective function, the collaborative optimization of the PRNN model parameters is achieved and the PRNN model is trained. Use the trained PRNN model to simulate watershed runoff; The performance of the basin runoff and total water storage anomaly simulation results was evaluated based on the trained PRNN model.

2. The basin runoff forecasting method integrating attention mechanism and physical recurrent neural network according to claim 1 is characterized in that: The quality inspection uses a first-class support vector machine method to identify and eliminate outliers, and uses linear interpolation to fill in missing data; the preprocessing converts all processed data into a continuous daily time series.

3. The basin runoff forecasting method integrating attention mechanism and physical recurrent neural network according to claim 1 is characterized in that: The structure of the input layer and output layer of the PRNN model is the same as that of the input layer and output layer in the recurrent neural network RNN.

Citation Information

Patent Citations

  • Flood forecasting method based on time sequence attention mechanism

    CN112785043A

  • Drainage basin runoff forecasting method based on interpretable machine learning

    CN117689042A