Hydrological flow prediction method based on causal inference and extended long short-term memory network

By screening characteristic meteorological factors based on causal inference and expanding long and short-term memory networks, we construct a hydrological flow prediction model based on causal inference and expansion of long and short-term memory networks, and solving the uncertainty problem of existing models under the influence of climate change and human activities, achieving more accurate flow prediction and real-time response.

CN120409772APending Publication Date: 2025-08-01CHINA HYDROELECTRIC ENGINEERING CONSULTING GROUP CHENGDU RESEARCH HYDROELECTRIC INVESTIGATION DESIGN AND INSTITUTE
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510470046.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Under the influence of climate change and human activities, the existing hydrological flow prediction model has great uncertainty in model parameters and lacks descriptions of the dynamic evolution of the lower surface, which leads to great uncertainty in future prediction and poor modeling of factors other than flow.

Method used

Using a method based on causal inference and extended long and short-term memory network, characteristic meteorological factors were screened through Granger's causal test, combined with the water equilibrium equation and non-negative flow constraints, a hydrological flow prediction model was constructed, and the extended long and short-term memory network was used for training and prediction.

Benefits of technology

It improves the accuracy and real-time nature of hydrological flow prediction, enhances the response ability to extreme events, improves the interpretability and scientificity of the model, and provides support for flood forecasting and disaster prevention and mitigation in the basin.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_14
    Figure SMS_14
  • Figure FDA0005359721000000011
    Figure FDA0005359721000000011
  • Figure FDA0005359721000000012
    Figure FDA0005359721000000012
Patent Text Reader

Abstract

The invention mainly relates to the technical field of hydrological forecasting. In order to improve the precision and real-time performance of hydrological flow prediction, the invention provides a hydrological flow prediction method based on causal inference and an extended long short-term memory network, and the method comprises the following steps: collecting historical hydrological flow and meteorological factor data, and carrying out the preprocessing; meteorological factors having Granger causality with the hydrological flow are screened out to serve as characteristic meteorological factors for hydrological flow prediction; and establishing a hydrological flow prediction model based on the extended long short-term memory network, taking the historical feature meteorological factors and the hydrological flow data as the input of the hydrological flow prediction model, and training the hydrological flow prediction model to predict the future hydrological flow. The hydrological flow prediction model is more accurate when learning the long-term trend and short-term fluctuation of the hydrological flow, the interpretability and scientificity of a hydrological flow prediction result of the hydrological flow prediction model are enhanced, and a scientific basis and technical support are provided for hydrological management, drainage basin treatment and extreme climate response.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the technical field of hydrological forecasting, and particularly relates to a hydrological flow prediction method based on causal inference and extended long short-term memory network. Background Art

[0002] In China, due to the uneven distribution of water resources in terms of time and space, affected by climate, there is more rain in the south, with relatively rich fresh water resources, while the north is relatively scarce. With the continuous development of the national economy, the water consumption for agriculture and industry is continuously increasing. Under the influence of human activities, the climate changes sharply in the short term, changing the flow directions of each part in the water cycle. Therefore, the rational utilization of water resources and flood control and disaster reduction have become issues that cannot be ignored. Hydrological forecasting is a key content of the disciplines of hydrology and water resources. Among them, real-time flow prediction is the focus of hydrological forecasting and is the basis for realizing the scientific planning, rational allocation, and adaptive utilization of water resources. Over the years, many experts and scholars at home and abroad have carried out a large number of studies on the problem of hydrological flow prediction and achieved many fruitful results, effectively supporting the work of water resource allocation and management. However, in the changing environment affected by climate change and human activities, the formation mechanism and evolution law of runoff will change, and these changes pose great challenges to the applicability of existing prediction models and methods. The current distributed models have a good physical description of the hydrological process, but have poor modeling effects on other factors except flow, and the uncertainty of model parameters is large; they lack the description of the dynamic evolution of the underlying surface, and the uncertainty of future prediction is large. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a hydrological flow prediction method based on causal inference and extended long short-term memory network, aiming to improve the accuracy and real-time performance of hydrological flow prediction.

[0004] The technical solution adopted by the present invention to solve the above technical problem is:

[0005] A hydrological flow prediction method based on causal inference and extended long short-term memory network, the method comprising:

[0006] Collect historical hydrological flow and meteorological factor data, and perform data preprocessing;

[0007] Screen out the meteorological factors that have Granger causality with the hydrological flow as the characteristic meteorological factors for hydrological flow prediction;

