An intelligent long-term runoff prediction method based on a grid cell-based machine learning model
By using a machine learning model based on grid cells, the lag and differences between meteorological factors and runoff are analyzed. Combined with an LSTM model, the problem of insufficient model prediction capability in medium- and long-term runoff forecasting is solved, and high-precision medium- and long-term runoff forecasting is achieved, providing a scientific basis for water resources management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING UNIV OF TECH
- Filing Date
- 2022-10-20
- Publication Date
- 2026-05-15
AI Technical Summary
In medium- and long-term runoff forecasting, existing technologies have failed to effectively handle the lag effect of meteorological factors and the differences in the relationship between meteorological factors and runoff at different locations, resulting in insufficient model prediction capabilities and affecting the practical significance of water resource management.
A machine learning model based on grid cells is adopted, and the lag between meteorological factors and runoff is analyzed using autocorrelation function, partial autocorrelation function and time lag cross-correlation method. A medium- and long-term runoff forecasting method is established by combining LSTM model. Through grid data processing, factor lag analysis, model modeling, parameter optimization and evaluation, the forecast accuracy is improved.
It has improved the accuracy of medium- and long-term runoff forecasts at different locations, with a coefficient of determination of over 0.8, meeting the standards for hydrological information forecasting and providing a scientific basis for water resources management.
Smart Images

