Flood prediction method and system based on LSTM-MHA model

By using the LSTM-MHA model in flood disaster prediction, combined with the SHAP algorithm and the composite flood simulation model, the problem of insufficient prediction timeliness and interpretation in the existing technology is solved, and high-precision and interpretable flood depth prediction is achieved.

CN119830702APending Publication Date: 2025-04-15GUANGDONG RES INST OF WATER RESOURCES & HYDROPOWER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411769002.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The prior art is difficult to provide effective early warning information in a short time in flood disaster prediction, and traditional machine learning methods ignore the medium and long-term timing relationships of input features, and the model output results are difficult to explain.

Method used

The flood prediction method based on the LSTM-MHA model was adopted, and the composite flood simulation model and heavy rain-tide level-watering data set were constructed, and the interpretability analysis was performed in combination with the SHAP algorithm. The LSTM layer and the multi-head attention layer were introduced, and the LSTM-MHA model was constructed to predict the multimodal rain sample data set.

Benefits of technology

The accuracy of prediction of water depth in heavy rain and floods is improved, the understanding and explanation of the role of flooding factors is enhanced, the rapid response needs in flood prediction are met, and the contribution degree of model input factors is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830702A_ABST
    Figure CN119830702A_ABST
Patent Text Reader

Abstract

The invention discloses a flood prediction method and system based on an LSTM-MHA model, and the method comprises the steps: carrying out the data collection and simulation of a to-be-studied region, and constructing a composite flood simulation model of the to-be-studied region; performing simulation analysis on different spatial characteristic rainstorm and tide level data of the to-be-studied area, and constructing a rainstorm-tide level-waterlogging data set of the to-be-studied area; carrying out interpretability analysis through an SHAP algorithm, and constructing a multi-modal rainstorm sample data set of the to-be-researched region; an LSTM layer and a multi-head attention layer are introduced, and an LSTM-MHA model is constructed; and carrying out rainstorm flood prediction on the multi-modal rainstorm sample data set of the to-be-researched region. According to the method, the input factor contribution degree of the LSTM-MHA model can be unlocked, and the combined action and sequential relationship of rain tide driving factors in the flood process are fully considered, so that the rainstorm flood water depth prediction precision is improved. The flood prediction method and system based on the LSTM-MHA model can be widely applied to the technical field of flood disaster prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flood disaster prediction, and in particular to a flood prediction method and system based on an LSTM-MHA model. Background Art

[0002] In order to implement the flood warning system, accurate and efficient physical mechanism models are needed to simulate the inundation range and depth of waterlogging with high spatial resolution. Hydrodynamic models based on physical mechanisms usually have high simulation accuracy and have been widely used in two-dimensional simulation of flood disasters. However, waterlogging problems usually occur rapidly in a short period of time, so the forecasting system is required to have extremely high timeliness. The calculation process of traditional physical mechanism models is complex and time-consuming, and it is difficult to provide effective warning information in a short time.

[0003] Deep learning models can learn from historical flood disaster data samples, extract key features from raw data through a multi-level neural network structure, and capture and characterize the nonlinear relationships hidden in the flood process. Because it does not rely on a clear description of the physical process, it is significantly better than traditional models in terms of computational efficiency, and can generate prediction results in a relatively short time, meeting the rapid response requirements in flood prediction. At present, the implementation of rapid simulation of waterlogging is usually based on machine learning methods, which have weak processing capabilities for high-dimensional data, require specific feature extraction when facing complex data, and still have limitations in processing raw natural data. At the same time, since floods are a dynamic process, they usually involve long-term series data such as flow and precipitation, but the current modeling methods based on traditional machine learning ignore the medium- and long-term temporal relationships of input features. In addition, previous studies usually lack the analysis of the interpretability of model output results. As a nonlinear method, deep learning can capture and characterize the nonlinear relationships hidden between data in the flood process, but its "black box" characteristics make it difficult for us to understand the internal operating mechanism of the model, resulting in the final prediction results being difficult to meet actual requirements. Summary of the invention

