Flood forecasting method and system based on transfer learning

By pre-training and transfer learning in data-rich source basins, and using the Transformer-LSTM model to predict floods in the sparse data target basins, the problem of inaccurate forecasting of hydrological models in the sparse data environment is solved, and efficiency and accuracy are improved , meets the needs of real-time and interpretability.

CN119090051APending Publication Date: 2024-12-06XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411083067.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Existing hydrological models are difficult to unearth complex relationships between hydrological parameters from a small amount of data in watershed with sparse data, resulting in inaccurate flood forecasts.

Method used

Using a transfer learning-based method, the basin model is pre-trained using data-rich source basin to build a Transformer-LSTM model, and the benchmark model is applied to data sparseness through transfer learning strategies such as fine-tuning, deep domain confusion and deep correlation alignment. flood forecasts are carried out in the target watershed.

Benefits of technology

Reduce the dependence of the target basin on data, improve the efficiency and accuracy of flood forecasting, enhance the generalization ability of the model, and meet the real-time requirements through the parallel processing of Transformer and the sequence processing ability of LSTM, and improve the forecasting. Accuracy and interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090051A_ABST
    Figure CN119090051A_ABST
Patent Text Reader

Abstract

The invention discloses a flood forecasting method and system based on transfer learning. The method comprises the following steps: step 1, respectively obtaining a hydrological sequence of a source basin and a hydrological sequence of a target basin; 2, pre-training the drainage basin model by using the hydrological sequence of the source drainage basin to obtain a reference model; step 3, according to the hydrological sequence of the target drainage basin and a plurality of preset transfer learning strategies, carrying out transfer learning on the reference model to obtain a forecast sequence of the reference model under each transfer learning strategy; and 4, selecting a flood forecasting sequence of the target drainage basin from the plurality of forecasting sequences according to the performance index of each forecasting sequence, and performing flood forecasting on the target drainage basin according to the flood forecasting sequence. According to the method, the drainage basin model is pre-trained in the data-rich drainage basin, and the drainage basin model is applied to the data-sparse drainage basin based on transfer learning, so that the data collection difficulty and cost are reduced, and the flood forecasting efficiency and accuracy of the sparse drainage basin are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of water conservancy engineering, and in particular relates to a flood forecasting method and system based on transfer learning. Background Art

[0002] As one of the most common and widely distributed hydrological phenomena, floods can occur in all types of rivers and waterways. Due to their suddenness and great destructiveness, they often cause huge economic losses and casualties to human society. Therefore, it is very important to accurately predict flood disasters.

[0003] With the development of machine learning technology, data-driven hydrological models have shown excellent performance. Due to their simple structure and powerful processing capabilities for nonlinear relationships, these models are widely used in runoff prediction and flood forecasting.

[0004] However, hydrological models are highly dependent on the original data in the basin. In basins with good centralized observation conditions and abundant data, hydrological models demonstrate superior performance. But in basins with sparse data, existing hydrological models find it difficult to discover the complex relationship between various hydrological parameters from a small amount of data, and thus cannot accurately predict floods. Summary of the invention

[0005] In order to solve the above problems, the present invention discloses a flood forecasting method and system based on transfer learning.

[0006] The present invention discloses a flood forecasting method based on transfer learning, comprising the following steps:

[0007] Step 1: Obtain the hydrological sequence of the source basin and the hydrological sequence of the target basin respectively;

[0008] Step 2: Use the hydrological sequence of the source basin to pre-train the basin model to obtain a benchmark model;

[0009] Step 3: Perform transfer learning on the benchmark model according to the hydrological sequence of the target basin and a plurality of preset transfer learning strategies, and obtain the forecast sequence of the benchmark model under each transfer learning strategy;

[0010] Step 4: Select a flood forecast sequence for a target river basin from multiple forecast sequences according to the performance index of each forecast sequence, and perform flood forecasting for the target river basin according to the flood forecast sequence.

[0011] Preferably, between step 1 and step 2, the method further includes: constructing a watershed model, wherein the watershed model is a Transformer-LSTM model.

[0012] Correspondingly, the construction of the watershed model is as follows:

[0013] Get the Transformer model and LSTM model;

[0014] The LSTM model is embedded into the fully connected layer of the decoder of the Transformer model to obtain a Transformer-LSTM model.

[0015] Preferably, the plurality of preset transfer learning strategies include at least two of fine-tuning, deep domain confusion, and deep correlation alignment.

[0016] Preferably, the performance indicator includes at least one of root mean square error, mean absolute error, percentage deviation and Nash efficiency coefficient.

[0017] Preferably, the hydrological sequence of the source basin and the hydrological sequence of the target basin are obtained respectively, specifically:

[0018] Obtain hydrological data of the source basin and target basin respectively;

[0019] The hydrological data is preprocessed to obtain a hydrological sequence of a source basin and a hydrological sequence of a target basin, wherein the preprocessing includes at least one of interpolation processing, outlier processing and normalization.

[0020] Performing flood forecasting for the target basin according to the flood forecasting sequence is specifically as follows:

[0021] Determining a probability prediction interval sequence according to the flood forecast sequence;

[0022] According to the probability prediction interval sequence, flood forecast is performed for the target basin.

[0023] The present invention also discloses a flood forecasting system based on transfer learning, comprising:

[0024] Hydrological sequence acquisition module: used to obtain the hydrological sequence of the source basin and the hydrological sequence of the target basin respectively;

[0025] Pre-training module: used to pre-train the basin model using the hydrological sequence of the source basin to obtain a benchmark model;

[0026] Migration module: used to perform transfer learning on the benchmark model according to the hydrological sequence of the target basin and a plurality of preset transfer learning strategies, and obtain the forecast sequence of the benchmark model under each transfer learning strategy;

[0027] Forecast module: used to select a flood forecast sequence of a target basin from multiple forecast sequences according to the performance index of each forecast sequence, and perform flood forecasting for the target basin according to the flood forecast sequence.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] (1) The present invention uses the source basin to pre-train the basin model to obtain a benchmark model, and applies the benchmark model from the data-rich source basin to the data-sparse target basin based on transfer learning, thereby reducing the dependence on data in flood prediction in the target basin, reducing the difficulty and cost of data collection, and improving the efficiency and accuracy of flood forecasting in the target basin;

[0030] (2) The present invention constructs a Transformer-LSTM model, which combines the ability of LSTM to process long-term dependencies and the ability of Transformer to capture global information, and can more accurately capture the long-term and short-term trends in flood changes and improve the accuracy of flood forecasting;

[0031] (3) In the Transformer-LSTM model constructed by the present invention, the parallel processing capability of the Transformer enables it to have higher efficiency in processing long sequences. Combined with the sequence processing capability of the LSTM, it can improve the computational efficiency while maintaining a high forecast accuracy, thus meeting the real-time requirements of flood forecasting.

[0032] (4) The present invention uses transfer learning to enable the benchmark model to learn knowledge from the source basin and apply it to the target basin, so that the benchmark model can accumulate knowledge by learning flood data from different basins and then apply it to new basins, thereby enhancing the generalization ability of the model;

[0033] (5) The present invention constructs a Transformer-LSTM model. The Transformer's self-attention mechanism enables it to visualize the contribution of different positions in the input sequence to the output, thereby improving the interpretability of the model and helping staff to better understand the patterns and causes of flood changes and take more effective response measures. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a flow chart of the method of the present invention;

[0035] Figure 2 It is a schematic diagram of the process of applying the watershed model from the source watershed to the target watershed according to a plurality of preset transfer learning strategies of the present invention;

[0036] Figure 3 is a schematic diagram of comparing a plurality of preset performance indicators in one embodiment of the present invention;

[0037] Figure 4It is a scatter plot of the actual observation values ​​and the predicted values ​​of the four models TL-LSTM, TL-Transformer, TL-LSTM-CNN and TL-Transformer-LSTM under the 1h forecast period;

[0038] Figure 5 It is a scatter plot of the actual observation values ​​and the predicted values ​​of the four models TL-LSTM, TL-Transformer, TL-LSTM-CNN and TL-Transformer-LSTM under the 2h forecast period;

[0039] Figure 6 It is a scatter plot of the actual observation values ​​and the predicted values ​​of the four models TL-LSTM, TL-Transformer, TL-LSTM-CNN and TL-Transformer-LSTM under the 3h forecast period;

[0040] Figure 7 This is the probability prediction diagram of the TL-Transformer model for actual floods;

[0041] Figure 8 This is the probability prediction diagram of the TL-Transformer-LSTM model for actual floods;

[0042] Fig. 9 This is the probability prediction diagram of the TL-LSTM model for actual floods;

[0043] Fig.10 This is the probability prediction map of the TL-LSTM-CNN model for actual floods. DETAILED DESCRIPTION

[0044] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0045] like Figure 1 As shown, the present invention discloses a flood forecasting method based on transfer learning, comprising the following steps:

[0046] Step 1: Obtain the hydrological sequence of the source basin and the hydrological sequence of the target basin respectively;

[0047] Step 1 specifically includes: obtaining the hydrological data of the source basin and the target basin respectively and preprocessing the hydrological data to obtain the hydrological sequence of the source basin and the hydrological sequence of the target basin;

