Flood prediction method based on hybrid machine model

By constructing a hybrid machine model based on CatBoost and RF models and using the SHAP value iterative feature importance selection method, the problem of insufficient performance of existing flood prediction models in short-term or real-time prediction is solved, and more efficient and accurate flooding is achieved predict.

CN119443314AInactive Publication Date: 2025-02-14SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411509551.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing flood prediction models are not effective in short-term or real-time predictions, and the hydrological model relies on on-site survey data and expert knowledge, resulting in low prediction accuracy.

Method used

The flood prediction method based on hybrid machine model is adopted, and a hybrid model of the CatBoost model and RF model is constructed, and the iterative feature importance selection method that explains the SHAP value is used to reduce model training time and improve prediction accuracy.

Benefits of technology

Through the use of hybrid machine models, the effectiveness and accuracy of flood predictions are improved, model training time is reduced, and performance is excellent in short-term or real-time predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443314A_ABST
    Figure CN119443314A_ABST
Patent Text Reader

Abstract

The invention discloses a flood prediction method based on a hybrid machine model, and the method comprises the following steps: 1, obtaining flood information, and constructing a data set which comprises a test set and a training set; preprocessing the data set; step 2, constructing a hybrid machine model based on a CatBoost model and an RF model; 3, training the hybrid machine model, and carrying out flood prediction by adopting the trained hybrid machine model to obtain a prediction result; according to the method, the CatBoost model and the RF model form a hybrid machine model, so that the prediction effectiveness of the hybrid machine model is ensured; selection is carried out through additive interpretation of iteration feature importance of the SHAP value; after an iterative feature importance selection process, the selected feature is finally determined by finding a knee point with significantly reduced model training performance or a minimum point with optimal model training performance, the time of model training can be shortened by feature selection measurement, and the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a flood prediction method, and in particular to a flood prediction method based on a hybrid machine model. Background Art

[0002] Floods are the natural disasters that cause the most casualties worldwide, so flood prediction is very useful. Traditional hydrological models are currently used for flood forecasting, but hydrological models rely on field survey data and geomorphological expert knowledge. These models face huge difficulties and challenges. First, hydrological models are difficult to apply to short-term or real-time predictions, and field survey data cannot be obtained intensively at low cost. Second, even if the model is very complex, the prediction accuracy of the hydrological model is not very high due to the uncertainty of hydrological, calibration and verification data.

[0003] In recent years, machine learning models have attracted widespread attention in flood forecasting. Machine learning models do not need to rely on the experience and knowledge of experts. Machine models are superior to hydrological models in short-term flood forecasting. However, the existing machine models for flood forecasting are mainly divided into two categories: non-tree-based models and tree-based models. However, the existing machine learning models have their own advantages and disadvantages and cannot adapt well to the requirements of flood forecasting. Summary of the invention

[0004] The present invention aims at solving the problems in the prior art and provides a flood prediction method based on a hybrid machine model.

[0005] The technical solution adopted by the present invention is: a flood prediction method based on a hybrid machine model, comprising the following steps:

[0006] Step 1: Obtain flood information and construct a data set, including a test set and a training set; preprocess the data set;

[0007] Step 2: Build a hybrid machine model based on CatBoost model and RF model;

[0008] Step 3: Train the hybrid machine model, use the trained hybrid machine model to perform flood prediction, and obtain prediction results;

[0009] The dataset preprocessing process is as follows:

[0010] S11: Extract features from the data set, calculate the additive explanation SHAP value of all features, and sort the obtained SHAP values ​​according to size;

[0011] S12: remove the feature with the smallest SHAP value in the data set, update the data set, and use the data set to train the mixture and its model;

[0012] S13: Repeat steps S11 to S12 until the last feature remains, and update the data set.

[0013] Furthermore, after removing the feature with the smallest SHAP value in step S12, the hybrid machine model is evaluated using the updated data set, the number of iterations and the evaluation results are recorded, and the data set that satisfies the number of iterations corresponding to the evaluation results is selected as the required data set.

[0014] Furthermore, the root mean square error is used to evaluate the hybrid machine model.

[0015] Furthermore, after recording the number of iterations and the evaluation results, a curve of the number of iterations and the root mean square error is obtained with the number of iterations as the horizontal coordinate and the root mean square error as the vertical coordinate; the lowest point and the knee point are obtained according to the curve, and the data set formed by the number of iterations corresponding to the lowest point or the knee point is used as the final required data set.

[0016] Furthermore, the knee point is a point where the root mean square error increases by more than 0.1.

