A hydrological deep learning probabilistic prediction method based on conditional normalizing flow

By using a hydrological deep learning method based on conditional normalized flow, the problem of insufficient characterization of complex runoff distribution in existing hydrological forecasts is solved, and efficient runoff probability forecasting is achieved, which is suitable for real-time flood warning and rolling forecasting.

CN122432970APending Publication Date: 2026-07-21BUREAU OF HYDROLOGY CHANGJIANG WATER RESOURCES COMMISSION
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BUREAU OF HYDROLOGY CHANGJIANG WATER RESOURCES COMMISSION
Filing Date
2026-04-17
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing hydrological forecasting methods are unable to accurately characterize the uncertainty of runoff with complex non-Gaussian distributions, and have low computational efficiency, failing to meet the needs of real-time flood warnings and rolling forecasts.

Method used

A hydrological deep learning method based on conditional normalized flow is adopted. Feature extraction and probability distribution modeling are achieved through a unified neural network structure. Conditional context vectors are constructed, and complex probability distributions of runoff are generated by multi-layer reversible nonlinear transformations for end-to-end training and forecasting.

Benefits of technology

It achieves accurate characterization of the thick tail, multi-peak, and asymmetric characteristics of runoff data, possesses the ability to model state-dependent uncertainties, has high computational efficiency, and is suitable for real-time flood warning and rolling forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432970A_ABST
    Figure CN122432970A_ABST
Patent Text Reader

Abstract

The application discloses a hydrological deep learning probability prediction method based on a conditional normalization flow, and belongs to the technical field of hydrological forecasting and artificial intelligence. The method encodes a historical hydrological and meteorological sequence of a basin through a time sequence neural network to extract dynamic time sequence features, and fuses static attribute features of a basin underlying surface to construct a conditional context vector. A conditional neural network is constructed based on the vector to generate learnable transformation parameters, a conditional normalization flow model of a multi-layer reversible nonlinear transformation is constructed, a runoff conditional probability density function is analytically calculated, and a negative log-likelihood loss is constructed. Finally, an end-to-end joint training is performed, a benchmark distribution analytical quantile mapping is combined with a non-negative physical constraint to generate a runoff probability prediction result. The method can depict the uncertainty of runoff prediction without distribution assumption, improve the reliability and calculation efficiency of probability prediction, and is suitable for business application scenarios such as flood forecasting and warning and reservoir scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hydrological forecasting and artificial intelligence technology, and specifically relates to a hydrological deep learning probabilistic prediction method based on conditionally normalized flow. Background Technology

[0002] Against the backdrop of escalating global climate change and the increasing impact of human activities, the hydrological cycle in watersheds is exhibiting more complex and extreme characteristics, with rainfall-runoff relationships showing significant nonlinearity, multi-scale coupling, and increased uncertainty. Traditional hydrological forecasting methods mostly employ deterministic forecasting models, outputting only a single flow prediction value, which is insufficient to reflect the error range and risk probability of the forecast results, and cannot meet the needs of modern flood control scheduling and risk management for uncertainty quantification.

[0003] To address the aforementioned issues, probabilistic hydrological forecasting methods have gradually become a research hotspot. Their core lies in estimating the conditional probability distribution of runoff at future times, thereby providing prediction intervals at different confidence levels. However, most existing probabilistic hydrological forecasting methods employ a two-stage post-processing framework. The first stage uses physical models or neural networks to generate deterministic point prediction results; the second stage uses statistical models to model the residuals, thereby deriving the prediction intervals. This two-stage method and some generative models have the following shortcomings:

[0004] (1) Limited distribution assumptions: Some statistical post-processing methods usually assume that the error follows a normal distribution or other fixed parameter distribution. Since real hydrological data often exhibits complex characteristics such as thick tails, multiple peaks, and skewness, fixed distribution assumptions are difficult to accurately characterize the uncertain structure of runoff.

[0005] (2) Insufficient ability to characterize heteroscedasticity: Runoff error has obvious state-dependent characteristics. The error amplitude and distribution pattern are significantly different during the rising and receding water periods, and between the dry and flood periods. Traditional post-processing methods often simply scale based on the flow rate, which is difficult to reflect the impact of the dynamic state within the basin on uncertainty.

[0006] (3) The optimization objectives are disconnected: Under the two-stage framework, the deterministic model is usually trained with the mean square error as the objective, while the post-processing model is trained with the likelihood function as the objective. The two stages are optimized independently, which makes it difficult for the feature extraction layer to jointly optimize the final probability distribution objective and achieve overall optimization.

[0007] (4) Although some novel generative models have strong expressive power in probabilistic modeling, they rely on multi-step iterative sampling or cannot calculate the exact solution but instead optimize the next boundary of evidence, resulting in large computational overhead, which is not conducive to real-time flood warning and rolling forecast scenarios.

[0008] Therefore, it is necessary to propose a hydrological deep learning probabilistic prediction method that can flexibly characterize complex non-Gaussian distributions, has the ability to model state-dependent uncertainty, and has high computational efficiency. Summary of the Invention

[0009] To overcome the problems of existing technologies, this invention proposes a hydrological deep learning probabilistic prediction method based on conditionally normalized flow. This method simultaneously performs feature extraction and probability distribution modeling through a unified neural network structure, achieving accurate characterization and efficient generation of complex runoff distributions.