[0048] The present invention takes the watershed with rich data as the source watershed and the watershed with sparse data as the target watershed. Data richness and data sparseness can be judged by technical personnel in this field according to actual conditions. The hydrological data mainly include the rainfall data of each rain gauge and the flood flow data of the hydrological station within a preset time period.

[0049] The preprocessing includes: at least one of interpolation processing, outlier processing, normalization and data set partitioning;

[0050] Normalization is specifically: z-score normalization.

[0051] The specific division of the data set is: according to the preset ratio, the hydrological data after interpolation processing, outlier processing and normalization processing are divided into training set, validation set and test set. The training set is used to train the watershed model, the validation set is used to verify the fitting effect of the watershed model, and the test set is used for formal data prediction of the watershed model.

[0052] Step 2: Use the hydrological sequence of the source basin to pre-train the basin model to obtain a benchmark model;

[0053] The watershed model is a deep learning hybrid model that can fully learn the hydrological data characteristics of the source watershed; the hyperparameters that need to be adjusted during the pre-training process of the deep learning hybrid model include the number of attention heads, hidden layer dimension, dropout rate, and number of LSTM stacking layers. Furthermore, during the pre-training process, this embodiment also uses the Adam optimizer as the optimization algorithm of the deep learning hybrid model, and adjusts the hyperparameters at the same time to achieve the best performance of the model.

[0054] Preferably, between step 1 and step 2, the method further includes: constructing a watershed model, wherein the watershed model is a Transformer-LSTM model. Figure 2 As shown in the pre-training part, the construction of the watershed model is as follows: obtain the Transformer model and the LSTM model;

[0055] The LSTM model is embedded into the fully connected layer of the decoder of the Transformer model to obtain the Transformer-LSTM model.

[0056] The LSTM model has a recursive neural network repeating unit chain, that is, the output of the current moment is passed to the next moment, and the state of the model is constantly changing as the input information of the subsequent moments is updated. The LSTM model realizes the input and output calculation of the model through the interaction of three control gates (input gate, output gate and forget gate) and cell unit states. Cell unit state Ct Records the internal state variables of the model at different times, the hidden state h t It is associated with the output layer and determines the size of the model output value. In the model structure, the forget gate f t And the cell unit update status C t1 , input gate i t And the cell unit update status C t2 , output gate o t and hidden state h t And the final model output y t The calculation methods are as follows:

[0057] f t =σ(W f x t +U f h t-1 +b f )

[0058] C t1 =tanh(W c x t +U c h t-1 +b c )

[0059] i t =σ(W i x t +U i h t-1 +b i )

[0060] C t2 =f t ☉C t-1 +i t ☉C t

[0061] o t =σ(W o x t +U o h t-1 +b o )

[0062] h t =tanh(C t )☉o t

[0063] y t =W d h t +b d

[0064] Where: σ is the sigmoid activation function; Wf , U f and b f is the forget gate weight matrix and bias parameter; h t-1 is the hidden state at the previous moment; tanh is the hyperbolic tangent activation function; W c , U c and b c Update the weight matrix and bias parameters for the cell state respectively; W i , U i and b i are the input gate weight matrix and bias parameter respectively; the symbol ⊙ represents the Hadamard product; W o , U o and b o are the output gate weight matrix and bias parameter respectively; W d and b d are the fully connected weight matrix and bias parameters respectively; x t is the input vector; C t-1 is the cell state at time t-1.

[0065] Transformer is a non-recurrent neural network model composed of multiple identical encoder and decoder layers stacked together. Both contain multi-layer multi-head attention modules and feedforward neural networks. Since there is no built-in sequence position information, it is recorded in the form of position encoding. At the same time, residual connections and normalization are used to eliminate the gradient vanishing and exploding problems during training.

[0066] Before the data is processed by the encoder or decoder, it is positionally encoded, and the calculation method is as follows:

[0067]

[0068] Where: PE represents position encoding; pos represents vector position; i represents the i-th dimension; d model is the vector dimension.

[0069] The attention mechanism is an important part of the Transformer model structure. It can assign different weights according to the importance of different positions in the input sequence. The calculation method is as follows:

[0070]

[0071] Where: K, V and Q are key, value and query matrices respectively; d k is the vector dimension; K T is the transposed matrix of the key matrix.

[0072] The feedforward neural network part of the Transformer model consists of two linear transformations (fully connected layers) and a nonlinear activation function. By performing a fully connected transformation on the position encoded or decoded vector, the representation of position information and the extraction of features are enhanced. The mathematical expression is as follows:

[0073] FFN(x)=max(0,xW 1 +b 1 )W 2 +b 2