[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a flood prediction method and system based on the LSTM-MHA model, which can unlock the contribution of the input factors of the LSTM-MHA model, and fully consider the joint effect and temporal relationship of the rain and tide driving factors in the flood process, thereby improving the prediction accuracy of rainstorm flood water depth.

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

[0006] Collect and simulate data in the study area, and build a composite flood simulation model for the study area;

[0007] Based on the composite flood simulation model of the area to be studied, the rainstorm and tide data with different spatial characteristics in the study area are simulated and analyzed to construct the rainstorm-tide-waterlogging dataset of the area to be studied.

[0008] The SHAP algorithm is used to perform interpretable analysis on the rainstorm-tide-waterlogging dataset in the study area, and a multi-modal rainstorm sample dataset is constructed in the study area.

[0009] Introduce LSTM layer and multi-head attention layer to build LSTM-MHA model;

[0010] Based on the LSTM-MHA model, heavy rain and flood prediction is carried out on the multimodal heavy rain sample data set in the study area, and the heavy rain and flood water depth prediction results in the study area are obtained.

[0011] Furthermore, the step of collecting and simulating data for the area to be studied and constructing a composite flood simulation model for the area to be studied specifically includes:

[0012] Obtain river network data, land use data, soil type data and rainfall data for the area to be studied, and construct a one-dimensional hydrological model for the area to be studied;

[0013] Obtain rainstorm data in the area to be studied and input it into the one-dimensional hydrological model of the area to be studied for simulation, and obtain the spatial location data and water level change data of the river in the area to be studied;

[0014] Based on the spatial location data and water level change data of the river channel in the area to be studied, combined with the terrain and tide level data of the area to be studied, a two-dimensional simulation of flooding and accumulation of water is carried out to construct a two-dimensional hydrodynamic model of the area to be studied;

[0015] The one-dimensional hydrological model of the area to be studied is coupled with the two-dimensional hydrodynamic model of the area to be studied to construct a composite flood simulation model for the area to be studied.

[0016] Furthermore, the composite flood simulation model based on the area to be studied simulates and analyzes the rainstorm and tide data with different spatial characteristics in the area to be studied, and constructs a rainstorm-tide-waterlogging data set for the area to be studied, which specifically includes:

[0017] Acquire different spatial characteristic rainstorm and tide data of the area to be studied, wherein the different spatial characteristic rainstorm and tide data represent rainstorm and tide data of different return periods and different rainstorm centers;

[0018] The rainstorm and tide data with different spatial characteristics in the study area are input into the composite flood simulation model of the study area to simulate the evolution of the inundation range and inundation depth, and the rainstorm-tide-waterlogging data set of the study area is obtained.

[0019] Furthermore, the step of performing interpretable analysis on the rainstorm-tide-waterlogging dataset of the study area by using the SHAP algorithm to construct a multimodal rainstorm sample dataset of the study area specifically includes:

[0020] According to the recurrence period of the rainstorm and tide data of the rainstorm-tide-waterlogging data set of the area to be studied, data division processing is performed to obtain a divided rainstorm sample data set of the area to be studied, wherein the divided rainstorm sample data set of the area to be studied includes high recurrence period tide level-low recurrence period rainstorm samples, high recurrence period tide level-high recurrence period rainstorm samples, low recurrence period tide level-low recurrence period rainstorm samples and low recurrence period tide level-high recurrence period rainstorm samples;

[0021] The Shapley values ​​of high-return period tide level-low-return period rainstorm samples and low-return period tide level-high-return period rainstorm samples were calculated by SHAP algorithm, and high-return period tide level-low-return period rainstorm samples with factor contribution and low-return period tide level-high-return period rainstorm samples with factor contribution were obtained.

[0022] Combining high-return period tide level-low-return period rainstorm samples with factor contribution, low-return period tide level-high-return period rainstorm samples with factor contribution, high-return period tide level-high-return period rainstorm samples and low-return period tide level-low-return period rainstorm samples, a multimodal rainstorm sample dataset for the area to be studied is constructed.

[0023] Furthermore, the expression for calculating the Shapley value is specifically as follows:

[0024]

[0025] In the above formula, S represents the subset of features used in the model, p represents the total number of features, represents the combined weight, x p represents the pth input feature, x i represents the i-th input feature, φ i represents the Shapley value, and val(S) represents the predicted value of the eigenvalue of set S.

[0026] Furthermore, the LSTM-MHA model specifically includes an LSTM layer, a multi-head attention layer, a Dropout layer and a fully connected layer, wherein the output end of the LSTM layer is connected to the input end of the multi-head attention layer, the output end of the multi-head attention layer is connected to the input end of the Dropout layer, and the output end of the Dropout layer is connected to the input end of the fully connected layer.

[0027] Furthermore, the step of performing rainstorm and flood prediction on the multimodal rainstorm sample data set in the area to be studied based on the LSTM-MHA model to obtain the rainstorm and flood depth prediction result of the area to be studied specifically includes:

[0028] Input the multimodal rainstorm sample dataset of the area to be studied into the LSTM-MHA model;

[0029] Based on the LSTM layer of the LSTM-MHA model, feature extraction is performed on the multimodal rainstorm sample dataset in the area to be studied to obtain a multimodal rainstorm feature sample dataset in the area to be studied;

[0030] Based on the multi-head attention layer of the LSTM-MHA model, linear transformation and attention calculation are performed on the multimodal rainstorm feature sample dataset in the area to be studied, and the attention weight value of the multimodal rainstorm feature sample dataset in the area to be studied is obtained;

[0031] Based on the Dropout layer of the LSTM-MHA model, the attention weight values ​​of the multimodal rainstorm feature sample data set in the area to be studied are regularized to obtain the regularized attention weight values ​​of the multimodal rainstorm feature sample data set in the area to be studied;

[0032] Based on the fully connected layer of the LSTM-MHA model, the attention weight values ​​of the regularized multimodal rainstorm feature sample data in the study area are mapped to obtain the rainstorm flood depth prediction results in the study area.

[0033] The second technical solution adopted by the present invention is: a flood prediction system based on the LSTM-MHA model, comprising:

[0034] The first module is used to collect and simulate data in the study area and build a composite flood simulation model for the study area;

[0035] The second module is used to simulate and analyze the rainstorm and tide data with different spatial characteristics in the study area based on the composite flood simulation model of the study area, and to construct the rainstorm-tide-waterlogging data set of the study area;

[0036] The third module is used to perform interpretable analysis on the rainstorm-tide-waterlogging dataset of the study area through the SHAP algorithm, and to construct a multimodal rainstorm sample dataset of the study area;

[0037] The fourth module is used to introduce the LSTM layer and the multi-head attention layer to build the LSTM-MHA model;

[0038] The fifth module is used to predict rainstorm and floods in the multimodal rainstorm sample data set in the study area based on the LSTM-MHA model, and obtain the rainstorm and flood depth prediction results in the study area.

[0039] The beneficial effects of the method and system of the present invention are as follows: the present invention collects and simulates data for the study area to construct a composite flood simulation model for the study area, and then simulates and analyzes the different spatial characteristic rainstorm and tide data of the study area based on the composite flood simulation model of the study area to construct a rainstorm-tide-waterlogging data set for the study area, and further uses the SHAP algorithm to perform interpretability analysis on the rainstorm-tide-waterlogging data set of the study area, and constructs an interpretable model based on SHAP, which can unlock the contribution of the input factors of the LSTM-MHA model. The waterlogging inundation data predicted by the LSTM-MHA model are combined through the SHAP algorithm to construct an interpretable composite flood simulation model, which can improve the efficiency and accuracy of heavy rain waterlogging simulation in coastal areas and enhance the understanding and interpretation of the role of waterlogging factors. Then, the LSTM layer and the multi-head attention layer are introduced to construct the LSTM-MHA model to predict heavy rain and floods in the multimodal heavy rain sample data set in the study area. The LSTM and multi-head attention mechanism model is applied to the composite flood disaster simulation, which can realize the accurate simulation of the flooding depth and spatial distribution in the region, and can fully consider the joint effect and temporal relationship of rain and tide driving factors in the flood process, thereby improving the prediction accuracy of heavy rain and flood depth. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a flow chart of the steps of a flood prediction method based on the LSTM-MHA model of the present invention;

[0041] Figure 2 It is a structural block diagram of a flood prediction system based on the LSTM-MHA model of the present invention;

[0042] Figure 3 It is a schematic diagram of a one-dimensional hydrological model HEC-HMS of the area to be studied provided by a specific embodiment of the present invention;

[0043] Figure 4 It is a schematic diagram of the LSTM-MHA model structure provided by a specific embodiment of the present invention;

[0044] Figure 5 It is a schematic diagram of the spatial difference and water depth correlation of the flooded water depth predicted by the LSTM-MHA model and simulated by the composite flood model in a flood-prone area with the center of the rainstorm as the upstream, the rainfall once in 50 years, and the tide level once in 1 year, provided by a specific embodiment of the present invention;

[0045] Figure 6 It is a schematic diagram of the spatial difference and correlation of flood depths predicted by the LSTM-MHA model and simulated by the composite flood model in a flood-prone area upstream of the center of a rainstorm, with a rainfall once in 30 years and a tide once in 5 years, provided by a specific embodiment of the present invention;

[0046] Figure 7 It is a schematic diagram of the spatial difference and water depth correlation of the flooded water depth predicted by the LSTM-MHA model and simulated by the composite flood model in a flood-prone area in the upstream of the center of the rainstorm, with a rainfall once in 10 years and a tide level once in 2 years, provided by a specific embodiment of the present invention;

[0047] Figure 8 It is a schematic diagram of the spatial difference and water depth correlation of the flooded water depth predicted by the LSTM-MHA model and simulated by the composite flood model in a flood-prone area in the upstream of the center of the rainstorm, with a rainfall once in 10 years and a tide level once in 5 years, provided by a specific embodiment of the present invention;

[0048] Fig. 9 It is a schematic diagram of the absolute average value of the global SHAP of samples in the LSTM-MHA model in a typical scenario of a high-return period rainstorm-low-return period tide level in a certain flood-prone area provided by a specific embodiment of the present invention;

[0049] Fig.10 It is a schematic diagram of the SHAP distribution of each input factor of LSTM-MHA of each grid in a typical scenario of high-return period rainstorm-low-return period tide level in a flood-prone area provided by a specific embodiment of the present invention;

[0050] Fig.11 It is a schematic diagram of the absolute average value of the global SHAP of samples in the LSTM-MHA model in a typical scenario of a low-return period rainstorm-high-return period tide level in a certain flood-prone area provided by a specific embodiment of the present invention;

[0051] Fig.12 It is a schematic diagram of the SHAP distribution of each input factor of each grid LSTM-MHA in a typical scenario of low-return period rainstorm-high-return period tide level in a certain flood-prone area provided by a specific embodiment of the present invention. DETAILED DESCRIPTION

[0052] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0053] Reference Figure 1 The present invention provides a flood prediction method based on the LSTM-MHA model, which comprises the following steps:

[0054] S100, collecting and simulating data in the study area, and constructing a composite flood simulation model for the study area;

[0055] Specifically, river network data, land use data, soil type data and rainfall data of the area to be studied are obtained to construct a one-dimensional hydrological model of the area to be studied; rainstorm data of the area to be studied are obtained and input into the one-dimensional hydrological model of the area to be studied for simulation, so as to obtain the spatial position data and water level change data of the river channel in the area to be studied; based on the spatial position data and water level change data of the river channel in the area to be studied, a two-dimensional simulation of flooding and accumulation is carried out in combination with the terrain and tide data of the area to be studied, so as to construct a two-dimensional hydrodynamic model of the area to be studied; the one-dimensional hydrological model of the area to be studied is coupled with the two-dimensional hydrodynamic model of the area to be studied, so as to construct a composite flood simulation model of the area to be studied.

[0056] In this example, data on topography, river network, rainfall, tide level, soil type, and land use type in the study area were collected to construct a composite flood simulation based on a one-dimensional hydrological model HEC-HMS and a two-dimensional hydrodynamic model HEC-RAS;

[0057] In this embodiment, Figure 3 As shown, take a river basin at the junction of a city as an example (the area is about 337km 2 ), construct a rain-tide composite flood model;

[0058] In the composite flood simulation, the HEC-HMS model was constructed using river network, land use, soil type and rainfall data; the rainstorm data was input into the HEC-HMS model, and the spatial position of the river and the water level change process were derived from the HEC-HMS model, which were then input into the HEC-RAS model to perform a two-dimensional simulation of flooding and accumulation combined with terrain and tide data. Finally, the HEC-RAS model was used to output the flooding range, flooding depth and flooding evolution process information;