[0010] The objective of this invention is achieved as follows:

[0011] This invention provides a hydrological deep learning probabilistic prediction method based on conditionally normalized flow, comprising the following steps:

[0012] Step 1, construct the conditional context vector:

[0013] The historical hydrological and meteorological measurement sequences of the watershed are encoded using a temporal neural network to extract dynamic temporal features. These dynamic temporal features are then fused with the static attribute features of the underlying surface of the watershed to construct a conditional context vector that simultaneously contains the dynamic hydrological state and static physical attributes of the watershed.

[0014] Step 2, construct the conditional neural network:

[0015] Based on the conditional context vector obtained in step 1, a conditional neural network is constructed to generate a set of learnable transformation parameters for controlling the shape of the probability distribution.

[0016] Step 3, establish an explicit probability model for runoff:

[0017] First, a standard normal distribution or standard logistic distribution is selected as the baseline probability distribution. Then, a conditional normalized flow model is constructed by stacking multiple differentiable and invertible nonlinear transformations. The invertible mapping relationship between the baseline random variable and the target runoff variable is established. The cascaded expression of multiple invertible nonlinear transformations is realized through function composition operations. The observed runoff variable is mapped to the baseline spatial variable by utilizing the model's invertibility. The conditional probability density function is analytically calculated based on the variable substitution formula containing the Jacobian determinant term. Finally, the negative log-likelihood loss is constructed based on the conditional probability density function to realize explicit probability modeling of runoff without runoff distribution assumptions.

[0018] Step 4, Model Training and Prediction Process:

[0019] Based on the conditional probability density function obtained in step 3, the model is jointly trained end-to-end using the direction from the flow space to the reference space as the positive training direction and negative log-likelihood loss. In the prediction stage, the direction from the reference space to the flow space is taken as the negative direction. By selecting the quantile of the reference probability distribution, the corresponding quantile value of the flow space is calculated analytically, and non-negative physical constraints are applied to the mapping result to obtain the probability prediction result.

[0020] Furthermore, in step 1, the temporal neural network is a neural network encoder that models and outputs a temporal representation using historical hydrological and meteorological measured sequences;

[0021] The dynamic temporal feature is a time-dependent vector extracted by the temporal neural network that represents the hydrological and meteorological state of the watershed.

[0022] The static attribute features are attribute vectors that are relatively stable during the forecast period and are used to describe the geographical features of the watershed, including at least one of the following: watershed area, average elevation, channel gradient, slope, and river meandering coefficient.

[0023] The fusion involves mapping dynamic temporal features and static attribute features to a unified feature space and forming a joint representation.

[0024] The conditional context vector is a fused vector that contains both the current hydrological and meteorological status information of the basin and the overall physical attribute information of the basin, and is used to characterize the background conditions for runoff evolution.

[0025] Furthermore, in step 2, the specific steps for constructing the conditional neural network include:

[0026] S21, Generate distribution shape transformation parameters based on the conditional context vector obtained in step 1:

[0027]

[0028] In the formula, Indicates the first The set of learnable transformation parameters corresponding to the layer-conditional normalized flow transform; This represents the corresponding prediction timescale constructed in step 1. The conditional context vector; Represents a conditional neural network;

[0029] S22, the set of learnable transformation parameters is defined as follows:

[0030]

[0031] In the formula: express The width parameter of the i-th bin in the layer spline transformation; express In layer spline transformation, the first Height parameters of each compartment The parameter represents the first derivative at the binning node; M represents the number of bins that divide the domain; for Layer spline transformation, total These parameters constitute a parameter set.

[0032] Furthermore, in step 3, the specific steps for establishing the explicit probabilistic model of runoff include:

[0033] S31, Selection of baseline probability distribution:

[0034] Choose either the standard normal distribution or the standard logistic distribution as the baseline probability distribution Z;

[0035] S32, Construct an invertible mapping for conditionally normalized flows:

[0036] Construct a conditionally normalized flow model formed by stacking multiple layers of reversible nonlinear transformations, such that the baseline random variables and the target runoff variables satisfy a mapping relationship:

[0037]

[0038] In the formula: Y represents the future runoff variable of the target watershed; T represents the positive mapping function of the conditionally normalized flow; c represents the conditional context vector;

[0039] S33, cascaded expression of multi-level reversible nonlinear transformations:

[0040] The conditionally normalized flow model is composed of multiple cascaded invertible transformations, satisfying:

[0041]

[0042] In the formula: This represents the k-th reversible transformation, where K represents the total number of layers, and k is the index variable for traversing from 1 to K. This indicates the composition of functions;

[0043] Each layer of transformation is a differentiable and invertible function, and its Jacobian determinant can be obtained simultaneously in the forward and reverse calculation process. The overall Jacobian determinant is the product of the Jacobian determinants of each layer.

[0044] S34, Construct the inverse mapping and solve for the reference space variables:

[0045] Utilizing the invertibility of the conditionally normalized flow model, observed runoff variables are mapped to baseline spatial variables, satisfying:

[0046]

[0047] In the formula, This represents the inverse mapping function of the conditionally normalized flow model;

[0048] S35, Analytical calculation of runoff conditional probability density function:

[0049] Based on the variable substitution formula and combined with the Jacobian determinant, the conditional probability density function of the target runoff is calculated, satisfying:

[0050]

[0051] In the formula: Let be the conditional probability density function of the target runoff; The probability density function representing the baseline probability distribution; The Jacobian determinant of the inverse mapping;

[0052] S36, Calculate the negative log-likelihood loss:

[0053] Construct a negative log-likelihood loss based on the conditional probability density function, satisfying:

[0054]

[0055] In the formula, The loss is negative log-likelihood. This represents the expectation of observed runoff data; Indicates the observed runoff value; This represents the log probability density of the reference space variable under the reference space distribution; Represents the logarithmic term of the Jacobian determinant of the inverse transformation;

[0056] Through the steps S31 to S36 above, the complex distribution characteristics of runoff can be explicitly characterized without pre-setting the specific form of the target distribution.

[0057] Furthermore, in step 4, the probability prediction result is generated through analytical quantile mapping, the specific steps of which include:

[0058] S41, Analytical calculation of the quantiles of the baseline probability distribution:

[0059] After the model training is completed, in the forecasting phase, the mapping direction is from the baseline space to the runoff space, and a set of preset cumulative probability levels is selected from the baseline probability distribution. The corresponding baseline quantile is calculated using the inverse cumulative distribution function of the baseline probability distribution, satisfying:

[0060]

[0061] In the formula: The inverse cumulative distribution function represents the baseline probability distribution; Indicates the corresponding cumulative probability level The baseline quantile;

[0062] S42, Runoff Spatial Quantile Mapping and Physical Constraint Processing:

[0063] The benchmark quantile By mapping the conditionally normalized flow model to the runoff space via a forward invertible mapping, the runoff prediction quantiles are obtained, satisfying:

[0064]

[0065] In the formula, For the predicted quantiles of runoff space; is the positive mapping function for the conditionally normalized flow; c represents the conditional context vector;

[0066] Applying nonnegative physical constraints to the predicted runoff quantiles obtained from the mapping, the predicted results are restored to physical runoff values, based on different cumulative probability levels. Runoff prediction quantiles Generate runoff prediction intervals at different confidence levels to output runoff probability forecast results.

[0067] The advantages and beneficial effects of this invention are:

[0068] 1. The hydrological deep learning probabilistic prediction method of the present invention constructs a complex probability distribution through multi-layer reversible nonlinear spline transformation. It does not require pre-setting the error to follow a specific parameter distribution form, and can effectively characterize the thick tail, multi-peak and asymmetric characteristics of runoff data, and has a strong distribution expression ability.

[0069] 2. Uncertainty modeling of state dependence: This invention dynamically adjusts the transformation parameters of the flow model through conditional context vectors, enabling the predicted distribution to adaptively adjust its shape according to different hydrological states, thereby achieving an accurate characterization of heteroscedasticity.

[0070] 3. End-to-end joint optimization: In the hydrological deep learning probabilistic prediction method described in this invention, the feature extraction network and the probability generation module are jointly trained in a unified computation graph, which avoids the problem of the two-stage model objective being separated and is conducive to obtaining a globally consistent optimal solution;

[0071] 4. High inference efficiency: The normalized flow model supports single-step forward mapping to generate predicted quantiles, which has higher computational efficiency than generative methods that rely on multiple iterations for denoising, and higher computational accuracy than approximate generative methods. It is suitable for real-time flood warning and rolling forecast scenarios. Attached Figure Description

[0072] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0073] Figure 1 This is a flowchart illustrating the method described in Embodiment 1 of the present invention;

[0074] Figure 2 This is a schematic diagram of the overall process framework of the method described in the application example of the present invention;

[0075] Figure 3 This is a detailed training architecture diagram of the model in an application example of the present invention, showing the data flow between each module;

[0076] Figure 4 This is a reliability comparison chart of application examples of the present invention and two-stage optimization and one-step optimization baseline models with fixed distribution functions;

[0077] Figure 5 This is an application example of the present invention and a diagram showing the effect of capturing heteroscedasticity in a two-stage optimization and a one-step optimization of a baseline model with a fixed distribution function. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments disclosed herein will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0079] Example 1:

[0080] This embodiment provides a hydrological deep learning probabilistic prediction method based on conditionally normalized flow, such as... Figure 1 As shown, it includes the following steps:

[0081] Step 1, construct the conditional context vector:

[0082] The historical hydrological and meteorological measurement sequences of the watershed are encoded using a temporal neural network to extract dynamic temporal features. These dynamic temporal features are then fused with the static attribute features of the underlying surface of the watershed to construct a conditional context vector that simultaneously contains the dynamic hydrological state and static physical attributes of the watershed.

[0083] The watershed is a region enclosed by the watershed line that can collect rainwater and flow out from its outlet; the historical hydrological and meteorological observation sequence is a continuous time series of hydrological and meteorological observations acquired before the forecast time; the temporal neural network is a neural network encoder that models and outputs a temporal representation using the historical hydrological and meteorological observation sequence; the dynamic temporal feature is a time-dependent vector extracted by the temporal neural network that characterizes the hydrological and meteorological state of the watershed; the static attribute feature is an attribute vector that is relatively stable during the forecast period and is used to describe the geographical characteristics of the watershed, including at least one of watershed area, average elevation, channel gradient, slope, and river meandering coefficient; the fusion is mapping the dynamic temporal feature and the static attribute feature to a unified feature space and forming a joint representation; the conditional context vector is a fused vector that simultaneously contains information on the current hydrological and meteorological state of the watershed and the overall physical attribute information of the watershed, and is used to characterize the background conditions for runoff evolution.