[0008] Establish a hydrological flow prediction model based on the extended long short-term memory network, use the historical characteristic meteorological factors and hydrological flow data as the input of the hydrological flow prediction model, and train the hydrological flow prediction model;

[0009] Predict the hydrological flow within a set future prediction period based on the trained hydrological flow prediction model.

[0010] Furthermore, the preprocessing includes: removing outliers, imputing missing values, normalizing, and standardizing the historical hydrological flow and meteorological factor data.

[0011] Furthermore, the specific steps of screening out the meteorological factors that have Granger causality with the hydrological flow as the characteristic meteorological factors for hydrological flow prediction are as follows:

[0012] Screen out the characteristic meteorological factors for hydrological flow prediction based on Granger causality test;

[0013] Establish a restricted regression model and predict the hydrological flow based on the historical hydrological flow;

[0014] Establish an unrestricted regression model and predict the hydrological flow based on the historical hydrological flow and the characteristic meteorological factors that affect the hydrological flow prediction;

[0015] If the difference between the error between the hydrological flow prediction result of the unrestricted regression model and the true hydrological flow and the error between the hydrological flow prediction result of the restricted regression model and the true hydrological flow meets the set standard, then the screened characteristic meteorological factors meet the requirements; otherwise, the screening of the characteristic meteorological factors needs to be redone.

[0016] Furthermore, the restricted regression model is: Where Q t1 Is the hydrological flow predicted by the restricted regression model, Q t-i Is the historical flow, P is the historical time length, i represents the index of the lagged flow term, εt is the error term, α0 is the constant term, α i ' Is the restricted hydrological flow regression coefficient.

[0017] Furthermore, the unrestricted regression model is: Where Q t2 Is the hydrological flow predicted by the unrestricted regression model, Q t-i Is the historical flow, i represents the index of the lagged flow term, P is the historical time length, ηt is the error term, β0 is the constant term, β i Is the unrestricted hydrological flow regression coefficient, X t-j Is the screened meteorological factor, j represents the index of the meteorological factor term, γ t Is the meteorological regression coefficient.

[0018] Furthermore, based on the F-test, determine whether the difference between the error between the hydrological flow prediction results of the restricted regression model and the unrestricted regression model and the true hydrological flow meets the set standard. The specific calculation method is: Where SSEr The sum of squared errors between the predicted hydrological flow of the restricted regression model and the true hydrological flow, SSE μ The sum of squared errors between the predicted hydrological flow of the unrestricted regression model and the true hydrological flow, k is the number of introduced characteristic meteorological variables, and n is the number of samples.

[0019] Furthermore, constructing the hydrological flow prediction model includes: adding a physical loss term to the loss function in the extended long short-term memory network, and the physical loss term includes constraints such as the water balance equation and the non-negativity of flow.

[0020] Furthermore, the loss function after adding the physical loss term is: L = ∑ t (Q true,t -Q predict,t ) 2 +λL physics , where L physics is the physical loss term, Q in,t is the upstream hydrological flow output, Q out,t is the downstream hydrological flow output, Q predict,t is the predicted hydrological flow, is the change in water storage, λ is the physical constraint strength, and Q true,t is the true value of the sum of the basin's hydrological flow.

[0021] Furthermore, during the training of the hydrological flow prediction model, the Adam optimizer is used to update the parameters until the loss function converges.

[0022] Furthermore, the method further includes continuously inputting historical hydrological flow and meteorological factors into the trained hydrological flow prediction model in a sliding window manner, and the hydrological flow prediction model dynamically conducts hydrological flow prediction based on the model's adaptive learning mechanism.

[0023] Advantages of the present invention:

[0024] (1) The hydrological flow prediction method based on causal inference and extended long short-term memory network of the present invention integrates causal inference theory, deep learning algorithms, and physical constraint optimization. In the data processing stage, the Granger causality algorithm is used to screen the characteristic meteorological factors that have the most significant impact on hydrological flow, remove redundant meteorological features, optimize the variable set input for hydrological flow prediction, and input the characteristic meteorological factors screened by the Granger causality algorithm and historical hydrological flow into the extended long short-term memory network with stronger memory ability and feature extraction ability, which can more effectively process the non-linear and non-stationary time series in the model input features, improve the response ability to extreme events such as floods and dry seasons, make the hydrological flow prediction model more accurate in learning the long-term trend and short-term fluctuations of hydrological flow, enable the model to have the ability to learn the laws of hydrological formation, enhance the interpretability and scientificity of the hydrological flow prediction results of the hydrological flow prediction model, and provide scientific basis and technical support for basin flood forecasting, engineering flood control and flood season operation, basin disaster prevention and mitigation, basin governance, and extreme climate response;