[0059] The constructed composite flood simulation is calibrated and verified by adjusting the model parameters until the simulation accuracy meets the requirements.

[0060] S200, based on the composite flood simulation model of the area to be studied, simulate and analyze the rainstorm and tide data with different spatial characteristics in the study area, and construct a rainstorm-tide-waterlogging data set for the area to be studied;

[0061] Specifically, the rainstorm and tide data with different spatial characteristics in the area to be studied are obtained, and the rainstorm and tide data with different spatial characteristics represent the rainstorm and tide data with different recurrence periods and different rainstorm centers; the rainstorm and tide data with different spatial characteristics in the area to be studied are input into the composite flood simulation model of the area to be studied to simulate the evolution of the inundation range and inundation depth, so as to obtain the rainstorm-tide-waterlogging data set of the area to be studied.

[0062] Among them, it should be specifically explained that the different spatial characteristics refer to rainstorms and tides with different recurrence periods and different rainstorm centers. Different recurrence periods include 5, 10, 30, 50 and 100 years; different rainstorm centers refer to the upper, middle and lower reaches of the study area.

[0063] The database of rainstorm-tide-waterlogging with different characteristics at different times refers to inputting rainstorms and tides with different characteristics into the constructed composite flood simulation to simulate the flooding range, flooding depth and flooding evolution process under different rainstorm-tide scenarios. In this embodiment, the database of rainstorm-tide-waterlogging with different characteristics includes 30 rainstorm-waterlogging flooding scenarios.

[0064] S300, using the SHAP algorithm to perform interpretable analysis on the rainstorm-tide-waterlogging dataset in the study area, and construct a multimodal rainstorm sample dataset in the study area;

[0065] Specifically, data division processing is performed according to the recurrence period of the rainstorm and tide data of the rainstorm-tide-waterlogging data set in the area to be studied, and the divided rainstorm sample data set in the area to be studied is obtained, and the divided rainstorm sample data set in the area to be studied includes high recurrence period tide level-low recurrence period rainstorm samples, high recurrence period tide level-high recurrence period rainstorm samples, low recurrence period tide level-low recurrence period rainstorm samples and low recurrence period tide level-high recurrence period rainstorm samples; the high recurrence period tide level-low recurrence period rainstorm samples and the low recurrence period tide level-high recurrence period rainstorm samples are divided by the SHAP algorithm. The Shapley value of the high-return period tide level-high return period rainstorm samples was calculated to obtain the high-return period tide level-low return period rainstorm samples with factor contribution and the low-return period tide level-high return period rainstorm samples with factor contribution; the high-return period tide level-low return period rainstorm samples with factor contribution, the low-return period tide level-high return period rainstorm samples with factor contribution, the high-return period tide level-high return period rainstorm samples and the low-return period tide level-low return period rainstorm samples were combined to construct a multimodal rainstorm sample dataset in the area to be studied.