[0074] Where: FFN represents the fully connected transformation; x is the input tensor; W 1 、b 1 , W 2 、b 2 are the learnable weight matrices and bias vectors.

[0075] The present invention constructs a Transformer-LSTM model, which combines the ability of LSTM to process long-term dependencies and the ability of Transformer to capture global information. It can more accurately capture the long-term and short-term trends in flood changes and improve the accuracy of flood forecasting.

[0076] Furthermore, in the Transformer-LSTM model, the parallel processing capability of the Transformer enables it to be more efficient in processing long sequences. Combined with the sequence processing capability of the LSTM, it can improve computing efficiency while maintaining high forecast accuracy, thus meeting the real-time requirements of flood forecasting.

[0077] Step 3: Based on the hydrological sequence of the target basin and a variety of preset transfer learning strategies, transfer learning is performed on the benchmark model to obtain the forecast sequence of the benchmark model under each transfer learning strategy;

[0078] Furthermore, in other embodiments, while performing transfer learning on the baseline model, the Adam optimizer is used as the optimization algorithm of the baseline model to perform hyperparameter adjustment so that the baseline model achieves optimal performance.

[0079] Preferably, in the present application, the plurality of preset transfer learning strategies include at least two of: fine-tuning (Fine-Tuning), deep domain confusion (Deep Domain Confusion, DDC) and deep correlation alignment (DeepCORAL, DCORAL).

[0080] The following is a description of each preset transfer learning strategy:

[0081] Fine-Tuning: Adjust the weights of the pre-trained model in a small range to adapt to the target domain;

[0082] Deep Domain Confusion (DDC): Domain adaptation by minimizing the difference in feature distribution between the source domain and the target domain;

[0083] DDC is a classic domain adaptation method. It introduces cross entropy in deep neural networks to minimize the difference in feature distribution between the source domain and the target domain for domain adaptation. The maximum mean discrepancy (MMD) is used as a measure of data domain differences. The calculation method is as follows:

[0084] MMD 2 (p, q) = |μ p -μ q || 2 +T r (C p +C q -2(C p C q ) 1 / 2 )

[0085] Where: p, q represent two different distributions; μ p and μ q is the mean of the distribution; C p and C q is the covariance matrix of the distribution; ||·|| represents the norm of the vector; T r (·) represents the trace of the matrix.

[0086] Deep Correlation Alignment (DCORAL): Similar to DDC, it uses linear transformation to reduce the correlation difference between domains and align feature representations to achieve domain adaptation. It uses CORAL loss as a measure of correlation difference. CORAL loss is calculated as follows:

[0087]

[0088] Where: l CORAL Indicates CORAL loss; C S and C T represents the covariance matrix of the source domain and the target domain; ||·|| F represents the Frobenius norm of the matrix; d is the feature dimension.

[0089] Step three is as follows: inputting the hydrological sequence of the target basin into the benchmark model, and obtaining the forecast sequence corresponding to the benchmark model under each preset transfer learning strategy based on the Monte Carlo method; in this embodiment, the forecast sequence refers to: point value prediction sequence.

[0090] Taking the generation process of the forecast sequence under the first transfer learning strategy (the first transfer learning strategy is one of multiple preset transfer learning strategies) as an example, step three is explained:

[0091] The hydrological sequence of the target watershed is input into the benchmark model, and the benchmark model is transferred and learned according to the first transfer learning strategy;

[0092] The number of Monte Carlo method iterations is set to n times, and n predicted flow rates are output by the benchmark model at each moment; the average of the n predicted flow rates is used as the point value prediction at the corresponding moment; and the point value prediction sequence, i.e., the forecast sequence, is obtained.

[0093] Step 4: According to the performance indicators of each forecast sequence, a flood forecast sequence for the target basin is selected from multiple forecast sequences, and flood forecasting is performed for the target basin based on the flood forecast sequence.

[0094] The present invention uses at least one of the following performance evaluation indicators to evaluate multiple transfer learning strategies, so as to select the forecast sequence under the optimal transfer learning strategy to forecast the flood in the target basin.

[0095] The specific performance evaluation indicators are:

[0096] Root mean square error (RMSE), which measures the average distance between the predicted value and the true value;

[0097] Mean absolute error (MAE), the average of the absolute values ​​of the differences between the predicted values ​​and the true values;

[0098] Percent bias (PBias), which evaluates the relative size of the predicted value to the true value;

[0099] Nash efficiency (NSE) measures the ratio of the error between the model's predicted value and the observed value to the magnitude of the change in the observed value.

[0100] For the RMSE, MAE, and abs(PBias) indicators, the smaller the value, the better the performance, while the larger the NSE indicator, the better the performance.