[0084] Step 2, construct the conditional neural network:

[0085] Based on the conditional context vector obtained in step 1, a conditional neural network is constructed to generate a set of learnable transformation parameters for controlling the shape of the probability distribution; the specific steps include:

[0086] S21, Generate distribution shape transformation parameters based on the conditional context vector obtained in step 1:

[0087] (1)

[0088] In the formula, Indicates the first The set of learnable transformation parameters corresponding to the layer-conditional normalized flow transform; This represents the corresponding prediction timescale constructed in step 1. The conditional context vector; This represents a conditional neural network, which is implemented using a residual multilayer perceptron structure.

[0089] The core of this step is that the model does not directly output runoff predictions or error distribution parameters, but instead outputs transformation parameters used to construct the probability distribution shape, thereby realizing a state-dependent probability generation mechanism.

[0090] S22, the set of learnable transformation parameters is defined as follows:

[0091] (2)

[0092] In the formula: express The width parameter of the i-th bin in the layer spline transformation (binning is the process of dividing the domain of a variable into i consecutive local intervals and transforming each interval using a monotonically rational quadratic spline function). express In layer spline transformation, the first Height parameters of each compartment The parameter represents the first derivative at the binning node; M represents the number of bins that divide the domain; for Layer spline transformation, total These parameters constitute a parameter set.

[0093] This parameter set does not directly correspond to parameters such as mean and variance in traditional statistical models. Instead, it is used to control the stretching, compression, and probability quality distribution of the probability distribution in different intervals. The conditional network outputs the transformation parameters required by the layer based on the conditional context vector corresponding to the current prediction time, thereby ensuring that different transformation layers can learn the distribution adjustment methods of different levels. Through the above mapping mechanism, the conditional context vector is transformed into the core control quantity that drives the generation of the probability distribution.

[0094] Step 3, establish an explicit probability model for runoff:

[0095] First, a standard normal distribution or standard logistic distribution is selected as the baseline probability distribution. Then, a conditionally normalized flow model is constructed, consisting of multiple stacked differentiable and invertible nonlinear transformations. An invertible mapping relationship is established between the baseline random variables and the target runoff variables. A cascaded expression of multiple invertible nonlinear transformations is achieved through function composition operations. The model's invertibility is used to map observed runoff variables to baseline spatial variables. The conditional probability density function is analytically calculated based on a variable substitution formula containing a Jacobian determinant term. Finally, a negative log-likelihood loss is constructed based on this conditional probability density function, achieving explicit probability modeling of runoff without runoff distribution assumptions. Specific steps include:

[0096] S31, Selection of baseline probability distribution:

[0097] The conditionally normalized flow model is used to achieve an explicit mapping from a simple baseline probability distribution to a conditional probability distribution of target runoff. One of the standard normal distribution and the standard logistic distribution is selected as the simple baseline probability distribution Z. The selection of the simple distribution can be directly mapped to quantiles in the subsequent forecast stage, avoiding complex numerical sampling processes and improving computational efficiency.

[0098] S32, Construct an invertible mapping for conditionally normalized flows:

[0099] Construct a conditionally normalized flow model formed by stacking multiple layers of reversible nonlinear transformations, such that the baseline random variables and the target runoff variables satisfy a mapping relationship:

[0100] (3)

[0101] In the formula: Y represents the future runoff variable of the target watershed; T represents the positive mapping function of the conditionally normalized flow; c represents the conditional context vector.

[0102] S33, cascaded expression of multi-level reversible nonlinear transformations:

[0103] The conditionally normalized flow model is composed of multiple cascaded invertible transformations, satisfying:

[0104] (4)

[0105] In the formula: This represents the k-th reversible transformation, where K represents the total number of layers, and k is the index variable for traversing from 1 to K. This indicates the composition of functions;

[0106] Each transformation is a differentiable and invertible function, and its Jacobian determinant can be obtained simultaneously in the forward and inverse calculation processes. Therefore, in the case of stacked multi-level transformations, the overall Jacobian determinant can be expressed as the product of the Jacobian determinants of each level, thereby realizing the accurate calculation of the conditional probability density.

[0107] S34, Construct the inverse mapping and solve for the reference space variables:

[0108] Utilizing the invertibility of the conditionally normalized flow model, observed runoff variables are mapped to baseline spatial variables, satisfying:

[0109] (5)

[0110] In the formula, The inverse mapping function of the conditionally normalized flow model is represented; the Jacobian determinant is used to characterize the local scaling relationship of the invertible transformation on the probability measure, thereby realizing the accurate analytical calculation of the probability density.

[0111] S35, Analytical calculation of runoff conditional probability density function:

[0112] Based on the variable substitution formula and combined with the Jacobian determinant, the conditional probability density function of the target runoff is calculated, satisfying:

[0113] (6)

[0114] In the formula: Let be the conditional probability density function of the target runoff; The probability density function representing the baseline probability distribution; It is the Jacobian determinant of the inverse mapping.