[0066] In this embodiment, four different test samples are used as specific examples to test the prediction effect of the LSTM-MHA model on the spatial variation of water depth under different rainstorms. The four test samples are R503030aT1a, R203020aT5a, R101010aT2a, and R1055aT5a, where R203020aT5a refers to the design rainstorm recurrence period of 20 years for the upstream rain gauge station in the study area, 30 years for the midstream design rainstorm recurrence period, 20 years for the downstream design rainstorm recurrence period, and 5 years for the tide setting recurrence period, and the rest of the samples are analogous. In each scenario, the LSTM-MHA model predicts a total of 73 time steps (total duration of 36 hours, predicted every half an hour) of spatial flooding depth. The LSTM-MHA model predicted a total of 3,280,901 grids. Since there are a large number of spatial grid maps for each rainstorm prediction and the flooding situation in the 18th hour is more serious, the water depth grid map in the 18th hour is selected here to display and illustrate the spatial prediction effect.

[0067] Under the R503030aT1a scenario, the difference and correlation (t=18h) between the water depth predicted by the LSTM-MHA model and the composite flood model based on the HEC coupling model are shown in Figure 2. Figure 5 (a) and Figure 5 (b) As shown. The spatial flooding depth predicted by the LSTM-MHA model is close to the result of the urban waterlogging model, and the flood-prone locations are consistent. The maximum water depth difference between the two is basically less than 0.1m. The water depth predicted by the CNN model has a high correlation with the water depth simulated by the urban waterlogging model, showing a significant linear correlation (P<0.001). The average PCC correlation coefficient predicted by the LSTM-MHA model is 0.992, the average MAE is 2.87cm, and the average RMSE is 0.053. The results show that the difference in water depth changes over time between the LSTM-MHA model prediction and the composite flood model simulation is small.

[0068] Under the R203020aT5a scenario, the difference and correlation (t = 18h) between the water depth predicted by the LSTM-MHA model and the simulated water depth by the composite flood model based on the HEC coupling model are shown in Figure 2. Figure 6 (a) and Figure 6(b) As shown. The spatial flooding depth predicted by the LSTM-MHA model is close to the result of the urban waterlogging model, and the flood-prone locations are consistent. The maximum water depth difference between the two is basically less than 0.1m. The water depth predicted by the CNN model has a high correlation with the water depth simulated by the urban waterlogging model, showing a significant linear correlation (P<0.001). The average PCC correlation coefficient predicted by the LSTM-MHA model is 0.994, the average MAE is 3.40cm, and the average RMSE is 0.049. The results show that the difference in water depth changes over time between the LSTM-MHA model prediction and the composite flood model simulation is small.

[0069] Under the R101010aT2a scenario, the difference and correlation (t = 18h) in water depth simulation between the LSTM-MHA model prediction and the composite flood model based on the HEC coupling model are shown in Figure 2. Figure 7 (a) and Figure 7 (b) As shown. The spatial flooding depth predicted by the LSTM-MHA model is close to the result of the urban waterlogging model, and the flood-prone locations are consistent. The maximum water depth difference between the two is basically less than 0.1m. The water depth predicted by the CNN model has a high correlation with the water depth simulated by the urban waterlogging model, showing a significant linear correlation (P<0.001). The average PCC correlation coefficient predicted by the LSTM-MHA model is 0.991, the average MAE is 2.77cm, and the average RMSE is 0.055. The results show that the difference in water depth changes over time between the LSTM-MHA model prediction and the composite flood model simulation is small.

[0070] Under the R1055aT5a scenario, the difference and correlation (t = 18 h) between the water depth predicted by the LSTM-MHA model and the composite flood model based on the HEC coupling model are shown in Figure 2. Figure 8 (a) and Figure 8 (b) As shown. The spatial flooding depth predicted by the LSTM-MHA model is close to the result of the urban waterlogging model, and the flood-prone locations are consistent. The maximum water depth difference between the two is basically less than 0.1m. The water depth predicted by the CNN model has a high correlation with the water depth simulated by the urban waterlogging model, showing a significant linear correlation (P<0.001). The average PCC correlation coefficient predicted by the LSTM-MHA model is 0.995, the average MAE is 2.83cm, and the average RMSE is 0.043. The results show that the difference in water depth changes over time between the LSTM-MHA model prediction and the composite flood model simulation is small.

[0071] Specifically, the interpretability analysis of the typical scenario samples of the test set is performed based on the interpretability algorithm SHAP to reveal the contribution of input factors. Typical scenario samples refer to high return period tide level-low return period rainstorm samples and low return period tide level-high return period rainstorm samples. In this example, they refer to the R503030aT1a scenario and the R1055aT5a scenario.

[0072] The explainable SHAP algorithm is based on the SHapley Additive exPlanations algorithm. The algorithm is based on the Shapley value in game theory. The marginal contribution of each feature in all possible feature combinations determines its input factor contribution. The Shaply value Φ i The calculation process is as follows:

[0073]

[0074] Where S is the subset of features used in the model, p is the number of features, and represents the prediction for the feature values ​​of set S. represents the combination weight, which is used to ensure that all possible feature combinations are considered fairly.

[0075] After constructing an interpretable model based on the SHAP algorithm, the LSTM-MHA model and the typical scenario prediction values ​​were input into the SHAP model for analysis. At the same time, to facilitate subsequent analysis, the calculation results of the input rainfall data of the same rain gauge were merged, that is, the 144 features of the 5-minute rainfall sequence process of the six rain gauges two hours before the current time were merged into one feature. Finally, the global contribution of 14 variables was obtained.