[0101] According to the performance indicators of each forecast sequence, the flood forecast sequence is selected from multiple forecast sequences, specifically:

[0102] Obtain multiple performance indicators corresponding to each forecast sequence respectively;

[0103] The calculation methods of RMSE, MAE, abs(PBias), and NSE indicators are as follows:

[0104]

[0105] Where: Q oi and Q si Represent the real traffic and the point value prediction of the model respectively; represents the average value of the real flow, i represents the i-th moment, and n represents the number of time periods.

[0106] like Figure 3 As shown, the corresponding relationship between each performance indicator and multiple transfer learning strategies is obtained according to the multiple performance indicators corresponding to each forecast sequence;

[0107] When more than half of the performance indicators among multiple performance indicators represent that the same transfer learning strategy is the best, the forecast sequence corresponding to the transfer learning strategy is used as the flood forecast sequence;

[0108] Otherwise, a preset weight is assigned to each performance indicator and a weighted average is taken. According to the weighted average result, a flood forecast sequence is selected from multiple forecast sequences.

[0109] Affected by many factors, the hydrological characteristics of the basin are nonlinear and complex, and it is quite difficult to accurately predict the future flood flow at a point value. Therefore, the present invention uses a probability prediction interval to forecast floods. In step 4, flood forecasting is performed on the target basin according to the flood forecast sequence, specifically:

[0110] Determine the probability prediction interval sequence based on the flood forecast sequence;

[0111] Based on the probability prediction interval sequence, flood forecast is carried out for the target basin.

[0112] The probability prediction interval is an estimate of the uncertainty range of future observations. Unlike the confidence interval, the probability prediction interval takes into account the prediction error caused by randomness and model error. Therefore, it is usually more explanatory of the uncertainty of predicted traffic than the confidence interval. The calculation method is as follows:

[0113] L=mz×s e -z×s r

[0114] U=m+z×s e +z×s r

[0115] Where: U and L represent the upper and lower bounds of the prediction interval respectively; m represents the mean; z represents the confidence coefficient; s e represents standard deviation; s rRepresents the residual standard deviation. Mean, standard deviation, and residual standard deviation are all common concepts in mathematical statistics. In the present invention, they can be obtained by performing relevant calculations on specific point value predictions.

[0116] The present invention generates a probability prediction interval based on the Monte Carlo method, and uses the probability prediction interval to perform a probability forecast of basin floods. Based on the probability distribution of flood occurrence, the flood risk can be evaluated more comprehensively.

[0117] The present invention pre-trains the hybrid model in a data-rich basin, and applies the hybrid model to a data-sparse basin based on transfer learning, thereby reducing dependence on data, lowering the difficulty and cost of data collection, and improving the efficiency and accuracy of flood forecasting in sparse basins.

[0118] The following is an embodiment of the present application:

[0119] The Shuhe River hydrological station control basin and the Zhidan hydrological station control basin in Shaanxi Province, China were selected as the research area. The Shuhe River is 67.1 kilometers long and the hydrological station controls a basin area of ​​590 square kilometers. It has a subtropical humid monsoon climate with four distinct seasons and the characteristics of rain and heat in the same period. The rainfall in the basin is mainly concentrated in July-October, and the precipitation is unevenly distributed. The average annual precipitation is about 920 mm. The Shuhe River basin has a temperate semi-arid monsoon climate with an average gradient of 3.6%. The Zhidan hydrological station controls a basin area of ​​775 square kilometers, with an average annual rainfall of less than 600 mm, mainly concentrated in summer. The differences in climate, rainfall, evaporation, etc. between the two basins have led to very different flood processes. The Shuhe River basin generally has longer flood durations, larger peak flows, and higher flood frequency.

[0120] In this paper, the control basin of Shuhe hydrological station is taken as the source basin, and the control basin of Zhidan hydrological station is taken as the target basin.

[0121] For each rainfall and flood process in the two basins, the sliding interception method is used to generate the respective hydrological data. In order to ensure the consistency of the model input and improve the convergence speed during the model training process, the rainfall and flow data in the hydrological data are preprocessed by the z-score normalization method to obtain the hydrological series of the source basin and the target basin respectively. The calculation method is as follows:

[0122]

[0123] Where: y i represents the normalized observed value; x i represents the observed value; represents the mean; s represents the standard deviation.

[0124] The hydrological series of the watershed controlled by the Shuhe hydrological station were divided into training set, validation set and test set in a ratio of 8:1:1.

[0125] The watershed model of this embodiment is a Transformer-LSTM model, which is pre-trained using the hydrological sequence of the source watershed to obtain a benchmark model.