[0115] S36, Calculate the negative log-likelihood loss:

[0116] Construct a negative log-likelihood loss based on the conditional probability density function, satisfying:

[0117] (7)

[0118] In the formula, The loss is negative log-likelihood. This represents the expectation of observed runoff data; Indicates the observed runoff value; This represents the log probability density of the reference space variable under the reference space distribution; Let represent the logarithmic term of the Jacobian determinant of the inverse transformation.

[0119] Through the steps S31 to S36 above, the complex distribution characteristics of runoff can be explicitly characterized without pre-setting the specific form of the target distribution.

[0120] Step 4, Model Training and Prediction Process:

[0121] Based on the conditional probability density function obtained in step 3, the model is trained end-to-end using the direction from the flow space to the reference space as the positive training direction and the negative log-likelihood loss is used. Specifically, the training process inputs the conditional context vector from the runoff space and trains the reversible transformation parameters of the above formula (2) so that the observed distribution of the runoff space conforms to the reference probability distribution function after the transformation of the above formula (4).

[0122] In the forecasting phase, the direction from the reference space to the flow space is reversed. By selecting the quantiles of the reference probability distribution, the corresponding quantile values ​​in the flow space are analytically calculated, and non-negative physical constraints are applied to the mapping results to obtain the probabilistic forecast results. The probabilistic forecast results are generated through analytical quantile mapping, the specific steps of which include:

[0123] S41, Analytical calculation of the quantiles of the baseline probability distribution:

[0124] After the model training is completed, in the forecasting phase, the mapping direction is from the baseline space to the runoff space, and a set of preset cumulative probability levels is selected from the baseline probability distribution. The corresponding baseline quantile is calculated using the inverse cumulative distribution function of the baseline probability distribution, satisfying:

[0125] (8)

[0126] In the formula: The inverse cumulative distribution function represents the baseline probability distribution; Indicates the corresponding cumulative probability level The baseline quantile.

[0127] S42, Runoff Spatial Quantile Mapping and Physical Constraint Processing:

[0128] The benchmark quantile By mapping the conditionally normalized flow model to the runoff space via a forward invertible mapping, the runoff prediction quantiles are obtained, satisfying:

[0129] (9)

[0130] In the formula, For the predicted quantiles of runoff space; is the positive mapping function for the conditionally normalized flow; c represents the conditional context vector;

[0131] Applying nonnegative physical constraints to the predicted runoff quantiles obtained from the mapping, the predicted results are restored to physical runoff values, based on different cumulative probability levels. Runoff prediction quantiles Generate runoff prediction intervals at different confidence levels to output runoff probability forecast results.

[0132] Application examples:

[0133] This application example uses a mountainous watershed in a humid region of my country as an example. The method described in Embodiment 1 of this application is used to provide daily runoff forecasts for this watershed. Figure 2 As shown, it includes the following steps:

[0134] Step 1, construct the conditional context vector:

[0135] Data Preparation and Preprocessing: This embodiment selects hydrological and meteorological data from the experimental watershed from 2007 to 2021. Meteorological forcing data include the watershed average daily precipitation P(t) and potential evapotranspiration PET(t). Hydrological Status: The antecedent precipitation index API(t) is calculated using the following formula: This indicator reflects the soil's moisture level. Temporal characteristics: To allow the model to perceive seasonal variations, sine and cosine temporal characteristics are constructed: sin(2π·DOY / 365.25) and cos(2π·DOY / 365.25), where DOY is the day of the year. Static attributes include watershed area (over 2000...). The river channel gradient (approximately 0.0015), mean elevation (approximately 300m), and river meander coefficient (approximately 1.5) were normalized and used as static inputs. In the absence of explicit weather forecasts after time t, future precipitation was set to 0, and future PET was assumed to be the multi-year average of the same historical date to simulate information-limited operational scenarios.

[0136] Objective variable transformation: Since river runoff Q(t) is strictly non-negative and often spans multiple orders of magnitude, this case uses a logarithmic transformation. The dynamic range of the compressed data is utilized, while the non-negativity constraint is implicitly imposed by leveraging the domain property of the logarithmic function. All input features (P, PET, API) are Z-score standardized using the mean and standard deviation of the training set.

[0137] In this embodiment, the temporal neural network is implemented using a two-layer gated recurrent unit network, with 128 hidden units in each layer, used to encode a 30-day historical window. The final hidden state output by the encoder serves as the initial hydrological memory representation of the watershed. Four static indicators (e.g., watershed area, channel gradient, average elevation, river meandering coefficient, etc.) are selected for the watershed static attribute features, and a two-layer multilayer perceptron is used to map these four static attributes into a 128-dimensional static embedding vector. Subsequently, the "final hidden state of the encoder (128 dimensions)" and the "static embedding vector (128 dimensions)" are concatenated to obtain the initial hidden state used to initialize the decoder, thus enabling the decoder to simultaneously possess dynamic memory and watershed physical attribute constraints when generating future conditional information.

[0138] In this application example, the decoder is implemented using a single-layer GRUCell with 128 hidden units, and the decoder hidden state sequence is generated daily on an autoregressive rolling basis within the forecast period. , ..., For any prediction time t+k, determine the decoder hidden state at that time. (128-dimensional) and static embedding (128-dimensional) concatenation is performed to define the conditional context vector: Its dimension is 256. This 256-dimensional conditional context vector serves as the sole input to the subsequent conditional network, driving the conditional normalized flow to generate a conditional probability distribution consistent with the current hydrological situation.