[0017] Furthermore, in the hybrid machine model of step 2, the CatBoost model and the RF model are hybridized using an averaging strategy, and the predictions of the CatBoost model and the RF model are averaged to be the prediction of the hybrid model.

[0018] Furthermore, in the hybrid machine model of step 2, the CatBoost model and the RF model are hybridized using a linear fitting strategy, and the output of the first layer model is used as a feature, which is used as a learning label for the second layer model.

[0019] The beneficial effects of the present invention are:

[0020] (1) The present invention constructs a hybrid machine model by combining the CatBoost model and the RF model through averaging or linear regression, thereby ensuring the effectiveness of its prediction;

[0021] (2) The present invention selects features by additively interpreting the iterative feature importance of SHAP values, sorting the importance of features in each iteration, discarding the least important features, and updating in the next iteration; this feature selection measurement can reduce the time of model training and improve the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of the process of iterative feature importance selection in the present invention.

[0023] Figure 2 Schematic diagram of the curve of the number of iterations and the root mean square error in the embodiment.

[0024] Figure 3It is the evaluation result of the model after the model is trained by the data set processed by the feature selection of the present invention using the model constructed by mixing the existing machine learning models. DETAILED DESCRIPTION

[0025] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0026] A flood prediction method based on a hybrid machine model comprises the following steps:

[0027] Step 1: Obtain flood information and construct a data set, including a test set and a training set; preprocess the data set;

[0028] Obtain flood information and create a feature vector from the samples in the data set, f n =[s n ,x n ,y n ,h n ,p 1,n ,p 2,n ,...,p 17,n ] T , where n = 1, 2, ..., 16466; the mth feature element of the nth sample is defined as Wherein, m=1,...,21.

[0029] In order to increase the hydrological diversity, 70% of the total samples were randomly selected with the same probability for training and cross-validation, and a dataset containing N Φ The remaining 30% of the total samples are constructed to contain N Θ The test set Θ of samples. Φ∪Θ={f n}, And N Φ +N Θ =N.

[0030] The dataset preprocessing process is as follows Figure 1 As shown:

[0031] S11: Extract features from the data set, calculate the additive explanation SHAP value of all features, and sort the obtained SHAP values ​​according to size;

[0032] S12: Remove the feature with the smallest SHAP value in the data set, update the data set, and use the data set to train the hybrid and its model; after removing the feature with the smallest SHAP value, use the updated data set to evaluate the hybrid machine model, record the number of iterations and the evaluation results, and select the data set that meets the number of iterations corresponding to the evaluation results as the required data set.

[0033] S13: Repeat steps S11 to S12 until the last feature is left, and update the data set; after recording the number of iterations and the evaluation results, use the number of iterations as the horizontal coordinate and the root mean square error as the vertical coordinate to obtain a curve of the number of iterations and the root mean square error; obtain the lowest point and the knee point according to the curve, and the data set formed by the number of iterations corresponding to the lowest point or the knee point is used as the final required data set. The curve obtained using the existing machine model is as follows Figure 2 shown.

[0034] The knee point is the point where the RMS error increases by more than 0.1.

[0035] The machine model can be evaluated using mean absolute error MAE, root mean square error RMSE, explained variance EV and determination coefficient R2.

[0036] The MAE on the test set Θ is defined as

[0037]

[0038] Where: N Θ To measure the sample size, r n is the flood coverage rate at the sample point location, The predicted value output by the model.

[0039] It is usually used as a loss function to evaluate the performance of regression models. MAE The lower the value, the more accurate the prediction.

[0040] Root mean square error RMSE, the RMSE on the test set Θ is defined as:

[0041]

[0042] Explained variance EV, EV on the test set Θ is defined as:

[0043]

[0044] Where: represents the prediction error, f EV The closer it is to 1, the more accurate the prediction.

[0045] The coefficient of determination R2, R2 on the test set Θ is defined as:

[0046]

[0047] To determine which features are most important, two critical values ​​of l can be found:

[0048]

[0049] Where T is the preset threshold, l * (or l+ ) features are considered insignificant and eliminated in the previous iteration. The remaining Ml * (or Ml + ) features are considered to be the most important features in the candidate model. * is the lowest point, l + The knee point.

[0050] We can obtain the training set Φ(l * )、Φ(l + ) and the test set Θ(l * ), Θ(l + )

[0051] Step 2: Build a hybrid machine model based on CatBoost model and RF model;

[0052] In the hybrid machine model, the CatBoost model and the RF model are mixed using an average strategy, and the predictions of the CatBoost model and the RF model are averaged as the prediction of the hybrid model. In the hybrid machine model, the CatBoost model and the RF model are mixed using a linear fitting strategy, and the output of the first layer model is used as a feature, which is used as the learning label of the second layer model.