[0076] In the R503030aT1a scenario, the SHAP distribution diagram of each sample input factor and the sample population absolute average diagram in the LSTM-MHA model are shown in Fig. 9 and Fig.10 In the R1055T5a scenario, the SHAP distribution diagram of each sample input factor in the LSTM-MHA model and the sample population absolute average diagram are shown in Fig.11 and Fig.12 As shown. The ranking of contribution factors in the two typical scenario samples is roughly the same, from high to low, they are current time, average water depth, rain gauge station, and tide level station. For the two characteristics of current time and average water depth, as the characteristic value increases, the Shapley value becomes higher, which positively affects the model prediction value and makes the prediction value larger. For the other characteristics, as the characteristic value increases, the absolute value of the Shapley value becomes higher, but the impact on the model prediction results does not show an obvious change pattern. Compared with the typical scenarios, it can be seen that the contribution of the tide level factor in the low return period heavy rain-high return period tide level sample is significantly higher than that in the high return period heavy rain-low return period tide level sample, and the contribution ranking of the rain gauge station and the tide level station is also different according to the different geographical locations.

[0077] S400, introduce LSTM layer and multi-head attention layer to build LSTM-MHA model;

[0078] Specifically, the LSTM-MHA model includes an LSTM layer, a multi-head attention layer, a Dropout layer and a fully connected layer, wherein the output end of the LSTM layer is connected to the input end of the multi-head attention layer, the output end of the multi-head attention layer is connected to the input end of the Dropout layer, and the output end of the Dropout layer is connected to the input end of the fully connected layer.

[0079] In this embodiment, the LSTM-MHA model is constructed using the Pytorch library in the Python language. The LSTM layer of the LSTM model is designed to be 2 layers, and the Tanh function is selected as the activation function. The multi-head attention layer is 1 layer. The fully connected layer is 2 layers, and the number of neurons is 512 and 1024 respectively. The random inactivation rate of the Dropout layer is set to 0.3, and the output layer activation function is selected as softmax, corresponding to the flooding depth of different grids. The LSTM-MHA structure used is as follows Figure 4 shown.

[0080] There are multiple parameters that need to be set and optimized when building the LSTM model. In this study, the parameters of the LSTM-MHA model were optimized by the grid search method. The optimized parameter settings are shown in Table 1:

[0081] Table 1 LSTM-MHA model parameters and values ​​used

[0082]

[0083] S500. Based on the LSTM-MHA model, a rainstorm and flood prediction is performed on the multimodal rainstorm sample data set in the study area to obtain the rainstorm and flood depth prediction result of the study area.

[0084] Specifically, the multimodal rainstorm sample data set in the area to be studied is input into the LSTM-MHA model; based on the LSTM layer of the LSTM-MHA model, feature extraction is performed on the multimodal rainstorm sample data set in the area to be studied to obtain the multimodal rainstorm feature sample data set in the area to be studied; based on the multi-head attention layer of the LSTM-MHA model, linear transformation and attention calculation are performed on the multimodal rainstorm feature sample data set in the area to be studied to obtain the attention weight value of the multimodal rainstorm feature sample data set in the area to be studied; based on the Dropout layer of the LSTM-MHA model, the attention weight value of the multimodal rainstorm feature sample data set in the area to be studied is regularized to obtain the regularized attention weight value of the multimodal rainstorm feature sample data in the area to be studied; based on the fully connected layer of the LSTM-MHA model, the regularized attention weight value of the multimodal rainstorm feature sample data in the area to be studied is mapped to obtain the rainstorm flood depth prediction result of the area to be studied.

[0085] In this embodiment, the training set validation set is divided to construct an LSTM-MHA model. The rainfall process two hours before the current moment at the six rain gauges, the current moment tide level, the flooding depth at the previous moment, and time are used as independent variables, and the flooding depth of different target grids is used as the dependent variable. The LSTM-MHA model is trained using the training set data of the rainstorm-tide-waterlogging database, and the model hyperparameters are adjusted and optimized.

[0086] The independent variables of LSTM-MHA are the rainfall sequence process of the six rain gauges two hours before the current moment (the total rainfall duration is 24 hours, and the 5-minute rainfall is used as a feature, with a total of 144 features), the tide levels T1-T6 of the six tide stations at the current moment, the flooding depth D1 at the previous moment (the previous 30 minutes) and the time (moment) t of the flooding, a total of 152 input features. The dependent variable is the water depth of different spatial grids (a total of 3280901 grids, with a grid resolution of 5m×5m). The 30 simulated rainstorm flooding scenarios were randomly divided into training sets and test sets according to a ratio of 7:3, that is, a total of 21 samples were used for model training. The input and output data structures used in the model are as follows Figure 4 As shown;

[0087] The input features of the flood depth prediction in this embodiment are one-dimensional, and the main structure of the constructed LSTM-MHA model includes LSTM layer, multi-head attention layer, Dropout layer and fully connected layer.

