Flood forecasting method fusing physical mechanism and conditional denoising diffusion model
By integrating physical mechanisms with conditional denoising diffusion models, the flood forecasting method solves the problem that existing flood forecasting methods are insufficient in fitting the nonlinear changes of extreme flood peaks and receding processes in complex watersheds. It achieves high-precision flood forecasting and probability distribution quantification, thereby improving the reliability of disaster prevention and mitigation decisions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2026-04-30
- Publication Date
- 2026-06-02
AI Technical Summary
Existing flood forecasting methods struggle to accurately fit the characteristics of extreme flood peaks and the nonlinear changes in the recession process when faced with complex and variable underlying surface conditions and extreme weather forcing. Furthermore, they are unable to quantify the probability distribution characteristics and potential bias range of forecast results, resulting in insufficient robustness.
A flood forecasting method that integrates physical mechanisms and conditional denoising diffusion models is adopted. Through multi-stage sequential parameter optimization, multi-dimensional conditional variable dimensionality reduction screening, and multi-scale denoising sampling, deterministic and probabilistic flood forecasting results are generated.
It enables accurate flood deviation boundary prediction under changing hydrological environments, enhancing the reliability of disaster prevention and mitigation decisions and the accuracy of forecast results.
Smart Images

Figure CN122133082A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrological and water resources information processing technology, and in particular to a flood forecasting method that integrates physical mechanisms and conditional denoising diffusion models. Background Technology
[0002] Flood forecasting is a core technical support for watershed flood control, disaster reduction, and scientific water resource allocation. Accurately predicting the evolution of floods is of significant technical value for improving the accuracy of hydrological forecasts, extending the lead time, and quantifying forecast uncertainties. With the continuous accumulation of multi-source hydrological monitoring data, how to efficiently utilize massive amounts of heterogeneous data and reveal the spatiotemporal evolution patterns of complex hydrological systems has become a fundamental research topic in the field of hydrometeorological forecasting.
[0003] Current flood forecasting methods mainly include process-driven models and data-driven models. Process models are typically constructed based on runoff generation and confluence physical laws or hydrophysical equations; data-driven models often utilize deep neural networks to directly map the nonlinear relationship between meteorological forcing and runoff response. Both typically output a single forecast value. When faced with complex and variable watershed underlying surface conditions and extreme meteorological forcing, existing models are easily limited in their ability to fit extreme flood peak characteristics and nonlinear changes in the recession process. Furthermore, when extrapolating long and complex hydrological processes, it is often difficult to effectively quantify the probability distribution characteristics and potential bias range of the forecast results.
[0004] Existing methods still lack robustness in forecasting results when dealing with multi-source hydrological data under complex conditions, and struggle to balance the rationality of process fitting with the accurate quantification of uncertainty. Therefore, it is necessary to research a forecasting method that can improve the overall effectiveness of hydrological forecasting under complex meteorological conditions. Summary of the Invention
[0005] The purpose of this invention is to provide a flood forecasting method that integrates physical mechanisms and conditional denoising diffusion models, in order to solve the aforementioned problems existing in the prior art.
[0006] Technical solution: A flood forecasting method integrating physical mechanisms and conditional denoising diffusion models, comprising:
[0007] Acquire multi-source hydrological data for the watershed to be forecasted;
[0008] Based on multi-source hydrological data, a pre-set hydrological model is driven, and multi-stage sequential parameter optimization is performed to obtain the basic forecast sequence and the initial residual sequence.
[0009] Multidimensional condition variables are extracted from multi-source hydrological data and initial residual sequences. Multidimensional evaluation criteria are used to reduce the dimensionality of the extracted multidimensional condition variables and obtain a fused condition vector.
[0010] The fusion condition vector is used as a guiding condition input to a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed through multi-scale denoising operators to generate a set of prediction residual probability sequences.
[0011] By coupling the basic forecast sequence with the set of forecast residual probability sequences, deterministic and probabilistic forecast results for the watershed to be forecasted are obtained.
[0012] Optionally, a multi-stage sequential parameter optimization is performed to obtain the base forecast sequence and the initial residual sequence, including:
[0013] The waveform similarity between multi-source hydrological data and each sample sequence in a pre-stored historical flood event database is calculated using the dynamic time warping algorithm. Similar scenarios are selected to extract historical model parameters and construct a prior parameter search space.
[0014] The time windows corresponding to multi-source hydrological data are divided into rising water period, peak period and receding water period, and a subset of sensitive parameters corresponding to each hydrological stage is extracted based on the physical mechanism of the preset hydrological model.
[0015] Within the prior parameter search space, dedicated objective functions set for the flood season, peak season and receding season are used sequentially to independently optimize the corresponding sensitive parameter subsets and output the basic forecast sequence.
[0016] The initial residual sequence is obtained by calculating the difference between the basic forecast sequence and the actual observation sequence contained in the multi-source hydrological data.
[0017] Optionally, specific objective functions are used for the rising water period, peak period, and receding water period, in sequence, including:
[0018] During the flood season, the Nash efficiency coefficient is used as the first specific objective function to optimize the corresponding sensitive parameter subset;
[0019] During the peak period, a weighted error function incorporating both peak flow error and peak time error is used as the second specific objective function to optimize the corresponding subset of sensitive parameters. The formula for calculating the weighted error function is as follows:
[0020] L peak =w1*||Q p -Q obs ||+w2*||T p -T obs ||;
[0021] Among them, L peak The calculated value of the second specific objective function is given by w1 and w2, which are pre-configured weight coefficients. p With Q obs T represents the simulated peak flow and the observed peak flow after dimensionless processing, respectively. p With Tobs These represent the simulated peak time and the observed peak time after dimensionless processing, respectively;
[0022] During the receding period, the receding trend error is used as the third specific objective function to optimize the corresponding subset of sensitive parameters.
[0023] Optionally, multi-dimensional condition variables are extracted based on multi-source hydrological data and initial residual sequences. Multi-dimensional evaluation criteria are then used to perform dimensionality reduction and filtering on the extracted multi-dimensional condition variables to obtain a fused condition vector, including:
[0024] Sequences containing physical state, external forcing, and historical statistical dimensions are extracted from multi-source hydrological data to form multi-dimensional conditional variables;
[0025] Calculate the mutual information values between each candidate feature in the multidimensional condition variables and the initial residual sequence;
[0026] Calculate the hydrophysical correlation between each candidate feature and the selected feature subset;
[0027] The mixed score of each candidate feature is calculated by combining the mutual information value and the hydrophysical correlation. Based on this, the candidate features are iteratively screened and updated to the selected feature subset until the pre-configured convergence threshold is met. The final selected feature subset is then used as the fusion condition vector.
[0028] Optionally, in the mixed score of calculating each candidate feature based on the comprehensive mutual information value and the hydrophysical correlation, the following are included:
[0029] Based on the numerical values after eliminating dimensional differences, the mixed score for each candidate feature is calculated using the following formula:
[0030] Score(f i )=α*Norm(MI(f i ,y))+(1-α)*Norm(Phys(f i ,S));
[0031] Among them, Score(f i () is a mixed score, f i Let be the i-th feature among the candidate features, y be the initial residual sequence, S be the selected feature subset, α be the pre-configured balancing weights, Norm be the selected function to eliminate dimensional differences, and MI(f i Phys(f,y) represents the calculated mutual information value. i S represents the calculated hydrophysical correlation degree.
[0032] Optionally, the fusion condition vector is used as a guiding condition input to a pre-trained conditional denoising diffusion model, and iterative denoising sampling is performed through multi-scale denoising operators to generate a set of prediction residual probability sequences, including:
[0033] The fusion condition vector is analyzed into fast-changing condition features and slow-changing condition features according to the hydrological evolution rate;
[0034] Temporal encoding is performed on fast-changing and slow-changing conditional features to construct a multi-scale conditional feature tensor;
[0035] The multi-scale conditional feature tensor is used as a guiding condition input into a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed using multi-scale denoising operators to obtain a set of prediction residual probability sequences.
[0036] Optionally, the multi-scale conditional feature tensor is used as a guiding condition input into a pre-trained conditional denoising diffusion model, and iterative denoising sampling is performed using a multi-scale denoising operator to obtain a set of predicted residual probability sequences, including:
[0037] In each iteration of denoising sampling, the embedding vector of the current denoising time step and the denoised residual tensor corresponding to the current step are extracted.
[0038] By utilizing an embedded gating network, dynamic weight matrices corresponding to fast-changing and slow-changing conditional features are calculated based on time-step embedding vectors.
[0039] The noisy residual tensor, time step embedding vector and multi-scale conditional feature tensor are fused by Hadamard product based on dynamic weight matrix. The contribution of conditional features at different time scales to the denoising mean is dynamically allocated. The denoising calculation is iteratively performed until a set of prediction residual probability sequences is generated.
[0040] Optionally, before inputting the fusion condition vector as a guiding condition into the pre-trained conditional denoising diffusion model, the method further includes training the initial diffusion network using historical samples to obtain the pre-trained conditional denoising diffusion model.
[0041] Obtain historical hydrological condition samples and corresponding historical true residual sequences;
[0042] Perform a forward noise addition process on the historical real residual sequence to generate noisy sequences at each time step;
[0043] Noisy sequences and historical hydrological condition samples are input into the initial diffusion network to generate predictive noise;
[0044] Based on the prediction noise, the residual sequence is reconstructed, and a joint loss function containing network prediction loss and physical constraint loss terms is constructed according to the prediction noise and the residual sequence.
[0045] Gradient backpropagation is performed using the joint loss function to update the parameters of the initial diffusion network, resulting in a pre-trained conditional denoising diffusion model.
[0046] Optionally, in constructing a joint loss function that includes network prediction loss and physical constraint loss terms based on the prediction noise and the inference residual sequence, the calculation of the physical constraint loss term includes:
[0047] Calculate the first and second differences of the extrapolated residual sequence and construct a process smoothness criterion;
[0048] Calculate the flow integral deviation of the extrapolated residual sequence within a predetermined time window and construct a water balance criterion;
[0049] Calculate the morphological error between the extrapolated residual sequence and the historical true residual sequence, and construct a morphological consistency criterion;
[0050] By aggregating the process smoothness criterion, water balance criterion, and morphological consistency criterion, a physical constraint loss term is obtained.
[0051] Optionally, the integral deviation of the flow rate within a predetermined time window is calculated to construct a water balance criterion, including:
[0052] Calculate the cumulative runoff of the projected residual sequence and the historical actual residual sequence within a predetermined time window, respectively.
[0053] The absolute difference between the cumulative total runoff of the projected residual sequence and the cumulative total runoff of the historical actual residual sequence is calculated and used as the water balance criterion.
[0054] Beneficial effects: This invention removes interference features unrelated to hydrological evolution, realizes the leap from single-point forecasting to probability distribution extrapolation, can accurately obtain flood deviation boundaries under changing hydrological environmental conditions, and enhances the reliability of disaster prevention and mitigation decisions. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the overall process of a flood forecasting method that integrates physical mechanisms and conditional denoising diffusion models, provided in an embodiment of this application.
[0056] Figure 2 This is a schematic diagram of the process of obtaining the basic forecast sequence and the initial residual sequence by performing multi-stage sequential parameter optimization according to the embodiments of this application.
[0057] Figure 3 This is a flowchart illustrating the dedicated objective function set for the flood season, peak season, and receding season, as provided in the embodiments of this application.
[0058] Figure 4This is a schematic diagram of the process of extracting multi-dimensional condition variables based on multi-source hydrological data and initial residual sequences, and using multi-dimensional evaluation criteria to perform dimensionality reduction and screening on the extracted multi-dimensional condition variables to obtain a fused condition vector. Detailed Implementation
[0059] Example 1: A flood forecasting method that integrates physical mechanisms and conditional denoising diffusion models is provided, such as... Figure 1 As shown.
[0060] Step 101: Obtain multi-source hydrological data for the watershed to be forecasted.
[0061] Specifically, multi-source hydrological data is represented in its underlying data structure as a multivariate time series tensor. In practical applications, multi-source hydrological data typically includes meteorological elements collected in real time by meteorological stations located within the watershed to be forecasted, such as rainfall data (in mm) and temperature data (in °C). In addition, multi-source hydrological data also includes hydrological elements monitored by hydrological stations, such as runoff flow data at monitoring sections (in m³). 3 / s. By systematically collecting the above-mentioned multi-source hydrological data, a complete input foundation can be provided for subsequent physical hydrological model simulation and data-driven model deduction.
[0062] The temporal resolution of multi-source hydrological data can be set according to the flood response rate of the basin, such as using hourly or 6-hourly time steps. Before inputting into subsequent models, conventional preprocessing operations can be performed on the multi-source hydrological data according to the actual data quality, including missing value imputation, outlier removal, and format standardization. Appropriate preprocessing methods can be selected according to the actual data type and sampling method.
[0063] Step 102: Based on multi-source hydrological data, drive the preset hydrological model and perform multi-stage sequential parameter optimization to obtain the basic forecast sequence and the initial residual sequence.
[0064] In this embodiment, the preset hydrological model refers to a deterministic conceptual model or a distributed hydrological model with a clear hydrophysical mechanism. Since globally uniform parameter calibration often ignores the specificity of different stages in the flood process, this scheme adopts a multi-stage sequential parameter optimization mechanism.
[0065] Specifically, the system utilizes multi-source hydrological data as external forced input, sequentially performing parameter sensitivity analysis and segmented optimization according to different stages of flood evolution to finely fit the runoff process. After the parameter optimization-driven model, the system outputs a deterministic baseline forecast sequence. This sequence represents the prediction benchmark achievable based on purely physical mechanisms. Further, the observed actual runoff sequence is subtracted from the baseline forecast sequence to extract the initial residual sequence. The initial residual sequence contains nonlinear errors not fully represented by the physical model, as well as uncertainties from the external system, and is used as the target object for implicit modeling in subsequent deep learning models.
[0066] Step 103: Extract multi-dimensional condition variables based on multi-source hydrological data and initial residual sequences, and use multi-dimensional evaluation criteria to perform dimensionality reduction and screening of the extracted multi-dimensional condition variables to obtain a fused condition vector.
[0067] To provide highly guiding prior information for subsequent generative models, the system extracts high-dimensional feature sequences from multiple perspectives, including external forcing and physical states, forming multi-dimensional condition variables. However, the originally extracted high-dimensional features often suffer from severe information redundancy, and some features lack clear physical causal relationships. Therefore, a multi-dimensional evaluation criterion is employed for dimensionality reduction screening. This criterion considers not only the information entropy correlation between candidate features and the initial residual sequence at the data statistics level, but also the strength of their physical correlation in hydrological mechanisms. Through dual-driven evaluation and dimensionality reduction iterations, the system can eliminate redundant noise and extract fusion condition vectors that conform to both hydrological physical coupling mechanisms and are rich in statistical information, reducing the computational cost of subsequent high-dimensional matrices and avoiding the curse of dimensionality.
[0068] Step 104: The fusion condition vector is used as a guiding condition input into the pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed through multi-scale denoising operators to generate a set of prediction residual probability sequences.
[0069] In this embodiment, the pre-trained conditional denoising diffusion model no longer adopts the traditional deep learning model paradigm of directly fitting a single deterministic residual. Instead, it achieves implicit modeling by learning the high-dimensional Markov probability distribution of the residual data under predetermined conditions. Specifically, the fusion condition vector extracted in the previous step is injected into the network as external guiding information. During the inference phase, the model starts from pure Gaussian noise and uses multi-scale denoising operators, combined with the given guiding conditions, to gradually predict and eliminate noise components. After multiple iterative denoising sampling steps, the model outputs a predicted sequence sample that conforms to the characteristics of the true residual distribution. Through multiple parallel independent samplings, a set of forecast residual probability sequences containing multiple predicted samples can be generated, thereby comprehensively characterizing the residual uncertainty range caused by meteorological mutations or hydrological nonlinear evolution.
[0070] Step 105: Couple the basic forecast sequence with the set of forecast residual probability sequences to obtain the deterministic forecast results and probabilistic forecast results for the watershed to be forecasted.
[0071] In this step, the underlying physical baseline and the upper-level AI-generated results are fused in a closed loop. Specifically, each independent sample sequence in the forecast residual probability sequence set is superimposed onto the base forecast sequence to form multiple composite forecast sequence samples. To generate probabilistic forecast results, the system performs statistical analysis on the multiple composite forecast sequence samples along the time step axis. In this embodiment, the 5th and 95th quantiles of each time step are extracted to construct the confidence interval of the forecast. This confidence interval intuitively quantifies the fluctuation range of the forecast results. Simultaneously, the system can further calculate the mean or median of all samples at each time step as a deterministic forecast result output. This coupling mechanism achieves the complementary advantages of physical baseline and data expansion, providing high-precision point forecasts and probabilistic forecast results with reliable interval widths while ensuring that the forecast results conform to macroscopic hydrological laws.
[0072] Example 2 describes a hydrological model extrapolation method based on multi-stage sequential parameter optimization. Addressing the technical problem that optimizing globally unified hydrological model parameters easily overlooks the specific characteristics of different stages—rising water, peak water, and receding water—leading to compromises in overall fitting performance, this method constructs a priori space through dynamic waveform matching and introduces stage-specific objective functions, effectively reducing the error base of the initial physical simulation.
[0073] Performing multi-stage sequential parameter optimization yields the base forecast sequence and the initial residual sequence, such as... Figure 2 As shown, it specifically includes:
[0074] Step 201: Calculate the waveform similarity between multi-source hydrological data and each sample sequence in the pre-stored historical flood event database using the dynamic time warping algorithm, filter similar scenarios to extract historical model parameters, and construct a prior parameter search space.
[0075] In conventional model parameter calibration, parameters are often blindly searched within a global physical threshold range, resulting in huge computational costs and a high risk of getting trapped in local optima. In this embodiment, a dynamic time warping algorithm is used to evaluate the morphological distance between the current rainfall-runoff sequence and real events in the historical database on the time axis. This algorithm, by locally stretching or compressing the time axis, can overcome the influence of flood response time shifts and accurately identify historical flood processes with similar waveforms.
[0076] After selecting several historical events with the highest similarity, the system extracts the optimal parameter set that has been calibrated in previous simulations for these events, and uses the envelope of its value range as the prior parameter search space for this optimization. Based on the prior constraints of historical pattern matching, the optimization space is narrowed, improving the convergence efficiency of subsequent optimizations.
[0077] Step 202: Divide the time window corresponding to the multi-source hydrological data into the rising water period, the peak period and the receding water period, and extract the sensitive parameter subset corresponding to each hydrological stage based on the physical mechanism of the preset hydrological model.
[0078] Specifically, when dividing the hydrological stages, the baseflow segmentation method can be used, or the locations of wave troughs and peaks in the sequence can be identified by calculating the first derivative of the sequence and finding abrupt changes in the derivative sign. Based on the above time points, the system accurately divides the entire flood process into three stages: the rising water period, the peak period, and the receding water period.
[0079] Because the dominant physical mechanisms of the pre-defined hydrological model differ at different stages—for example, during the flood season, it is mainly dominated by soil infiltration and slope runoff parameters, while during the recession season, it is mainly affected by the groundwater recession coefficient—it is necessary to extract the pre-defined parameters that have the most significant impact on the simulation results for each stage, forming a corresponding subset of sensitive parameters. The parameter dimensionality reduction and decoupling mechanism avoids interference from insensitive parameters in the optimization process at each stage.
[0080] Step 203: Within the prior parameter search space, the dedicated objective functions set for the flood season, peak season and recession season are used sequentially to independently optimize the corresponding sensitive parameter subsets and output the basic forecast sequence.
[0081] The specific objective functions defined for the flood season, peak period, and receding period are used sequentially, such as... Figure 3 As shown, it specifically includes:
[0082] Step 204: During the flood season, the Nash efficiency coefficient is used as the first specific objective function to optimize the corresponding subset of sensitive parameters.
[0083] During the initial rise of the floodwaters, the system focuses on assessing the fit of the overall process curve. The Nash efficiency coefficient formula, by calculating the ratio of the simulation variance to the observation variance, can macroscopically quantify the overall fit between the predicted process curve and the actual rise process curve. With maximizing this first specific objective function as the optimization objective, the sensitive parameters during the rise period are iteratively adjusted within the prior parameter search space.
[0084] Step 205: During the peak period, a weighted error function incorporating both peak flow error and peak time error is used as the second specific objective function to optimize the corresponding subset of sensitive parameters. Before applying the weighted error function, the peak flow error and peak time error are first processed to eliminate the dimensional differences between different physical quantities. The formula for calculating the weighted error function is as follows:
[0085] L peak =w1*||Q p -Q obs ||+w2*||T p -T obs ||;
[0086] Among them, L peak The calculated value of the second specific objective function is given by w1 and w2, which are pre-configured weight coefficients. p With Q obs T represents the simulated peak flow and the observed peak flow after dimensionless processing, respectively. p With T obs These represent the simulated peak time and the observed peak time, respectively, after dimensionless processing.
[0087] Since the magnitude and timing of flood peaks are key indicators for flood control scheduling, conventional hydrological assessment indicators tend to smooth out extreme flow peaks. This embodiment introduces a dual-error weighted assessment mechanism of time and flow to highlight the physical characteristics of the peak period. For example, assume the pre-configured flow error weight w1 is set to 0.7 and the time error weight w2 is set to 0.3. The weighting coefficients can be adaptively adjusted according to the actual flood peak magnitude characteristics and peak timing sensitivity requirements of the watershed.
[0088] After dimensionless processing, the absolute difference between the simulated peak flow and the observed flow is 0.2, and the absolute difference between the simulated peak time and the observed time is 0.1. Substituting these values into the weighted error function formula, the second specific objective function value is calculated to be 0.17. The system uses this calculated value as the basis for adjusting the peak time sensitivity parameter in reverse, and the optimization objective is to make this value continuously approach 0.
[0089] Step 206: During the receding water period, the receding water trend error is used as the third specific objective function to optimize the corresponding sensitive parameter subset.
[0090] The receding floodwaters typically exhibit a predetermined exponential decay of flow over time. The receding trend error primarily measures the deviation between the decay coefficient of the simulated sequence and the actual observed sequence. Specifically, an exponential receding equation can be used to fit the decay curves of the simulated and observed sequences during the receding period, extracting their respective receding constants, and calculating the relative or absolute deviation between the two as the receding trend error. Those skilled in the art can select appropriate receding curve equations and error measurement methods based on the characteristics of the watershed's receding flow.
[0091] For example, the recession trend error L recession =||k sim -k obs ||,k sim and k obs are the exponential decay coefficients of the simulated and observed receding water curves, respectively, and ||·|| is the norm / bias operator.
[0092] By independently optimizing the parameters of groundwater recession and retained water using a third specific objective function, the smoothness and physical rationality of the predicted recession process can be guaranteed. After the sequential independent optimization in the above three stages, the optimal parameter combination calibrated in each stage drives the preset hydrological model to obtain a continuous basic forecast sequence with a clear physical mechanism.
[0093] Step 207: Calculate the difference between the basic forecast sequence and the actual observation sequence contained in the multi-source hydrological data to obtain the initial residual sequence.
[0094] After obtaining the basic forecast sequence driven by physical mechanisms, it is aligned with and subtracted from the actual flow observation sequence in multi-source hydrological data at each corresponding time step. The difference sequence obtained by subtraction is the initial residual sequence. This initial residual sequence objectively records the nonlinear noise and uncertainty components that are difficult to fully analyze due to the simplification assumptions of the physical hydrological model, providing a data target for subsequent derivation of implicit probability distributions using conditional denoising diffusion models.
[0095] The phased independent optimization mechanism effectively overcomes the underestimation of flood peaks and the trailing effect of receding water caused by global single calibration, keeping the physical simulation errors at each stage at a lower level and providing a high-quality benchmark for subsequent residual correction.
[0096] Example 3 describes the main process of multidimensional condition variable extraction and multidimensional evaluation criterion dimensionality reduction screening.
[0097] Multidimensional condition variables were extracted based on multi-source hydrological data and initial residual sequences. Multidimensional evaluation criteria were used to perform dimensionality reduction and filtering on the extracted multidimensional condition variables, resulting in a fused condition vector, such as... Figure 4 As shown, it includes:
[0098] Step 301: Extract sequences from multi-source hydrological data that include physical state dimension, external forcing dimension and historical statistical dimension to form multi-dimensional conditional variables.
[0099] Specifically, the physical state dimension can include soil moisture content and groundwater level sequences from the early stages of the watershed; the external forcing dimension can include rainfall, temperature, and evaporation sequences; and the historical statistics dimension can include the historical average runoff sequence for the same period. The initially extracted sequences collectively constitute a high-dimensional set of candidate features. Features selected solely through data mining often lack explanations of physical mechanisms. This approach, through multi-dimensional extraction, provides a comprehensive candidate library that considers both physical mechanisms and data correlations for subsequent screening.
[0100] Step 302: Calculate the mutual information values between each candidate feature in the multidimensional condition variables and the initial residual sequence.
[0101] In this step, statistical analysis is performed on each candidate feature in the high-dimensional candidate library and the initial residual sequence output by the previous physical hydrological model. Mutual information is used to quantify the nonlinear correlation between the two variables. A higher mutual information value indicates a greater contribution of the candidate feature to explaining and predicting the initial residual sequence. This calculation process achieves a preliminary quantitative assessment of feature effectiveness from a data-driven perspective.
[0102] Step 303: Initialize the selected feature subset to an empty set and perform iterative screening. In each iteration: calculate the hydrophysical correlation between each candidate feature and the selected feature subset.
[0103] The hydrophysical correlation degree is a predefined set of expert scores based on prior hydrological knowledge, or a physical coupling strength index, such as the natural hysteresis response of rainfall to runoff. It measures the complementarity of a candidate feature relative to a selected subset of features at the hydrophysical mechanism level; a higher value indicates that the candidate feature can supplement more physical evolution information not yet covered in the selected subset. When the selected subset contains multiple features, the hydrophysical correlation degree can be obtained by calculating the mean of the pairwise physical complementarity scores between the candidate feature and each feature in the selected subset. The pairwise physical complementarity scores can be predefined by those skilled in the art based on prior physical knowledge in the hydrological field, combined with watershed characteristics, forming a scoring matrix. For example, rainfall and soil moisture content have a strong physical coupling relationship in runoff generation mechanisms, and their pairwise complementarity scores can be set to higher values; while two features that both reflect atmospheric forcing, such as rainfall and temperature, have overlapping information in physical mechanisms, and their complementarity scores can be set to lower values. The specific values of the scoring matrix can be determined based on the runoff generation and confluence physical characteristics of the watershed.
[0104] Calculating the correlation between candidate features and the selected feature subset is to ensure that the newly introduced features are not only statistically significant, but also do not have serious mechanistic redundancy with the existing features, and can supplement the physical evolution process missing from the selected features.
[0105] Step 304: Calculate the mixed score of each candidate feature by combining the mutual information value and the hydrophysical correlation degree. Iteratively filter candidate features based on the mixed score and update them to the selected feature subset until the pre-configured convergence threshold is met. Use the final selected feature subset as the fusion condition vector.
[0106] This step can also be further described as follows: calculating the mixed score of each candidate feature by combining the mutual information value and the hydrophysical correlation degree; selecting the feature corresponding to the highest score from each candidate feature based on the mixed score and updating it to the selected feature subset until the pre-configured convergence threshold is met; and using the final selected feature subset as the fusion condition vector.
[0107] When the selected feature subset is empty, the hydrophysical correlation term is set to its default value of 0, meaning the first round of screening is based solely on mutual information values. At the implementation level, when the selected feature subset S is empty, Score(f) is directly set to 0. i The hydrophysical correlation term (1-α)·Norm(Phys(f) i The entire array is set to 0, and the Norm function is not called to avoid the boundary case of normalizing an all-zero array.
[0108] In the first iteration, since the selected feature subset is empty, the system only sorts the candidate features based on the mutual information value between each candidate feature and the initial residual sequence, and selects the candidate feature with the highest mutual information value as the initial selected feature. From the second iteration onwards, subsequent screening is carried out based on the mixed score.
[0109] In the calculation of the hybrid score for each candidate feature based on the comprehensive mutual information value and the hydrophysical correlation, the specific processing method is as follows:
[0110] Step 305: Eliminate dimensional differences using one of the following parallel schemes: use the maximum-minimum normalization algorithm to process the mutual information value and the hydrophysical correlation, or use the Z-score normalization algorithm to process the mutual information value and the hydrophysical correlation.
[0111] Mutual information, as an indicator of information entropy, naturally conflicts with the hydrophysical correlation degree generated by expert scoring in terms of numerical scale. If left unaddressed, this will result in dimensional bias.
[0112] In a preferred embodiment, a minimum-maximum normalization algorithm is used to linearly map the mutual information value and the hydrophysical correlation to the interval between 0 and 1. As an alternative implementation, for candidate feature sets with extreme outliers, a Z-score normalization algorithm is used to transform the corresponding data into a distribution with a mean of 0 and a standard deviation of 1. By executing one of the above parallel schemes, the dimensional bias between different evaluation dimensions is effectively eliminated.
[0113] Step 306: Based on the numerical values after eliminating dimensional differences, calculate the mixed score for each candidate feature using the following formula:
[0114] Score(f i )=α*Norm(MI(f i ,y))+(1-α)*Norm(Phys(f i ,S));
[0115] Among them, Score(f i () is a mixed score, f i Let be the i-th feature among the candidate features, y be the initial residual sequence, S be the selected feature subset, α be the pre-configured balancing weights, Norm be the selected function to eliminate dimensional differences, and MI(f i Phys(f,y) represents the calculated mutual information value. i S represents the calculated hydrophysical correlation degree.
[0116] Specifically, in each dimensionality reduction iteration, the final score of the unselected features is calculated using the aforementioned linear formula. Assume the pre-configured balancing weight α is set to 0.5. The balancing weight can be determined by those skilled in the art through experiments on the validation set. For a candidate feature, such as the rainfall in the first 3 hours, after maximum-minimum normalization, its mutual information score with the initial residual sequence is 0.8, and its hydrophysical correlation score with the selected feature subset is 0.6. Substituting these values into the formula, the final mixed score of the candidate feature is calculated to be 0.5*0.8 + (1-0.5)*0.6 = 0.7.
[0117] The system sorts the mixed scores in descending order to determine whether to update them to the selected feature subset. If the information increment brought by the feature corresponding to the highest score is higher than the pre-configured convergence threshold, it is included in the subset and the next round of iteration calculation is started; if it is lower than the convergence threshold, the iteration is terminated.
[0118] The pre-configured convergence threshold can be determined as follows: when the increment of the highest mixed score in N consecutive iterations is lower than a preset minimum value, convergence is determined and the iteration is terminated. In this embodiment, N is set to 3, and the preset minimum value is set to 0.01. The convergence threshold can be determined experimentally on a validation set based on the feature dimension requirements and model input capacity in the actual application scenario. Those skilled in the art can select a suitable cutoff point based on the decreasing trend of information increment without any creative effort.
[0119] This process extracts a simplified conditional vector that has both high statistical information entropy and conforms to the hydrophysical coupling mechanism, reducing the computational cost of the subsequent high-dimensional diffusion denoising process.
[0120] Example 4 describes the gated multi-scale denoising inference method in more detail, mainly describing the process of iteratively denoising and sampling the fused conditional vector input to the diffusion model to generate a set of prediction residual probability sequences.
[0121] Step 401: The fusion condition vector is analyzed into fast-changing condition features and slow-changing condition features according to the hydrological evolution rate.
[0122] Specifically, the fusion condition vector includes various hydrological, physical, and environmental state data that have undergone dimensionality reduction and screening in the early stages. In this embodiment, the hydrological evolution rate refers to the speed at which different types of feature data undergo significant changes over time. The system decomposes the fusion condition vector into two parts based on pre-defined hydrological and physical attributes. Rapidly changing condition features mainly include variables that respond quickly to short-term meteorological abrupt changes, such as rainfall intensity, wind speed, and surface runoff abrupt changes within the last 3 hours. Slowly changing condition features include relatively stable variables over a long time span, such as previous soil moisture content, baseflow index, and seasonal evapotranspiration. This analytical approach allows the subsequent network to distinguish the timeliness of features across different time dimensions, preventing long-term slow-changing features from being masked by short-term meteorological noise.
[0123] Step 402: Perform temporal encoding on the fast-changing conditional features and the slow-changing conditional features to construct a multi-scale conditional feature tensor.
[0124] Independent temporal feature extraction is performed on the separated fast-changing and slow-changing conditional features. Specifically, a long short-term memory neural network with an encoder-decoder architecture can be used to process the two sets of feature sequences separately, extracting their evolution patterns at different temporal resolutions. The extracted high-dimensional features are aligned according to time steps and then concatenated and fused to generate a unified multi-scale conditional feature tensor. This multi-scale conditional feature tensor is represented as a high-dimensional matrix in network operations. It retains information on the dramatic hydrological fluctuations caused by short-term precipitation while incorporating long-term constraint information on the watershed's soil water storage status, providing a comprehensive and multi-scale physically meaningful guiding background for denoising the diffusion model.
[0125] The multi-scale conditional feature tensor is used as a guiding condition input into a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed using multi-scale denoising operators to obtain a set of predicted residual probability sequences, including:
[0126] Step 403: Sample the initial noise tensor from the standard Gaussian distribution; in each iteration of denoising sampling, extract the time step embedding vector of the current denoising time step and the denoised residual tensor corresponding to the current step, wherein the denoised residual tensor in the first iteration is the initial noise tensor.
[0127] Conditional denoising diffusion models gradually restore pure Gaussian noise to a residual sequence with practical hydrological and physical significance through hundreds to thousands of backward iterations. When performing single-step iterative denoising, it is necessary to clearly define the current denoising stage. The time-step embedding vector represents the current backward denoising time step, typically using sine and cosine positional encoding techniques to transform discrete time-step values into continuous high-dimensional vectors. The noisy residual tensor is the hydrological residual sequence output from the previous time step, containing a certain proportion of noise. Extracting these two variables is to convey the noise level of the current object and the current denoising time point to the multi-scale denoising operator, guiding the network to adaptively adjust the denoising intensity and feature extraction strategy.
[0128] In some alternative implementations, the base network of the multi-scale denoising operator preferably adopts a multilayer perceptron, which can effectively capture long-distance dependencies in time series data and fuse multi-scale features at different levels to support complex denoising inference processes.
[0129] In the process of utilizing an embedded gating network, the dynamic weight matrices corresponding to fast-changing and slow-changing conditional features are calculated based on the time-step embedding vectors. Specifically, this includes:
[0130] Step 404: Input the time step embedding vector into the multilayer perceptron for nonlinear feature mapping to obtain the mapped feature vector.
[0131] The gating mechanism network dynamically adjusts the guidance strength of multi-scale conditional features based on the current denoising time step. The time step embedding vector itself only contains temporal location information; to transform it into a control signal for feature allocation, a multilayer perceptron is needed for processing. The multilayer perceptron consists of fully connected layers. Through multiple linear transformations and nonlinear activation operations, it maps the time step embedding vector into a hidden layer feature space that matches the conditional feature tensor, extracting a high-dimensional representation closely related to the current denoising stage, laying the foundation for subsequent generation of control weights.
[0132] Step 405: Normalize the mapped feature vector using the Sigmoid activation function, constrain the output value range to be between 0 and 1, and use the output result as a dynamic weight matrix.
[0133] The high-dimensional vectors obtained after nonlinear feature mapping may have a wide range of values, making them difficult to use directly as weight coefficients. Using the Sigmoid activation function to process this mapping feature smoothly maps the value of each element to the interval between 0 and 1. The resulting dynamic weight matrix contains two sets of weight sequences, corresponding to the weights of rapidly changing conditional features and the weights of slowly changing conditional features, respectively. In the early stages of diffusion denoising, the network may rely more on slowly evolving macroscopic state information; however, in the later stages of denoising, the network needs to finely recover the abrupt changes in the flood peak, at which point the dynamic weight matrix automatically assigns higher values to the rapidly changing conditional features. Through this mechanism, the multi-scale denoising operator can adaptively focus on hydrological conditions at different time scales in different iteration steps.
[0134] Step 406: Based on the dynamic weight matrix, perform Hadamard product fusion calculation on the noisy residual tensor, time step embedding vector and multi-scale conditional feature tensor, dynamically allocate the contribution of conditional features at different time scales to the denoising mean, and iteratively execute the denoising calculation until a set of prediction residual probability sequences is generated.
[0135] The Hadamard product refers to the operation of multiplying the elements one by one at corresponding positions of two matrices of the same dimension. In this step, the generated dynamic weight matrix is used to perform element-wise weighted multiplication of the fast-changing conditional features and the slow-changing conditional features. The weighted conditional features are then deeply fused with the noisy residual tensor and the time-step embedding vector in the feature channel dimension. The fused features are fed into the hidden layer of the multi-scale denoising operator to calculate the amount of prediction noise to be subtracted in the current step, and to update the denoised mean and variance for the next time step. The system iteratively executes the above gated fusion and denoising prediction operations until all time steps are traversed, and finally outputs multiple sets of noise-free smooth sequences, which together constitute the prediction residual probability sequence set, characterizing the probability distribution characteristics of hydrological residuals under the constraints of multi-scale physical mechanisms.
[0136] Example 5 describes the main process of constructing and completing offline training of the joint loss of the conditional denoising diffusion model guided by physical information before inference and prediction.
[0137] Step 501: Obtain historical hydrological condition samples and corresponding historical true residual sequences.
[0138] Specifically, multiple sets of historical flood event fragments are extracted from a pre-set historical database. The historical hydrological condition samples are feature tensors constructed from multi-source hydrological variables after prior dimensionality reduction and multi-scale feature extraction. The historical true residual sequence is the time series of deviations between the baseline sequence obtained from physical hydrological model simulation and the actual observed flow at the corresponding hydrological station. The baseline sequence is the basic forecast sequence.
[0139] Historical flood event data can be obtained from publicly available hydrological datasets or through routine observation records from hydrological monitoring stations within the basin. The specific size and number of events in the training data can be adjusted based on the accumulation of basin data and the model training effect.
[0140] Step 502: Perform a forward noise addition process on the historical real residual sequence to generate noisy sequences at each time step, as well as the corresponding sampling noise at each time step.
[0141] In this embodiment, based on the Markov chain principle, standard Gaussian noise is gradually injected into the historical real residual sequence according to a preset variance scheduling strategy. As the forward noise addition time step increases, the original high-dimensional hydrological residual data distribution is gradually destroyed, and finally degenerates into an isotropic pure random noise distribution at the set maximum time step.
[0142] Step 503: Input the noisy sequence and historical hydrological condition samples into the initial diffusion network to generate predicted noise.
[0143] In this step, the initial diffusion network attempts to extract the noise component injected at the current time step from the noisy sequence based on the network's internal parameters to be optimized. Simultaneously, historical hydrological condition samples are incorporated into the network as guiding conditions, enabling the initial diffusion network to perceive external forcing and internal physical state information such as current watershed rainfall and prior soil moisture during noise prediction, thus achieving implicit modeling of conditional probabilities.
[0144] Step 504: Reconstruct the residual sequence based on the predicted noise, and construct a joint loss function that includes network prediction loss and physical constraint loss terms based on the predicted noise and the residual sequence.
[0145] Optionally, the residual sequence is reconstructed based on the predicted noise and the noisy sequence, and a joint loss function containing network prediction loss and physical constraint loss terms is constructed based on the predicted noise, the sampling noise at each time step, and the residual sequence.
[0146] Based on the predicted noise, the residual sequence is reconstructed. Specifically, according to the closed-form solution of the diffusion process, let: β represents the cumulative noise intensity of the forward process. s The noise variance scheduling coefficient is pre-set at the s-th time step, (1-β)s The single-step signal retention rate (x) can be obtained from the noisy sequence using the following formula. t With prediction noise ε θ (x t The deduced residual sequence can be directly reconstructed from t and c. :
[0147] ;
[0148] in, To deduce the residual sequence, x t For the noisy sequence at the current time step, ε is the cumulative noise scheduling coefficient up to time step t. θ (x t (t, c) represents the predicted noise output by the diffusion network, and c represents historical hydrological condition samples. The above restoration step is only performed during the training phase to calculate the physical constraint loss term and does not participate in the backsampling process during the inference phase.
[0149] A joint loss function is constructed based on the predicted noise and the inferred residual sequence, including network prediction loss and physical constraint loss terms, comprising:
[0150] Step 5041: Calculate the dimensionless network prediction loss and the physical constraint loss with macroscopic hydrological dimensions, respectively.
[0151] Step 5042: Calculate the dynamic scaling weights of loss terms with different dimensions using a multi-objective adaptive weighting algorithm;
[0152] Step 5043: Linearly weight the network prediction loss and physical constraint loss terms using dynamic scaling weights to construct a joint loss function.
[0153] Specifically, the network prediction loss is typically calculated using the mean square error between the predicted noise output by the initial diffusion network and the actual forward-injected noise; this network prediction loss is itself a dimensionless statistical spatial bias value. However, the physical constraint loss term is based on macroscopic real physical quantities reconstructed from the inferred residual sequence, possessing definite hydrological unit dimensions such as cubic meters per second. To balance the gradient contributions of loss terms with different dimensions, a multi-objective adaptive weighting algorithm is used to calculate the dynamically scaling weights.
[0154] By employing a multi-objective adaptive weighting algorithm in step 5042 to solve for and generate dynamically scaled weights, the gradient contributions of the two dimensions can be balanced in real time. Optionally, the multi-objective adaptive weighting algorithm can be implemented using a weighting algorithm based on homoscedastic uncertainty or a dynamic penalty algorithm based on gradient normalization.
[0155] After scaling, the calculated joint loss function is expressed as follows:
[0156] L total =W pred *L pred +W phy *L phy ;
[0157] Where L total W represents the combined gradient backpropagation value of the joint loss function. pred L is the dynamically scaling weight for the corresponding network prediction loss calculated using an adaptive algorithm. pred For dimensionless network prediction loss, W phy For the dynamic scaling weights corresponding to the physical constraint loss term, L phy This is a physical constraint loss term with macroscopic hydrological dimensions.
[0158] In constructing a joint loss function that includes network prediction loss and physical constraint loss terms based on the prediction noise and the inferred residual sequence, the specific process of calculating the physical constraint loss term includes:
[0159] Step 5044: Calculate the first and second differences of the extrapolated residual sequence and construct the process smoothness criterion;
[0160] Specifically, the curve oscillation is measured by calculating the sum of squared differences of the extrapolated residual sequences between adjacent discrete time steps, which serves as the loss quantity characterizing the process smoothness criterion. This calculation process can effectively suppress high-frequency oscillations in the final generated forecast residual sequence that do not conform to the continuous evolution of natural hydrology. For example, the formula for calculating the process smoothness loss term is:
[0161] ;
[0162] Among them, L smooth The process smoothness loss term; t is the discrete time step index, ranging from 2 to T, where T is the total time step of the forecast sequence, and the sequence index starts from 0; ε t To extrapolate the value of the residual sequence at time t, i.e., the residual value predicted by the model; ε t-1 To extrapolate the value of the residual sequence at time t-1; ε t-2 To extrapolate the value of the residual sequence at time t-2, (ε t -ε t-1 (ε) is the first-order difference, representing the rate of change of the residual sequence at adjacent time points. The sum of squares of this term is used to penalize abrupt changes in value; t -2ε t-1 +ε t-2) represents the second-order difference, characterizing the change in the rate of change of the residual sequence (acceleration / curvature). This term is used to penalize excessive oscillations in the sequence and ensure the smoothness of the curve. λ is a smoothing adjustment coefficient, used to balance the relative importance of the first-order difference constraint and the second-order difference constraint. It can be preset according to the specific hydrological characteristics of the watershed. The specific value can be determined by grid search or cross-validation on the validation set. In one optional implementation, λ is set to 0.5.
[0163] Step 5045: Calculate the flow integral deviation of the extrapolated residual sequence within a predetermined time window and construct a water balance criterion;
[0164] This step can also involve calculating the flow integral deviation between the projected residual sequence and the historical real residual sequence within a preset time window, and constructing a water balance criterion.
[0165] In calculating the integral deviation of the flow rate within a predetermined time window and constructing the water balance criterion, the specific steps include:
[0166] Step 50451: Calculate the total cumulative runoff of the projected residual sequence and the historical actual residual sequence within the predetermined time window, respectively.
[0167] Step 50452: Calculate the absolute difference between the cumulative total runoff of the extrapolated residual sequence and the cumulative total runoff of the historical true residual sequence, and use it as the water balance criterion.
[0168] In this embodiment, the predetermined time window is typically set to a hydrological event cycle encompassing the entire flood season to the recession season. A processing mechanism of summing and subtracting discrete integrals is employed to accumulate the instantaneous flow deviations at each time step, transforming them into the total dimensional deviation within the predetermined time window. This criterion strictly ensures that the network adheres to the fundamental laws of mass conservation and water balance in nature when correcting macroscopic errors.
[0169] Step 5046: Calculate the morphological error between the extrapolated residual sequence and the historical true residual sequence, and construct the morphological consistency criterion;
[0170] In calculating the morphological error between the derived residual sequence and the historical true residual sequence, and constructing the morphological consistency criterion, this is specifically handled through one of the following parallel schemes:
[0171] Step 50461: The soft dynamic time warping algorithm is used to calculate the differentiable morphological distance between the inferred residual sequence and the historical real residual sequence, which serves as the morphological consistency criterion.
[0172] Step 50462: Input the inferred residual sequence and the historical real residual sequence into the pre-constructed convolutional feature extraction network to extract the temporal morphological feature map, and calculate the mean square error of the temporal morphological feature map as the morphological consistency criterion.
[0173] According to one aspect of this application, step 50462 may also involve inputting the inferred residual sequence and the historical real residual sequence into a pre-constructed convolutional feature extraction network, extracting the corresponding temporal morphological feature maps, and calculating the mean square error between the two sets of temporal morphological feature maps as a morphological consistency criterion.
[0174] Regarding the preferred implementation method involved in step 50461, conventional dynamic time warping algorithms rely on non-differentiable minimum value operations during temporal path optimization calculations, which makes it difficult to backpropagate the calculated morphological deviations within a deep learning framework. This solution employs a soft dynamic time warping algorithm, replacing local minimum value operations with a smooth exponential function relationship. This achieves complete differentiability of the temporal distance calculation process, transforming the overall waveform morphological differences of the macroscopic flood process into effective gradient constraint information that can guide the initial diffusion network in parameter optimization.
[0175] In the alternative implementation described in step 50462, the one-dimensional temporal residuals are transformed into feature vectors. A pre-trained lightweight convolutional neural network is used as a morphological feature estimator. The lightweight convolutional neural network can adopt a standard architecture consisting of multiple alternating layers of one-dimensional convolutional layers and pooling layers. The input is a one-dimensional temporal residual sequence, and the output is a multi-channel temporal morphological feature map. This network can be pre-trained based on historical flood residual data using self-supervised learning or supervised learning. Those skilled in the art can select appropriate network depth and convolutional kernel parameters according to the actual temporal length and accuracy requirements.
[0176] The temporal morphological consistency between the two sequences is characterized by measuring feature differences in a high-dimensional feature graph space.
[0177] Step 5047: Aggregate the process smoothness criterion, water balance criterion, and morphological consistency criterion to obtain the physical constraint loss term.
[0178] The aggregation process involves a weighted summation of the three criteria. The weight coefficients for each criterion can be determined on the validation set using conventional hyperparameter tuning methods such as grid search or Bayesian optimization. Before aggregation, each criterion can be normalized to eliminate numerical scaling differences.
[0179] According to one aspect of this application, before performing weighted aggregation, the process smoothness criterion, water balance criterion, and morphological consistency criterion are first normalized to eliminate differences in numerical scale and dimensions between the criteria, ensuring that each loss term participates in the aggregation calculation within the same numerical range. The normalization method can employ conventional methods in the art, such as maximum-minimum normalization or logarithmic scaling, selected based on the actual numerical distribution characteristics. After normalization, the physical constraint loss term is obtained by weighted aggregation using the following formula:
[0180] ;
[0181] Among them, L phy Physical constraint loss term, The normalized process smoothness criterion The normalized water balance criterion The normalized morphological consistency criteria are defined by γ1, γ2, and γ3, which are pre-configured weight coefficients for each criterion. These coefficients can be determined on the validation set using conventional hyperparameter tuning methods such as grid search or Bayesian optimization.
[0182] Step 505: Perform gradient backpropagation using the joint loss function to update the parameters of the initial diffusion network and obtain the pre-trained conditional denoising diffusion model.
[0183] In this step, integrated gradient information, combining microscopic statistical noise matching and macroscopic hydrophysical consistency, is continuously fed back into the network. After numerous iterations and parameter updates, the final solidified pre-trained conditional denoising diffusion model can stably generate high-quality residual prediction probability sequences that possess both highly realistic multidimensional conditional probability distributions and strictly adhere to smoothness, total quantity conservation, and flood peak morphology consistency at the physical level when dealing with inferences from unknown watershed data.
[0184] Those skilled in the art can use conventional model training methods in the field, such as the Adam optimizer and stochastic gradient descent, to train the initial diffusion network. Hyperparameters during the training process, such as learning rate, batch size, number of iterations, and total number of forward noise steps, can be determined by conventional hyperparameter tuning methods.
[0185] The guidance of physical constraint joint loss enables the residual sequence generated by the network to accurately match the statistical characteristics of noise at the micro level, and strictly follow physical laws such as smoothness and continuity, water conservation and consistency of flood morphology at the macro level.
[0186] Example 6 describes the hardware and system deployment architecture of a flood forecasting device that integrates physical mechanisms and a conditional denoising diffusion model.
[0187] In some alternative implementations, an electronic device is provided, which may specifically be a high-performance computing server, a cloud-based distributed computing node set, or a local workstation of a meteorological and hydrological monitoring station. The electronic device includes at least one processor and a memory communicatively connected to the at least one processor. Furthermore, the electronic device may also include a communication interface and a bus structure, through which the processor, memory, and communication interface communicate with each other and transmit multi-source hydrological data.
[0188] Specifically, memory, as a non-volatile computer-readable storage medium, is used to store non-volatile software programs, non-volatile computer-executable programs, and module instructions. Memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. The memory stores computer program instructions corresponding to the aforementioned flood forecasting method.
[0189] The processor executes various functional applications and high-dimensional data processing of the flood forecasting method that integrates physical mechanisms and conditional denoising diffusion models in any of the above embodiments by running non-volatile software programs, instructions, and modules stored in memory. For example, when the processor executes computer program instructions, it can drive a preset hydrological model to perform multi-stage sequential parameter optimization, use the arithmetic logic unit within the processor to calculate mutual information values and hydrophysical correlation, and input the fused conditional vector as a guiding condition into the conditional denoising diffusion model to perform iterative denoising sampling.
[0190] Furthermore, considering that this invention relates to offline training of a conditional denoising diffusion model with physical constraints, and high-dimensional matrix operations on multi-scale conditional feature tensors, the processor preferably employs a heterogeneous computing architecture combining a central processing unit (CPU) and a graphics processing unit (GPU). The GPU is configured to handle the Hadamard product fusion calculation involved in iterative denoising sampling, and to handle the gradient backpropagation process performed based on a joint loss function with a soft dynamic time warping algorithm. This heterogeneous hardware configuration can shorten the generation cycle of the residual probability sequence set, meeting the operational real-time computing requirements of watershed flood forecasting.
[0191] Accordingly, this embodiment also provides a computer-readable storage medium storing computer-executable instructions thereon. When the computer-executable instructions are executed by one or more processors, the one or more processors cause the one or more processors to perform the complete operational steps of the flood forecasting method in any of the above method embodiments.
[0192] It is understood that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include and execute the processes of the embodiments of the above methods.
[0193] The hardware device embodiments described above are merely illustrative, and the computing units illustrated as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in a centralized supercomputing center or distributed across multiple edge network computing nodes. Depending on the actual distribution of hydrological monitoring nodes and the allocation requirements of physical computing resources, some or all of the modules can be selected to implement the fusion computation of macroscopic hydrological physical constraints and microscopic probabilistic generation models preset in this scheme.
[0194] According to one aspect of this application, the model architecture of the conditional denoising diffusion model is specifically described as follows:
[0195] I. Encoder-decoder architecture Long Short-Term Memory Neural Network (LSTM) for extracting multi-scale conditional vectors. The encoder-decoder architecture processes two sets of feature sequences, one rapidly changing and one slowly changing, to extract high-dimensional features at different time scales. It mainly consists of an encoder, a decoder, and an output layer.
[0196] The encoder's input layer is a stacked LSTM layer on both sides, which can accept an input X of shape (Batch size, Input length, Feature dim). t The hidden state at the last time step of the last layer is taken as the context vector. Here, Batch size is the batch size, Input length is the input length, and Feature dim is the number of variables.
[0197] The decoder's initial state is the context vector generated by the encoder, with the first input being a zero vector. A fully connected layer is used to map the LSTM's hidden states to the target dimension.
[0198] The output layer aligns the extracted high-dimensional features according to time steps and then concatenates and fuses them to generate a unified multi-scale conditional feature vector.
[0199] II. Denoising Operator. The denoising operator consists of a multilayer sensing mechanism. Its function is to predict the noise added to the data x under the guidance of an arbitrary diffusion time step t and the extracted conditional feature vector c (historical hydrological condition samples). t The noise ε contained in it mainly consists of an input layer, a hidden layer, and an output layer.
[0200] Input layer, noisy data x t The three information streams—diffusion time step t and conditional feature vector c—are directly concatenated along the feature dimension to form a fused feature vector.
[0201] The hidden layer, through fully connected layers and nonlinear activation functions, performs nonlinear feature transformation on the concatenated fused feature vector. The linear layer performs spatial transformation and information mixing of features, weighting and summing all features from the previous layer to map the features to a new high- or low-dimensional space, finding feature combinations that can better predict noise. The activation layer introduces nonlinearity.
[0202] The high-dimensional abstract features learned in the last hidden layer are mapped back to the target space through the output layer.
[0203] The training objective of the conditional diffusion model is to make the generated distribution as close as possible to the true residual distribution. Through derivation, the loss function that maximizes the variational lower bound can be transformed into minimizing the L2 norm between the predicted noise and the true noise.
[0204] L=E[||ε-ε θ (x t ,t,c)||2 2 ];
[0205] In the formula, L is the training loss value of the model, E represents the expectation with respect to time step t and noise ε, ε is Gaussian noise, and ε θ For the predicted noise of the diffusion model, ||·||2 2 It is an L2 norm.
[0206] The training process is as follows:
[0207] Sample a true residual sample x0 from the dataset;
[0208] Sample random Gaussian noise ε ~ N(0, I);
[0209] According to the forward process formula q(x) t |x t-1 ,c)=N(x t ;sqrt(1-β t )x t-1 ,β t I) Calculate x after adding noise t ;
[0210] Where q(·) is the probability distribution of the forward process, N is a Gaussian distribution (normal distribution), and β t Let be the preset variance scheduling coefficient at time t, which controls the rate at which noise is added, and I be the identity matrix.
[0211] The forward noise addition process is mathematically independent of the condition variable c, i.e., q(x) t |x t-1 c)=q(x t |x t-1The condition variable c only plays a guiding role in the reverse denoising process (backsampling stage). The forward process is executed uniformly on all historical samples and is not affected by the condition variables corresponding to each sample.
[0212] x t The time step t and the conditional variable c are input into the conditional diffusion model to obtain the predicted noise ε. θ (x t ,t,c);
[0213] The mean square error between the predicted noise and the actual noise ε is calculated as the loss, and the network parameters θ are updated through backpropagation. Parameter optimization methods can use optimizers such as Adam.
[0214] The model hyperparameters are shown in Table 1.
[0215] Table 1 Model hyperparameters
[0216]
[0217] According to one aspect of this application, an alternative implementation of a flood forecasting method that integrates physical mechanisms and a conditional denoising diffusion model is provided, comprising the following steps:
[0218] Collect hydrological data such as rainfall, runoff, and evapotranspiration from historical flood events in the basin;
[0219] Using a multi-stage collaborative optimization method based on historical flood pattern recognition, the collected hydrological data are used to optimize and drive the conceptual hydrological model, resulting in structural parameters, forecast sequences, and error sequences.
[0220] Based on the acquired multi-source information, a multi-scale condition variable set is constructed, and a hybrid screening criterion is used for iterative dimensionality reduction to obtain the dimensionality-reduced fusion vector;
[0221] Using the fusion vector as a condition, a multi-timescale conditional fusion network is constructed as a denoising operator to implicitly learn the conditional probability distribution of the residual sequence and generate a sequence set of prediction errors.
[0222] The base forecast sequence is coupled with the set of forecast error sequences to generate the final deterministic and probabilistic forecast results.
[0223] Optionally, a dynamic time warping algorithm can be used to select similar scenarios from historical flood events to form a reference set;
[0224] Based on the historical optimal parameter set corresponding to the reference set, the statistical characteristics of each parameter are calculated, and the prior parameter search space is constructed.
[0225] Based on the hydrological characteristics of the current flood process, it is divided into the rising water period, the peak period, and the receding water period, and the most sensitive parameter subset for each hydrological stage is determined.
[0226] Within the prior search space, the sensitive parameter subsets for the rising, peak, and receding water periods are sequentially optimized using the objective function specific to that stage, ultimately yielding the globally optimal parameter combination.
[0227] Furthermore, in multi-stage sequential optimization, a specific objective function is defined for each stage;
[0228] The objective function during the rising water period focuses on the goodness of fit of the simulated flow increase process, and uses the Nash efficiency coefficient of the rising water section.
[0229] The peak-time objective function focuses on the accuracy of flood peak forecasting, using the combined error of flood peak flow and peak occurrence time;
[0230] The objective function during the receding period focuses on the degree of trend consistency in simulating the receding process.
[0231] Optionally, multi-scale variables are extracted from three dimensions: physical model state, external forced input, and historical statistics, to form the initial condition set:
[0232] Using the model residuals at future time points as the target variable, the mutual information value between each candidate feature and the target variable is calculated as a measure of the correlation between the feature and the target.
[0233] Calculate the hydrophysical correlation degree between each candidate feature and each feature in the selected feature subset. The hydrophysical correlation degree is a predefined quantitative index based on the coupling strength of the hydrological variables represented by the feature in terms of physical mechanisms.
[0234] For each candidate feature, a mixed score is calculated based on its relevance measure to the target and the hydrophysical correlation of the selected feature subset.
[0235] Select the candidate feature with the highest mixed score and add it to the selected feature subset. Repeat the above steps until the number of features in the selected feature subset reaches a preset threshold or the increment of the mixed score is lower than a preset sensitivity.
[0236] Optionally, the fused conditional vector is embedded into the conditional information encoder and encoded into a multi-scale conditional feature tensor containing the rapidly changing short-term state features of the forecast error and the slowly changing historical trend features.
[0237] The noisy error sequence, time step embedding, and multi-scale conditional features are processed through a gating mechanism. Based on the current denoising time step and the phase of the error sequence, the contribution weights of different scale conditional features to the generation process are dynamically adjusted.
[0238] The output predicts the local characteristics of the forecast error noise mean and conditional distribution for the current denoising step.
[0239] Based on the prediction target and physical constraint loss terms according to the noise distribution characteristics, loss calculation and parameter optimization are performed to drive the multi-timescale conditional fusion network to accurately learn the spatiotemporal evolution law of hydrological forecast error.
[0240] Furthermore, the hydrophysical criteria upon which the physical constraint loss term is based include at least one of the following:
[0241] The process smoothness criterion is used to penalize high-frequency abrupt changes in the generated residual sequence that do not satisfy the continuity of the hydrological process.
[0242] The water balance criterion is used to penalize deviations in the flow process after the generated residual sequence correction that violate the water balance principle within a specific time window;
[0243] The morphological consistency criterion is used to penalize situations where the generated residual sequence causes the corrected flood hydrograph morphology to deviate significantly from the typical flood morphological characteristics.
[0244] To verify the effectiveness of the method of this invention, historical flood event data from a certain watershed were selected for testing. Historical flood event data can be obtained from publicly available hydrological datasets or routine monitoring records from watershed hydrological stations. Those skilled in the art can select appropriate data sources based on specific watershed conditions. The experiment used Nash efficiency coefficient, relative error of peak flow, peak time error, and interval coverage as evaluation indicators, comparing the method of this invention with conceptual hydrological models using globally unified parameter calibration and deep learning models that directly output single-point forecast values. Experimental results show that the method of this invention outperforms the aforementioned comparative methods in terms of Nash efficiency coefficient, exhibits higher accuracy in peak flow capture and peak time accuracy, and the generated probability forecast interval can effectively cover the actual observed values. Those skilled in the art will understand that the specific performance improvement may vary depending on watershed characteristics, data quality, and parameter configuration.
[0245] This invention performs multi-stage sequential parameter optimization on the hydrological model, dividing the hydrological process into rising water, peak, and receding water phases, and employs a dedicated objective function to independently optimize a subset of sensitive parameters for each phase. This effectively overcomes the peak underestimation or receding water tailing phenomenon caused by global single calibration, keeping the basic simulation error at a low level. It also solves the problem of insufficient forecast robustness of existing methods when dealing with complex hydrological evolution stages.
[0246] This invention utilizes mutual information values and hydrophysical correlation to perform dimensionality reduction and screening of multidimensional conditional variables. It accurately eliminates interfering features unrelated to hydrological evolution, ensuring that the data input to the model has high physical indicative significance. It also solves the problem of redundant noise interfering with the rationality of physical fitting in multi-source heterogeneous data.
[0247] This invention uses selected features as guiding conditions input into a diffusion model, generating a set of residual probability sequences through multi-scale iterative denoising sampling. This achieves a leap from single-point forecasting to interval probability extrapolation, delineates flood deviation boundaries under extreme conditions, and enhances the reliability of disaster prevention and mitigation decisions. It also addresses the pain point of single deterministic forecasts being unable to quantify risk uncertainty.
[0248] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.
Claims
1. A flood forecasting method integrating physical mechanisms and conditional denoising diffusion models, characterized in that, include: Acquire multi-source hydrological data for the watershed to be forecasted; Based on multi-source hydrological data, a pre-set hydrological model is driven, and multi-stage sequential parameter optimization is performed to obtain the basic forecast sequence and the initial residual sequence. Multidimensional condition variables are extracted from multi-source hydrological data and initial residual sequences. Multidimensional evaluation criteria are used to reduce the dimensionality of the extracted multidimensional condition variables and obtain a fused condition vector. The fusion condition vector is used as a guiding condition input to a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed through multi-scale denoising operators to generate a set of prediction residual probability sequences. By coupling the basic forecast sequence with the set of forecast residual probability sequences, deterministic and probabilistic forecast results for the watershed to be forecasted are obtained.
2. The method according to claim 1, characterized in that, Perform multi-stage sequential parameter optimization to obtain the base forecast sequence and the initial residual sequence, including: The waveform similarity between multi-source hydrological data and each sample sequence in a pre-stored historical flood event database is calculated using the dynamic time warping algorithm. Similar scenarios are selected to extract historical model parameters and construct a prior parameter search space. The time windows corresponding to multi-source hydrological data are divided into rising water period, peak period and receding water period, and a subset of sensitive parameters corresponding to each hydrological stage is extracted based on the physical mechanism of the preset hydrological model. Within the prior parameter search space, dedicated objective functions set for the flood season, peak season and receding season are used sequentially to independently optimize the corresponding sensitive parameter subsets and output the basic forecast sequence. The initial residual sequence is obtained by calculating the difference between the basic forecast sequence and the actual observation sequence contained in the multi-source hydrological data.
3. The method according to claim 2, characterized in that, The specific objective functions defined for the flood season, peak period, and receding period are used sequentially, including: During the flood season, the Nash efficiency coefficient is used as the first specific objective function to optimize the corresponding sensitive parameter subset; During the peak period, a weighted error function incorporating both peak flow error and peak time error is used as the second specific objective function to optimize the corresponding subset of sensitive parameters. The formula for calculating the weighted error function is as follows: 50 peak =w1*||Q p -Q obs ||+w2*||T p -T obs ||; Among them, L peak The calculated value of the second specific objective function is given by w1 and w2, which are pre-configured weight coefficients. p With Q obs T represents the simulated peak flow and the observed peak flow after dimensionless processing, respectively. p With T obs These represent the simulated peak time and the observed peak time after dimensionless processing, respectively; During the receding period, the receding trend error is used as the third specific objective function to optimize the corresponding subset of sensitive parameters.
4. The method according to claim 1, characterized in that, Multidimensional condition variables are extracted based on multi-source hydrological data and initial residual sequences. Multidimensional evaluation criteria are then used to perform dimensionality reduction and filtering on the extracted multidimensional condition variables, resulting in a fused condition vector, including: Sequences containing physical state, external forcing, and historical statistical dimensions are extracted from multi-source hydrological data to form multi-dimensional conditional variables; Calculate the mutual information values between each candidate feature in the multidimensional condition variables and the initial residual sequence; Calculate the hydrophysical correlation between each candidate feature and the selected feature subset; The mixed score of each candidate feature is calculated by combining the mutual information value and the hydrophysical correlation. Based on this, the candidate features are iteratively screened and updated to the selected feature subset until the pre-configured convergence threshold is met. The final selected feature subset is then used as the fusion condition vector.
5. The method according to claim 4, characterized in that, In the mixed score calculation of each candidate feature based on the comprehensive mutual information value and hydrophysical correlation, the following are included: Based on the numerical values after eliminating dimensional differences, the mixed score for each candidate feature is calculated using the following formula: Score(f i )=α*Norm(MI(f i ,y))+(1-α)*Norm(Phys(f i ,S)); Among them, Score(f i () is a mixed score, f i Let be the i-th feature among the candidate features, y be the initial residual sequence, S be the selected feature subset, α be the pre-configured balancing weights, Norm be the selected function to eliminate dimensional differences, and MI(f i Phys(f,y) represents the calculated mutual information value. i S represents the calculated hydrophysical correlation degree.
6. The method according to claim 1, characterized in that, The fusion conditional vector is used as a guiding condition input to a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed using a multi-scale denoising operator to generate a set of prediction residual probability sequences, including: The fusion condition vector is analyzed into fast-changing condition features and slow-changing condition features according to the hydrological evolution rate; Temporal encoding is performed on fast-changing and slow-changing conditional features to construct a multi-scale conditional feature tensor; The multi-scale conditional feature tensor is used as a guiding condition input into a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed using multi-scale denoising operators to obtain a set of prediction residual probability sequences.
7. The method according to claim 6, characterized in that, The multi-scale conditional feature tensor is used as a guiding condition input into a pre-trained conditional denoising diffusion model. Iterative denoising sampling is performed using multi-scale denoising operators to obtain a set of predicted residual probability sequences, including: In each iteration of denoising sampling, the embedding vector of the current denoising time step and the denoised residual tensor corresponding to the current step are extracted. By utilizing an embedded gating network, dynamic weight matrices corresponding to fast-changing and slow-changing conditional features are calculated based on time-step embedding vectors. The noisy residual tensor, time step embedding vector and multi-scale conditional feature tensor are fused by Hadamard product based on dynamic weight matrix. The contribution of conditional features at different time scales to the denoising mean is dynamically allocated. The denoising calculation is iteratively performed until a set of prediction residual probability sequences is generated.
8. The method according to claim 1, characterized in that, Before inputting the fusion conditional vector as a guiding condition into the pre-trained conditional denoising diffusion model, the initial diffusion network is trained using historical samples to obtain the pre-trained conditional denoising diffusion model. Obtain historical hydrological condition samples and corresponding historical true residual sequences; Perform a forward noise addition process on the historical real residual sequence to generate noisy sequences at each time step; Noisy sequences and historical hydrological condition samples are input into the initial diffusion network to generate predictive noise; Based on the prediction noise, the residual sequence is reconstructed, and a joint loss function containing network prediction loss and physical constraint loss terms is constructed according to the prediction noise and the residual sequence. Gradient backpropagation is performed using the joint loss function to update the parameters of the initial diffusion network, resulting in a pre-trained conditional denoising diffusion model.
9. The method according to claim 8, characterized in that, In constructing a joint loss function that includes network prediction loss and physical constraint loss terms based on the prediction noise and the inference residual sequence, the calculation of the physical constraint loss term includes: Calculate the first and second differences of the extrapolated residual sequence and construct a process smoothness criterion; Calculate the flow integral deviation of the extrapolated residual sequence within a predetermined time window and construct a water balance criterion; Calculate the morphological error between the extrapolated residual sequence and the historical true residual sequence, and construct a morphological consistency criterion; By aggregating the process smoothness criterion, water balance criterion, and morphological consistency criterion, a physical constraint loss term is obtained.
10. The method according to claim 9, characterized in that, Calculate the integral deviation of the flow rate within a predetermined time window based on the extrapolated residual sequence, and construct a water balance criterion, including: Calculate the cumulative runoff of the projected residual sequence and the historical actual residual sequence within a predetermined time window, respectively. The absolute difference between the cumulative total runoff of the projected residual sequence and the cumulative total runoff of the historical actual residual sequence is calculated and used as the water balance criterion.