[0126] The rationality of hyperparameters has a great impact on model performance. In order to obtain the best hyperparameters, this embodiment selects the Adam optimizer as the optimization algorithm during the pre-training process to achieve the best performance of the watershed model. The hyperparameters that need to be set in advance during the pre-training process include the number of attention heads (head), hidden layer dimension (dim), dropout rate (dropout), and the number of LSTM stacking layers (depth).

[0127] Furthermore, in the subsequent transfer learning process, this embodiment also uses the Adam optimizer as an optimization algorithm to optimize the hyperparameters of the benchmark model in the transfer learning; the hyperparameters that need to be set in advance during the migration process include the number of attention heads (head), hidden layer dimension (dim), dropout rate (dropout), number of LSTM stacking layers (depth), migration loss weight (lamb) and number of Monte Carlo method iterations (n), and the optimal settings are shown in Table 1.

[0128] In order to improve the ability of the model to adapt to new data, in this embodiment, the common hyperparameter settings of the pre-training and transfer learning stages are basically the same.

[0129] Table 1. Optimal hyperparameter settings for the models

[0130] head dim dropout depth lamb n 4 64 0.1 1 100 100

[0131] There are large differences between different transfer learning strategies under different application scenarios and data characteristics. In order to explore the best transfer learning strategy of the benchmark model in cross-basin transfer learning, this embodiment selects three transfer learning strategies, Fine-tuning, DDC and DCORAL, and applies them to the benchmark model. The flood event simulation results (i.e., forecast sequences) under the three transfer learning strategies are evaluated by RMSE, MAE, PBias and NSE indicators. Since the PBias indicator has a negative value, the absolute value is uniformly taken for comparison. The positive and negative PBias only represents the size of the specific prediction value relative to the true value, which will not affect the performance evaluation. Figure 3 The performance metrics under each transfer learning strategy are shown.

[0132] The comparison results of the performance indicators under the three strategies show that the DCORAL method has the best performance. For the RMSE, MAE, and abs(PBias) indicators, the smaller the better the performance, and the larger the NSE indicator, the better the performance. The Fine-tuning method did not perform well in the four indicators, so it was excluded first. The RMSE and NSE indicators of the DCORAL method are slightly better than the DDC method, and it has a greater advantage in the MAE indicator, but the abs(PBias) indicator of DDC performs better. On the whole, the DCORAL method was finally selected as the best transfer learning strategy in cross-basin transfer learning.

[0133] After transfer learning using the DCORAL method, the forecast sequence obtained is used as the flood forecast sequence to conduct flood forecasting for the target basin.

[0134] Furthermore, after flood forecasting, this embodiment also compares the performance of the flood forecasting model corresponding to the optimal transfer learning strategy (TL-Transformer-LSTM model) with other preset flood forecasting models, and verifies the performance of the flood forecasting model based on the performance comparison results; other preset flood forecasting models specifically include: TL-LSTM model, TL-LSTM-CNN model and TL-Transformer model.

[0135] The performance comparison is as follows: the performance of multiple models under different forecast periods is compared based on performance indicators and scatter regression curves, and the probability prediction performance of different models is compared based on typical bimodal flood events;

[0136] In this embodiment, the performance of multiple models under different forecast periods is compared according to performance indicators, as shown in Table 2. Table 2 shows the model prediction performance of four models, TL-LSTM, TL-Transformer, TL-LSTM-CNN and TL-Transformer-LSTM, under 1h, 2h and 3h forecast periods respectively, and RMSE, MAE, PBias and NSE are still used as evaluation indicators.

[0137] Table 2 Model performance indicators under different forecast periods

[0138]

[0139]

[0140] The performance comparison results of the four models under different forecast periods show that the TL-Transformer-LSTM model performs best, and almost always shows better performance than other models in any preset forecast period. In the 1h and 3h forecast periods, the TL-Transformer-LSTM model is slightly better than the TL-Transformer model in almost all indicators, which shows that the prediction performance of the watershed model combining LSTM and Transformer is significantly improved.

[0141] Furthermore, the long-term memory capability of the LSTM model keeps the PBias index of the TL-Transformer-LSTM model at a low level at a 3-hour forecast period, and shows better performance at a longer forecast period. At a 2-hour forecast period, the TL-Transformer model performs better in terms of RMSE, MAE, and NSE, indicating that the Transformer model has a great advantage in short-term forecasting.

[0142] The TL-LSTM model and the TL-LSTM-CNN model performed poorly in any forecast period, which may be because the LSTM model is not suitable for the complex hydrological process during the migration process. Although the combination of LSTM and CNN enables the model to extract multivariate features and improves performance, it also increases the complexity of the model, resulting in a decrease in prediction ability.