[0025] (2) In the process of training the hydrological flow prediction model of the present invention, the water balance equation and the non-negativity constraint of flow in hydrology are introduced as physical constraint mechanisms to ensure that the hydrological flow prediction process and results conform to hydrological laws, and a dynamic update strategy is combined in the prediction process of the hydrological flow prediction model, so that the input data of the hydrological flow prediction model can be continuously optimized during model training, that is, "self-learning", improving the hydrological flow prediction accuracy and the adaptability to real-time flow data input into the model. Specific implementation manner

[0026] Collect the historical hydrological flow data of the basin recorded by the hydrological station and the meteorological factor data affecting evapotranspiration, such as precipitation, temperature, wind speed, relative humidity, etc. in the selected historical period of the basin. Preprocess the collected historical hydrological flow and meteorological factor data, including outlier removal, missing value filling, standardization, and normalization. When filling in missing values, if the data volume is small, the KNN algorithm (K nearest neighbor) is used to interpolate the missing values, and if the data volume is large, the random forest method is used for interpolation; the Z-score method is used for outlier detection and processing. When the absolute value of Z exceeds the set value, the points in the corresponding sequence in the data are marked as outliers and removed; finally, the data is normalized to 0-1 to ensure the hydrological flow of the basin and reduce the existence of errors.

[0027] Granger causality test is a causal analysis method based on time series data, aiming to judge whether a variable X helps to predict another variable Y. If the past values of X can significantly improve the prediction result of Y, then X is considered to have a Granger causal relationship with Y. In the present invention, based on the Granger causality test, the characteristic meteorological factors that have a significant impact on hydrological flow prediction are screened from the collected meteorological factors, and the screening method is as follows:

[0028] A restricted regression model is established, and historical hydrological flow is used to predict the hydrological flow at the next moment. The restricted regression model is as follows: where Q t1 is the hydrological flow predicted by the restricted regression model, Q t-i is the historical hydrological flow, P is the historical time length, εt is the error term, P is the historical time length, α0 is the constant term of the regression model, representing the base flow (channel base flow) level when all variables are zero, and α i is the restricted regression coefficient, which is used to quantify the influence degree of the i-th causal driving variable (lag flow or meteorological factor) on the flow Qt+1 at the future moment.

[0029] An unrestricted regression model is established. Meteorological factors are selected, and the historical data of the selected meteorological factors and the historical data of hydrological flow are used to predict the hydrological flow at the next moment. The unrestricted regression model is as follows: where Q t2 is the hydrological flow predicted by the unrestricted regression model, Q t-i is the historical hydrological flow, P is the historical time length, ηt is the error term, β0 is the constant term of the regression model, representing the base flow (the lowest flow in the channel) level when all variables are zero, and β i is the unrestricted regression coefficient, which is used to quantify the influence degree of the i-th causal driving variable (lag flow or meteorological factor) on the hydrological flow at the future moment, X t-j is the value of the selected meteorological factor, and γ t is the meteorological regression coefficient.

[0030] If the difference between the error between the hydrological flow prediction result of the unrestricted regression model and the true hydrological flow and the error between the hydrological flow prediction result of the restricted regression model and the true hydrological flow meets the set standard, the corresponding meteorological factor meets the requirements and is used as the characteristic meteorological factor. Otherwise, the screening of the characteristic meteorological factor needs to be carried out again.

[0031] In this embodiment, the F-test is used to judge whether the selected characteristic meteorological factor meets the standard. The specific algorithm is as follows: where SSE r is the sum of the squares of the errors between the hydrological flow prediction result of the restricted regression model and the true hydrological flow, SSE μ is the sum of the squares of the errors between the hydrological flow prediction result of the unrestricted regression model and the true hydrological flow, k is the number of introduced characteristic meteorological factors, and n is the number of samples. If the F value is significantly greater than 1, and the p value p < 0.05, the null hypothesis is rejected, and it is considered that there is a Granger causality between the selected characteristic meteorological factor and the hydrological flow. For example, SSE r= 50, SSE μ = 30, k = 2, n = 20. The critical value of the F-test (significance level 0.05) is calculated to be 3.59. If the F value > the critical value in the F-distribution table, it indicates that the introduced variable has a significant impact. Since the calculated F value in this embodiment is 5.67, F = 5.67 > 3.59, the original hypothesis is rejected, indicating that the corresponding meteorological factor has Granger causality on the hydrological flow. It is used as a characteristic meteorological factor for the input of constructing the hydrological flow prediction model.