[0088] The LSTM layer is used to extract and store the data features at the current time t, and output the predicted probability at the current time t in combination with the data features at the previous time t-1. Under the control of the input gate, output gate, and forget gate, the feature information flow transmitted in the network unit can be adaptively controlled.

[0089] The main function of the Dropout layer is to implement weight regularization, which suppresses overfitting by randomly discarding some of the activated features in the neural network layer. Weight regularization can simplify the complexity of the model and improve the generalization performance of the model.

[0090] Fully connected layer: connects all neural units in the LSTM layer, and after passing through the hidden layer, the output layer outputs the prediction results.

[0091] In the LSTM layer, the cell units are calculated at each time step. After the cyclic calculation, they are forward propagated as the input of the next network layer. The cyclic calculation process is as follows:

[0092] F t =σ(W f1 x t +W f2 h t-1 +b f )

[0093] I t =σ(W i1 x t +W i2 h t-1 +b i )

[0094] O t =σ(W o1 x t +W o2 h t-1 +b o )

[0095]

[0096] In the above formula: F t ,I t ,O t Represent the activation vectors of the forget gate, output gate, and input gate at time t, respectively, C t represents the cell output at time t; σ(·) is the activation function; W f1 ,W i1 ,W o1 is the input weight corresponding to the forget gate, input gate and output gate at time t; W f2 ,W i2 ,W o2 is the output weight corresponding to time t; b is the bias of the corresponding neuron;

[0097] In the multi-head attention layer, the input data is imported into each attention head for linear transformation and attention calculation. The attention mechanism calculation process is as follows:

[0098]

[0099] In the above formula, Q, K, and V refer to the query matrix, key matrix, and value matrix generated by the linear transformation of the input data, respectively. k is the dimension of K, and softmax(·) represents the calculation of the softmax function.

[0100] By splicing the output of each attention head, we can get the multi-head attention output. The multi-head splicing process is as follows:

[0101] MuliHead(Q,K,V)=Concat(head1,head2…head h )W O

[0102] In the formula, head i =Atention(Q i ,K i ,V i ), W O is the weight matrix, h is the number of attention heads, and Concat(·) is the vertical matrix concatenation operation.

[0103] The time series data of heavy rain in the test set is input into the constructed LSTM-MHA model, and the changes in the inundation depth of each spatial grid are output to achieve rapid simulation of the inundation range, inundation depth and inundation evolution process under complex floods.

[0104] Reference Figure 2 , a flood prediction system based on LSTM-MHA model, including:

[0105] The first module 201 is used to collect and simulate data in the study area and construct a composite flood simulation model for the study area;

[0106] The second module 202 is used to simulate and analyze the rainstorm and tide data with different spatial characteristics in the study area based on the composite flood simulation model of the study area, and construct a rainstorm-tide-waterlogging data set for the study area;

[0107] The third module 203 is used to perform interpretable analysis on the rainstorm-tide-waterlogging dataset of the study area through the SHAP algorithm, and construct a multi-modal rainstorm sample dataset of the study area;

[0108] The fourth module 204 is used to introduce the LSTM layer and the multi-head attention layer to build the LSTM-MHA model;

[0109] The fifth module 205 is used to predict rainstorm and floods in the multimodal rainstorm sample data set in the area to be studied based on the LSTM-MHA model, and obtain the prediction result of the rainstorm and flood water depth in the area to be studied.

[0110] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0111] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A flood prediction method based on LSTM-MHA model, characterized in that: The following steps are involved: Collect and simulate data in the study area, and build a composite flood simulation model for the study area; Based on the composite flood simulation model of the area to be studied, the rainstorm and tide data with different spatial characteristics in the study area are simulated and analyzed to construct the rainstorm-tide-waterlogging dataset of the area to be studied. The SHAP algorithm is used to perform interpretable analysis on the rainstorm-tide-waterlogging dataset in the study area, and a multi-modal rainstorm sample dataset is constructed in the study area. Introduce LSTM layer and multi-head attention layer to build LSTM-MHA model; Based on the LSTM-MHA model, heavy rain and flood prediction is carried out on the multimodal heavy rain sample data set in the study area, and the heavy rain and flood water depth prediction results in the study area are obtained.

2. According to the flood prediction method based on the LSTM-MHA model of claim 1, it is characterized in that: The step of collecting and simulating data in the study area and constructing a composite flood simulation model for the study area specifically includes: Obtain river network data, land use data, soil type data and rainfall data for the area to be studied, and construct a one-dimensional hydrological model for the area to be studied; Obtain rainstorm data in the area to be studied and input it into the one-dimensional hydrological model of the area to be studied for simulation, and obtain the spatial location data and water level change data of the river in the area to be studied; Based on the spatial location data and water level change data of the river channel in the study area, combined with the terrain and tide level data of the study area, a two-dimensional simulation of flooding and accumulation of water is carried out to construct a two-dimensional hydrodynamic model of the study area; The one-dimensional hydrological model of the area to be studied is coupled with the two-dimensional hydrodynamic model of the area to be studied to construct a composite flood simulation model for the area to be studied.