[0139] Step 2, construct the conditional neural network:

[0140] S21: Conditional Network Structure

[0141] In this application example, conditional networks Implemented using a residual multilayer perceptron, it is used to transfer the conditional context vector. The mapping is to the set of spline parameters for the k-th layer flow transformation. The residual MLP consists of two linear layers with ReLU activation function between layers and identity residual connections to enhance gradient propagation stability. To ensure that each flow transformation layer has differentiated distribution shaping capabilities, this application example configures a structurally isomorphic but parameter-independent conditional network for each layer of the flow, i.e., "each layer has a separate set of residual MLP parameters, without weight sharing." The input of the conditional network is 256-dimensional. The output is the parameter vector required for the RQS transformation of this layer. This enables the mapping of conditional information to distributional control quantities.

[0142] S22: Generation of RQS parameter set

[0143] In this application example, the conditional normalized flow is composed of a stack of 5 layers of conditional RQS (rational quadratic spline) transformations, i.e., K=5.

[0144] Each layer of the RQS sets the boundary interval to [-10, 10], and divides this interval into 16 bins (M=16). Identity transformations are applied outside the interval. To ensure the numerical stability and monotonic invertibility of the spline function, lower bound constraints are set for the width, height, and derivative of each bin. The minimum bin width, minimum bin height, and minimum derivative are all set to... The unnormalized parameters output by the conditional network are processed by Softmax (for width / height normalization) and Softplus (for positive derivative constraint) to obtain a set of parameters (width, height, derivative) that can be directly used for the k-th layer RQS transform, thereby enabling each layer transform to adaptively adjust the probability mass distribution while satisfying invertibility.

[0145] Step 3, establish an explicit probability model for runoff:

[0146] S31: Selection of baseline probability distribution

[0147] In this application example, the latent variable space of the conditionally normalized flow model is selected from the standard normal distribution as the baseline probability distribution, and its random variable is denoted as z, which satisfies: The standard normal distribution is chosen as the benchmark distribution because its probability density function and cumulative distribution function both have analytical expressions, which facilitates the direct calculation of subsequent quantiles. It also conforms to the basic assumption of probability measure conservation in the normalized flow model.

[0148] S32: Constructing an invertible mapping for conditionally normalized flows

[0149] In this application example, a conditionally normalized flow model is constructed to be used in a given conditional context vector. In this case, the latent variable z is mapped to the target runoff variable. The mapping relationship is expressed as follows: .in, This represents a conditionally normalized flow mapping function formed by stacking multiple layers of invertible nonlinear transformations. This is the 256-dimensional conditional context vector constructed in step 1.

[0150] S33: Cascaded Expression of Multilayer Reversible Nonlinear Transforms

[0151] In this application example, the conditionally normalized flow model consists of K=5 layers of cascaded invertible nonlinear transformations, and its overall mapping relationship can be expressed as: Each layer Rational quadratic spline transformations are employed to reshape the probability distribution of random variables layer by layer. Through multi-layer stacking, a simple baseline distribution can be progressively transformed into a highly flexible target runoff distribution.

[0152] S34: Construct the inverse mapping and solve for the reference space variables

[0153] During the model training phase, the invertibility of conditionally normalized flow is utilized to transform observed runoff variables. By inverse mapping transformation to the latent variable space, the corresponding latent variable z is obtained: This inverse mapping can be analytically computed in each layer of RQS transform, enabling the model to directly trace back its corresponding position in the baseline distribution space from the observed data.

[0154] S35: Analytical Calculation of Conditional Probability Density Function

[0155] In this application example, since the conditionally normalized flow model consists of multiple layers of invertible transformations, its overall Jacobian determinant can be decomposed into the product of the Jacobian determinants of each layer. According to the chain rule, we have: .in, This represents the Jacobian matrix corresponding to the k-th level RQS transform. Since runoff is a one-dimensional variable in this application example, the Jacobian matrix degenerates into a scalar, and its value can be obtained synchronously during the forward or backward calculation of each transform level. Based on the variable substitution formula, under given conditional context vectors... In this case, the conditional probability density function of the target runoff variable is expressed as: .in, It is the probability density function of the standard normal distribution.

[0156] S36: Calculate the negative log-likelihood loss

[0157] The negative log-likelihood loss function is further constructed from the probability density function of S35 as the main training objective of the model: In this application example, a gradient-based optimization method is used to update the model parameters during training. Specifically, all trainable parameters in the model, including parameters of the temporal coding network, static attribute embedding network, decoder, and conditional network and spline transformation parameters in the conditional normalization flow, are jointly updated using the backpropagation algorithm to ensure end-to-end optimization of the feature extraction module and the probability generation module in a unified computational graph. In this application example, the AdamW optimizer is used to update the model parameters, with an initial learning rate set to... The weight decay coefficient is set to To suppress overfitting and improve the numerical stability of parameter updates, a mini-batch stochastic gradient descent strategy was employed for model training, with a batch size of 128 and 60 training epochs. In each epoch, forward propagation, conditional probability density calculation, loss function evaluation, and backpropagation gradient updates were performed sequentially. In multi-timestep prediction scenarios, the overall model loss was the average of the negative log-likelihoods at each prediction step size, ensuring consistent distribution fitting ability across different prediction steps. After training, the model parameters were fixed and no longer updated, entering the prediction phase.