[0053] In order to verify the effect of the present invention, three candidate models are selected for combination, and four possible combinations are obtained: RF-XGB, RF-CatBoost, XGB-CatBoost, and RF-XGB-CatBoost.

[0054] The above combination methods are combined using the average value strategy and the linear fitting strategy respectively, and a mixed model of 8 combination methods is obtained.

[0055] The hybrid model of the above 8 combinations is (Φ (0) ,θ (0) ), )and( Train and test on the dataset.

[0056] The above-mentioned mean absolute error MAE, root mean square error RMSE, explained variance EV and determination coefficient R2 are used for evaluation. It can be seen from the evaluation indicators that the RF-CatBoost hybrid model using the average combination strategy outperforms other hybrid models in terms of RMSE. The CatBoost-RF hybrid model trained on has the lowest RMSE. The CatBoost-RF hybrid model trained on has the shortest training time.

[0057] From the above evaluation indicators, the CatBoost-RF hybrid model used in the present invention has the best performance, so not any random combination of existing models can meet the requirements. The model of the present invention is selected based on the actual situation through its unique structural analysis.

[0058] In the feature selection method of the present invention, as the number of features decreases, the remaining features will have a change in the feature importance ranking. This may be due to the calculation method of SHAP Value. First, the calculation of SHAP value is based on all possible feature subsets to fairly distribute the contribution of each feature to model prediction. After removing certain features, the prediction of the model will be redistributed to the remaining features, which will cause the SHAP value of the remaining features to change. Secondly, the SHAP value is calculated based on the difference between the model prediction of the feature subset and the benchmark model (usually a model without features, and the prediction value is the average value). After removing certain features, the prediction of the benchmark model may change, which will further affect the calculation of the SHAP value. In addition, removing features will change the complexity of the model, especially for some nonlinear models.

[0059] Each model can find a minimum point and a knee point in the iterative feature importance selection. Usually, these two points are not the same. The minimum point represents that the model can get the minimum RMSE prediction result by selecting this strategy. At the same time, the model training and prediction time can be saved by reducing the complexity of the model by reducing the features. The knee point represents that the model can achieve an acceptable prediction accuracy with the least features by selecting this strategy.

Claims

1. A flood prediction method based on a hybrid machine model, characterized in that: The following steps are involved: Step 1: Obtain flood information and construct a data set, including a test set and a training set; Preprocess the dataset; Step 2: Build a hybrid machine model based on CatBoost model and RF model; Step 3: Train the hybrid machine model, use the trained hybrid machine model to perform flood prediction, and obtain prediction results; The dataset preprocessing process is as follows: S11: Extract features from the data set, calculate the additive explanation SHAP value of all features, and sort the obtained SHAP values ​​according to size; S12: remove the feature with the smallest SHAP value in the data set, update the data set, and use the data set to train the mixture and its model; S13: Repeat steps S11 to S12 until the last feature remains, and update the data set.

2. A flood prediction method based on a hybrid machine model according to claim 1, characterized in that: After removing the feature with the smallest SHAP value in step S12, the hybrid machine model is evaluated using the updated data set, the number of iterations and the evaluation results are recorded, and the data set that meets the number of iterations corresponding to the evaluation results is selected as the required data set.

3. A flood prediction method based on a hybrid machine model according to claim 2, characterized in that: The root mean square error is used to evaluate the hybrid machine model.

4. A flood prediction method based on a hybrid machine model according to claim 3, characterized in that: After recording the number of iterations and the evaluation results, a curve of the number of iterations and the root mean square error is obtained with the number of iterations as the horizontal coordinate and the root mean square error as the vertical coordinate; The lowest point and the knee point are obtained according to the curve, and the data set formed by the number of iterations corresponding to the lowest point or the knee point is used as the final required data set.

5. A flood prediction method based on hybrid and its model according to claim 4, characterized in that: The knee point is the point where the root mean square error increases by more than 0.

1.

6. A flood prediction method based on a hybrid machine model according to claim 1, characterized in that: In the hybrid machine model of step 2, the CatBoost model and the RF model are hybridized using an averaging strategy, and the predictions of the CatBoost model and the RF model are averaged to be the prediction of the hybrid model.

7. A flood prediction method based on a hybrid machine model according to claim 1, characterized in that: In the hybrid machine model of step 2, the CatBoost model and the RF model are hybridized using a linear fitting strategy, and the output of the first layer model is used as a feature, which is used as a learning label for the second layer model.