[0032] The traditional long short-term memory network (LSTM) has good performance in time series prediction, but its long-term memory ability is limited, its adaptability to non-stationary data is poor, it is insensitive to physical constraints, and the "black box" process is difficult to reflect the hydrological formation mechanism. Therefore, the present invention establishes a hydrological flow prediction model based on the extended long short-term memory network (xLSTM) to improve the accuracy, interpretability and stability of hydrological flow prediction.

[0033] The preprocessed historical data of characteristic meteorological factors and historical hydrological flow are input into the extended long short-term memory network for hydrological flow prediction training to establish a hydrological flow prediction model. The extended long short-term memory network is mainly divided into an input layer, a memory unit, a physical constraint layer, a fully connected layer and an output layer.

[0034] Input layer: Used to input the preprocessed historical hydrological flow and characteristic meteorological factor data;

[0035] Memory Unit: Enhance the traditional long short-term memory network structure, introduce improvement mechanisms such as variable time step control and weight adaptive adjustment, and improve the learning ability for long-term trends and extreme events. The advantages of the extended long short-term memory network memory unit are as follows: When the long short-term memory network learns time series, it usually has a fixed time step. For example, when predicting the current hydrological flow, the long short-term memory network only refers to the flow data of the past set number of days, such as 5 days. Regardless of whether the data of the past 5 days are all important, the long short-term memory network uses them equally. However, in the real hydrological system, the importance of data at different times is different. For example, yesterday's heavy rainstorm has a great impact on today's flow, but the light rain 10 days ago may have little impact. The long short-term memory network may not be able to distinguish the importance of data at these different time steps. The extended long short-term memory network can effectively perform variable time step control and automatically adjust the time range of backtracking. For example, when extreme rainfall (rainstorm flood) occurs recently, the extended long short-term memory network will automatically focus on the data of the recent few days. When the weather is stable, it will consider longer-term trends (such as data from the previous 10 - 15 days), rather than being limited to a fixed 5 days. At the same time, through the attention mechanism, the extended long short-term memory network can dynamically adjust the importance of different prediction parameters. For example, during the flood period, precipitation is the main influencing factor for basin hydrological prediction, and the extended long short-term memory network will increase the weight of precipitation; during the dry period, evaporation is more important for the hydrological flow of the basin, and the extended long short-term memory network will increase the weight of temperature.

[0036] Physical Constraint Layer: In the present invention, based on the mean square error (MSE), the water balance equation and the non-negativity constraint of flow are added as physical loss terms to the loss function, making the trained flow prediction model more interpretable in terms of hydrological genesis laws. The loss function after adding the physical loss term is: L = ∑ t (Q true,t -Q predict,t ) 2 +λL physics , where L physics is the physical loss term, Q in,t is the upstream hydrological flow output, Q out,t is the downstream hydrological flow output, Q predict,t is the predicted hydrological flow, is the change in water storage, λ is the physical constraint intensity, Q true,t is the predicted value of hydrological flow, and the boundary constraint is that the flow value cannot be less than 0.

[0037] Construct the input matrix where Q t-n , ……, Q t-1 , Q tis the hydrological flow value from t - n to t in the past, P t-n , ……, P t-1 , P t ; ……; X t-n , ……, X t-1 , X t are the values of various characteristic meteorological factors from t - n to t in the past.

[0038] Input the constructed input matrix into the hydrological flow prediction model for model training. The model training process specifically includes:

[0039] According to the pre - processed historical hydrological flow and characteristic meteorological factor data, divide them into a training set, a validation set, and a calibration set. The training set is used to train the model, the validation set is used to validate the model trained by the training set and optimize the parameters, and the calibration set is only used to judge the quality of the model.

[0040] During the training process of the hydrological flow prediction model, use the Adam optimizer to update the parameters until the loss function converges.

[0041] Finally, when predicting the actual hydrological flow, use the sliding window method to continuously input the historical hydrological flow and meteorological factors into the trained hydrological flow prediction model. The number of windows can be continuously updated according to data changes. The hydrological flow prediction model dynamically conducts hydrological flow prediction based on the adaptive learning mechanism to improve the real - time performance of the hydrological flow prediction results.