[0158] Step 4, Model Training and Prediction Process:

[0159] S41: Analytical Calculation of Quantiles of the Baseline Probability Distribution

[0160] In this application example, the model does not use random sampling to generate runoff prediction results during the forecasting phase. Instead, it directly uses the analytical quantile expression of the baseline distribution for quantile mapping. For a given confidence level α, the corresponding quantiles are first calculated in the standard normal distribution: .in, This represents the inverse cumulative distribution function of the standard normal distribution. This method allows for the simultaneous acquisition of latent variable quantiles at multiple confidence levels without the need for multiple random sampling.

[0161] S42: Runoff Spatial Quantile Mapping and Physical Constraint Processing

[0162] After obtaining the baseline distribution quantiles, these quantiles are mapped to the runoff space using the forward mapping function of the conditionally normalized flow model: By mapping the quantiles of different confidence levels α, the conditional probability distribution of future runoff and the corresponding prediction intervals can be directly constructed. For example, for nominal confidence levels... The symmetrical interval of is given by the prediction interval as follows: In this application example, non-negative constraints are applied to the prediction results at the output stage to ensure that the predicted runoff values ​​conform to physical meaning.

[0163] Figure 3 This is a comparison chart of the interval coverage reliability curves of the method of this invention and the comparative method under different forecast periods. Figure 3 As shown, the horizontal axis represents nominal coverage, and the vertical axis represents empirical coverage. Reliability curves are plotted for probability forecasts with forecast periods of t+1, t+2, t+3, and t+4. Ideally, the reliability curve should be close to the diagonal, indicating that the nominal coverage in the forecast interval matches the actual coverage. Figure 3The calibration of the prediction interval can be compared under different lead times: when the reliability curve is below the diagonal, it indicates that the prediction interval is too narrow and under-dispersion exists; when the reliability curve is above the diagonal, it indicates that the prediction interval is too wide and over-dispersion exists. This figure is used to illustrate the ability of the method of the present invention to characterize the reliability of prediction interval coverage in multi-step lead time scenarios, and to verify the consistency of probabilistic forecast results across different confidence level intervals.

[0164] Figure 4 This figure shows a comparison of the heteroscedasticity capture performance between an application example of the present invention, a two-stage post-processing method, and a fixed-distribution end-to-end method. Figure 4 As shown, the method of this invention exhibits a dispersed and state-dependent relationship between the prediction interval width and runoff size under different flow amplitude conditions. This means that the prediction uncertainty not only varies with flow size but also adaptively adjusts according to the current hydrological situation. In contrast, the two-stage post-processing method and the fixed-distribution end-to-end method show a relatively simple relationship between the prediction interval width and runoff size, exhibiting an approximately monotonic scaling characteristic. This result demonstrates that this invention, by dynamically adjusting the normalized flow transform parameters through the conditional context vector, enables the prediction uncertainty to vary with changes in the internal state of the watershed, thereby effectively characterizing heteroscedasticity.

[0165] In summary, this invention provides an end-to-end probabilistic hydrological prediction method that is structurally clear, computationally efficient, and highly expressive. This invention can efficiently obtain stable probabilistic forecast results without the need for extensive random sampling or iterative calculations, and is suitable for hydrological forecasting scenarios with high requirements for computational efficiency and real-time performance.

[0166] Finally, it should be noted that the above is only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention (such as the application of various formulas, the order of steps, etc.) without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A hydrological deep learning probabilistic prediction method based on conditionally normalized flow, characterized in that, The method includes the following steps: Step 1, construct the conditional context vector: The historical hydrological and meteorological measurement sequences of the watershed are encoded using a temporal neural network to extract dynamic temporal features. These dynamic temporal features are then fused with the static attribute features of the underlying surface of the watershed to construct a conditional context vector that simultaneously contains the dynamic hydrological state and static physical attributes of the watershed. Step 2, construct the conditional neural network: Based on the conditional context vector obtained in step 1, a conditional neural network is constructed to generate a set of learnable transformation parameters for controlling the shape of the probability distribution. Step 3, establish an explicit probability model for runoff: First, a standard normal distribution or standard logistic distribution is selected as the baseline probability distribution. Then, a conditional normalized flow model is constructed by stacking multiple differentiable and invertible nonlinear transformations. The invertible mapping relationship between the baseline random variable and the target runoff variable is established. The cascaded expression of multiple invertible nonlinear transformations is realized through function composition operations. The observed runoff variable is mapped to the baseline spatial variable by utilizing the model invertibility. Then, the conditional probability density function is analytically calculated based on the variable substitution formula containing the Jacobian determinant term. Finally, the negative log-likelihood loss is constructed based on the conditional probability density function to realize explicit probability modeling of runoff without runoff distribution assumptions. Step 4, Model Training and Prediction Process: Based on the conditional probability density function obtained in step 3, the model is jointly trained end-to-end using the direction from the flow space to the reference space as the positive training direction and negative log-likelihood loss. In the prediction stage, the direction from the reference space to the flow space is taken as the negative direction. By selecting the quantile of the reference probability distribution, the corresponding quantile value of the flow space is calculated analytically, and non-negative physical constraints are applied to the mapping result to obtain the probability prediction result.

