A runoff ensemble forecasting method for real-time correction of machine learning models based on weights
By classifying the prediction results of the runoff prediction model and modifying dynamic weights, the problem of prediction deviations in traditional methods in complex runoff processes is solved, and the accuracy of runoff prediction is improved.
Patent Information
- Application Number
- CN202510369681.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-03-27
AI Technical Summary
Traditional runoff prediction methods have biases when dealing with complex nonlinear runoff processes, especially when all models experience systematic overestimation or underestimation at a certain time step. The existing methods cannot effectively adjust the weight, resulting in bias in the prediction results.
By classifying the prediction results of all machine learning runoff prediction models, the model weight sequence is estimated using dynamic Bayesian algorithm, and weight correction is carried out according to the prediction performance of different categories, real-time weight correction is implemented to reduce the overall deviation of the model set.
The impact of the overall deviation of the model ensemble on runoff prediction is effectively reduced, and the accuracy of runoff forecast in the basin is improved.
Smart Images

Figure CN119884960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of watershed hydrological forecasting, and specifically to a runoff ensemble forecasting method based on a machine learning model with real-time weight correction. Background Technique
[0002] Runoff prediction is a core issue in hydrological research and is of great significance for water resources management, flood control and disaster reduction, and ecological protection. However, the runoff process is comprehensively affected by various natural and human factors, showing significant nonlinearity and complexity, which poses a huge challenge to the prediction work. Traditional physical mechanism models are limited by complex simulation processes and large computational requirements. Therefore, data-driven machine learning models have become a research hotspot in the field of runoff prediction in recent years.
[0003] To improve the accuracy of runoff prediction, ensemble forecasting technology has been widely applied in the hydrological field. Ensemble forecasting can effectively reduce the uncertainty of a single model and improve the overall prediction performance by integrating the prediction results of multiple models. Common model ensemble methods include simple arithmetic mean, weighted mean, and dynamic weighted mean based on optimization algorithms. However, traditional methods usually assign weights based on the overall performance of a single model in the historical period and do not fully consider the specific performance of the model at different time steps. For example, when all models systematically overestimate or underestimate at a certain time step, the existing methods cannot adjust the weights for this situation, resulting in biased prediction results. Summary of the Invention
[0004] The purpose of the present invention is to provide a runoff ensemble forecasting method based on a machine learning model with real-time weight correction. By classifying the runoff prediction results of all models and adopting corresponding weight correction strategies according to the overall performance of each model's prediction results in different time periods, it can effectively reduce the impact of the overall deviation of the model ensemble on the final runoff prediction effect, thereby improving the accuracy of watershed runoff forecasting.
[0005] To solve the above technical problems, the present invention provides the following technical solutions:
[0006] A runoff ensemble forecasting method based on a machine learning model with real-time weight correction, the steps of which include:
[0007] Collect hydrometeorological data in the study watershed and divide it into a training set, a validation set, and a test set, and use multiple machine learning models to train a machine learning runoff prediction model, and construct a machine learning runoff forecasting ensemble according to all the trained machine learning runoff prediction models; the hydrometeorological data includes measured runoff and meteorological characteristic data;
[0008] Use all machine learning runoff forecasting models to perform runoff prediction to obtain corresponding simulated runoff data;
[0009] According to the simulated runoff data of all machine learning runoff prediction models and their corresponding measured runoff data, the dynamic Bayesian algorithm is used to estimate the weight sequence of each machine learning runoff prediction model in the machine learning runoff prediction model ensemble;
[0010] Classify the runoff simulation values predicted by the machine learning runoff prediction model according to the measured runoff data to obtain the categories of the runoff simulation values; the categories of the runoff simulation values include category 0, category 1, and category 2;
[0011] Use the machine learning runoff prediction ensemble to predict the runoff simulation values corresponding to the training set and the validation set, and use the runoff simulation values and their corresponding category labels in the training set and the validation set as target variables to train and construct a category prediction model, and use the constructed category prediction model to predict the category labels of the runoff simulation values in the test set;
[0012] Based on the runoff simulation values in the training set and their corresponding category labels, divide the training set into three category subsets: category 0 subset, category 1 subset, and category 2 subset, and correct the weight sequence corresponding to each category subset extracted according to the time label, and use the validation set to verify and determine the weight correction values corresponding to each category subset;
[0013] According to the category label results of the runoff simulation values in the test set predicted by the category prediction model, divide the test set into three category subsets: category 0 subset, category 1 subset, and category 2 subset, correct the weight sequence of the corresponding category subset extracted in combination with the time label according to the weight correction values corresponding to each category subset, and use the corrected weight sequences of each category subset for integrated calculation to generate the final runoff prediction result.
[0014] According to the above technical solution, the categories of the runoff simulation values include:
[0015] Category 0, in one time step, the runoff simulation value is larger or smaller than the measured value;
[0016] Category 1, in one time step, the runoff simulation values of all models are greater than the measured value;
[0017] Category 2, in one time step, the runoff simulation values of all models are less than the measured value.
[0018] According to the above technical solution, the category prediction model:
[0019] ;
[0020] where represents the category label of the runoff simulation value predicted by the category prediction model; Indicates the training of a class prediction model, which includes Support Vector Classification (SVC), Random Forest (RF), Extreme Gradient Boosting (XGBoost), etc.; Indicates the runoff simulation value of the first machine learning runoff prediction model at time ; Indicates the runoff simulation value of the second machine learning runoff prediction model at time ; Indicates the th machine learning runoff prediction model at time runoff simulation value.
[0021] According to the above technical solution, the weight sequence correction of the class subset includes: weight correction of the class 1 subset and weight correction of the class 2 subset, while the weight sequence corresponding to the class 0 subset is not corrected;
[0022] The weight correction formula for the class 1 subset:
[0023] ;
[0024] The weight correction formula for the class 2 subset:
[0025] ;
[0026] In the formula, , Indicates the corrected weight sequence of the th machine learning runoff prediction model in the class 1 subset at time ; Indicates the weight sequence of the th machine learning runoff prediction model in the class 1 subset at time ; Indicates the weight correction value of the class 1 subset; , Indicates the corrected weight sequence of the th machine learning runoff prediction model in the class 2 subset at time ; Indicates the weight sequence of the th machine learning runoff prediction model in the class 2 subset at time ; Indicates the weight correction value of the class 2 subset.
[0027] According to the above technical solution, the weight correction value corresponding to the class 1 subset is determined using the Bayesian optimization method, and its range is between -0.5 and 0;
[0028] The weight correction value corresponding to the subset of the 2nd category is determined by the Bayesian optimization method, and its range is between 0 and 0.5.
[0029] According to the above technical solution, the integrated calculation formula of the corrected weight sequence of each category subset includes:
[0030] ;
[0031] ;
[0032] ;
[0033] In the formula, represents the integrated result of the weight sequence corresponding to the 0th category subset, represents the integrated corrected weight sequence corresponding to the 1st category subset, represents the integrated corrected weight sequence corresponding to the 2nd category subset, represents the weight sequence corresponding to the 0th category subset of the test set, represents the corrected weight sequence corresponding to the 1st category subset, represents the corrected weight sequence corresponding to the 2nd category subset, represents the runoff simulation value of the 1st machine learning runoff prediction model in the 0th category subset at time ; represents the runoff simulation value of the 2nd machine learning runoff prediction model in the 0th category subset at time ; represents the runoff simulation value of the th machine learning runoff prediction model in the 0th category subset at time ; represents the runoff simulation value of the 1st machine learning runoff prediction model in the 1st category subset at time ; represents the runoff simulation value of the 2nd machine learning runoff prediction model in the 1st category subset at time ; represents the runoff simulation value of the th machine learning runoff prediction model in the 1st category subset at time ; represents the runoff simulation value of the 1st machine learning runoff prediction model in the 2nd category subset at time ; represents the runoff simulation value of the 2nd machine learning runoff prediction model in the 2nd category subset at time ; represents the The runoff simulation values of a machine learning runoff prediction model at a certain time where T represents the transpose, represents the subset of class 0, represents the subset of class 1, represents the subset of class 2.
[0034] According to the above technical solution, reorder , and according to the time tags to obtain the final runoff prediction result.
[0035] A storage medium for storing computer-executable instructions, which implement the above technical solution, a runoff ensemble forecasting method based on real-time weight correction of a machine learning model, when executed.
[0036] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: The traditional multi-model averaging method usually determines the weights based on the overall performance of a single model in the runoff simulation of historical periods and sets the sum of the weights of the models to 1. However, in runoff simulation, when the simulation results of all models are overall higher or lower than the measured values, the runoff prediction results cannot be corrected by the model averaging method. The present invention classifies the prediction results of all machine learning runoff prediction models, so that different weight correction strategies can be adopted for each type of data according to its characteristics, effectively reducing the poor final runoff prediction results caused by the overall deviation of the machine learning runoff prediction ensemble, thereby improving the accuracy of watershed runoff prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the present invention and do not constitute a limitation to the present invention. In the drawings:
[0038] Figure 1 is a step diagram of a runoff ensemble forecasting method based on real-time weight correction of a machine learning model according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0040] The present invention divides the model runoff simulation results into three categories, and then constructs a classification model for predicting class labels. For different categories of runoff simulation values, appropriate weight correction values are calibrated, and the corrected weights are used for integrated calculation to generate the final runoff prediction result. The specific steps ( Figure 1 ) include:
[0041] S1. Collect hydrometeorological data such as precipitation, temperature, potential evapotranspiration, and runoff in the study basin. After dividing the hydrometeorological data into a training set, a validation set, and a test set according to the ratio of 7:1.5:1.5, a machine learning runoff prediction ensemble is constructed using all the machine learning runoff prediction models obtained through training. The specific steps include:
[0042] S101. Based on the hydrometeorological data of the training set, establish a Random Forest (RF) model, and select appropriate predictors as the input of the machine learning runoff prediction model.
[0043] S102. Based on the predictor data selected from the training set, select multiple machine learning models such as Long Short-Term Memory Network (LSTM), Gated Recurrent Unit (GRU), Support Vector Machine (SVM), etc. for training to obtain multiple corresponding machine learning runoff prediction models. Based on all the machine learning runoff prediction models obtained through training, a machine learning runoff prediction ensemble is constructed. The machine learning runoff prediction ensemble puts all the machine learning runoff prediction models obtained through training in a set.
[0044] S103. Based on the test set and the constructed machine learning runoff prediction ensemble, conduct basin runoff simulation, and use the Nash Efficiency Coefficient (NSE) to evaluate the performance of a single machine learning runoff prediction model.
[0045] S2. According to the simulated runoff data and measured runoff data of multiple machine learning runoff prediction models, use the dynamic Bayesian algorithm to estimate the weight sequence of each machine learning runoff prediction model in the machine learning runoff prediction model ensemble. Specifically:
[0046] S201. Conduct Box-Cox transformation on the simulated runoff data and measured runoff data obtained by each machine learning runoff prediction model to ensure that they satisfy the normal distribution;
[0047] S202. Based on the simulated runoff data and measured runoff data after Box-Cox transformation, use the dynamic Bayesian algorithm to estimate the weight sequence of each machine learning runoff prediction model;
[0048] S3. Classify the predicted runoff simulation values of the machine learning runoff prediction models in the machine learning runoff prediction ensemble according to the measured runoff data to obtain the categories of the runoff simulation values. Specifically, the categories of the runoff simulation values are divided into three categories:
[0049] Category 0, that is, in a time step, the runoff simulation value is larger or smaller than the measured value;
[0050] Category 1, that is, in a time step, the runoff simulation values of all models are greater than the measured value;
[0051] Category 2, that is, in a time step, the runoff simulation values of all models are less than the measured value.
[0052] The formula for classifying the runoff simulation values is as follows:
[0053] ;
[0054] In the formula, represents the category label of the runoff simulation value at time , represents the th runoff simulation value of the machine learning runoff prediction model at time , represents the measured runoff value at time represents the number of machine learning runoff prediction models.
[0055] S4. Based on the runoff simulation values and the corresponding category labels in the training set and the validation set as the target variables, train and construct a category prediction model, and use the constructed category prediction model to predict the category labels of the runoff simulation values in the test set.
[0056] Among them, training the category prediction model:
[0057] ;
[0058] In the formula, represents the category label of the runoff simulation value predicted by the category prediction model; represents training the category prediction model, and the training category prediction model includes support vector classification SVC, random forest RF, extreme gradient boosting XGBoost, etc.; represents the runoff simulation value of the 1st machine learning runoff prediction model at time ; represents the runoff simulation value of the 2nd machine learning runoff prediction model at time , represents the th runoff simulation value of the machine learning runoff prediction model at time .
[0059] S5. Based on the runoff simulation values and their class labels in the training set, divide the training set into three subsets, extract the corresponding weight sequences for each subset according to the time labels, calibrate the weight correction values for different class subsets to adjust the sum of weights, and verify the effect on the validation set to determine the weight correction values corresponding to each class subset.
[0060] That is, based on the corresponding runoff simulation values and their class labels in the training set, divide them into three class subsets: class 0, class 1, and class 2, and extract the corresponding weight sequences according to the time labels, combined with the obtained weight correction values and , calculate the average value of the runoff simulation values in the validation set, and use NSE to evaluate the effect of the correction value. The optimal weight correction value can be determined according to the effect of the correction value and .
[0061] Among them, extracting the corresponding weight sequence for each class subset according to the time label is the weight sequence composed of the weights of each machine learning runoff prediction model in the machine learning runoff prediction model set under the corresponding time label.
[0062] Specifically, the weights corresponding to the class 0 subset are not corrected.
[0063] For the class 1 subset, the simulation values of all machine learning runoff prediction models are larger than the measured values, so the sum of weights needs to be reduced. Therefore, a weight correction value for the class 1 subset is set, and its range is between -0.5 and 0. Use Bayesian optimization to find the optimal , and correct the weight sequence (representing the weight of the th machine learning runoff prediction model in the class 1 subset at time ), and the correction formula is as follows:
[0064] ;
[0065] In the formula, , represents the corrected weight sequence of the th machine learning runoff prediction model in the class 1 subset at time .
[0066] For the class 2 subset, the predicted values of all machine learning runoff prediction models are smaller than the measured values, so the sum of weights needs to be increased. Therefore, a weight correction value for the class 2 subset is set, and its range is between 0 and 0.5. Use the Bayesian optimization algorithm to find the optimal , the weight sequence (representing the weight sequence of the th machine learning runoff prediction model in the 2-class category subset at time ) is corrected, and the correction formula is as follows:
[0067] ;
[0068] In the formula, , represents the corrected weight sequence of the th machine learning runoff prediction model in the 2-class category subset at time .
[0069] S6. Use the class label results of the runoff simulation values in the test set predicted by the class prediction model, and divide the test set into a 0-class category subset , a 1-class category subset and a 2-class category subset according to the class prediction results. Combine the time labels to extract the corresponding weight sequences of each subset, and adjust the weights according to the obtained weight correction values to obtain the corrected weight sequences corresponding to the 0-class category subset, 1-class category subset, and 2-class category subset , and . Perform an integrated calculation on the corrected weight sequences of each category subset during the test period, and the calculation formula is as follows:
[0070] ;
[0071] ;
[0072] ;
[0073] In the formula, represents the integrated result of the weight sequence corresponding to the 0-class category subset, represents the integration of the corrected weight sequence corresponding to the 1-class category subset, represents the integration of the corrected weight sequence corresponding to the 2-class category subset, and T represents the transpose.
[0074] Finally, according to the time label, , and are rearranged to obtain the final runoff prediction result.
[0075] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device.
[0076] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A runoff ensemble forecasting method based on a weighted real-time modified machine learning model, characterized in that: The steps include: The hydrological and meteorological data in the study basin are collected and divided into a training set, a validation set and a test set, and a machine learning runoff prediction model is trained using multiple machine learning models, and a machine learning runoff forecast set is constructed based on all the machine learning runoff prediction models obtained through training; the hydrological and meteorological data include measured runoff and meteorological characteristic data; Use all machine learning runoff forecasting models to predict runoff and obtain corresponding simulated runoff data; According to the simulated runoff data of all machine learning runoff forecast models and their corresponding measured runoff data, the dynamic Bayesian algorithm is used to estimate the weight sequence of each machine learning runoff prediction model in the machine learning runoff forecast model set; Classifying the runoff simulation value predicted by the machine learning runoff prediction model according to the measured runoff data to obtain the category of the runoff simulation value; the category of the runoff simulation value includes category 0, category 1 and category 2; The machine learning runoff forecast set is used to predict the runoff simulation values corresponding to the training set and the validation set. The runoff simulation values and corresponding category labels in the training set and the validation set are used as target variables to train and construct a category prediction model. The constructed category prediction model is used to predict the category labels of the runoff simulation values in the test set. Based on the runoff simulation values in the training set and their corresponding category labels, the training set is divided into three category subsets: category 0 subset, category 1 subset and category 2 subset. The weight sequence corresponding to each category subset extracted according to the time label is corrected, and the weight correction value corresponding to each category subset is verified and determined using the validation set. According to the category label results of the runoff simulation values in the test set predicted by the category prediction model, the test set is divided into three category subsets: category 0 subset, category 1 subset and category 2 subset. The weight sequence of the corresponding category subset extracted in combination with the time label is corrected according to the weight correction value corresponding to each category subset, and the corrected weight sequence of each category subset is used for integrated calculation to generate the final runoff prediction result.
2. A runoff ensemble forecasting method based on a weighted real-time corrected machine learning model according to claim 1, characterized in that: The categories of runoff simulation values include: Class 0: In a time step, the simulated runoff value is larger or smaller than the measured value; Category 1: at one time step, the runoff simulation values of all models are greater than the measured values; Category 2: At one time step, the runoff simulation values of all models are smaller than the measured values.
3. The runoff ensemble forecasting method based on the weighted real-time modified machine learning model according to claim 1 is characterized in that: The category prediction model: ; In the formula, Represents the category label of the runoff simulation value predicted by the category prediction model; Represents a training category prediction model; Represents the first machine learning runoff prediction model at time The runoff simulation value of Represents the second machine learning runoff prediction model at time The runoff simulation value, Indicates Machine learning runoff prediction model in time The runoff simulation value.
4. The method for runoff ensemble forecasting based on a weighted real-time corrected machine learning model according to claim 1, characterized in that: The weight sequence correction of the category subsets includes: weight correction of category 1 category subsets and weight correction of category 2 category subsets, while the weight sequence corresponding to category 0 category subsets is not corrected; The weight correction formula of the category 1 subset is: ; The 2-category category subset weight correction formula is: ; In the formula, , Indicates the first Machine learning runoff prediction model in time The modified weight sequence of Indicates the first Machine learning runoff prediction model in time The weight sequence of Indicates the weight correction value of category 1 subset; , Indicates the first Machine learning runoff prediction model in time The modified weight sequence of Indicates the first Machine learning runoff prediction model in time The weight sequence of Indicates the weight correction value of 2-category category subset.
5. The method for runoff ensemble forecasting based on a weighted real-time corrected machine learning model according to claim 4, characterized in that: The weight correction value corresponding to the category 1 subset It is determined using the Bayesian optimization method. The range is between -0.5 and 0; The weight correction values corresponding to the two category subsets It is determined using the Bayesian optimization method. The range is between 0 and 0.
5.
6. The method for runoff ensemble forecasting based on a weighted real-time corrected machine learning model according to claim 1, characterized in that: The integrated calculation formula of the weight sequence after correction of each category subset includes: ; ; ; In the formula, It represents the weight sequence integration result corresponding to the 0-class category subset. Indicates the corrected weight sequence integration corresponding to the 1-category category subset, Indicates the corrected weight sequence integration corresponding to the 2-category category subset, Represents the weight sequence corresponding to the 0-category subset of the test set, represents the modified weight sequence corresponding to the 1-category category subset, represents the modified weight sequence corresponding to the 2-category category subset, Indicates the first machine learning runoff prediction model in the 0-class subset at time The runoff simulation value, Indicates the second machine learning runoff prediction model in the 0-class subset at time The runoff simulation value, Indicates the first Machine learning runoff prediction model in time The runoff simulation value of Represents the first machine learning runoff prediction model in the 1-category category subset at time The runoff simulation value, Represents the second machine learning runoff prediction model in the 1st category subset at time The runoff simulation value, Indicates the first Machine learning runoff prediction model in time The runoff simulation value of Represents the first machine learning runoff prediction model in the 2-category category subset at time The runoff simulation value, Represents the second machine learning runoff prediction model in the 2-category category subset at time The runoff simulation value, Indicates the first Machine learning runoff prediction model in time The simulated runoff value, T represents the transposition, represents the 0-class category subset, represents a subset of 1 category, Represents a 2-class category subset.
7. The method for runoff ensemble forecasting based on a weighted real-time corrected machine learning model according to claim 6, characterized in that: According to the time label , and Rearrange to get the final runoff prediction result.
8. A storage medium for storing computer executable instructions, characterized in that: When executed, the computer executable instructions implement a runoff ensemble forecasting method based on a weighted real-time corrected machine learning model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Medium-and-long-term runoff forecasting method and device considering meteorological factors and storage medium
CN115438838A
Drainage basin runoff forecasting method based on interpretable machine learning
CN117689042A