Claims

1. A hydrological flow prediction method based on causal inference and extended long short-term memory network, characterized in that The method includes: Collect historical hydrological flow and meteorological factor data and perform data preprocessing; Screen out the meteorological factors that have Granger causality with the hydrological flow as the characteristic meteorological factors for hydrological flow prediction; Build a hydrological flow prediction model based on the extended long short-term memory network, use the historical characteristic meteorological factors and hydrological flow data as the input of the hydrological flow prediction model, and train the hydrological flow prediction model; Predict the hydrological flow within a set future prediction period based on the trained hydrological flow prediction model.

2. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 1, wherein, The preprocessing includes: removing outliers, imputing missing values, normalizing and standardizing the historical hydrological flow and meteorological factor data.

3. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 1, characterized in that The screening out of the meteorological factors that have Granger causality with the hydrological flow as the characteristic meteorological factors for hydrological flow prediction specifically includes: The screening out of the meteorological factors that have Granger causality with the hydrological flow as the characteristic meteorological factors for hydrological flow prediction specifically includes: Screen out the characteristic meteorological factors for hydrological flow prediction based on Granger causality test; Build a restricted regression model and predict the hydrological flow based on historical hydrological flow; Build an unrestricted regression model and predict the hydrological flow based on historical hydrological flow and the characteristic meteorological factors that have an impact on hydrological flow prediction; If the difference between the error between the hydrological flow prediction result of the unrestricted regression model and the true hydrological flow and the error between the hydrological flow prediction result of the restricted regression model and the true hydrological flow meets the set standard, the screened characteristic meteorological factors meet the requirements; otherwise, the characteristic meteorological factors need to be screened again.

4. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 3, wherein, The restricted regression model is as follows: where Q t1 is the predicted hydrological flow by the restricted regression model, Q t-i is the historical flow, P is the historical time length, εt is the error term, α0 is the constant term, and α i is the restricted hydrological flow regression coefficient, and i represents the index of the lagged flow term.

5. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 3, wherein The non - restricted regression model is as follows: where Q t2 is the predicted hydrological flow by the non - restricted regression model, Q t-i is the historical flow, P is the historical time length, ηt is the error term, β0 is the constant term, β i is the non - restricted hydrological flow regression coefficient, X t-j is the selected meteorological factor, γ t is the meteorological regression coefficient, i represents the index of the lagged flow term, and j represents the index of the meteorological factor term.

6. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 3, characterized in that, Based on the F-test, determine whether the difference between the errors between the hydrological flow prediction results of the restricted regression model and the unrestricted regression model and the true hydrological flow meets the set standard. The specific calculation method is as follows: where SSE r is the sum of squared errors between the hydrological flow prediction result of the restricted regression model and the true hydrological flow, and SSE μ is the sum of squared errors between the hydrological flow prediction result of the unrestricted regression model and the true hydrological flow. k is the number of introduced characteristic meteorological variables, and n is the number of samples.

7. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 1, wherein The building of the hydrological flow prediction model includes: adding a physical loss term to the loss function in the extended long short-term memory network, and the physical loss term includes the water balance equation and the non-negativity constraint of the flow.

8. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 7, characterized in that The loss function after adding the physical loss term is: L = ∑ t (Q true,t - Q predict,t ) 2 + λL physics , where L physics is the physical loss term, Q in,t is the upstream hydrological flow output, Q out,t is the downstream hydrological flow output, Q predict,t is the predicted hydrological flow, is the change in water storage, λ is the physical constraint intensity, Q true,t is the true value of the sum of the basin hydrological flows.

9. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 1, wherein During the training of the hydrological flow prediction model, use the Adam optimizer to update the parameters until the loss function converges.

10. The hydrological flow prediction method based on causal inference and extended long short-term memory network according to claim 1, characterized in that, The method further includes continuously inputting historical hydrological flow and meteorological factors into the trained hydrological flow prediction model in a sliding window manner, and the hydrological flow prediction model dynamically conducts hydrological flow prediction based on an adaptive learning mechanism.

Citation Information

Cited By

  • Method and system for inverting degree-day factors based on snow water equivalent difference and used for snow melting forecast

    CN121165221A

  • A method and product for analyzing and forecasting the interaction between hydrology and drought of rivers and lakes

    CN122388444A

  • A method and product for analyzing and predicting the interaction between hydrology and drought in lakes connected to the Yangtze River.

    CN122388444B