[0143] In summary, in the TL-Transformer-LSTM model of this embodiment, Transformer shows great application potential in transfer learning, and its combination with LSTM greatly improves the model performance. Compared with other models, the prediction results are more accurate.

[0144] Furthermore, through performance comparison, this embodiment verifies that the TL-Transformer-LSTM model has good forecasting performance in the long forecast period, so that the staff in this field have sufficient warning time and emergency response time for flood disasters, further reducing the risks brought by floods.

[0145] The specific process of comparing the performance of multiple models under different forecast periods based on the scatter regression curve is as follows:

[0146] like Figure 4-Figure 6 As shown, this embodiment obtains the scatter distribution of the runoff prediction value and observation value of each model under the 1h, 2h and 3h forecast period, as well as the linear regression curve of each model.

[0147] Figure 4-Figure 6It shows that the regression line of the TL-Transformer-LSTM model is closest to the standard fitting line, while the result of the TL-LSTM-CNN model has the largest deviation. When the forecast period is 2h, the forecast results of TL-Transformer are better than those of TL-Transformer-LSTM model in terms of indicators. However, from the scatter regression diagram, we can see that the fitting results of TL-Transformer are not ideal, and there is even a large gap with the forecast results of the TL-LSTM model. It is almost the worst performing model, while TL-LSTM has become the model with the second best performance after TL-Transformer-LSTM. It can be seen that there is a close connection between the scatter regression results and the PBias index. At the same time, it also shows that analyzing the performance of the model from the perspective of overall systematic deviation may lead to different conclusions. Although there are some changes in the order of performance of the models, overall, TL-Transformer-LSTM is still the best performing model, and the law that performance decreases with the increase of the forecast period still applies.

[0148] In summary, the results of comparing the models based on the scatter regression curves show that the TL-Transformer-LSTM model exhibits better robustness and stability, and has more advantages in transfer learning flood forecasting.

[0149] This embodiment further compares the changes in the performance of each model as the forecast period increases in the form of a scatter regression plot, analyzes the performance of each model more intuitively, and verifies the robustness of the TL-Transformer-LSTM model.

[0150] In this embodiment, the probability prediction performance of different models is compared based on a typical double-peak flood process, specifically:

[0151] like Figure 7-Figure 10 The following table shows the typical flood probability prediction results of the four models, as well as the actual rainfall histogram and actual runoff curve. Each model calculates the 50% prediction interval, 90% prediction interval and mean prediction. Among them, the TL-Transformer-LSTM model has a smaller probability prediction interval due to its strong robustness. In order to facilitate observation and analysis, its probability prediction interval is appropriately enlarged.

[0152] Depend on Figure 7-Figure 10It can be seen that the prediction results of the TL-Transformer-LSTM model are closest to the true value overall, especially in the prediction of flood peak flow, which has a fairly good performance. The flood peak prediction performance of the TL-Transformer and TL-LSTM-CNN models is poor, and the prediction results are small, and both do not reach the actual flow value. Although the prediction results of the TL-LSTM model are close to the true value at the flood peak, there is a slight lag. In terms of the flood rise and fall process, except that the prediction results of TL-Transformer are quite different from the true value, the prediction results of the other models are relatively good and there is no big difference. The probability prediction interval shows the error size of the model and the prediction range of the flow, so the performance of the model can also be analyzed from the perspective of the size of the probability prediction interval.

[0153] The TL-Transformer model has a small prediction volatility when the flood rises and falls, but has a larger range at the flood peak, indicating that the model has a large error in flood peak prediction and low performance. The TL-Transformer-LSTM model has a small probability prediction interval in the entire flood prediction process, indicating that the prediction results of the model in multiple samplings are not much different, which once again demonstrates the robustness and stability of the model. The probability prediction interval ranges of the other two models are basically balanced throughout the flood process, but the range of TL-LSTM is larger, reflecting the greater uncertainty of the model.

[0154] Transformer-LSTM has both the ability of Transformer to extract complex features and the ability of LSTM to maintain long-term memory. This application analyzes the performance of four models in different forecast periods and finds that the Transformer model is effective in short-term forecasting through transfer learning, while the LSTM model has more advantages in long-term forecasting. The combination of the two can significantly improve the model's prediction performance.

[0155] In summary, this embodiment compares multiple preset models according to the actual flood probability prediction results, verifies the robustness and stability of the flood forecasting model of the present invention, and therefore the flood forecasting method disclosed in the present invention has more accurate results.

[0156] Compared with the prior art, the present invention has the following beneficial effects:

