A method and system for predicting watershed runoff based on LSTM
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BAOZHUSI HYDROPOWER PLANT OF HUADIAN SICHUAN POWER GENERATION CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-02
Smart Images

Figure CN121935552B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrological monitoring technology, specifically to a watershed runoff prediction method and system based on LSTM. Background Technology
[0002] Hydrological flow forecasting is a core prerequisite for optimized water resource allocation, flood control and disaster reduction, and improved power generation efficiency in river basins. Its forecasting accuracy directly determines the safety and economy of water conservancy projects. Against the backdrop of global climate change, extreme drought and flood events are becoming more frequent, and hydrological sequences are exhibiting stronger nonlinearity, nonstationarity, and multi-scale fluctuations, highlighting the limitations of traditional hydrological forecasting techniques.
[0003] Early hydrological forecasting relied heavily on empirical statistical models and conceptual hydrological models. Empirical statistical models (such as multiple linear regression and ARIMA models) are simple in structure and computationally efficient, but they can only capture the linear relationship of hydrological sequences and cannot adapt to the complex fluctuation characteristics under extreme climate conditions, resulting in insufficient prediction accuracy for extreme periods such as flood peaks and low water levels. Conceptual hydrological models (such as the Xin'anjiang model) are built based on the physical mechanisms of the hydrological cycle. Although they can reflect the core process of rainfall-runoff generation, they are extremely sensitive to parameters of the underlying surface conditions (such as vegetation cover and soil moisture content). In areas with scarce data or drastic changes in the underlying surface, parameter calibration is difficult, and prediction errors are prone to accumulate.
[0004] With the development of machine learning technology, single deep learning models are increasingly being applied to the field of hydrological forecasting. Long Short-Term Memory (LSTM) networks, with their ability to capture long-term dependencies in time-series data, have demonstrated superior performance to traditional models in hydrological sequence forecasting, effectively mining the temporal dimension features of flow sequences. However, when a single LSTM model directly processes the original hydrological sequence, it struggles to separate fluctuation signals at different scales (high-frequency flood peak fluctuations, mid-frequency seasonal variations, and low-frequency climate trends), and is susceptible to mode aliasing interference, leading to insufficient prediction stability under extreme conditions. Summary of the Invention
[0005] The purpose of this invention is to provide a watershed runoff prediction method and system based on LSTM, which solves the problem of insufficient prediction stability in existing technologies.
[0006] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows:
[0007] In a first aspect, the present invention provides a watershed runoff prediction method based on LSTM, the method comprising:
[0008] Historical hydrological data of the target watershed are acquired and preprocessed to obtain historical hydrological sequences.
[0009] Historical hydrological sequences are decomposed based on preset multi-scale decomposition rules to obtain multiple component data.
[0010] The temporal correlation of each component data is determined based on the partial autocorrelation coefficient analysis method, and component samples of each component data are constructed based on the temporal correlation.
[0011] Construct multiple LSTM models, using the component samples of each component data as the input sequence of an LSTM model to obtain multiple traffic prediction values, and record the accuracy index of each LSTM model.
[0012] Based on the accuracy index of each LSTM model and the frequency characteristics of each component data, the dynamic fusion coefficient of each flow prediction value is determined. The flow prediction values are then fused according to the dynamic fusion coefficient to obtain the intermediate fusion result.
[0013] The nonlinear error of the intermediate fusion results is corrected based on the preset error correction rules to obtain the final traffic prediction result.
[0014] Preferably, the multi-scale decomposition rule is:
[0015] The historical hydrological sequence is used as the target to be decomposed, and multiple sets of independent Gaussian white noise are added to the target to be decomposed to obtain multiple sets of noisy sequences.
[0016] The empirical mode decomposition algorithm is used to perform a basic screening for each group of noisy sequences to extract the first intrinsic mode component and use the first intrinsic mode component as a candidate component.
[0017] Multiple candidate components are aggregated to obtain the final intrinsic mode components. The final intrinsic mode components are then used to perform residual updates on the current target to be decomposed, resulting in the decomposed residual components.
[0018] Determine whether the residual components after decomposition meet the preset conditions. If not, take the residual components after decomposition as the new target to be decomposed, and repeat the basic screening and residual update until the residual components after decomposition are obtained again meet the preset conditions.
[0019] Record the final intrinsic mode component obtained by aggregating multiple candidate components each time and the residual component obtained by the last residual update;
[0020] The recorded final intrinsic mode components and residual components are standardized to obtain standardized final intrinsic mode components and standardized residual components. The standardized final intrinsic mode components and standardized residual components are used as multiple component data.
[0021] Preferably, the temporal correlation of each component data is determined based on the partial autocorrelation coefficient analysis method, and component samples of each component data are constructed according to the temporal correlation, including:
[0022] The temporal correlation of each component data was analyzed using the partial autocorrelation coefficient analysis method.
[0023] Based on the time-series correlation of each component data, plot the autocorrelation coefficient of each component data;
[0024] The correlation of each component data extracted from the correlation coefficient graph is greater than the lag order corresponding to the preset value;
[0025] Lagged data are extracted from the component data based on the lag order, and the lagged data are used as component samples.
[0026] Preferably, the historical hydrological data includes daily rainfall and basin flow, the flow prediction value is the predicted flow of the target basin, and the accuracy indicators include mean absolute error and flood peak misjudgment rate, wherein the mean absolute error is determined by the basin flow and the predicted flow.
[0027] Preferably, the method further includes: determining the flood peak misjudgment rate, including:
[0028] The watershed flow exceeding the preset flow rate is used as the flood peak sample, and the number of flood peak samples is counted.
[0029] Extract the basin flow and predicted flow corresponding to each flood peak sample;
[0030] The flood peak misjudgment rate is determined based on the number of flood peak samples and the corresponding basin flow and predicted flow for each flood peak sample.
[0031] Preferably, based on the accuracy index of each LSTM model and the frequency characteristics of each component data, the dynamic fusion coefficients of each flow prediction value are determined, including:
[0032] Based on the mean absolute error of each LSTM model, the initial dynamic weights for each traffic prediction value are constructed.
[0033] Based on the predicted flow of the target watershed, the scenario type of the target watershed is determined, wherein the scenario type is peak flood period, low water period, or normal water period;
[0034] Determine the scene correction coefficient based on the scene type of the target watershed;
[0035] The frequency characteristics of each component data are divided, and the scene accuracy deviation is determined based on the frequency characteristics.
[0036] The initial dynamic weights of each traffic prediction value are corrected based on the scene correction coefficient and scene accuracy deviation to obtain the dynamic fusion coefficient of each traffic prediction value.
[0037] Preferably, the frequency characteristics include high-frequency components and low-frequency components. When the component data is a high-frequency component, the peak misclassification rate of the LSTM model corresponding to the high-frequency component is used as the scene accuracy deviation. When the component data is a low-frequency component, the scene accuracy deviation is determined based on the mean absolute error of the LSTM model corresponding to the low-frequency component.
[0038] Preferably, the error correction rule is as follows:
[0039] An error correction model is constructed based on the XGBoost algorithm;
[0040] The intermediate fusion results are used as input features for the error correction model, which is then trained. The trained error correction model outputs the initial traffic prediction results.
[0041] The initial traffic prediction results are destandardized to obtain the final traffic prediction results.
[0042] Secondly, the present invention provides an LSTM-based watershed runoff prediction system for implementing the aforementioned LSTM-based watershed runoff prediction method, the system comprising:
[0043] The data acquisition module is used to acquire historical hydrological data of the target watershed and preprocess the historical hydrological data to obtain historical hydrological sequences.
[0044] The data decomposition module is used to decompose historical hydrological sequences based on preset multi-scale decomposition rules to obtain multiple component data.
[0045] The sample construction module is used to determine the temporal correlation of each component data based on the partial autocorrelation coefficient analysis method, and to construct component samples of each component data according to the temporal correlation.
[0046] The watershed prediction module is used to construct multiple LSTM models. It takes the component samples of each component data as the input sequence of an LSTM model to obtain multiple flow prediction values and records the accuracy index of each LSTM model.
[0047] The prediction fusion module is used to determine the dynamic fusion coefficient of each flow prediction value based on the accuracy index of each LSTM model and the frequency characteristics of each component data. The flow prediction values are then fused according to the dynamic fusion coefficient to obtain the intermediate fusion result.
[0048] The prediction correction module is used to correct the nonlinear error of the intermediate fusion results based on preset error correction rules to obtain the final traffic prediction result.
[0049] Thirdly, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described LSTM-based watershed runoff prediction method.
[0050] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described LSTM-based watershed runoff prediction method.
[0051] The beneficial effects of this invention are mainly reflected in:
[0052] The prediction method of this invention can improve the accuracy of flow prediction in the target watershed. The prediction accuracy is significantly better than that of traditional models and single LSTM models, and can provide technical support for the optimized scheduling of water resources, flood control and disaster reduction, and power generation efficiency improvement in the target watershed. Attached Figure Description
[0053] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:
[0054] Figure 1 This is a flowchart of a watershed runoff prediction method based on LSTM provided in one embodiment of the present invention;
[0055] Figure 2 This is a block diagram of a watershed runoff prediction system based on LSTM provided in one embodiment of the present invention. Detailed Implementation
[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.
[0057] Example 1
[0058] Figure 1 This is a flowchart of a watershed runoff prediction method based on LSTM provided in one embodiment of the present invention. Figure 1 As shown, this embodiment provides a watershed runoff prediction method based on LSTM, the method including:
[0059] Step S10: Obtain historical hydrological data of the target watershed and preprocess the historical hydrological data to obtain historical hydrological sequences.
[0060] The target watershed in this embodiment is Baozhusi Reservoir in the Bailongjiang River Basin. This watershed has complex topography, variable climate, uneven spatial and temporal distribution of rainfall, and the inflow is affected by multiple factors such as rainstorms and snowmelt, resulting in strong sequence fluctuations. Traditional models are difficult to meet the requirements for accurate prediction. Therefore, this embodiment can improve the accuracy of inflow prediction for Baozhusi Reservoir in the Bailongjiang River Basin through the prediction steps S10 to S60.
[0061] The historical hydrological data in this embodiment includes daily rainfall and watershed discharge. In the case of the target watershed, which is the Baozhusi Reservoir in the Bailongjiang River Basin, the historical hydrological data specifically refers to the daily hydrological data of the Baozhusi Reservoir in the Bailongjiang River Basin for 18 years from January 1, 1997 to December 31, 2014, mainly including two core indicators: daily rainfall (unit: mm) and daily inflow (unit: m³ / s).
[0062] The preprocessing in this embodiment includes, but is not limited to, data filtering and regularization, data standardization, and missing value imputation.
[0063] The data screening and standardization process involved removing invalid data such as instrument malfunctions (e.g., instantaneous flow values exceeding historical extremes by more than twice), equipment calibration errors, and data acquisition interruptions, ultimately retaining 4328 valid data entries. For outliers in historical hydrological data, the interquartile range (IQR) method was used to correct them.
[0064] Data standardization involves employing a two-interval standardization method to eliminate the dimensional differences between rainfall and flow, ensuring a uniform data range. The functional expression for the two-interval standardization method is as follows:
[0065] ;
[0066] In the formula, X represents the data that needs to be standardized (daily rainfall, daily inflow). min X is the minimum value among all the data that need to be standardized. max X is the maximum value among all the data that need to be standardized. nor The data is standardized (standardized daily rainfall, standardized daily inflow).
[0067] Missing value imputation involves dividing the data into two dimensions: "season" and "climate type" (seasons are divided into spring, summer, autumn, and winter; climate types are divided into normal water levels, drought levels, and flood levels). Missing data is imputed using the mean of the data in the same dimension. For example, for missing flow values during the flood period in summer, the mean flow value of the same period in summer (the past 5 years) is used to impute the missing values. This avoids disrupting the hydrological time series trend by using a single mean imputation, ensures data integrity, meets the requirement of no missing components in the multi-scale decomposition in step S20, and provides a reliable data foundation for the collaborative dynamic fusion in step S50.
[0068] Step S20: Decompose the historical hydrological sequence based on the preset multi-scale decomposition rules to obtain multiple component data.
[0069] This embodiment decomposes historical hydrological sequences using multi-scale decomposition rules, which can accurately capture the high-frequency fluctuations (flood peaks, short-term rainfall response), medium-frequency changes (seasonal changes), and low-frequency trends (long-term climate influences) of hydrological sequences. It achieves feature coverage of all hydrological conditions, including flood peaks, normal water levels, and low water levels, effectively reducing the learning difficulty of LSTM models for nonlinear sequences, improving the convergence speed of single-component LSTM models, avoiding the model from getting trapped in local optima, and thus improving the accuracy of inflow prediction for Baozhusi Reservoir in the Bailongjiang River Basin.
[0070] Specifically, the multi-scale decomposition rule is as follows:
[0071] Step S201: Take the historical hydrological sequence as the target to be decomposed, and add multiple sets of independent Gaussian white noise to the target to be decomposed to obtain multiple sets of noisy sequences.
[0072] In this embodiment, the target to be decomposed is taken as the current residual component, and intrinsic mode decomposition is performed on the current residual component; the functional expression of multiple noisy sequences in this embodiment is:
[0073] ;
[0074] In the formula, The residual components of the (i-1)th decomposition at the current time (t). The preprocessed historical hydrological sequence, i.e. The initial value corresponding to i being 1; Let be the noise intensity of the i-th decomposition. The noise is Gaussian white noise in group j. Let j be the noisy sequence of the residual components of the (i-1)th decomposition; where the noise intensity of the i-th decomposition is... The calculation expression is:
[0075] .
[0076] This embodiment enhances the component differences by adding multiple sets of independent Gaussian white noise to the target to be decomposed, providing a basis for accurate differentiation in the dynamic fusion in step S50.
[0077] Step S202: Perform a basic screening on each group of noisy sequences based on the empirical mode decomposition algorithm to extract the first intrinsic mode component and use the first intrinsic mode component as a candidate component; in this embodiment, the extraction of the first intrinsic mode component avoids component distortion caused by over-screening and ensures the scale feature purity of each intrinsic mode component.
[0078] Step S203: Aggregate multiple candidate components to obtain the final intrinsic mode components, and use the final intrinsic mode components to perform residual updates on the current target to be decomposed to obtain the decomposed residual components.
[0079] The functional relationship for aggregating multiple candidate components is as follows:
[0080] ;
[0081] In the formula, M is the total number of Gaussian white noise groups. For the final intrinsic mode components, IMF1 performs a basic screening operation for each noisy sequence to extract the first intrinsic mode component.
[0082] The functional relationship for residual update of the current target to be decomposed using the final intrinsic mode components is as follows:
[0083] .
[0084] This embodiment can offset the influence of noise by aggregating multiple candidate components, ensuring the accuracy of the final intrinsic mode components and providing a reliable basis for single-component prediction for dynamic fusion.
[0085] Step S204: Determine whether the residual components after decomposition meet the preset conditions. If not, take the residual components after decomposition as the new target to be decomposed, and repeat the basic screening and residual update, that is, repeat steps S201 to S204 until the residual components after decomposition obtained again meet the preset conditions.
[0086] The preset condition of this embodiment is that the current residual component data is a monotonic sequence with no fluctuation characteristics, and it is impossible to decompose it into new residual components. The relationship between the residual component data, the final intrinsic mode components, and the historical hydrological sequence before decomposition in this embodiment is as follows:
[0087] ;
[0088] In the formula, The first part represents the historical hydrological sequence before decomposition, and the second part represents the total number of final intrinsic mode components after decomposition. In this embodiment, the total number of final intrinsic mode components after decomposition is 8, resulting in 8 final intrinsic mode components. This is the residual component obtained from the last residual update.
[0089] Step S205: Record the final intrinsic mode component obtained by aggregating multiple candidate components each time and the residual component obtained by the last residual update.
[0090] Step S206: Standardize the recorded final intrinsic mode components and residual components respectively to obtain standardized final intrinsic mode components and standardized residual components. Use the standardized final intrinsic mode components and standardized residual components as multiple component data. In this embodiment, there are 9 component data, including 8 final intrinsic mode components and 1 residual component.
[0091] In this embodiment, the standardization preferably adopts dual-interval standardization. Since the frequency characteristics of each component are different (high-frequency components fluctuate greatly, while low-frequency components are stable), separate standardization can avoid mutual interference and ensure that the prediction accuracy of each component can be quantified independently.
[0092] Step S30: Determine the temporal correlation of each component data based on the partial autocorrelation coefficient analysis method, and construct component samples for each component data according to the temporal correlation.
[0093] Specifically, the temporal correlation of each component data is determined based on the partial autocorrelation coefficient analysis method, and component samples of each component data are constructed based on the temporal correlation, including: analyzing the temporal correlation of each component data based on the partial autocorrelation coefficient analysis method; drawing the autocorrelation coefficient plot of each component data based on the temporal correlation of each component data; extracting the lag order corresponding to the correlation of each component data in the autocorrelation coefficient plot being greater than a preset value; and extracting lagged data from the component data based on the lag order, using the lagged data as component samples.
[0094] In this embodiment, the lag order is 20, with a preset value of 95%. That is, when the lag order is 20, the correlation of all components exceeds the 95% confidence interval, and the correlation tends to stabilize as the lag order increases. Therefore, the lag data of each component in the previous 20 days are selected as the input of the subsequent LSTM model, with an input dimension of 20.
[0095] Therefore, the method for extracting lagged data from component data based on the lag order is as follows: construct component samples according to the one-to-one mapping relationship of "9 component data from the first 20 days → daily inbound flow on the 21st day".
[0096] This embodiment uses partial autocorrelation coefficient analysis to eliminate the indirect influence of intermediate lag orders, reflecting only the direct linear correlation between the current lag order and the target variable. This accurately determines the optimal input lag order for the hydrological sequence (each intrinsic modal component and residual component after decomposition). It provides an objective basis for setting the input dimension of the LSTM model, avoiding overfitting due to excessively high lag orders and feature loss due to excessively low lag orders, ensuring the completeness and rationality of the model's capture of temporal dependencies.
[0097] Furthermore, for multi-scale components at high, medium, and low frequencies, partial autocorrelation coefficient analysis can analyze the temporal correlation of each component separately, unaffected by fluctuation characteristics at different scales. For example, the correlation patterns between high-frequency intrinsic mode components (peak response) and low-frequency residual components (long-term trend) differ significantly. Partial autocorrelation coefficient analysis can independently determine the optimal lag order for both, ensuring that the LSTM model input design for each component is adapted to its own characteristics, thus laying a reliable foundation for the accuracy quantification and weight allocation of subsequent dynamic fusion.
[0098] Step S40: Construct multiple LSTM models, using the component samples of each component data as the input sequence of an LSTM model to obtain multiple traffic prediction values, and record the accuracy index of each LSTM model.
[0099] In this embodiment, there are 9 LSTM models, and each LSTM model can independently learn the temporal features of the corresponding component data.
[0100] The LSTM model in this embodiment has the following structure: 20 units in the input layer (corresponding to 20-day lag data), 1 hidden layer (15 neurons, lightweight structure to avoid overfitting), and 1 unit in the output layer (corresponding to single-step flow prediction value).
[0101] The hyperparameter settings of the LSTM model in this embodiment are as follows: the activation function is ReLU (to solve the vanishing gradient problem), the optimizer is Adam (learning rate 0.001, decay coefficient 0.9), the loss function is mean squared error (MSE), and an early stopping mechanism is used (training stops if there is no decrease in the validation set MAE for 10 consecutive rounds).
[0102] After obtaining the component samples, this embodiment divides the training set, validation set, and test set into an 8:1:1 ratio. During the division, stratified sampling is performed according to "season-climate type" to ensure that the fluctuation characteristics of the eight intrinsic modal components (IFM1, IFM2, ..., IFM8) and one residual component are consistent across each set. This avoids excessively high / low proportions of high-frequency components (flood peaks) in any one set, which could lead to biased weight training in dynamic fusion and ensure that the weights are adapted to the entire hydrological scenario. IFM1 and IFM2 are high-frequency components, IFM3-IFM5 are mid-frequency components, and IFM6-IFM8 are low-frequency components.
[0103] After each LSTM model is trained, it outputs the predicted values of the corresponding components in the training set, validation set, and test set, and records the accuracy metrics of each model in real time. In this embodiment, the mean absolute error and the peak false positive rate are recorded.
[0104] The mean absolute error is determined by the watershed discharge and the predicted discharge, and its functional expression is as follows:
[0105] ;
[0106] In the formula, MAE is the mean absolute error, N is the total number of component samples, t is the time series index corresponding to the daily data, and x(t) is the watershed flow (actual inflow) at time t. The predicted flow rate (predicted inflow rate) at time t.
[0107] The method for determining the flood peak misjudgment rate is as follows: the basin flow exceeding the preset flow is taken as the flood peak sample, and the number of flood peak samples is counted; the basin flow and predicted flow corresponding to each flood peak sample are extracted; and the flood peak misjudgment rate is determined based on the number of flood peak samples and the basin flow and predicted flow corresponding to each flood peak sample.
[0108] The functional expression for the flood peak false positive rate in this embodiment is:
[0109] ;
[0110] In the formula, For the flood peak misjudgment rate, G represents the preset flow rate, and G is the number of peak flow samples. The basin flow rate at time t in the flood peak sample. This represents the predicted flow rate at time t in the flood peak sample.
[0111] Step S50: Based on the accuracy index of each LSTM model and the frequency characteristics of each component data, determine the dynamic fusion coefficient of each flow prediction value, and fuse each flow prediction value according to the dynamic fusion coefficient to obtain the intermediate fusion result.
[0112] Specifically, based on the accuracy metrics of each LSTM model and the frequency characteristics of each component data, the dynamic fusion coefficients for each flow prediction value are determined, including:
[0113] Step S501: Based on the mean absolute error of each LSTM model, construct the initial dynamic weights for each traffic prediction value. The function expression for the initial dynamic weights in this embodiment is:
[0114] ;
[0115] In the formula, w i Let MAE be the initial dynamic weights of the i-th LSTM model. k The mean absolute error of the k-th component data. It is a very small constant.
[0116] Step S502: Determine the scenario type of the target watershed based on the predicted flow rate of the target watershed, wherein the scenario type is peak flood period, dry season, or normal water period.
[0117] Step S503: Determine the scene correction coefficient based on the scene type of the target watershed.
[0118] Step S504: Divide the data components into frequency characteristics and determine the scene accuracy deviation based on the frequency characteristics; wherein, the frequency characteristics include high-frequency components (including IFM1 and IFM2) and low-frequency components (including IFM6~IFM8 and residual components). When the component data is a high-frequency component, the flood false positive rate of the LSTM model corresponding to the high-frequency component is used as the scene accuracy deviation. When the component data is a low-frequency component, the scene accuracy deviation is determined based on the mean absolute error of the LSTM model corresponding to the low-frequency component.
[0119] Step S505: Correct the initial dynamic weights of each traffic prediction value according to the scene correction coefficient and scene accuracy deviation to obtain the dynamic fusion coefficients of each traffic prediction value.
[0120] The functional expression for the dynamic fusion coefficient in this embodiment is:
[0121] ;
[0122] In the formula, Let be the dynamic fusion coefficients of the i-th LSTM model. This is a scene correction factor; when the scene type is peak flood period, the scene correction factor is... The value is set to 0.2 to strengthen the weight of high-frequency components. When the scene type is a dry season, the scene correction coefficient is... The value is set to 0.15 to strengthen the weight of low-frequency components; when the scene type is a flat water period, the scene correction coefficient is... The value is set to 0.1 to balance the weights of each component.
[0123] S i The scene accuracy deviation of the i-th LSTM model is divided into the following three scenarios based on the frequency characteristics of each component data:
[0124] When the component data input to the i-th LSTM model is a high-frequency component, the flood peak misclassification rate is directly used as the scene accuracy deviation.
[0125] When the component data input to the i-th LSTM model is the mid-frequency component, the scene accuracy deviation is 0.
[0126] When the input component data of the i-th LSTM model is a low-frequency component, the scene accuracy deviation S of the i-th LSTM model is... i The expression is as follows:
[0127] ;
[0128] In the formula, Let be the mean absolute error of the i-th LSTM model. This represents the maximum value of the mean absolute error among all LSTM models.
[0129] The scene accuracy deviation S in this embodiment i By setting differentiated parameters for different components, the prediction bias of each component's data in the corresponding scenario can be objectively quantified, avoiding the subjectivity of relying solely on experience to judge the component's adaptability. For example, the high-frequency component uses scenario accuracy bias to accurately reflect the prediction accuracy of flood peak scenarios, while the normalized MAE of the low-frequency component can intuitively reflect the trend bias of low-water scenarios, serving as a scenario correction coefficient. The role of this is to provide clear targets and ensure that weight adjustments are "based on evidence" rather than being made blindly.
[0130] In this embodiment, the scene correction coefficient dynamically adjusts the weight amplification ratio based on hydrological conditions (peak flood 0.2, low water 0.15, normal water 0.1), and then combines this with the scene accuracy deviation value to achieve "better to the best." When the high-frequency component peak flood prediction accuracy is high, the scene correction coefficient... Its weighting can be further increased to strengthen its advantage in capturing flood peaks; when the prediction deviation of low-frequency components in terms of low water trend is small, the scenario correction coefficient can be used. Optimization highlights its trend-fitting value, achieving deep integration of component characteristics, hydrological scenarios, and prediction accuracy to form a closed loop of "deviation perception - weight correction - accuracy improvement." Faced with complex conditions such as uneven rainfall and sudden changes in flow in the Bailongjiang River basin, this linkage can quickly adapt to scenario changes. Compared to a single correction scheme, it can improve anti-interference capabilities and perfectly adapt to the nonlinear and non-stationary characteristics of hydrological sequences.
[0131] Therefore, the formula for fusing the predicted traffic values based on the dynamic fusion coefficient in this embodiment is as follows:
[0132] ;
[0133] In the formula, This is the result of intermediate fusion. Let be the traffic prediction value of the i-th LSTM model.
[0134] Step S60: Correct the nonlinear error of the intermediate fusion result based on the preset error correction rule to obtain the final traffic prediction result.
[0135] In this embodiment, due to the residual nonlinear errors in the multi-scale decomposition of historical hydrological sequences and the dynamic fusion of various flow predictions, in order to further improve the prediction accuracy, this embodiment adopts an error correction rule to correct the nonlinear errors of the intermediate fusion results. Specifically, the error correction rule is as follows: an error correction model is constructed based on the XGBoost algorithm; the intermediate fusion results are used as input features of the error correction model, and the error correction model is trained; the trained error correction model outputs the initial flow prediction result; the initial flow prediction result is de-standardized to obtain the final flow prediction result.
[0136] This embodiment uses the intermediate fusion results of dynamic fusion as input features of the error correction model and the original hydrological sequence as output labels to train the error correction model. Leveraging the regularization mechanism and gradient boosting characteristics of the XGBoost algorithm, it accurately corrects residual nonlinear errors in multi-scale decomposition and dynamic fusion, ensuring the model's generalization ability and ultimately outputting high-precision prediction results. Specifically, the optimal hyperparameters of XGBoost are determined through Yeats optimization: learning rate 0.05 (to improve generalization ability), maximum depth 8 (to control complexity and avoid overfitting), maximum number of features 9 (consistent with the number of CEEMDAN components), minimum number of sample splits 10, minimum number of sample leaf nodes 5, and regularization coefficients L1=0.1 and L2=0.01 (to strengthen regularization).
[0137] This embodiment's prediction method was developed to meet the inflow prediction needs of Baozhusi Reservoir in the Bailongjiang River Basin. It focuses on addressing the shortcomings of traditional hydrological models (such as multi-year average inflow, historical similarity years, and set pair analysis models) under extreme climate change in responding to extreme droughts and floods, the increasing complexity of rainfall-runoff relationships, and risk control in scheduling decisions. This embodiment employs a basin runoff prediction method centered on "multi-scale decomposition rules + multi-model dynamic fusion + nonlinear correction," constructing a complete technical system encompassing "data processing - feature decomposition - model prediction - integrated optimization - visualization interaction," ultimately achieving accurate inflow prediction. After retesting of 4328 valid data points obtained from preprocessing in step S10, the model prediction accuracy reached over 82%, significantly outperforming traditional models and single LSTM models, providing technical support for reservoir optimized scheduling, flood control and disaster reduction, and power generation efficiency improvement.
[0138] Example 2
[0139] Figure 2 This is an LSTM-based watershed runoff prediction system provided by one embodiment of the present invention. For example... Figure 2As shown, this embodiment provides a watershed runoff prediction system based on LSTM. The system is used to implement the watershed runoff prediction method based on LSTM in Embodiment 1. The system includes:
[0140] The data acquisition module is used to acquire historical hydrological data of the target watershed and preprocess the historical hydrological data to obtain historical hydrological sequences.
[0141] The data decomposition module is used to decompose historical hydrological sequences based on preset multi-scale decomposition rules to obtain multiple component data.
[0142] The sample construction module is used to determine the temporal correlation of each component data based on the partial autocorrelation coefficient analysis method, and to construct component samples of each component data according to the temporal correlation.
[0143] The watershed prediction module is used to construct multiple LSTM models. It takes the component samples of each component data as the input sequence of an LSTM model to obtain multiple flow prediction values and records the accuracy index of each LSTM model.
[0144] The prediction fusion module is used to determine the dynamic fusion coefficient of each flow prediction value based on the accuracy index of each LSTM model and the frequency characteristics of each component data. The flow prediction values are then fused according to the dynamic fusion coefficient to obtain the intermediate fusion result.
[0145] The prediction correction module is used to correct the nonlinear error of the intermediate fusion results based on preset error correction rules to obtain the final traffic prediction result.
[0146] This embodiment also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described LSTM-based watershed runoff prediction method.
[0147] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described LSTM-based watershed runoff prediction method.
[0148] This embodiment can improve the accuracy of flow prediction in the target watershed. The prediction accuracy is significantly better than that of traditional models and single LSTM models, and can provide technical support for the optimized scheduling of water resources, flood control and disaster reduction, and power generation efficiency improvement in the target watershed.
[0149] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.
[0151] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A watershed runoff prediction method based on LSTM, characterized in that, The method includes: Historical hydrological data of the target watershed are acquired and preprocessed to obtain historical hydrological sequences. Historical hydrological sequences are decomposed based on preset multi-scale decomposition rules to obtain multiple component data. The temporal correlation of each component data is determined based on the partial autocorrelation coefficient analysis method, and component samples of each component data are constructed based on the temporal correlation. Construct multiple LSTM models, using the component samples of each component data as the input sequence of an LSTM model to obtain multiple traffic prediction values, and record the accuracy index of each LSTM model. Based on the accuracy index of each LSTM model and the frequency characteristics of each component data, the dynamic fusion coefficient of each flow prediction value is determined. The flow prediction values are then fused according to the dynamic fusion coefficient to obtain the intermediate fusion result. The nonlinear error of the intermediate fusion results is corrected based on the preset error correction rules to obtain the final traffic prediction result. Among them, based on the accuracy index of each LSTM model and the frequency characteristics of each component data, the dynamic fusion coefficients of each flow prediction value are determined, including: Based on the mean absolute error of each LSTM model, the initial dynamic weights for each traffic prediction value are constructed. Based on the predicted flow of the target watershed, the scenario type of the target watershed is determined, wherein the scenario type is peak flood period, low water period, or normal water period; Determine the scene correction coefficient based on the scene type of the target watershed; The frequency characteristics of each component data are divided, and the scene accuracy deviation is determined based on the frequency characteristics. The initial dynamic weights of each traffic prediction value are corrected based on the scene correction coefficient and the scene accuracy deviation to obtain the dynamic fusion coefficient of each traffic prediction value. The frequency characteristics include high-frequency components and low-frequency components. When the component data is a high-frequency component, the peak misclassification rate of the LSTM model corresponding to the high-frequency component is used as the scene accuracy deviation. When the component data is a low-frequency component, the scene accuracy deviation is determined based on the mean absolute error of the LSTM model corresponding to the low-frequency component.
2. The LSTM-based watershed runoff prediction method according to claim 1, characterized in that, The multi-scale decomposition rule is as follows: The historical hydrological sequence is used as the target to be decomposed, and multiple sets of independent Gaussian white noise are added to the target to be decomposed to obtain multiple sets of noisy sequences. The empirical mode decomposition algorithm is used to perform a basic screening for each group of noisy sequences to extract the first intrinsic mode component and use the first intrinsic mode component as a candidate component. Multiple candidate components are aggregated to obtain the final intrinsic mode components. The final intrinsic mode components are then used to perform residual updates on the current target to be decomposed, resulting in the decomposed residual components. Determine whether the residual component data after decomposition meets the preset conditions. If not, take the residual component after decomposition as the new target to be decomposed, and repeat the basic screening and residual update until the residual component after decomposition is obtained again meets the preset conditions. Record the final intrinsic mode component obtained by aggregating multiple candidate components each time and the residual component obtained by the last residual update; The recorded final intrinsic mode components and residual components are standardized to obtain standardized final intrinsic mode components and standardized residual components. The standardized final intrinsic mode components and standardized residual components are used as multiple component data.
3. The LSTM-based watershed runoff prediction method according to claim 1, characterized in that, The temporal correlation of each component data was determined based on the partial autocorrelation coefficient analysis method, and component samples of each component data were constructed based on the temporal correlation, including: The temporal correlation of each component data was analyzed using the partial autocorrelation coefficient analysis method. Based on the time-series correlation of each component data, plot the autocorrelation coefficient of each component data; The correlation of each component data extracted from the correlation coefficient graph is greater than the lag order corresponding to the preset value; Lagged data are extracted from the component data based on the lag order, and the lagged data are used as component samples.
4. The LSTM-based watershed runoff prediction method according to claim 1, characterized in that, The historical hydrological data includes daily rainfall and basin flow, the flow prediction value is the predicted flow of the target basin, and the accuracy indicators include mean absolute error and flood peak misjudgment rate, wherein the mean absolute error is determined by the basin flow and the predicted flow.
5. The LSTM-based watershed runoff prediction method according to claim 4, characterized in that, The method further includes: determining the flood peak misjudgment rate, including: The watershed flow exceeding the preset flow rate is used as the flood peak sample, and the number of flood peak samples is counted. Extract the basin flow and predicted flow corresponding to each flood peak sample; The flood peak misjudgment rate is determined based on the number of flood peak samples and the corresponding basin flow and predicted flow for each flood peak sample.
6. The LSTM-based watershed runoff prediction method according to claim 1, characterized in that, The error correction rule is as follows: An error correction model is constructed based on the XGBoost algorithm; The intermediate fusion results are used as input features for the error correction model, which is then trained. The trained error correction model outputs the initial traffic prediction results. The initial traffic prediction results are destandardized to obtain the final traffic prediction results.
7. A watershed runoff prediction system based on LSTM, used to implement the watershed runoff prediction method based on LSTM as described in any one of claims 1-6, characterized in that, The system includes: The data acquisition module is used to acquire historical hydrological data of the target watershed and preprocess the historical hydrological data to obtain historical hydrological sequences. The data decomposition module is used to decompose historical hydrological sequences based on preset multi-scale decomposition rules to obtain multiple component data. The sample construction module is used to determine the temporal correlation of each component data based on the partial autocorrelation coefficient analysis method, and to construct component samples of each component data according to the temporal correlation. The watershed prediction module is used to construct multiple LSTM models. It takes the component samples of each component data as the input sequence of an LSTM model to obtain multiple flow prediction values and records the accuracy index of each LSTM model. The prediction fusion module is used to determine the dynamic fusion coefficient of each flow prediction value based on the accuracy index of each LSTM model and the frequency characteristics of each component data. The flow prediction values are then fused according to the dynamic fusion coefficient to obtain the intermediate fusion result. The prediction correction module is used to correct the nonlinear error of the intermediate fusion results based on preset error correction rules to obtain the final traffic prediction result.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the LSTM-based watershed runoff prediction method as described in any one of claims 1-6.