3. According to the flood prediction method based on the LSTM-MHA model of claim 2, it is characterized in that: The step of simulating and analyzing the rainstorm and tide data with different spatial characteristics in the study area based on the composite flood simulation model of the study area to construct a rainstorm-tide-waterlogging data set for the study area specifically includes: Acquire different spatial characteristic rainstorm and tide data of the area to be studied, wherein the different spatial characteristic rainstorm and tide data represent rainstorm and tide data of different return periods and different rainstorm centers; The rainstorm and tide data with different spatial characteristics in the study area are input into the composite flood simulation model of the study area to simulate the evolution of the inundation range and inundation depth, and the rainstorm-tide-waterlogging data set of the study area is obtained.

4. A flood prediction method based on LSTM-MHA model according to claim 3, characterized in that: The step of performing interpretable analysis on the rainstorm-tide-waterlogging dataset of the study area by using the SHAP algorithm to construct a multimodal rainstorm sample dataset of the study area specifically includes: According to the recurrence period of the rainstorm and tide data of the rainstorm-tide-waterlogging data set of the area to be studied, data division processing is performed to obtain a divided rainstorm sample data set of the area to be studied, wherein the divided rainstorm sample data set of the area to be studied includes high recurrence period tide level-low recurrence period rainstorm samples, high recurrence period tide level-high recurrence period rainstorm samples, low recurrence period tide level-low recurrence period rainstorm samples and low recurrence period tide level-high recurrence period rainstorm samples; The Shapley values ​​of high-return period tide level-low-return period rainstorm samples and low-return period tide level-high-return period rainstorm samples were calculated by SHAP algorithm, and high-return period tide level-low-return period rainstorm samples with factor contribution and low-return period tide level-high-return period rainstorm samples with factor contribution were obtained. Combining high-return period tide level-low-return period rainstorm samples with factor contribution, low-return period tide level-high-return period rainstorm samples with factor contribution, high-return period tide level-high-return period rainstorm samples and low-return period tide level-low-return period rainstorm samples, a multimodal rainstorm sample dataset for the area to be studied is constructed.

5. A flood prediction method based on LSTM-MHA model according to claim 4, characterized in that: The expression for calculating the Shapley value is specifically as follows: In the above formula, S represents the subset of features used in the model, p represents the total number of features, represents the combined weight, x p represents the pth input feature, x i represents the i-th input feature, φ i represents the Shapley value, and val(S) represents the predicted value of the eigenvalue of set S.

6. A flood prediction method based on LSTM-MHA model according to claim 5, characterized in that: The LSTM-MHA model specifically includes an LSTM layer, a multi-head attention layer, a Dropout layer and a fully connected layer, wherein the output end of the LSTM layer is connected to the input end of the multi-head attention layer, the output end of the multi-head attention layer is connected to the input end of the Dropout layer, and the output end of the Dropout layer is connected to the input end of the fully connected layer.

7. A flood prediction method based on LSTM-MHA model according to claim 6, characterized in that: The step of performing rainstorm and flood prediction on the multimodal rainstorm sample data set in the area to be studied based on the LSTM-MHA model to obtain the rainstorm and flood water depth prediction result of the area to be studied specifically includes: Input the multimodal rainstorm sample dataset of the area to be studied into the LSTM-MHA model; Based on the LSTM layer of the LSTM-MHA model, feature extraction is performed on the multimodal rainstorm sample dataset in the area to be studied to obtain a multimodal rainstorm feature sample dataset in the area to be studied; Based on the multi-head attention layer of the LSTM-MHA model, linear transformation and attention calculation are performed on the multimodal rainstorm feature sample dataset in the area to be studied, and the attention weight value of the multimodal rainstorm feature sample dataset in the area to be studied is obtained; Based on the Dropout layer of the LSTM-MHA model, the attention weight values ​​of the multimodal rainstorm feature sample data set in the area to be studied are regularized to obtain the regularized attention weight values ​​of the multimodal rainstorm feature sample data set in the area to be studied; Based on the fully connected layer of the LSTM-MHA model, the attention weight values ​​of the regularized multimodal rainstorm feature sample data in the study area are mapped to obtain the rainstorm flood depth prediction results in the study area.

8. A flood prediction system based on LSTM-MHA model, characterized in that: Includes the following modules: The first module is used to collect and simulate data in the study area and build a composite flood simulation model for the study area; The second module is used to simulate and analyze the rainstorm and tide data with different spatial characteristics in the study area based on the composite flood simulation model of the study area, and to construct the rainstorm-tide-waterlogging data set of the study area; The third module is used to perform interpretable analysis on the rainstorm-tide-waterlogging dataset of the study area through the SHAP algorithm, and to construct a multimodal rainstorm sample dataset of the study area; The fourth module is used to introduce the LSTM layer and the multi-head attention layer to build the LSTM-MHA model; The fifth module is used to predict rainstorm and floods in the multimodal rainstorm sample data set in the study area based on the LSTM-MHA model, and obtain the rainstorm and flood depth prediction results in the study area.