[0157] (1) The present invention uses the source basin to pre-train the basin model, and optimizes the hyperparameters of the basin model to obtain a benchmark model. Based on transfer learning, the benchmark model is applied from the data-rich source basin to the data-sparse target basin, which reduces the dependence on data in flood prediction in the target basin, reduces the difficulty and cost of data collection, and improves the efficiency and accuracy of flood forecasting in the target basin.

[0158] (2) The present invention constructs a Transformer-LSTM model, which combines the ability of LSTM to process long-term dependencies and the ability of Transformer to capture global information, and can more accurately capture the long-term and short-term trends in flood changes and improve the accuracy of flood forecasting;

[0159] (3) In the Transformer-LSTM model constructed by the present invention, the parallel processing capability of the Transformer enables it to have higher efficiency in processing long sequences. Combined with the sequence processing capability of the LSTM, it can improve the computational efficiency while maintaining a high forecast accuracy, thus meeting the real-time requirements of flood forecasting.

[0160] (4) The present invention uses transfer learning to enable the benchmark model to learn knowledge from the source basin and apply it to the target basin, so that the benchmark model can accumulate knowledge by learning flood data from different basins and then apply it to new basins, thereby enhancing the generalization ability of the model;

[0161] (5) The present invention constructs a Transformer-LSTM model. The Transformer's self-attention mechanism enables it to visualize the contribution of different positions in the input sequence to the output, thereby improving the interpretability of the model and helping staff to better understand the patterns and causes of flood changes and take more effective response measures.

[0162] The above are only a few embodiments of the present application and do not constitute any form of limitation to the present application. Although the present application is disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technician familiar with the profession, without departing from the scope of the technical solution of the present application, using the technical content disclosed above to make slight changes or modifications are equivalent to equivalent implementation cases and fall within the scope of the technical solution.

Claims

1. A flood forecasting method based on transfer learning, characterized in that: The following steps are involved: Step 1: Obtain the hydrological sequence of the source basin and the hydrological sequence of the target basin respectively; Step 2: Use the hydrological sequence of the source basin to pre-train the basin model to obtain a benchmark model; Step 3: Perform transfer learning on the benchmark model according to the hydrological sequence of the target basin and a plurality of preset transfer learning strategies, and obtain the forecast sequence of the benchmark model under each transfer learning strategy; Step 4: Select a flood forecast sequence for a target river basin from multiple forecast sequences according to the performance index of each forecast sequence, and perform flood forecasting for the target river basin according to the flood forecast sequence.

2. The flood forecasting method based on transfer learning according to claim 1 is characterized in that: Between step 1 and step 2, the method further includes: constructing a watershed model, wherein the watershed model is a Trans former-LSTM model. Correspondingly, the construction of the watershed model is as follows: Get the Transformer model and LSTM model; The LSTM model is embedded into the fully connected layer of the decoder of the Transformer model to obtain a Transformer-LSTM model.

3. The flood forecasting method based on transfer learning according to claim 1, characterized in that: The multiple preset transfer learning strategies include at least two of fine-tuning, deep domain confusion, and deep correlation alignment.

4. The flood forecasting method based on transfer learning according to claim 1 is characterized in that: The performance indicator includes at least one of a root mean square error, a mean absolute error, a percentage deviation and a Nash efficiency coefficient.

5. The flood forecasting method based on transfer learning according to claim 1, characterized in that: The hydrological sequence of the source basin and the hydrological sequence of the target basin are obtained respectively, specifically: Obtain hydrological data of the source basin and target basin respectively; The hydrological data is preprocessed to obtain a hydrological sequence of a source basin and a hydrological sequence of a target basin, wherein the preprocessing includes at least one of interpolation processing, outlier processing and normalization.

6. The flood forecasting method based on transfer learning according to claim 1, characterized in that: Performing flood forecasting for the target basin according to the flood forecasting sequence is specifically as follows: Determining a probability prediction interval sequence according to the flood forecast sequence; According to the probability prediction interval sequence, flood forecast is performed for the target basin.

7. A flood forecasting system based on transfer learning, characterized in that: include: Hydrological sequence acquisition module: used to obtain the hydrological sequence of the source basin and the hydrological sequence of the target basin respectively; Pre-training module: used to pre-train the basin model using the hydrological sequence of the source basin to obtain a benchmark model; Migration module: used to perform transfer learning on the benchmark model according to the hydrological sequence of the target basin and a plurality of preset transfer learning strategies, and obtain the forecast sequence of the benchmark model under each transfer learning strategy; Forecast module: used to select a flood forecast sequence of a target basin from multiple forecast sequences according to the performance index of each forecast sequence, and perform flood forecasting for the target basin according to the flood forecast sequence.