2. The hydrological deep learning probabilistic prediction method according to claim 1, characterized in that, In step 1, the temporal neural network is a neural network encoder that models and outputs a temporal representation using historical hydrological and meteorological measured sequences; The dynamic temporal feature is a time-dependent vector extracted by the temporal neural network that represents the hydrological and meteorological state of the watershed. The static attribute features are attribute vectors that are relatively stable during the forecast period and are used to describe the geographical features of the watershed, including at least one of the following: watershed area, average elevation, channel gradient, slope, and river meandering coefficient. The fusion involves mapping dynamic temporal features and static attribute features to a unified feature space and forming a joint representation. The conditional context vector is a fused vector that contains both the current hydrological and meteorological status information of the basin and the overall physical attribute information of the basin, and is used to characterize the background conditions for runoff evolution.

3. The hydrological deep learning probabilistic prediction method according to claim 1, characterized in that, Step 2, the specific steps for constructing the conditional neural network include: S21, Generate distribution shape transformation parameters based on the conditional context vector obtained in step 1: In the formula, Indicates the first The set of learnable transformation parameters corresponding to the layer-conditional normalized flow transform; This represents the corresponding prediction timescale constructed in step 1. The conditional context vector; Represents a conditional neural network; S22, the set of learnable transformation parameters is defined as follows: In the formula: express The width parameter of the i-th bin in the layer spline transformation; express In layer spline transformation, the first Height parameters of each compartment The parameter represents the first derivative at the binning node; M represents the number of bins that divide the domain; for Layer spline transformation, total These parameters constitute a parameter set.

4. The hydrological deep learning probabilistic prediction method according to claim 1, characterized in that, Step 3, the specific steps for establishing an explicit probabilistic model of runoff include: S31, Selection of baseline probability distribution: Choose either the standard normal distribution or the standard logistic distribution as the baseline probability distribution Z; S32, Construct an invertible mapping for conditionally normalized flows: Construct a conditionally normalized flow model formed by stacking multiple layers of reversible nonlinear transformations, such that the baseline random variables and the target runoff variables satisfy a mapping relationship: In the formula: Y represents the future runoff variable of the target watershed; T represents the positive mapping function of the conditionally normalized flow; c represents the conditional context vector; S33, cascaded expression of multi-level reversible nonlinear transformations: The conditionally normalized flow model is composed of multiple cascaded invertible transformations, satisfying: In the formula: This represents the k-th reversible transformation, where K represents the total number of layers, and k is the index variable for traversing from 1 to K. This indicates the composition of functions; Each layer of transformation is a differentiable and invertible function, and its Jacobian determinant can be obtained simultaneously in the forward and reverse calculation process. The overall Jacobian determinant is the product of the Jacobian determinants of each layer. S34, Construct the inverse mapping and solve for the reference space variables: Utilizing the invertibility of the conditionally normalized flow model, observed runoff variables are mapped to baseline spatial variables, satisfying: In the formula, This represents the inverse mapping function of the conditionally normalized flow model; S35, Analytical calculation of runoff conditional probability density function: Based on the variable substitution formula and combined with the Jacobian determinant, the conditional probability density function of the target runoff is calculated, satisfying: In the formula: Let be the conditional probability density function of the target runoff; The probability density function representing the baseline probability distribution; The Jacobian determinant of the inverse mapping; S36, Calculate the negative log-likelihood loss: Construct a negative log-likelihood loss based on the conditional probability density function, satisfying: In the formula, The loss is negative log-likelihood. This represents the expectation of observed runoff data; Indicates the observed runoff value; This represents the log probability density of the reference space variable under the reference space distribution; Represents the logarithmic term of the Jacobian determinant of the inverse transformation; Through the steps S31 to S36 above, the complex distribution characteristics of runoff can be explicitly characterized without pre-setting the specific form of the target distribution.

5. The hydrological deep learning probabilistic prediction method according to claim 1, characterized in that, In step 4, the probability prediction result is generated through analytical quantile mapping, and the specific steps include: S41, Analytical calculation of the quantiles of the baseline probability distribution: After the model training is completed, in the forecasting phase, the mapping direction is from the baseline space to the runoff space, and a set of preset cumulative probability levels is selected from the baseline probability distribution. The corresponding baseline quantile is calculated using the inverse cumulative distribution function of the baseline probability distribution, satisfying: In the formula: The inverse cumulative distribution function represents the baseline probability distribution; Indicates the corresponding cumulative probability level The baseline quantile; S42, Runoff Spatial Quantile Mapping and Physical Constraint Processing: The benchmark quantile By mapping the conditionally normalized flow model to the runoff space via a forward invertible mapping, the runoff prediction quantiles are obtained, satisfying: In the formula, For the predicted quantiles of runoff space; is the positive mapping function for the conditionally normalized flow; c represents the conditional context vector; Applying nonnegative physical constraints to the predicted runoff quantiles obtained from the mapping, the predicted results are restored to physical runoff values, based on different cumulative probability levels. Runoff prediction quantiles Generate runoff prediction intervals at different confidence levels to output runoff probability forecast results.