Figure CN115659794B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medium- and long-term runoff forecasting, specifically to an intelligent medium- and long-term runoff forecasting method that combines factor lag analysis, raster and machine learning models. Background Technology
[0002] Medium- and long-term runoff forecasting, which utilizes meteorological, astronomical, and geophysical factors or the evolutionary patterns of hydrological elements, provides long-term hydrological predictions and plays a crucial role in flood control, drought relief, reservoir operation, and comprehensive water resource management. However, current research indicates that runoff time series exhibit significant randomness, nonlinearity, and high variability. Different meteorological factors have varying lag times on runoff, and the overall modeling of the study area differs from modeling at different locations. Therefore, medium- and long-term runoff forecasting remains a challenging task.
[0003] Machine learning models can deeply explore the intrinsic relationships between observed data and quickly and easily predict the response of hydrological processes to meteorological and other factors, especially in medium- and long-term hydrological forecasting. However, due to the lag in meteorological factors, a small lag period will result in the omission of some effective information in the training samples, leading to lower predictive ability of the model. Conversely, a large lag period not only increases the complexity of the model but also reduces predictive ability due to the inclusion of interfering information.
[0004] The influencing factors and their lag times for runoff vary across different locations. For example, taking runoff prediction in the Three-River-Source Region as an example, in the Yellow River source area, the main influencing factor is rainfall, with glacial meltwater having a minimal impact. However, in the Lancang River, glacial meltwater accounts for a significant proportion. Therefore, the input variables used in the prediction models for the Yellow River source area and the Lancang River source area will certainly be different. If the overall model is not considered in light of the differences in meteorological elements at different locations, it will inevitably affect the model's predictive ability and will not have high practical significance for the scientific management of water resources. Therefore, using machine learning models based on grid cells for medium- and long-term runoff forecasting can improve the accuracy of machine learning models in medium- and long-term runoff forecasting applications under conditions of spatial variability in influencing factors such as precipitation and temperature. Summary of the Invention
[0005] The present invention aims to propose a method for determining the lag period of different meteorological elements and runoff, and to establish a machine learning model using a grid as the unit, thereby improving the accuracy of medium- and long-term runoff forecasting.
[0006] Current forecasting studies typically build models based on time-series data of various meteorological factors and runoff to study the relationship between meteorological factors and runoff across the entire study area. This approach neglects the lag effect of the factors and equates the relationship between meteorological factors and runoff at different locations within the study area with the relationship across the entire region. However, in reality, the lag duration of meteorological factors varies at different locations, and the relationship between meteorological factors and runoff also differs depending on location. Therefore, setting the lag duration too long or too short, or modeling the entire study area using a one-size-fits-all approach, will affect the model's predictive ability and lack practical significance for the scientific management of water resources. Currently, there is a lack of research in the field of medium- and long-term runoff forecasting on how to handle the lag effect of meteorological factors and the differences in the relationship between meteorological factors and medium- and long-term runoff at different locations. The purpose of this invention is to solve these problems.
[0007] A key aspect of medium- and long-term runoff forecasting is establishing the relationship between meteorological factors and runoff. Traditional hydrological forecasting methods primarily rely on the continuous, periodic, regional, and stochastic characteristics of river runoff changes to study the causes and patterns of water resource formation and variation. However, actual hydrological processes exhibit high nonlinearity, making it difficult to achieve ideal forecasting results using traditional methods. Therefore, this invention uses machine learning theory and methods as the foundation for modeling. Machine learning models can deeply explore the intrinsic connections between observational data, quickly and easily predict the response of hydrological processes to meteorological and other factors, and are particularly advantageous in data-scarce high-altitude and cold regions for hydrological simulation and forecasting, especially in medium- and long-term hydrological forecasting. Among these, the Long Short-Term Memory (LSTM) model is widely used in medium- and long-term hydrological forecasting and has achieved good predictive results. LSTM models have advantages in time series modeling problems, possessing long-term memory capabilities, being simple to implement, and solving the gradient vanishing and gradient explosion problems that exist during long-sequence training, outperforming traditional recurrent neural network models.
[0008] The specific process of medium- and long-term smart runoff forecasting based on grid cell machine learning models is as follows: Figure 1 As shown, the core process includes raster data processing, factor lag analysis, machine learning model building, parameter optimization, model evaluation, and validation. The corresponding methods include raster transformation, using time-lag cross-correlation, autocorrelation functions, partial autocorrelation functions, LSTM, and validation methods.
[0009] Preliminary preparations: Determine the study area, understand the regional characteristics, analyze and select the main meteorological elements, and collect raster data of runoff and main meteorological elements in the study area.
[0010] The technical solution adopted in this invention is an intelligent long-term runoff forecasting method based on a machine learning model of grid cells. The steps to implement this method are as follows:
[0011] Step 1: Raster Data Processing
[0012] Raster data is a data format that divides space into regularly spaced grids, each grid being called a cell, and assigning corresponding attribute values to each cell to represent entities. Each data point in a raster represents the attribute data of a geographic feature or phenomenon. The higher the resolution, the more detailed the representation of geographic phenomena; conversely, lower resolution, because a single raster cell represents a large area, may cause some distortion to geographic entities and phenomena. Based on collected high-resolution meteorological and runoff raster data, Python is used to read NetCDF raster data, storing the hydrological data and latitude and longitude of each raster in a text file, forming a total sample dataset with multiple inputs (meteorological elements) and outputs (runoff), for subsequent analysis of the lag of input data based on the raster.
[0013] Step 2: Factor lag analysis;
[0014] Based on the obtained hydrological data, the correlation between previous runoff values and current runoff values is analyzed using the autocorrelation function (ACF) and the partial autocorrelation coefficient (PACF), and the lag time between runoff values is calculated. The calculation formula is as follows:
[0015]
[0016]
[0017] Where, x t Let x be the runoff value at time t. t+k Let Cov be the runoff value at time t+k, Var be the covariance, Cor be the correlation coefficient, and R be the variance. i,1,2,....,k It is x i Regarding (x2,......,x) k The residuals obtained from the linear regression of x. ACF measures x. t With x t+k The correlation between them does not consider x t With x t+1 x t+2 , ..., x t+k-1 The relationship between x and y, while PACFF takes into account the relationship between x and y. t+1 x t+2 , ..., x t+k-1 When x remains unchangedt+k With x t The correlation between the two lies in the different controls for other variables.
[0018] The analysis of the correlation between meteorological factors and runoff using temporal lag cross correlation (TLCC) essentially involves calculating the lag time between meteorological factors and runoff using the Pearson correlation coefficient. The calculation formula is as follows:
[0019]
[0020] Where Cov(x,y) is the covariance of x and y, and σxσy is the product of the standard deviations of x and y. The Pearson correlation coefficient reflects the strength of the linear correlation between two variables, ranging from [-1,1], r xy The larger the absolute value, the stronger the correlation.
[0021] Step 3: LSTM model building;
[0022] A series of samples are formed by combining meteorological factor data and their lag duration with runoff data. The LSTM method is used to divide the samples into training set and validation set according to a certain ratio. A medium- and long-term runoff forecast model is established with grid as the unit to simulate the relationship between meteorological factors and runoff.
[0023] Step 4: Parameter optimization;
[0024] Parameter optimization, as the final step in model building, enables the model to better fit the data and achieve effective generalization. This study analyzes the impact of LSTM model parameters on prediction accuracy using existing research. Optimal parameters are determined by using an automatic parameter tuning machine in Python, with the minimum mean segregation (MSE) set as the parameter selection rule.
[0025] Step 5: Model Evaluation;
[0026] A well-trained model needs objective performance evaluation to be effectively applied in decision-making. By setting different model evaluation metrics, the fitting effect of the machine learning model can be evaluated from both the training and validation phases, thus quantifying the model performance.
[0027] The medium- and long-term runoff forecasting method proposed in this invention uses a coefficient of determination for evaluation, and the coefficient of determination values can all reach above 0.8, achieving the Class B accuracy or above of the Hydrological Information Forecasting Standard (GB / T22482-2008). Attached Figure Description
[0028] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0029] Figure 1 This is a flowchart of the implementation steps of the present invention.
[0030] Figure 2 It is a time series fit of the prediction results of this invention. Detailed Implementation
[0031] The embodiments of the present invention are described in detail below with reference to examples, but the present invention is not limited to the following examples.
[0032] Example 1:
[0033] Figure 1 This is a flowchart of the implementation steps of the present invention. (See reference) Figure 1 In conjunction with the specific circumstances of the embodiments, the intelligent medium- and long-term runoff forecasting based on grid and machine learning models implemented in this invention includes the following steps:
[0034] Data preparation: Runoff and precipitation raster data for the study area were extracted from Global Runoff Reconstruction (G-RUN) and stored as NetCDF files.
[0035] Data visualization: Python was used to read the collected data, which spanned from January 1956 to December 2015, totaling 720 data points. The study area ranged from 26°00′ to 39°47′ north latitude and 73°19′ to 104°47′ east longitude. The raster ranged from 25.75° to 39.75° latitude and from 72.75° to 104.75° longitude, with a resolution of 0.5°, resulting in a total of 1792 raster cells.
[0036] Lag analysis: The lag time between runoff at each grid is calculated iteratively using the autocorrelation function (acf) and the partial autocorrelation coefficient (pacf). The lag time obtained by calculating the order of the highest correlation between rainfall and runoff is then calculated using the temporal lag cross correlation (TLCC) method.
[0037] Model building: Taking the grids at positions 99.25-99.75 and 33.25-33.75 as examples, lag analysis calculated the lag time between runoff to be 1 month, and the lag time between rainfall and runoff to be 2 months. Therefore, if the output is the runoff Q(t) in month t, the inputs are the current rainfall and the rainfall from the previous 1-2 months, P(t), P(t-1), P(t-2), and the runoff Q(t-1) from the previous month, totaling 708 input-output samples. The samples are divided at a ratio of 0.8: 566 samples from January 1956 to April 2003 form the training set, and 142 samples from May 2003 to December 2015 form the validation set. The same grid modeling process is used, iteratively modeling across 1792 grids within the study area.
[0038] Parameter optimization: The main parameters for machine learning modeling are neurons, epochs, and batch_size. The ranges for epochs and batch_size are set to 430, 435, 440, 445, 450, 455, 460 and 30, 35, 40, 45, 50, 55 respectively. The parameter training learner GridSearchCV in Python is used to automatically select the optimal parameter values within the given range. Since the range of neurons is relatively large (1-400) with intervals of 10, a loop statement in Python is used to select the neurons value that yields the best model fit. In addition, a random seed is set to avoid randomness within the machine learning model.
[0039] Model evaluation: The model's predicted values are compared with the actual observed values. Evaluation indicators such as mean square error, root mean square error, and coefficient of determination are set for the model. The coefficient of determination is used as a criterion for judging whether the model is overfitting.
[0040] Model Application: Using the obtained antecedent rainfall and runoff data, an input-output sample set is generated based on the lag time, and then fed into the corresponding machine learning model for future medium- and long-term runoff forecasts. The established model is used to achieve forecasts for different lead times of 1 month, 2 months, and 3 months, providing a reference for water resource management and comprehensive scheduling in the study area.
[0041] The medium- and long-term runoff forecasting method proposed in this invention, combined with quantitative assessment using the coefficient of determination (COD), achieves a COD value of over 0.8, reaching or exceeding the Class B accuracy standard of the Hydrological Information Forecasting Standard (GB / T22482-2008). For example, for the grid at 99.25°-99.75° and 33.25°-33.75°, the COD value is 0.83, achieving Class B accuracy of the Hydrological Information Forecasting Standard. The time series plot of the model prediction value and the measured value is shown below. Figure 2 .
Claims
1. A smart long-term runoff forecasting method based on a machine learning model using grid cells, characterized in that, The steps to implement this method are as follows: Step 1: Raster data processing; Each data point in the raster represents the attribute data of a land feature or phenomenon. Based on the collected high-resolution meteorological and runoff raster data, Python is used to read the NetCDF raster data and store the hydrological data and latitude and longitude of each raster in a text file to form a total sample dataset with multiple input meteorological elements and output runoff, which can be used for subsequent analysis of the lag of the input data on the basis of the raster. Step 2: Factor lag analysis; Based on the obtained hydrological data, the correlation between previous runoff values and current runoff values is analyzed using autocorrelation and partial autocorrelation functions, and the lag time between runoff values is calculated using the following formula: Where, x t Let x be the runoff value at time t. t+k Let Cov be the runoff value at time t+k, Var be the covariance, Cor be the correlation coefficient, and R be the variance. i,1,2,....,k It is x i Regarding (x2,......,x) k The residuals obtained from the linear regression of x; ACF measures x t With x t+k The correlation between them does not consider x t With x t+1 x t+2 , ..., x t+k-1 The relationship between x and pacf, where pacf considers the relationship between x and pacf. t+1 x t+2 , ..., x t+k-1 When x remains unchanged t+k With x t The correlation between the two lies in the different controls for other variables; Using time-lag cross-correlation analysis to determine the correlation between meteorological factors and runoff essentially involves calculating the lag time r between meteorological factors and runoff using the Pearson correlation coefficient. xy The calculation formula is as follows: Where Cov(x,y) is the covariance of x and y, and σxσy is the product of the standard deviations of x and y; Step 3: LSTM model building; A series of samples are formed by combining meteorological factor data and their lag time with runoff data. The LSTM method is used to divide the samples into training set and validation set according to a certain ratio. A medium- and long-term runoff forecast model is established with grid as the unit to simulate the relationship between meteorological factors and runoff. Step 4: Parameter optimization; Parameter optimization, as the final step in model building, improves the model by optimizing parameters; it utilizes the impact of LSTM model parameters on prediction accuracy; and it uses Python's automatic parameter tuning machine to determine the optimal parameters by setting the minimum mean segregation (MSE) as the parameter selection rule. Step 5: Model Evaluation; By setting different model evaluation metrics, the fitting effect of the machine learning model is evaluated from both the training and validation phases, thus quantifying the model performance.
2. The intelligent long-term runoff forecasting method based on a machine learning model using grid cells according to claim 1, characterized in that, r xy The larger the absolute value, the stronger the correlation.
3. The intelligent long-term runoff forecasting method based on a machine learning model using grid cells according to claim 1, characterized in that, The Pearson correlation coefficient reflects the strength of the linear correlation between two variables, and its range is [-1, 1].