Drainage basin runoff forecasting method fusing attention mechanism and physical recurrent neural network
By introducing attention mechanisms and physical recursive neural networks into runoff prediction, dynamically quantifying the contribution of water reservoirs to runoff, the problems of intermediate flux constraints and insufficient modeling of meteorological factors are solved, and the prediction performance and interpretability of the model are improved.
Patent Information
- Application Number
- CN202510745484.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-05
AI Technical Summary
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 expression ability and prediction performance in complex hydrological situations.
The attention mechanism is integrated with the physical recursive neural network, and the contribution weights of each water storage layer to runoff generation are dynamically quantified through the timing attention mechanism, and combined with the dynamic parameterized network driven by the meteorology, optimize the model parameters.
It enhances the physical consistency, generalization ability and interpretability of the model, and improves the prediction performance in complex hydrological situations.
Smart Images

Figure CN120258259A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the cross - technical field of hydrological simulation and machine learning, and specifically to a basin runoff forecasting method that integrates an attention mechanism and a physical recurrent neural network. Background Art
[0002] Runoff prediction is a core task in basin hydrology and has important scientific significance and application value for water resources management, disaster prevention and ecological protection. In recent years, global climate change and human activities have exacerbated the uncertainty of hydrological processes, with frequent extreme weather events, posing higher requirements for traditional prediction methods.
[0003] Currently, runoff prediction methods mainly include two categories: (1) Hydrological models based on physical processes rely on physical mechanisms to simulate key intermediate state variables, require parameter calibration through historical observation data, and conduct predictions based on the calibrated models; (2) Machine learning models based on data - driven approach achieve predictions by learning the mapping relationship between input and output variables, with advantages such as simple modeling and high accuracy. Although both methods have achieved certain results, they both have limitations: physical models rely on high - quality observation data, have large parameter uncertainties, and insufficient generalization ability; data - driven models lack interpretability, ignore key intermediate variables in the hydrological process, and affect their stability and physical consistency.
[0004] To bridge the gap between the two methods, physical - data driven coupled modeling methods have been proposed in recent years. Among them, the physical recurrent neural network (PRNN) has initially realized the integration of physical constraints and deep learning by embedding explicit physical equations such as hydrological state variable update rules and water conservation into the neural network structure, and has certain interpretability and prediction accuracy. However, the existing PRNN models still have the following significant deficiencies: (1) Insufficient constraint on intermediate fluxes: Although it can simulate the main hydrological state variables, it lacks strict physical constraints on intermediate fluxes such as evapotranspiration, quick flow, and base flow, limiting its ability to analyze the internal mechanism of the hydrological system; (2) Lack of modeling of meteorological factors: Meteorological factors such as precipitation and temperature play an important regulatory role in the dynamics of the aquifer and runoff response. The existing models have not effectively reflected the relationship between meteorological driving and hydrological response, weakening their adaptability under multiple climate conditions; (3) Limitations in static parameter setting: Traditional PRNN models generally adopt fixed parameters, which are difficult to respond to the time - varying changes of meteorological conditions and basin attributes, affecting their generalization ability and physical consistency in non - stationary environments and regional heterogeneity backgrounds.
[0005] Therefore, there is an urgent need to construct a hydrological modeling method that inherits the advantages of the physical model structure, integrates dynamic regulation and the ability to analyze intermediate fluxes, explicitly depicts the dynamic contribution of the aquifer to runoff generation, and improves the expression ability and prediction performance of the model in complex hydrological scenarios. Summary of the Invention
[0006] The object of the present invention is to provide a method for predicting basin runoff by integrating an attention mechanism and a physical recurrent neural network, which dynamically quantifies the contribution weights of each water storage layer to runoff generation through a temporal attention mechanism, and combines a meteorologically driven dynamic parameterization network to improve the physical consistency, generalization ability and interpretability of the model.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: A method for predicting basin runoff by integrating an attention mechanism and a physical recurrent neural network, the steps of which include: Conduct quality inspection and preprocessing on historical hydrometeorological data in the study basin to construct a set of hydrological driving factors; the hydrological driving factors include precipitation, temperature, potential evapotranspiration, etc.; Conduct standardization processing on the geographical attribute data in the study basin to construct a set of basin geographical attribute factors; the basin geographical attribute factors include terrain, climate, vegetation, soil and geological characteristics, etc.; Construct a PRNN model; the PRNN model includes an input layer, a PRNN recurrent layer and an output layer; On the basis of the constructed PRNN model, using the set of hydrological driving factors and the set of basin geographical attribute factors as inputs, simulate the internal physical parameters of the PRNN model, and combine the attention weight allocation in the forward propagation process and the backward correction based on the objective function to realize the collaborative optimization of the PRNN model parameters and train the PRNN model; Use the trained PRNN model to simulate basin runoff; Based on the trained PRNN model, conduct performance evaluation on the simulation results of basin runoff and total water storage anomaly.
[0008] According to the above technical solutions, the quality inspection uses a one-class support vector machine method to identify and remove outliers, and linear interpolation is used to fill in missing data; the preprocessing uniformly converts all processed data into a continuous daily-scale time series.
[0009] According to the above technical solutions, the structures of the input layer and the output layer of the PRNN model are the same as those of the input layer and the output layer in the recurrent neural network RNN.
[0010] According to the above technical solutions, the steps for constructing the PRNN model include: Select a hydrological model suitable for daily-scale simulation; Based on the calculation equation of the hydrological target variable in the selected hydrological model, replace the activation function in the RNN recurrent unit in the recurrent neural network with the physical formula of the intermediate state variable in the hydrological model and the runoff generation and concentration process to construct a PRNN recurrent network architecture with physical mechanism constraints; The weights and biases of the activation function in the PRNN recurrent network architecture are replaced with physical parameters simulated by a physically parameterized network and updated in the RNN recurrent unit; An attention mechanism is introduced into the PRNN recurrent network architecture to construct a PRNN model.
[0011] According to the above technical solution, the selected daily-scale hydrological conceptual model needs to have a clear division of storage layer state variables and be able to relatively completely describe the spatio-temporal migration process of water volume in the basin. Specifically, the selected daily-scale hydrological conceptual model should have a clear division of state variables, namely various storage layers, and be able to relatively completely describe the spatio-temporal migration process of water volume in the basin, such as snowmelt water storage layer, snowmelt water storage layer, upper soil water storage, etc.
[0012] According to the above technical solution, the physically parameterized network takes the hydrological driving factor set and the basin geographical attribute factor set as inputs, and passes through three fully connected layers to simulate the physical parameters inside the PRNN model to generate dynamic physical parameters respectively and static physical parameters , and dynamically update the combined weights of the static and dynamic parameters at each time step, and generate the final internal physical parameters of the PRNN model by weighted fusion of the dynamic physical parameters and static physical parameters .
[0013] 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: Concatenate all the storage layers involved in the PRNN recurrent network architecture at time t-1 into a vector, and pass the vector through a three-layer fully connected network to obtain an attention scoring vector , and normalize it into attention weights to calculate the attention-weighted state variable ; among them, the normalized attention weight represents the contribution ratio of each state variable at the current time step, and its process is as follows: ; ; ; ; ; ; In the formula, 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 during the calculation of the attention weight, represents the activation value of the second fully connected layer during the calculation of the attention weight, is the concatenated vector of all water storage layers at time t - 1, is the vector of the nth water storage layer at time t - 1. represents the vector of the first water storage layer at time t - 1, represents the vector of the second water storage layer at time t - 1.
[0014] To prevent the PRNN model from being misled by zero-valued state variables, for state variables with a value of zero, a masking mechanism is adopted for weight assignment. Specifically, for state variables with a value of zero, their corresponding attention scores are assigned extremely low values to ensure that after softmax normalization, their attention weights approach zero. In addition, a masking mechanism is also used to assign extremely small weights to state variables close to zero, enabling them to still play a certain role in the model. This process can be expressed as follows: ; ; ; ; ; In the formula, represents a mask vector, is the concatenated vector of all water storage layers at time t - 1 for calculation, represents the indicator function, represents a commonly used activation function for converting a numerical vector into a probability distribution such that the sum of all elements is 1. represents a part of the masking mechanism for adjusting the original attention score according to the value of the state variable (mainly zero or non-zero), represents the adjustment number, here referring to a very small positive number, represents the adjusted attention weight.
[0015] The original state variables are weighted with the state variables after attention weighting using a weighted average method to obtain new state variables. This process is expressed as: ; In the formula, represents the new state variable after weighting, represents the weighting value, represents the spliced vector of the aquifer after weighting by the attention mechanism, represents the original state variable.
[0016] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: 1. Existing physical-data driven coupling models usually fail to explicitly depict the dynamic influence of each aquifer on runoff generation in watershed runoff prediction, and it is difficult to reveal the internal response mechanism of complex hydrological processes. By introducing a temporal attention mechanism into the physical recurrent neural network architecture (PRNN), the present invention dynamically quantifies the relative contributions of different storage state variables to runoff at each time step, enhances the model's ability to express hydrological mechanisms, and improves the physical interpretability and modeling stability of the results.
[0017] 2. Existing PRNN models generally adopt static physical parameter settings, which are difficult to adapt to the dynamic changes under meteorological driving conditions and affect the prediction performance of the model under regional heterogeneity and non-stationary climate backgrounds. By simultaneously introducing meteorological driving factors and watershed geographical attribute factors into the physical parameterization network to dynamically generate model parameters and coordinating with the attention mechanism to regulate the hydrological process, the present invention significantly enhances the model's adaptability and generalization ability to different climate and watershed conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention, and do not constitute a limitation to the present invention. In the drawings: Figure 1 is a flowchart of the steps of the method for predicting watershed runoff by integrating the attention mechanism and the physical recurrent neural network of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0020] Based on the historical hydrometeorological data and geographical attribute data of the basin, this invention conducts quality inspection and preprocessing on the data to construct a set of hydrological driving factors and geographical attribute factors; selects a hydrological model suitable for daily-scale simulation and identifies the intermediate process variables and state variables therein; then embeds the physical equations of the hydrological model into the RNN recurrent unit to construct a PRNN architecture with physical mechanism constraints; next, introduces an attention mechanism to learn the contribution weights of different aquifers to runoff generation; finally, based on the input of historical data and geographical attributes, combines the attention mechanism with objective function correction to optimize the model parameters, and finally uses the trained PRNN model for runoff simulation. The specific steps are as follows: S1. Conduct quality inspection and preprocessing on the historical hydrometeorological data of precipitation, temperature, and potential evapotranspiration in the study basin to construct a set of hydrological driving factors; Among them, the quality inspection uses the One-Class SVM method to identify outliers. Specifically, its optimization goal is to minimize the distance from the hyperplane to the nearest normal point (support vector). This can be represented by the following convex optimization problem: ; In the formula, is the normal vector of the hyperplane, is the bias of the hyperplane, is the slack variable, is a user-defined parameter representing the upper limit ratio of normal sample points, is the number of sample points, The average distance from the hyperplane to the support vector, where i represents a general index variable here, used to refer to a specific element in the set (such as the sample point set, data set).
[0021] Clean the identified abnormal data, and its process is represented by the following formula: ; In the formula, is the original data point, represents unavailable data.
[0022] And use the linear interpolation method to fill in the missing data points. This method is based on a linear relationship and estimates the values of the missing data points according to the linear change between the known data points.
[0023] The linear interpolation formula is represented by the following formula: ; In the formula, is the missing data point, and are adjacent known data points, is the timestamp of the missing data point and are the timestamps of adjacent data points.
[0024] S2. Standardize the geographical attribute data within the research basin to construct a set of basin geographical attribute factors. Among them, the preprocessing uniformly converts all processed data into a continuous daily-scale time series.
[0025] S3. Construct a PRNN model, which includes an input layer, a PRNN recurrent layer, and an output layer.
[0026] Among them, the structures of the input layer and the output layer of the PRNN model are the same as those of the input layer and the output layer in the recurrent neural network RNN.
[0027] The specific steps of the said PRNN recurrent layer include: S301. Select the HBV-6 daily-scale model (hydrological model) applicable to daily-scale simulation, and systematically sort out its water volume transmission process, and clarify various intermediate process variables involved in the model, including intermediate fluxes (such as actual evapotranspiration) and state variables (such as water storage layers). The selected daily-scale hydrological conceptual model should have a clear division of state variables (i.e., various water storage layers), and be able to describe the spatio-temporal migration process of water volume within the basin more completely, such as snow water storage layer, snowmelt water storage layer, upper soil water storage, etc.
[0028] Taking the HBV-6 daily-scale model as an example, the core physical model of its hydrological process follows the water balance equation, and the expression is: ; In the formula, represents the hydrological storage at time , represents the inflow of the system, represents the outflow of the system.
[0029] This model divides the hydrological system into multiple interconnected storage units to characterize key hydrological processes such as precipitation, snowmelt, evapotranspiration, surface runoff, and groundwater flow. These processes interact with each other and are described through five different water storage units, each corresponding to a different physical state, including: snow storage (S1), snowmelt water storage (S2), soil moisture (S3), upper soil storage (S4), lower soil storage (S5). The above storage units are respectively related to specific hydrological fluxes (such as inflow, outflow) and physical parameters controlling their dynamic changes, and jointly determine the spatio-temporal evolution characteristics of the hydrological system.
[0030] (1) Snow process 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 of snow storage can be expressed as: ; In the formula, To store water for snowpack, is the snowfall (mm / day), which is determined by both temperature and precipitation; is the amount of snowmelt (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.
[0031] Physical fluxes describe the transformation of water between different states and system components. The 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: ; ; In the formula, For the moment Temperature (℃); is the freezing temperature threshold (℃); is the snow correction factor, which is used to correct the snowfall data, taking into account site-specific factors such as wind effects and precipitation meter measurement errors. Indicates the melting temperature threshold (°C).
[0032] When the temperature exceeds the snowmelt threshold When , the snow begins to melt. The snowmelt flux calculation formula is as follows: ; In the formula, is the snowmelt temperature threshold (℃); It is a degree-day factor, which represents the snowmelt rate per unit temperature change.
[0033] When the temperature is below freezing, some of the meltwater may refreeze and return to the snowpack. The refreezing flux is calculated as follows: ; In the formula, is the refreezing coefficient; is the freezing temperature threshold (℃). The above processes jointly control the dynamic changes of snow cover and affect the hydrological response characteristics of the basin.
[0034] (2) Snow water process When the snow cover melts, the meltwater enters the snowmelt storage (S2), and its variation is affected by rainfall, infiltration, and excess runoff simultaneously. The governing equation for snowmelt storage can be expressed as: ; where, represents the amount of snowmelt storage water, represents the rainfall (mm / day); represents the snowmelt amount (mm / day); represents the infiltration amount (mm / day), referring to the process of snowmelt infiltrating into the soil; represents the excess water (mm / day), which is generated when the snowmelt storage exceeds its water - holding capacity; represents the refreezing amount (mm / day).
[0035] The infiltration of snowmelt into the soil depends on the water - holding capacity of the snow cover, and its calculation formula is as follows: ; ; where, is the water - holding capacity coefficient of the snow cover. When the snowmelt storage exceeds this capacity, the excess water will form excess water. is the change amount of snowmelt storage.
[0036] When the snowmelt storage amount at the previous moment exceeds its water - holding capacity, the calculation formula for excess water is as follows: ; The generation of excess water will affect the hydrological process of the basin, especially during the period of intense snowmelt, and has an important impact on the formation of surface runoff.
[0037] (3) Soil water storage Soil water storage (S3) plays a key role in regulating evapotranspiration, groundwater recharge, and surface runoff generation processes. Soil water is mainly replenished by infiltration and consumed by evapotranspiration and runoff processes. The water balance equation for soil water can be expressed as: ; where, is the soil storage water amount, is the infiltration amount (mm / day); is the actual evapotranspiration amount (mm / day); is the recharge amount of soil water to the lower layer (mm / day).
[0038] When the soil water storage exceeds its water - holding capacity, the excess water leaks to the deep layer and replenishes the groundwater. The calculation formula for this process is as follows: ; In the formula, is the maximum soil water storage (field capacity); β is the non-linear coefficient of recharge from the upper soil layer.
[0039] Actual evapotranspiration depends on the availability of soil water and is related to potential evapotranspiration. Its calculation formula is: ; In the formula, is the soil moisture level when evapotranspiration reaches the potential value; is the potential evapotranspiration (mm / day).
[0040] In the HBV-6 model, potential evapotranspiration is calculated using the Hamon formula, and the expression is as follows: ; In the formula, is the sunshine duration (hours); is the saturation vapor pressure (kPa), and its calculation formula is as follows: ; In the formula, represents the temperature (°C).
[0041] (4) Upper soil zone process The upper soil zone (S4) is mainly responsible for quick flow and normal flow generated by infiltration. Its water balance equation is expressed as: ; In the formula, is the water storage in the upper soil layer, is the soil recharge (mm / day); is the quick flow (mm / day); is the normal flow infiltrating into the lower soil zone (mm / day).
[0042] When the water storage in the upper soil layer exceeds a certain threshold, the excess part forms quick flow, and its calculation formula is as follows: ; In the formula, is the quick flow runoff coefficient; is the soil water storage threshold for triggering quick flow.
[0043] The infiltration into the lower soil occurs in the form of normal flow, and its calculation formula is as follows: ; In the formula, is the infiltration coefficient.
[0044] (5) Subsoil zone process The subsoil zone (S5) mainly controls the formation of base flow and contributes to the groundwater discharge of the basin. Its water balance equation is expressed as: ; In the formula, is the water storage in the subsoil, is the amount of water infiltrating from the upper soil into the lower soil (mm / day); is the base flow (mm / day).
[0045] The infiltration flux from the upper soil to the lower soil is controlled by the maximum permeability, and the calculation formula is as follows: ; In the formula, is the maximum permeability.
[0046] The calculation formula for the base flow of the subsoil is as follows: ; In the formula, is the base flow runoff coefficient.
[0047] (6) Total runoff calculation and confluence process The total runoff at the basin outlet is represented by the sum of quick flow, normal flow and base flow, and its calculation formula is as follows: ; The outflow of the basin is calculated by using the time delay function for confluence, and its expression is as follows: ; In the formula, maxbas is the confluence parameter, which is used to characterize the time delay effect of runoff generation to outlet confluence, represents the total runoff at the basin outlet.
[0048] To sum up, the input variables of the HBV-6 model include precipitation, temperature, and potential evapotranspiration, and its state variables include 5 water storage processes , involving 14 hydrological flux variables .
[0049] S302. Construct the PRNN recurrent layer. The specific steps include obtaining the calculation equations of hydrological target variables in the selected hydrological model, replacing the activation function of the RNN recurrent unit in the recurrent neural network RNN with the physical formula of the intermediate state variables of the hydrological model and the runoff generation and confluence process, and constructing a PRNN recurrent network architecture with physical mechanism constraints; the weights and biases of the activation function in the PRNN recurrent network architecture are replaced with physical parameters simulated by the physical parameterization network and updated in the RNN recurrent unit.
[0050] Among them, the basic structure of the recurrent neural network (RNN) consists of an input layer, a recurrent hidden layer, and an output layer. For the hydrological input vector at time t (such as meteorological data like precipitation and temperature), the update of its hidden state follows the following recursive equation: ; In the formula, represents the hidden state at time t, is the input vector at time t, and is the hidden state at the previous time, and are the input weight matrix and the state transition 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.
[0051] The output layer generates the prediction result through a fully connected network: ; In the formula, is the output of the recurrent neural network (RNN) at time t, is the hidden state at the current time, is the output layer weight matrix, which characterizes the contribution weight of the hidden state features to the prediction target. is the output layer bias term, which is used to adjust the baseline offset of the prediction value and enhance the flexibility of the model.
[0052] In the recurrent unit of the PRNN recurrent layer, the activation function of the original RNN recurrent unit is replaced by the physical formula of the intermediate state variable of the physical model and the runoff process, and the weights , and the bias are replaced by the physical parameters and simulated by the physical parameterization network and updated in the recurrent unit. Among them, the physical formula of the intermediate state variable of the physical model and the runoff process refers to all HBV physical formulas, and the above physical formulas are all encoded as components of a single recurrent unit of the PRNN. The specific expression is: ; ; In addition, represents the hidden state at time, for the physical parameters and In the simulation, in the parametric network, the set of hydrological driving factors Xforce and the set of basin geographical attribute factors Xattributes are used as inputs, and a 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 .
[0053] To balance the influence of static attributes and dynamic driving factors, the model sets up two independent parameter generation sub-networks and fuses their outputs through weighting 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.
[0054] ; ; In the formula, is the set of physical parameters after weight balancing in the parametric network, and are the weights controlling the dynamic driving factors and static attribute factors respectively.
[0055] S303. Introduce an attention mechanism in the PRNN recurrent network architecture to learn the relative contribution weights generated by different state variables (i.e., water storage layers) to the target variable (runoff) at the current moment. The specific steps are as follows: Concatenate all the water storage layers involved in the HBV-6 model at time t - 1 into a vector, and pass these vectors through a three-layer fully connected network to obtain the attention scoring vector , and is normalized to the attention weight to calculate the attention-weighted state variable , and this process can be expressed as follows: ; ; ; ; ; ; In the formula, represents the weight matrix of the first layer of the fully connected layer, represents the weight matrix of the second layer of the fully connected layer, represents the weight matrix of the third layer of the fully connected layer, represents the bias term of the first layer of the fully connected layer, represents the bias term of the second layer of the fully connected layer, Represents the bias term of the third fully connected layer. Represents the activation value of the first fully connected layer during the calculation of the attention weight. Represents the activation value of the second fully connected layer during the calculation of the attention weight. Is the concatenated vector of all water storage layers at time t - 1. Is the vector of the nth water storage layer at time t - 1. Represents the vector of the first water storage layer at time t - 1. Represents the vector of the second water storage layer at time t - 1.
[0056] Furthermore, to prevent the PRNN model from being misled by zero-valued state variables, a masking technique is introduced in the attention mechanism. For state variables with a value of zero, their corresponding attention scores Are assigned a very low numerical value to ensure that after softmax normalization, their attention weights Approach zero. In addition, a masking mechanism is also used to assign extremely small weights to state variables close to zero, enabling them to still play a certain role in the model. This process can be expressed as follows: ; ; ; ; ; In the formula, Represents a mask vector. Is the concatenated vector of all water storage layers at time t - 1 for calculation. Represents the indicator function. Represents a commonly used activation function for converting a numerical vector into a probability distribution such that the sum of all elements is 1. Represents a part of the masking mechanism for adjusting the original attention score according to the value of the state variable (mainly zero or non-zero). Represents the adjustment number, here referring to a very small positive number. Represents the adjusted attention weight.
[0057] Subsequently, a weighted average method is adopted to combine the original state variable and the attention-weighted state variable in a specific proportion to avoid the loss of key information caused by over-reliance on attention weighting. This process is expressed as follows: ; In the formula, Represents the new state variable after weighting. Represents the weighted value, Indicates the spliced vector of the aquifer after being weighted by the attention mechanism, Represents the original state variable.
[0058] It is directly generated in the PRNN loop, but its main function is to be used for the verification of TWSA. It itself is weighted by the attention mechanism And the original state variable It is re-weighted. The reason for doing this is that relying too much on the weight shift of the attention mechanism will affect the risk that the state variable after being weighted by the attention mechanism loses its original attributes and data, and errors may occur when verifying the target variable.
[0059] The main function of the attention mechanism is in the forward propagation process of PRNN. That is, at each time step, the state variable (aquifer) at that moment is attention-weighted to quantify each time period, generating different state variables, that is, different aquifers' weights for runoff, so as to quantify the contribution to runoff generation.
[0060] Although there are two weightings, and both are carried out in the PRNN loop, the attention mechanism weighting is mainly used to quantify the contribution amount to obtain the attention score, while the latter weighting is set to reduce the information loss caused by over-relying on the attention mechanism and mainly serves the target variable verification.
[0061] S4. Based on the constructed PRNN model, using the set of hydrological driving factors and the set of basin geographical attribute factors as inputs, simulating the internal physical parameters of the PRNN model, and combining the attention weight allocation in the forward propagation process and the backward correction based on the objective function, to achieve the collaborative optimization of the PRNN model parameters and train the PRNN model.
[0062] S5. Use the trained PRNN model to simulate the basin runoff.
[0063] S6. Adopt the Nash coefficient ( NSE ), root mean square error ( RMSE ), Bayesian relative bias index ( PBIAS ) to evaluate the performance of the simulation results of the basin runoff and total water storage anomaly based on the trained PRNN model.
[0064] Among them, ; ; ; In the formula, And Respectively represent the simulated value and measured value of runoff at time i, 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, and its value range is from negative infinity to 1. The closer it is to 1, the higher the matching degree. RMSE measures the simulation error. The smaller the value, the higher the simulation accuracy, and the greater the deviation, the more significant the error. PBIAS evaluates the systematic bias. A positive value indicates overestimation, a negative value indicates underestimation, and a value close to 0 indicates a small overall error.
[0065] It should be noted that in this article, relational terms such as first and second are only used 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 term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device.
[0066] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for predicting basin runoff by integrating an attention mechanism and a physical recurrent neural network, characterized in that The steps include: Conduct quality inspection and preprocessing on historical hydrometeorological data within the research basin, and construct a set of hydrological driving factors; Perform standardization processing on the geographical attribute data within the research basin, and construct a set of basin geographical attribute factors; Construct a PRNN model; the PRNN model includes an input layer, a PRNN recurrent layer, and an output layer; Based on the constructed PRNN model, using the set of hydrological driving factors and the set of basin geographical attribute factors as inputs, simulate the internal physical parameters of the PRNN model, and combine the attention weight assignment in the forward propagation process and the backward correction based on the objective function to achieve the collaborative optimization of the PRNN model parameters and train the PRNN model; Use the trained PRNN model to simulate the basin runoff; Based on the trained PRNN model, conduct performance evaluation on the simulation results of basin runoff and total water storage anomaly.
2. The basin runoff forecasting method integrating an attention mechanism and a physical recurrent neural network according to claim 1, wherein, The quality inspection uses the one-class support vector machine method to identify and remove outliers, and linear interpolation method is used to fill in the missing data; the preprocessing uniformly converts all processed data into a continuous daily-scale time series.
3. The basin runoff forecasting method integrating the attention mechanism and the physical recurrent neural network according to claim 1, characterized in that, The structures of the input layer and the output layer of the PRNN model are the same as those of the input layer and the output layer in the recurrent neural network RNN.
4. The basin runoff forecasting method integrating an attention mechanism and a physical recurrent neural network according to claim 1, characterized in that, The steps for constructing the PRNN recurrent layer include: Select a hydrological model suitable for daily-scale simulation; Based on the calculation equation of the hydrological target variable in the selected hydrological model, replace the activation function in the RNN recurrent unit in the recurrent neural network with the physical formula of the intermediate state variable of the hydrological model and the runoff generation and concentration process, and construct a PRNN recurrent network architecture with physical mechanism constraints; The weights and biases of the activation function in the PRNN recurrent network architecture are replaced with the physical parameters simulated by the physical parameterization network and updated in the RNN recurrent unit; Introduce an attention mechanism into the PRNN recurrent network architecture.
5. The basin runoff forecasting method integrating an attention mechanism and a physical recurrent neural network according to claim 4, characterized in that, The selected daily-scale hydrological conceptual model should have a clear division of storage layer state variables and be able to describe the spatio-temporal migration process of water volume within the basin.
6. The basin runoff forecasting method integrating the attention mechanism and the physical recurrent neural network according to claim 4, characterized in that In the physical parameterization network, a set of hydrological driving factors and a set of basin geographical attribute factors are used as inputs. After passing through three fully connected layers to simulate the physical parameters inside the PRNN model, dynamic physical parameters are generated respectively. And static physical parameters , and the combined weights of the static and dynamic parameters are dynamically updated at each time step. By weighted fusion of the dynamic physical parameters And static physical parameters , the final internal physical parameters of the PRNN model are generated.
7. The basin runoff forecasting method integrating an attention mechanism and a physical recurrent neural network according to claim 4, characterized in that, Introduce an attention mechanism 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: Concatenate all the water storage layers involved in the PRNN recurrent network architecture into a vector at time t-1, and obtain the attention scoring vector by passing the vector through a three-layer fully connected network , and normalize to the attention weights to calculate the attention-weighted state variable ; among them, for state variables with values of zero and values approaching zero, a masking mechanism is used to assign weights; Use the weighted average method to weight the original state variable and the attention-weighted state variable to obtain a new state variable.
Citation Information
Patent Citations
Runoff prediction method based on attention mechanism and LSTM
CN110288157A
Flood forecasting method based on time sequence attention mechanism
CN112785043A
Drainage basin runoff forecasting method based on interpretable machine learning
CN117689042A
Flood forecasting model and method for coupling mechanism model and deep learning
CN118395868A
Hydrological forecasting method based on deep integrated learning and physical mechanism
CN119338081A
Cited By
Drainage basin runoff prediction method and system coupling physical mechanism and deep learning
CN121212026A
Basin hydrological situation change attribution quantification method
CN121365881A
Drainage basin runoff prediction method and system fusing graph attention network and physical constraint
CN121390393A
A method and system for predicting watershed runoff by fusing graph attention network and physical constraints
CN121390393B
Runoff forecasting method based on LSTM-KAN and physical guidance mechanism
CN121502313A