A physical constraint-fused deep learning method for predicting runoff
Patent Information
- Application Number
- CN202611156320.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-23
AI Technical Summary
[0007]本发明所要解决的技术问题是提供一种融合物理约束的深度学习径流量预测方法,解决现有数据驱动的机器学习模型在中长期径流预测上精度低、可解释性不足的技术问题
1.通过将时间卷积网络与门控循环单元串联构建混合模型,时间卷积网络通过膨胀因果卷积提取径流时间序列中的多尺度局部特征,门控循环单元通过门控机制捕捉序列中的长期依赖关系,二者协同作用有效解决了现有模型特征提取能力不足的问题。
Smart Images

Figure CN122964482A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of runoff prediction technology and relates to a deep learning method for predicting runoff that integrates physical constraints. Background Technology
[0002] Due to the strong nonlinear and nonstationary characteristics of monthly runoff sequences, and the fact that most regions cannot meet the modeling requirements of process-driven models, data-driven models are currently mainly used for monthly runoff prediction.
[0003] However, existing data-driven runoff prediction methods have the following problems: First, the model's feature extraction capability is insufficient. Existing prediction models struggle to simultaneously capture short-term fluctuations and long-term dependencies when dealing with runoff sequences exhibiting multi-scale temporal characteristics, resulting in limited prediction accuracy. Although some studies have attempted to combine temporal convolutional networks with recurrent neural networks to enhance feature extraction capabilities, the purely data-driven end-to-end learning model still exhibits poor extrapolation capabilities beyond the training data distribution.
[0004] Second, the physical consistency and interpretability of the prediction results are poor. Purely data-driven models lack explicit adherence to physical laws, and may predict unreasonable flow increases during runoff recession. In long-term predictions, the cumulative effect of errors is significant, and the prediction results are prone to deviating from the actual physical process, making it difficult to meet the strict requirements for physical consistency of prediction results in engineering.
[0005] Third, multi-model ensemble techniques face the problem of low computational efficiency. As research progresses, the method of fusing individual models using multi-model ensemble techniques has become a hot topic in runoff prediction. However, this method usually requires training multiple independent models, resulting in high computational overhead and long training cycles, which is not conducive to rapid deployment and real-time prediction.
[0006] The emerging physical information neural network (PIN) offers a new technological path in recent years. Its core idea is to embed physical laws as constraints into the loss function of the neural network, enabling the network to simultaneously fit observed data and satisfy physical laws during training, thus enhancing the model's generalization ability and interpretability. However, there is currently little research on integrating temporal convolutional networks, gated recurrent units, and PSNs for medium- to long-term runoff prediction. Summary of the Invention
[0007] The technical problem to be solved by this invention is to provide a deep learning method for predicting runoff that integrates physical constraints, thereby addressing the technical issues of low accuracy and insufficient interpretability of existing data-driven machine learning models in medium- and long-term runoff prediction.
[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a deep learning method for predicting runoff volume by incorporating physical constraints, comprising the following steps: S1: Obtain historical runoff data for the study area, and preprocess the historical runoff data to construct a time-series runoff dataset; S2: Divide the time-series runoff dataset into training set, validation set and test set in chronological order; S3: Construct the TCN-GRU-PINN model, which includes a TCN module, a GRU module, and a PINN module; S4: The TCN-GRU-PINN model is trained using the training set, the model hyperparameters are tuned using the validation set and the training process is monitored to prevent overfitting, and physical formulas are embedded as physical constraints into the model's loss function during training to guide the optimization direction of the model parameters until the model converges, thus obtaining a trained runoff prediction model. S5: Input the historical runoff data for a preset time period before the time point to be predicted into the trained runoff prediction model to obtain the predicted runoff value for the time point to be predicted.
[0009] The preprocessing described in S1 includes normalizing the historical runoff data and denoising the historical runoff data using a wavelet denoising method.
[0010] The training set mentioned in S2 is used for model parameter learning, the validation set is used for hyperparameter tuning and early stopping monitoring, and the test set is used for final model performance evaluation.
[0011] The training process of the TCN-GRU-PINN model described in S4 includes: S4.1: Input the training set data into the TCN module to learn local features in the time series data; S4.2: Input the features learned by the TCN module into the GRU module to learn the long-term dependencies of the time series data; S4.3: Map the output of the GRU module to the predicted runoff value through a fully connected layer.
[0012] The physical formula described in S4 is the receding water curve formula, and the discrete residual form of the receding water curve formula is: ; in, and The first and Time step runoff forecast values, This is the drainage coefficient. The base flow rate.
[0013] In S4, the physical loss term is constructed based on the aforementioned receding water curve formula. Based on the physical loss term With data loss items The total loss function is constructed by weighting.
[0014] The total loss function is expressed as: ; in, For data loss, For physical loss, This is the balance coefficient.
[0015] The physical loss item Defined as the mean of the squared residuals at all time steps in the predicted sequence: ; Where H is the prediction step size.
[0016] The drainage coefficient mentioned in S4 and the base flow rate As a learnable parameter, it is updated through backpropagation.
[0017] The preset time period mentioned in S5 is seven days before the time point to be predicted, and the prediction step size H is 3, 7 or 15, so as to obtain the predicted runoff value for H consecutive days after the time point to be predicted.
[0018] The main beneficial effects of this invention are as follows: 1. By cascading a temporal convolutional network with a gated recurrent unit to construct a hybrid model, the temporal convolutional network extracts multi-scale local features from runoff time series through dilated causal convolution, while the gated recurrent unit captures long-term dependencies in the sequence through a gating mechanism. The synergistic effect of the two effectively solves the problem of insufficient feature extraction capability of existing models.
[0019] 2. By embedding the recession curve formula as a physical constraint into the model's loss function, the model can simultaneously fit the observed data and satisfy physical laws during training, effectively solving the problems of poor physical consistency and weak interpretability of prediction results in traditional data-driven models.
[0020] 3. By adopting a single-model ensemble approach, the degradation coefficient is incorporated during training. and base flow As a learnable parameter, it enables the model to automatically learn the physical parameters related to the study area during training, without the need to train multiple independent models. This overcomes the shortcomings of high computational cost and long training cycle of multi-model ensemble technology, and improves computational efficiency while ensuring prediction accuracy. Attached Figure Description
[0021] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0022] Figure 1 This is a schematic diagram of the basic process of the present invention; Figure 2 This is a schematic diagram of the research area of the present invention; Figure 3 This is the hyperparameter grid search graph of the present invention; Figure 4 This is a sensitivity analysis diagram of the physical weight hyperparameters of the present invention; Figure 5 This is a diagram of the TCN-GRU coupled model architecture of the present invention; Figure 6 This is a schematic diagram of the physical constraint PINN of the present invention; Figure 7 This is a comparison chart of the multi-model prediction results of the present invention; Figure 8 This is a scatter plot comparing the prediction performance of the advanced model of this invention. Detailed Implementation
[0023] Example 1: As Figure 1 The method for predicting runoff volume using deep learning that incorporates physical constraints includes the following steps: S1: Obtain historical runoff data for the study area, and preprocess the historical runoff data to construct a time-series runoff dataset.
[0024] like Figure 2 As shown in this embodiment of the invention, the Wuhan section of the Yangtze River Basin is taken as the study area. Daily runoff data of the Wuhan section of the Yangtze River Basin from 2013 to 2022 were obtained through the Wuhan Hydrological Station. The collected data were normalized, and outliers were removed using wavelet denoising to ensure data quality.
[0025] S2: Divide the time-series runoff dataset into training set, validation set and test set in chronological order.
[0026] The dataset was divided into a training set (January 1, 2013 to December 31, 2019, totaling 2556 samples, accounting for 70%), used for model parameter learning; a validation set (January 1, 2020 to December 31, 2020, totaling 366 samples, accounting for 10%), used for hyperparameter tuning and early stopping monitoring; and a test set (January 1, 2021 to December 31, 2022, totaling 730 samples, accounting for 20%), used for final model performance evaluation.
[0027] S3: Construct the TCN-GRU-PINN model, which includes a TCN module, a GRU module, and a PINN module.
[0028] like Figure 5 The TCN module is responsible for learning the local features of time series data, the GRU module is responsible for characterizing the long-term dependencies in the time series, and the PINN module embeds the physical formula into the original loss function of the model, allowing the physical formula to guide the model's learning.
[0029] S4: The TCN-GRU-PINN model is trained using the training set, and the model hyperparameters are tuned using the validation set. The training process is monitored to prevent overfitting. During the training process, physical formulas are embedded as physical constraints into the model's loss function to guide the optimization direction of the model parameters until the model converges, thus obtaining a trained runoff prediction model.
[0030] In this embodiment of the invention, the main process of model training includes the following steps: S4.1: Input the training set data into the TCN module to learn local features in the time series data.
[0031] Specifically, such as Figure 5 As shown, the TCN module accepts a historical window (e.g., values from the past 30 days) as input, extracts local features at different time scales in the runoff time series through multi-layer dilated causal convolution, and outputs a high-dimensional feature map.
[0032] S4.2: Input the features learned by the TCN module into the GRU module to learn the long-term dependencies of the time series data.
[0033] Specifically, the features learned by the TCN module are fed into the GRU module, where dynamic temporal modeling is performed through a gating mechanism, and the hidden state that encodes historical information is output.
[0034] S4.3: Map the output of the GRU module to the predicted runoff value through a fully connected layer.
[0035] Specifically, the hidden state output by the GRU module is mapped to the predicted value of future multi-path flow through a fully connected layer.
[0036] like Figure 6As shown, purely data-driven models often lack explicit adherence to physical laws, leading to physically inconsistent predictions (such as unreasonable increases in runoff during the recession phase). Physical constraint embedding methods integrate known physical laws (such as recession curves, continuity equations, and constitutive relations) into neural networks as additional terms in the loss function or variable substitutions, enabling the model to satisfy physical constraints while fitting the data. Its physical basis is the discharge process of groundwater storage into the river channel within the watershed, which follows the linear reservoir assumption: discharge flow is proportional to storage capacity. The flow data from the training set is input into the recession formula for training, learning the formula parameters relevant to the study area.
[0037] The main process of physical constraints in model training includes the following steps: (1) Load the training set data and use the time series runoff data to train the unknown parameters in the drainage formula to obtain parameter values related to the study area; (2) Embed the physical formula into the loss function and calculate the physical residual of the predicted value; (3) The loss function combines data loss and physical loss according to the configured ratio to form the total loss, and the total loss is fed back to the model to guide the optimization direction.
[0038] The specific physical formula embedded in the loss function not only needs to fit the observed data numerically, but also needs to satisfy the differential equation under the assumption of no rainfall.
[0039] The physical formula described is the recession curve formula. The recession curve is a classic model in hydrology describing the decay of river flow over time during periods of no rainfall (or cessation of recharge). Since the neural network outputs flow values at discrete time steps, the differential equation is discretized using forward Euler analysis, and the calculation formula is as follows: ; Taking Δt = 1 day, we can obtain the discrete residual form: ; in, and The first and Time step runoff forecast values, This is the drainage coefficient. This is the base flow rate. Ideally (strictly satisfying the recession flow law), it should have: .
[0040] In this embodiment of the invention, the predicted value is obtained after passing through TCN-GRU. The loss function calculates not only the residual between the predicted value and the true value, but also the residual between the predicted value and the result of the physical formula. The former represents the data loss. (Using mean squared error (MSE), the latter being the physical loss) The two losses are combined according to certain weights to form the total loss: ; in For data loss, For physical loss, The weight assigned to physical loss (determined through grid search, taking...) ).
[0041] For a predicted sequence ( (For the prediction step size), the physical loss is defined as the mean of the squared residuals over all time steps. When When calculating the daily step size, it can be simplified to: ; Where H is the prediction step size (3, 7, or 15), and the summation is performed from step 1 to step H-1 (because the difference needs to be calculated between adjacent steps). Dimensions and data loss The units are the same (both are in the dimension of the square of the flow rate), which facilitates subsequent weighted summation.
[0042] In this embodiment of the invention, the drainage coefficient and base flow As learnable parameters, they are updated through backpropagation. Errors are simultaneously propagated to the TCN-GRU network parameters and the learnable parameters through both data loss and physical loss. , This "physically guided" training method enables the model to learn the receding dynamics that conform to hydrological patterns while fitting historical data.
[0043] To obtain the optimal model configuration, a strategy combining grid search and random search was employed to optimize the model hyperparameters on the validation set. The search space encompassed the number of hidden units, learning rate, batch size, number of TCN layers, kernel size, dropout rate, and physical constraint weights. And key parameters such as L2 regularization coefficient. Each configuration is trained on the validation set for a maximum of 200 epochs, with the early stopping patience value set to 15, to determine the optimal hyperparameter configuration with the goal of minimizing validation loss.
[0044] like Figure 3 The image shown is a hyperparameter grid search graph provided in one embodiment of the present invention. Figure 4 The figure shown is a sensitivity analysis diagram of the physical weight hyperparameters provided in an embodiment of the present invention. After optimization, the final optimal hyperparameter configuration is shown in Table 1: Table 1 Optimal Hyperparameter Configuration
[0045] S5: Input the historical runoff data for a preset time period before the time point to be predicted into the trained runoff prediction model to obtain the predicted runoff value for the time point to be predicted.
[0046] The preset time period before the expected prediction time is seven days. After inputting the runoff data for the previous seven days, the TCN module and GRU module output the final runoff prediction value for the target time. The prediction step size H is 3, 7, or 15, obtaining the runoff prediction values for the consecutive H days after the expected prediction time.
[0047] Specifically, after the model training is completed, the test set data is input into the ensemble model for prediction, and the predicted results are inversely normalized to obtain the actual predicted runoff value.
[0048] To further verify the effectiveness of each component of the TCN-GRU-PINN model proposed in this invention, ablation experiments were conducted. The main procedures of the model ablation experiments include the following steps: (1) Input the training set into multiple models for training, and calculate the model accuracy through the test set based on the training results.
[0049] (2) In order to quantitatively evaluate the performance of the model, four indicators representing the performance of the model were selected in the experiment.
[0050] Coefficient of determination : Measures the proportion of variability in the original data explained by the model, with a range of values. The closer the value is to 1, the better the fit.
[0051] ; in For the observed values, For predicted values, For the observed mean, The total number of samples.
[0052] Mean Absolute Error (MAE): Reflects the average absolute value of the forecast error; the unit is the same as the original flow rate unit. s), intuitive and easy to explain.
[0053] ; Root Mean Square Error (RMSE): The square root of the square of the error. It is more sensitive to large errors (such as flood peak prediction bias) and is suitable for evaluating the ability to predict extreme events.
[0054] ; Mean Absolute Percentage Error (MAPE): Expresses relative error as a percentage, facilitating comparisons between different flow rates.
[0055] ; (3) Train multiple times and take the best evaluation data of each model to make a list to compare the performance of each model.
[0056] The performance metrics of each model are compared in Table 2: Table 2 Comparison of Evaluation Indicators for Each Model
[0057] like Figure 7 The figure shows a comparison of multi-model prediction results provided by an embodiment of the present invention. For all prediction durations of 3 days, 7 days, and 15 days, the TCN-GRU model without physical constraints significantly outperforms LSTM and GRU in all metrics. Taking 15-day prediction as an example, the MAE of TCN-GRU (1053.90 m³ / s) is reduced by 23.1% compared to LSTM (1370.14 m³ / s) and by 27.6% compared to GRU (1456.18 m³ / s); R² is improved from 0.9864 for LSTM and 0.9848 for GRU to 0.9920. This fully demonstrates the superiority of the TCN-GRU hybrid architecture in multi-scale temporal feature extraction and long-term dependency modeling. TCN's dilated convolution can capture multi-periodic patterns from daily to seasonal scales with fewer layers, while GRU's gating mechanism further refines the temporal relationships between these features.
[0058] The TCN-GRU-PINN model, which incorporates physical constraints based on the recession curve, outperforms the purely data-driven TCN-GRU model across all metrics. The performance improvement is particularly significant in medium- and long-term forecasts (7-day and 15-day). In 15-day forecasts, TCN-GRU-PINN achieves an R² of 0.9956 and a MAPE of only 3.56%. Compared to TCN-GRU, MAE is reduced by 45.5% (from 1053.90 to 574.27), RMSE by 44.3% (from 1331.04 to 741.18), and MAPE by 40.4% (from 5.97% to 3.56%). This demonstrates that in long-term forecasts lacking sufficient data support, physical constraints play a crucial guiding and regularizing role, effectively suppressing the accumulation of errors caused by the high degree of model freedom.
[0059] To verify the model's state-of-the-art performance in the current time series forecasting field, representative state-of-the-art models from recent years were selected as strong baselines, including PatchTST, Autoformer, and HydroLSTM. A deeper comparison of the model performance was conducted, and the performance metrics of each model are shown in Table 3. Table 3 Comparison of Evaluation Indicators for Each Model
[0060] like Figure 8 The image shows a scatter plot comparing the prediction performance of the advanced model provided by this invention. From... Figure 8 It can be seen that the TCN-GRU-PINN model has the highest good of fit with the actual values and the most concentrated distribution of prediction errors, further verifying the effectiveness and advancement of the method of this invention in runoff prediction. The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The embodiments and features described in these embodiments can be arbitrarily combined without conflict. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.
Claims
1. A deep learning-based runoff prediction method incorporating physical constraints, characterized in that, Includes the following steps: S1: Obtain historical runoff data for the study area, and preprocess the historical runoff data to construct a time-series runoff dataset; S2: Divide the time-series runoff dataset into training set, validation set and test set in chronological order; S3: Construct the TCN-GRU-PINN model, which includes a TCN module, a GRU module, and a PINN module; S4: The TCN-GRU-PINN model is trained using the training set, the model hyperparameters are tuned using the validation set and the training process is monitored to prevent overfitting, and physical formulas are embedded as physical constraints into the model's loss function during training to guide the optimization direction of the model parameters until the model converges, thus obtaining a trained runoff prediction model. S5: Input the historical runoff data for a preset time period before the time point to be predicted into the trained runoff prediction model to obtain the predicted runoff value for the time point to be predicted.
2. The deep learning runoff prediction method integrating physical constraints according to claim 1, characterized in that: The preprocessing described in S1 includes normalizing the historical runoff data and denoising the historical runoff data using a wavelet denoising method.
3. The deep learning-based runoff prediction method incorporating physical constraints according to claim 1, characterized in that: The training set mentioned in S2 is used for model parameter learning, the validation set is used for hyperparameter tuning and early stopping monitoring, and the test set is used for final model performance evaluation.
4. The deep learning-based runoff prediction method incorporating physical constraints according to claim 1, characterized in that: In S4, the training process of the TCN-GRU-PINN model includes: S4.1: Input the training set data into the TCN module to learn local features in the time series data; S4.2: Input the features learned by the TCN module into the GRU module to learn the long-term dependencies of the time series data; S4.3: Map the output of the GRU module to the predicted runoff value through a fully connected layer.
5. The deep learning runoff prediction method integrating physical constraints according to claim 1, characterized in that: The physical formula described in S4 is the receding water curve formula, and the discrete residual form of the receding water curve formula is: ; in, and The first and Time step runoff forecast values, This is the drainage coefficient. The base flow rate.
6. The deep learning-based runoff prediction method incorporating physical constraints according to claim 5, characterized in that: In S4, the physical loss term is constructed based on the aforementioned receding water curve formula. Based on the physical loss term With data loss items The total loss function is constructed by weighting.
7. The deep learning-based runoff prediction method incorporating physical constraints according to claim 6, characterized in that: The total loss function is expressed as: ; in, For data loss, For physical loss, The weight assigned to physical losses.
8. The deep learning runoff prediction method integrating physical constraints according to claim 7, characterized in that: The physical loss item Defined as the mean of the squared residuals at all time steps in the predicted sequence: ; Where H is the prediction step size.
9. The deep learning-based runoff prediction method incorporating physical constraints according to claim 8, characterized in that: The drainage coefficient mentioned in S4 and the base flow rate As a learnable parameter, it is updated through backpropagation.
10. The deep learning runoff prediction method incorporating physical constraints according to claim 8, characterized in that: In S5, the preset time period is seven days before the time point to be predicted, and the prediction step size H is 3, 7 or 15, so as to obtain the predicted runoff value for H consecutive days after the time point to be predicted.