Flood simulation method and system based on dynamic parameters and physical deep learning
By using dynamic parameters and physical deep learning methods in data-lost watershed, the Transformer model is trained and combined with the hydrological physics mechanism, the explanatory problem of deep learning models in flood prediction is solved, and effective explanation and accurate prediction of flood phenomena are achieved. .
Patent Information
- Application Number
- CN202410444952.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-04-15
AI Technical Summary
The prior art is difficult to explain the prediction results of flood occurrence in data-deficient watersheds, and the black box characteristics of deep learning models limit their application in flood management and decision-making.
Using flood simulation methods based on dynamic parameters and physical deep learning, the Transformer model is trained, and the dynamic parameter model is calculated using known basin parameters and preset hydrological parameters, and the runoff parameters are calculated in combination with the hydrological physical mechanism. It is iteratively trained to make the hydrological parameters dynamically differentiable. , impart physical explanatory nature to deep learning models.
The explanation of flood prediction results in data-lack basin is achieved, and combined with deep learning and hydrological physical laws, the interpretability and accuracy of flood simulation are improved.
Smart Images

Figure CN118277919B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of flood prediction, and in particular to a flood simulation method and system based on dynamic parameters and physical deep learning. Background Art
[0002] Traditional methods of flood prediction mainly rely on a large amount of historical hydrological data to predict the occurrence and impact of floods by analyzing rainfall, river flow and terrain information. However, these methods are limited in data-scarce areas because these areas often lack long-term, continuous and high-quality hydrological and meteorological records. This limitation has prompted the exploration of new methods, especially data-driven and machine learning methods.
[0003] In recent years, with the rapid development of machine learning, especially deep learning technology, its potential in flood prediction has gradually been recognized. Deep learning models, such as convolutional neural networks (CNN) and long short-term memory networks (LSTM), are regarded as powerful tools for solving complex hydrological model problems due to their successful applications in image recognition and natural language processing. These models perform well in processing nonlinear and high-dimensional data and can learn complex patterns of flood occurrence from large amounts of data; however, the application of deep learning models in the field of flood prediction also faces challenges.
[0004] These models usually require a large amount of training data to ensure the accuracy of the predictions, but in data-scarce areas, such data are often difficult to obtain. The core idea of transfer learning is to use the knowledge learned in data-rich tasks or fields to assist in learning in data-scarce tasks or fields. Although this approach has achieved remarkable results in fields such as image recognition and natural language processing, the black box characteristics of deep learning models limit their ability to explain flood events and provide reliable guidance for risk management. For example, a deep learning model may successfully predict flood events in a specific area, but it cannot provide insights into the physical causes and processes of the flood. That is, the "black box" characteristics of deep learning models make their predictions difficult to explain, which is an issue that cannot be ignored in flood management and decision-making.
[0005] Therefore, a flood simulation method and system based on dynamic parameters and physical deep learning is studied, which can explain the prediction results of flood occurrence in data-deficient basins. Summary of the invention
[0006] The purpose of the present invention is to provide a flood simulation method and system based on dynamic parameters and physical deep learning, so as to solve the problem that the prior art is difficult to explain the prediction results of flood occurrence in data-deficient basins.
[0007] In order to solve the above technical problems, the first technical solution of the present invention provides a flood simulation method based on dynamic parameters and physical deep learning, comprising the following steps:
[0008] The Transformer model is trained using known basin classification parameters and preset hydrological parameters to obtain a known basin dynamic parameter model;
[0009] Fixing the attention layer and the feedforward neural network layer of the known watershed dynamic parameter model to obtain a fixed known watershed dynamic parameter model;
[0010] Using the target watershed parameters and the preset hydrological parameters to train the fixed known watershed dynamic parameter model to obtain the target watershed dynamic parameter model;
[0011] Inputting the target watershed parameters and the preset hydrological parameters into the target watershed dynamic parameter model to obtain a flood prediction result for the target watershed;
[0012] The training process of the known watershed dynamic parameter model is as follows:
[0013] Acquire the known watershed classification parameters, and classify the known watershed classification parameters to obtain the known watershed type;
[0014] Inputting the preset hydrological parameters and the known watershed type into the Transformer model to update the parameters, and calculating the runoff parameters based on the updated preset hydrological parameters;
[0015] The predicted total runoff is calculated using runoff parameters;
[0016] Calculating the difference between the predicted total runoff and the observed actual flow as a model loss, and using the model loss to train the Transformer model;
[0017] The training is iterated until the preset conditions are met to obtain the known watershed dynamic parameter model.
[0018] In some embodiments of the first technical solution, the preset hydrological parameters and the known watershed type are input into the Transformer model to perform parameter updating, and the runoff parameters are calculated based on the updated preset hydrological parameters. In this step, the preset hydrological parameters include a first part of preset hydrological parameters and a second part of preset hydrological parameters;
[0019] The specific steps include:
[0020] Inputting the first part of preset hydrological parameters and the known watershed classification parameters into the Transformer model to update the parameters, thereby obtaining the updated first part of preset hydrological parameters;
[0021] The runoff parameter is calculated using the updated first part of preset hydrological parameters and the second part of preset hydrological parameters;
[0022] The second part of preset hydrological parameters is input into the Transformer model to update the parameters, so as to obtain the updated second part of preset hydrological parameters.
[0023] In some embodiments of the first technical solution, the runoff parameters include at least soil flow and saturated slope runoff.
[0024] In some embodiments of the first technical solution, the first part of preset hydrological parameters includes soil moisture content in the vegetation root zone, maximum water storage depth in the unsaturated zone, and initial soil midflow;
[0025] The preset hydrological parameters in the second part include the hysteresis parameter of gravity drainage and the maximum water storage capacity of the root zone.
[0026] In some embodiments of the first technical solution, the step of calculating the runoff parameter using the updated first part of preset hydrological parameters and the second part of preset hydrological parameters specifically includes the following steps:
[0027] Based on the maximum water storage in the root zone and the updated soil moisture content in the root zone of the vegetation, the evaporation is calculated;
[0028] The infiltration rate is calculated based on the average saturated groundwater deficit depth, the hysteresis parameter of gravity drainage and the updated initial soil midflow;
[0029] The soil midflow is calculated based on the average saturated groundwater deficit depth, the updated maximum storage depth of the unsaturated zone, and the updated initial soil midflow;
[0030] The saturated slope runoff is calculated based on the initial water content of the unsaturated zone and the average saturated groundwater deficit depth.
[0031] In some embodiments of the first technical solution, the Transformer model includes an encoder and a decoder;
[0032] The encoder includes a position encoding layer, a self-attention layer, and a feed-forward neural network layer;
[0033] The decoder includes a decoding self-attention layer, an encoder-decoder attention layer, and a decoding feedforward neural network layer.
[0034] In some embodiments of the first technical solution, the model loss is expressed as follows:
[0035]
[0036] In the above formula, MAE is the model loss, Qobs t To predict total runoff, Qmodel t is the observed actual flow, and n is the length of the flow time series.
[0037] In some embodiments of the first technical solution, obtaining the known watershed classification parameters and classifying the known watershed classification parameters to obtain the known watershed types includes the following steps:
[0038] Collect static properties, dynamic time series and raster images of a large number of watersheds;
[0039] Calculate elements based on dynamic time series parameters, calculate the maximum information coefficient between the elements and all static attribute parameters, and filter the obtained dynamic time series;
[0040] Perform feature extraction on the screened dynamic time series to obtain time series features;
[0041] Fusing the static attribute with the temporal feature to obtain a fused feature;
[0042] The raster image and the fused features are input into a neural network to obtain the known watershed type.
[0043] In some embodiments of the first technical solution, before calculating the element parameters based on the dynamic time series parameters and calculating the maximum information coefficient between the element parameters and all the static attribute parameters to obtain the static features, the following steps are also included:
[0044] The principal component analysis method is used to eliminate the redundancy of static attributes.
[0045] The second technical solution, the present invention provides a flood simulation system based on dynamic parameters and physical deep learning, including:
[0046] The first training module is used to train the Transformer model using known watershed classification parameters and preset hydrological parameters to obtain a known watershed dynamic parameter model;
[0047] The training process of the known watershed dynamic parameter model is as follows:
[0048] Acquire the known watershed classification parameters, and classify the known watershed classification parameters to obtain the known watershed type;
[0049] Inputting the preset hydrological parameters and the known watershed type into the Transformer model to update the parameters, and calculating the runoff parameters based on the updated preset hydrological parameters;
[0050] The predicted total runoff is calculated using runoff parameters;
[0051] Calculating the difference between the predicted total runoff and the observed actual flow as a model loss, and using the model loss to train the Transformer model;
[0052] The training is iterated until the preset conditions are met to obtain the known watershed dynamic parameter model.
[0053] A first processing module is used to fix the attention layer and the feedforward neural network layer of the known watershed dynamic parameter model to obtain a fixed known watershed dynamic parameter model;
[0054] A second training module is used to train the fixed known watershed dynamic parameter model using the target watershed parameters and the preset hydrological parameters to obtain the target watershed dynamic parameter model;
[0055] The prediction module is used to input the target basin parameters and the preset hydrological parameters into the target basin dynamic parameter model to obtain the target basin flood prediction result.
[0056] The beneficial effects of the present invention are as follows:
[0057] In the present invention, saturated slope runoff and subsoil flow are calculated separately according to the hydrological physical mechanism. The hydrological parameters in the calculation process are connected to the Transformer network. The Transformer is iteratively trained by the loss value between the final predicted total runoff and the observed actual flow. The hydrological parameters are also iterated during the Transformer training process, so that the hydrological parameters with physical significance in the whole process become dynamically differentiable; that is, in the whole flood simulation process, the parameters of the hydrological model are updated and iterated over time through deep learning, which is equivalent to combining the physical laws of the hydrological model with the nonlinear data fitting ability of deep learning. This process gives the mechanism that originally used deep learning physics alone, so that the role of deep learning in the flood simulation process can be explained by physics. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 is a flow chart of an overall flood simulation method provided by a preferred embodiment of the present invention;
[0060] Figure 2It is a flow chart of a training method for a known watershed dynamic parameter model provided in a preferred embodiment of the present invention;
[0061] Figure 3 It is an overall schematic diagram provided by a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0062] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0063] In order to solve the above problems, the present invention provides a flood simulation method based on dynamic parameters and physical deep learning, please refer to Figures 1 to 3 , specifically including the following steps:
[0064] S1, using known basin classification parameters and preset hydrological parameters to train the Transformer model to obtain a known basin dynamic parameter model;
[0065] Preferably, step S1, please refer to Figure 2 , the training process of the known basin dynamic parameter model is as follows:
[0066] S10, obtaining known watershed classification parameters, and classifying the known watershed classification parameters to obtain known watershed types;
[0067] Preferably, step S10 specifically includes the following steps:
[0068] S100, extract the hydrological attributes of the watershed with large sample data, collect static attributes, dynamic time series and raster images of a large number of watersheds, that is, obtain static attribute data (topography, soil and other characteristic values), hydrological and meteorological data (dynamic time series data) and raster images representing surface precipitation distribution, temperature distribution and other characteristics of a large number of watersheds.
[0069] S101, using principal component analysis to eliminate redundancy of static attributes, that is, for static attributes (such as terrain, soil type), principal component analysis (PCA, Principal Components Analysis) is used to eliminate multicollinearity between variables and redundant information between indicators.
[0070] S102, calculating element parameters based on the dynamic time series, and calculating the maximum information coefficient between the element parameters and all static attribute parameters, and screening out appropriate dynamic time series parameters.
[0071] Specifically, flood events are screened out according to the dynamic time series data, and the average total rainfall, average rainfall intensity ( / h), average rainfall duration, average total flood volume, average peak flow and other factor values are calculated. The maximum information coefficient (MIC) between all static attributes is calculated, and the linear and nonlinear correlations between all indicators are judged to screen out appropriate dynamic time series parameters.
[0072] S103, using the LSTM autoencoder architecture to perform feature extraction and dimension reduction on the screened dynamic time series parameters to obtain time series features.
[0073] Specifically, it includes an encoder and a decoder; for the encoder, the encoder part is composed of multiple LSTM layers. It receives time series data (such as hydrological and meteorological data) and gradually compresses the data into a lower-dimensional representation, which captures the key temporal features of the input data; for the decoder, the decoder is also composed of multiple LSTM layers. Its goal is to reconstruct the original input data from the low-dimensional representation generated by the encoder. This process forces the encoder to learn the most important temporal features in the data. Time series data is used as input and also as target output to train the autoencoder. The training goal is to minimize the difference between the original input and the decoder output (using the mean square error as the loss function). The autoencoder maps the data to a low-dimensional space (latent space) through its encoder part, and then reconstructs the data through the decoder part.
[0074] S104, fusing the static features and the time series features to obtain fused features, that is, fusing the time series features extracted by the LSTM encoder with the static features through a fully connected layer, and the fused features contain information about the time series data and static attributes.
[0075] S105, inputting the raster image and the fused features into a neural network for classification to obtain a known watershed type M.
[0076] Specifically, the ReLU activation function is used after the fully connected layer to increase the nonlinear expression ability of the model, and then a clustering layer is added. This layer is a fully connected layer with the number of neurons equal to the expected number of clusters. The output uses the softmax function to convert the output into the probability distribution of each cluster.
[0077] Subsequently, a loss function is defined to optimize the neural network for classification, including reconstruction loss and clustering loss, where the reconstruction loss is the mean square error (MSE) and the clustering loss is the Kullback-Leibler (KL) divergence, which is used to measure the difference between the probability distribution predicted by the model and the target distribution. Finally, the classification M of the watershed is obtained and used in the next step.
[0078] The loss function calculation formula is as follows:
[0079]
[0080]
[0081] Total Loss=λ×MSE Loss+(1-λ)×KL Divergence Loss
[0082] In the above formula, x i is the real traffic time series, is the simulated traffic time series, K is the KL divergence, p i is the probability distribution of the model prediction in the i-th time series, q i is the actual probability distribution of the target in the i-th time series, and λ is the preset proportional coefficient.
[0083] To summarize step S10, step S10 obtains the classification of the watershed as prior knowledge by extracting the flood event time series and raster image features of the watershed using LSTM and CNN.
[0084] S11, inputting preset hydrological parameters and known watershed types into the Transformer model to update the parameters, and calculating the runoff parameters based on the updated preset hydrological parameters.
[0085] Preferably, step S11 specifically includes the following steps:
[0086] S110, define hydrological parameters.
[0087] Specifically, the soil water storage capacity is initialized according to the basin hydrological and meteorological time series data of the flood, where the initial water content of the unsaturated zone S is set uz is 0, defining the hysteresis parameter T of gravity drainage d , maximum water storage capacity in the root zone SR max , saturated hydraulic conductivity T0, soil moisture content in the vegetation root zone SR0, maximum water storage depth in the unsaturated zone SZM, initial soil midflow Q0, and based on the above defined parameters, calculate the average saturated groundwater deficit depth SBAR.
[0088] The calculation formula of average saturated groundwater deficit depth SBAR is as follows:
[0089]
[0090] In the above formula, SBAR is the initial average saturated groundwater shortage depth, SZM is the maximum water storage depth of the unsaturated zone, Q b is the soil flow, and Q0 is the initial soil flow.
[0091] The calculation formula of initial soil flow Q0 is as follows:
[0092] Q0=A×T0×e -λ
[0093] In the above formula, Q0 is the initial soil flow, A is the basin area, T0 is the saturated hydraulic conductivity, which is considered to be uniformly distributed in the entire basin, and λ is the soil flow calculation coefficient.
[0094] The calculation formula of soil flow calculation coefficient is as follows:
[0095]
[0096] In the above formula, λ is the calculation coefficient of soil flow, A is the watershed area, a is the single-width catchment area, which is obtained by flow direction analysis using ArcGIS software, and β is the slope value;
[0097] The calculation formula of soil flow is as follows:
[0098]
[0099] In the above formula, Q b is soil midflow, SBAR is the initial average saturated groundwater deficit depth, and SZM is the maximum storage depth of the unsaturated zone.
[0100] The hydrological parameters defined above include the preset hydrological parameters X = [T0 t , SR0 t , SZM t , Q0 t , Td t , SRMAX t ], that is, the preset hydrological parameters include the first part of the preset hydrological parameters and the second part of the preset hydrological parameters; the first part of the preset hydrological parameters includes the saturated hydraulic conductivity TO, the soil moisture content SR0 in the vegetation root zone, the maximum water storage depth SZM in the unsaturated zone and the initial soil midflow Q0; the second part of the preset hydrological parameters includes the hysteresis parameter T of gravity drainage d and the maximum water storage capacity of the root zone SR max .
[0101] S111, input the first part of preset hydrological parameters and known watershed classification parameters into the Transformer model for parameter update, and obtain the updated first part of preset hydrological parameters, that is, the saturated hydraulic conductivity T0, the soil moisture content in the vegetation root zone SR0, the maximum water storage depth in the unsaturated zone SZM, and the initial soil flow Q0 are connected to the encoder and decoder layers of the Transformer. After adopting this setting method, the input of the Transformer is the parameter value that changes with time, and the output is the iterated parameter value. This process gives the parameters dynamic differentiable characteristics.
[0102] For the Transformer model, the Transformer model includes an encoder and a decoder; the encoder includes a position encoding layer, a self-attention layer, and a feedforward neural network layer; the decoder includes a decoding self-attention layer, an encoder-decoder attention layer, and a decoding feedforward neural network layer. Specifically, the process of inputting the preset hydrological parameters and known watershed classification parameters into the Transformer model in the first part is as follows:
[0103] The Transfomer encoder receives the first part of preset hydrological parameters and known basin types M as input sequences, embeds and positions them, and then passes through the encoder's position encoding layer, self-attention layer and feedforward neural network layer and the decoder's self-attention layer, encoder-decoder attention layer and decoding feedforward neural network layer to finally obtain the updated parameters.
[0104] Position encoding layer:
[0105] X t =[T0 t , SR0 t , SZM t , Q0 t , Td t , SRMAX t , M]
[0106] In the above formula, X t is the parameter vector at time t.
[0107] Embed(X t )=E t
[0108] In the above formula, E t is the embedding vector.
[0109] E′ t =E t +PositionalEncoding(t)
[0110] In the above formula, E′ t To add position code.
[0111] Self-Attention Layer:
[0112]
[0113] Q=K=V=E t
[0114] Feedforward Neural Network Layer:
[0115] FFN(E′ t ) = ReLU(E′) t W1+b1)W2+b2
[0116] In the above formula, FFN(E′ t ) represents the state of the feedforward neural network, and W1, W2, b1 and b2 are all trainable parameters of the feedforward layer.
[0117] Transformer Decoder: The decoder part generates the next time step prediction of the parameters, excluding the fixed value F.
[0118] Decoder self-attention layer:
[0119] Y {t-1} =[T0 {t-1} , SR0 {t-1} , SZM {t-1} , Q0 {t-1} , Td {t-1} , SRMAX {t-1} ]
[0120] Y {t-1} is the previously predicted parameters, and the decoder self-attention is applied to Y {t-1} .
[0121] Encoder-Decoder Attention Layer:
[0122] DecoderAttention(Q, K, V)
[0123] Q = DecoderSelfAttention(Y t -1), K=V=H t
[0124] Output H t is the hidden state of the encoder.
[0125] Decoder feed-forward neural network layer:
[0126] DecoderFFN(Q)
[0127] Output Y t =[T0 t , SR0 t , SZMt , Q0 t , Td t , SRMAX t ] as the new parameter value for prediction.
[0128] S112, using the updated first part of preset hydrological parameters and the second part of preset hydrological parameters to calculate runoff parameters, wherein the runoff parameters preferably include evaporation, infiltration rate, soil flow and saturated slope runoff.
[0129] Preferably, step S112 specifically includes the following steps:
[0130] S1120, based on the maximum water storage capacity of the root zone SR max And the updated soil moisture content SR0 in the vegetation root zone, the evaporation is calculated, where the evaporation E is calculated as follows:
[0131]
[0132] In the above formula, E p is the evaporation capacity, SR0 is the soil water content in the vegetation root zone, and SR max It is the maximum water storage capacity of the root zone.
[0133] S1121, based on the average saturated groundwater deficit depth SBAR, gravity drainage hysteresis parameter T d and the updated initial soil flow Q0, the infiltration rate is calculated, where the infiltration rate calculation q v The formula is as follows:
[0134]
[0135] In the above formula, Q0 is the initial soil midflow, SBAR is the initial average saturated groundwater deficit depth, T d is the hysteresis parameter of gravity drainage.
[0136] S1122, based on the average saturated groundwater deficit depth SBAR, the updated maximum storage depth of the unsaturated zone SZM and the updated initial soil midflow Q0, calculate the soil midflow Q b , where the soil flow calculation formula is as follows:
[0137]
[0138] In the above formula, Q b is the mid-soil flow, Q0 is the initial mid-soil flow, SBAR is the average saturated groundwater deficit depth, and SZM is the maximum water storage depth in the unsaturated zone.
[0139] S1123, based on the initial water content S in the unsaturated zone uzand the average saturated groundwater deficit depth SBAR, the saturated slope runoff is calculated, where the saturated slope runoff calculation formula is as follows:
[0140]
[0141] In the above formula, Q S is the saturated slope runoff, Δt is the S calculated each time uz -max(SBAR,0) and the maximum time interval between 0, S uz is the initial water content of the unsaturated zone, and SBAR is the average saturated groundwater deficit depth.
[0142] For step S1122 and step S1123, both are calculated based on the time-progressive runoff generation for each divided sub-basin, that is, the local water deficit depth (SD) is calculated at each time step, and then the water volume in the vegetation root zone and the unsaturated zone is calculated based on the water balance, wherein the water in the unsaturated zone vertically enters the saturated groundwater zone at a certain rate to form soil flow, and the excess water forms saturated slope runoff.
[0143] S113, inputting the second part of the preset hydrological parameters into the Transformer model to update the parameters, and obtaining the updated second part of the preset hydrological parameters, that is, the hysteresis parameter T of the gravity drainage d , maximum water storage capacity in the root zone SR max Connect to the Transformer model in step S111 and finally output the updated parameters:
[0144] T0 {t+1} , SR0 {t+1} , SZM {t+1} , Q0 {t+1} , Td {t+1} , SRMAX {t+1}
[0145] =T0′ t , SR0′ t , SZM′ t , Q0′ t , Td′ t , SRMAX′ t
[0146] In the above formula, is the value of the new parameter predicted in the last step of step S111 at time t+1 (that is, the parameter at time t is updated to the new parameter at time t+1).
[0147] To summarize step S11, step S11 will calculate the saturated slope runoff and subsoil flow respectively according to the hydrological physical mechanism. The hydrological parameters in the calculation process are connected to the Transformer network. The hydrological parameters generated by the Transformer are iterated through the loss value calculated by the final basin flood flow and the actual observed flow, so that the hydrological parameters with physical significance in the whole process become dynamically differentiable.
[0148] After adopting this setting, compared with the existing method of extracting the features of historical data to train the recognition model and then migrating the recognition model to the target basin for prediction, this solution uses hydrological data with physical meaning to train and optimize the model, so that the preset hydrological parameters are iteratively updated in the Transformer model, and new hydrological parameters are obtained at each time step. These hydrological parameters participate in the calculation of the physical formula in the previous step, that is, the process of obtaining the flood (updating the hydrological model to calculate the flow). In addition, because in the entire flood simulation process, the parameters of the hydrological model are updated and iterated over time through deep learning, it is equivalent to combining the physical laws of the hydrological model with the nonlinear data fitting ability of deep learning. This process gives the original deep learning a hydrological physics mechanism, so that the role of deep learning in the flood simulation process can be explained by hydrological physics.
[0149] S12, using the runoff parameters to calculate the predicted total runoff.
[0150] Exemplarily, the predicted total runoff is calculated using the saturated slope runoff and subsoil flow calculated in step S11.
[0151] S13, calculating the difference between the predicted total runoff and the observed actual flow as the model loss, and using the model loss to train the Transformer model;
[0152] The model loss MAE is expressed as follows:
[0153]
[0154] In the above formula, MAE is the model loss, Qobs t For the Transformer model to predict total runoff, Qmodel t is the observed actual flow, and n is the length of the flow time series.
[0155] S14, iterative training until the preset conditions are met and a known watershed dynamic parameter model is obtained.
[0156] Exemplarily, the Transformer model is iteratively trained according to the above process until the number of iterations is met, and the preferred number of iterations is 100 times.
[0157] S2, fix the attention layer and feedforward neural network layer of the known watershed dynamic parameter model to obtain the fixed known watershed dynamic parameter model.
[0158] That is, the Transformer freezing layer is selected. The attention layer and feedforward layer responsible for capturing common features are frozen in both the encoder and the decoder, and do not participate in the gradient update. The attention layer and feedforward layer here are mainly responsible for extracting the general characteristics of the rainfall-runoff time series, that is, the laws that objectively exist in most basins. There are hydrological similarities between basins, and basins with similar underlying surface conditions and climatic conditions have certain similarities in runoff production and confluence. This can be achieved by retaining the general laws learned in basins with rich data and freezing the attention layer and feedforward layer. In basins with scarce data, the network is fine-tuned with limited data to achieve the effect of using less data to obtain better flood simulation.
[0159] To summarize step S2, step S2 migrates the trained Transformer to the data-deficient basin, freezes the attention layer and the feed-forward layer, and fine-tunes the Transformer according to the prior basin classification and the initial hydrological parameter values to obtain the flood simulation results for the data-deficient basin.
[0160] S3, using the target watershed parameters and the preset hydrological parameters to train the fixed known watershed dynamic parameter model to obtain the target watershed dynamic parameter model;
[0161] Preferably, step S3 specifically includes the following steps:
[0162] S30, obtaining the data of the target basin, that is, selecting meteorological data and hydrological data in the new data-deficient basin (where flow data is lacking or only a few are available), classifying the data of the target basin in the same way as step S10, and obtaining the target basin type to ensure that its format is compatible with the input of the model.
[0163] S31, compare the target basin type with the original preset hydrological parameter X = [T0 t ,SR0 t ,SZM t ,Q0 t ,Td t ,SRMAX t ] to form a combined input data set, ensuring that the hydrological parameters of the S30 data are aligned in time.
[0164] S32, input the target basin type and the combined input data set into the Transformer model for parameter update, and calculate the runoff parameters based on the updated preset hydrological parameters, that is, step S32 also needs to use the method of step S11 for iterative update, that is, in the simulation of the basin with insufficient data, the operation of deep transfer learning is added on the basis of the previous basin classification and dynamic hydrological parameters, from time t to time t+1, participating in the calculation of evaporation and infiltration, and finally obtaining the flow at each moment, that is, the total runoff, Iterate from time t to time t+1 Participate in the calculation of evaporation and infiltration, and finally get the flow rate at each moment.
[0165] S32, using the obtained runoff parameters to calculate the total runoff, and using the difference between the total runoff and the observed actual flow as the model loss to fine-tune the known basin dynamic parameter model after training and fixation, to obtain the target basin dynamic parameter model.
[0166] During the training process, the fine-tuning process still includes the complete operation of the encoder and decoder, but only the weights of the unfrozen layers are updated, that is, only the unfrozen part of the model is trained, and the corresponding loss function (such as MAE) is used to evaluate the performance of the model. The optimization algorithm such as gradient descent is iterated until the preset conditions are met and the dynamic parameter model of the target watershed is obtained.
[0167] MAE of target basin flow data:
[0168]
[0169] In the above formula, is the flow predicted by the known basin dynamic parameter model after fixation, is the actual observed flow, and n is the length of the flow time series.
[0170] S4, inputting the target basin parameters and the preset hydrological parameters into the target basin dynamic parameter model to obtain the flood prediction results of the target basin.
[0171] As can be seen from the above, this solution provides a flood simulation method based on dynamic parameters and physical deep learning. Next, this solution also provides a system that applies the above method, including:
[0172] The first training module is used to train the Transformer model using known watershed classification parameters and preset hydrological parameters to obtain a known watershed dynamic parameter model; wherein, the training process of the known watershed dynamic parameter model is as follows: obtain the known watershed classification parameters, and classify the known watershed classification parameters to obtain the known watershed type; input the preset hydrological parameters and the known watershed type into the Transformer model for parameter update, and calculate the runoff parameters based on the updated preset hydrological parameters; use the runoff parameters to calculate the predicted total runoff; calculate the difference between the predicted total runoff and the observed actual flow as the model loss, and use the model loss to train the Transformer model; iterate the training until the preset conditions are met to obtain the known watershed dynamic parameter model.
[0173] The first processing module is used to fix the attention layer and the feedforward neural network layer of the known watershed dynamic parameter model to obtain the fixed known watershed dynamic parameter model.
[0174] The second training module is used to train a fixed known basin dynamic parameter model using target basin parameters and preset hydrological parameters to obtain a target basin dynamic parameter model.
[0175] The prediction module is used to input the target basin parameters and preset hydrological parameters into the target basin dynamic parameter model to obtain the flood prediction results of the target basin.
[0176] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A flood simulation method based on dynamic parameters and physical deep learning, characterized in that: The following steps are involved: The Transformer model is trained using known basin classification parameters and preset hydrological parameters to obtain a known basin dynamic parameter model; Fixing the attention layer and the feedforward neural network layer of the known watershed dynamic parameter model to obtain a fixed known watershed dynamic parameter model; Using the target watershed parameters and the preset hydrological parameters to train the fixed known watershed dynamic parameter model to obtain the target watershed dynamic parameter model; Inputting the target watershed parameters and the preset hydrological parameters into the target watershed dynamic parameter model to obtain a flood prediction result for the target watershed; The training process of the known watershed dynamic parameter model is as follows: Acquire the known watershed classification parameters, and classify the known watershed classification parameters to obtain the known watershed type; Inputting the preset hydrological parameters and the known watershed type into the Transformer model to update the parameters, and calculating the runoff parameters based on the updated preset hydrological parameters; Calculating the predicted total runoff using the runoff parameters; Calculating the difference between the predicted total runoff and the observed actual flow as a model loss, and using the model loss to train the Transformer model; Iterative training is performed until preset conditions are met to obtain the known watershed dynamic parameter model; In the step of inputting the preset hydrological parameters and the known watershed type into the Transformer model to update the parameters, and calculating the runoff parameters based on the updated preset hydrological parameters, in which the preset hydrological parameters include a first part of preset hydrological parameters and a second part of preset hydrological parameters; The specific steps include: Inputting the first part of preset hydrological parameters and the known watershed classification parameters into the Transformer model to update the parameters, thereby obtaining the updated first part of preset hydrological parameters; The runoff parameter is calculated using the updated first part of preset hydrological parameters and the second part of preset hydrological parameters; Inputting the second part of preset hydrological parameters into the Transformer model to update the parameters, thereby obtaining updated second part of preset hydrological parameters; The runoff parameters at least include soil flow and saturated slope runoff; The calculation formula of soil flow is as follows: In the above formula, Q b is soil midflow, Q0 is initial soil midflow, SBAR is average saturated groundwater deficit depth, SZM is maximum storage depth of unsaturated zone; The calculation formula for saturated slope runoff is as follows: In the above formula, Q S is the saturated slope runoff, Δt is the S calculated each time uz -max(SBAR,0) and the maximum time interval between 0, S uz is the initial water content in the unsaturated zone; The preset hydrological parameters in the first part include soil moisture content in the vegetation root zone, maximum water storage depth in the unsaturated zone and initial soil midflow; The preset hydrological parameters in the second part include the hysteresis parameter of gravity drainage and the maximum water storage capacity of the root zone.
2. The flood simulation method based on dynamic parameters and physical deep learning according to claim 1 is characterized in that: The step of calculating the runoff parameter by using the updated first part of preset hydrological parameters and the second part of preset hydrological parameters specifically includes the following steps: Based on the maximum water storage in the root zone and the updated soil moisture content in the root zone of the vegetation, the evaporation is calculated; The infiltration rate is calculated based on the average saturated groundwater deficit depth, the hysteresis parameter of gravity drainage and the updated initial soil midflow; The soil midflow is calculated based on the average saturated groundwater deficit depth, the updated maximum storage depth of the unsaturated zone, and the updated initial soil midflow; The saturated slope runoff is calculated based on the initial water content of the unsaturated zone and the average saturated groundwater deficit depth.
3. The flood simulation method based on dynamic parameters and physical deep learning according to claim 1 is characterized in that: The Transformer model includes an encoder and a decoder; The encoder includes a position encoding layer, a self-attention layer, and a feed-forward neural network layer; The decoder includes a decoding self-attention layer, an encoder-decoder attention layer, and a decoding feedforward neural network layer.
4. The flood simulation method based on dynamic parameters and physical deep learning according to claim 1 is characterized in that: The model loss is expressed as follows: In the above formula, MAE is the model loss, Qobs t To predict total runoff, Qmodel t is the observed actual flow, and n is the length of the flow time series.
5. The flood simulation method based on dynamic parameters and physical deep learning according to claim 1, characterized in that: The step of obtaining the known watershed classification parameters and classifying the known watershed classification parameters to obtain the known watershed type specifically includes the following steps: Extract the hydrological attributes of the basins with large sample data, and collect static attributes, dynamic time series and raster images of known basins; Calculate elements based on dynamic time series parameters, calculate the maximum information coefficient between the elements and all static attribute parameters, and filter the obtained dynamic time series; Perform feature extraction on the screened dynamic time series to obtain time series features; Fusing the static attribute with the temporal feature to obtain a fused feature; The raster image and the fused features are input into a neural network to obtain the known watershed type.
6. The flood simulation method based on dynamic parameters and physical deep learning according to claim 5 is characterized in that: Before calculating the element parameters based on the dynamic time series parameters and calculating the maximum information coefficient between the element parameters and all the static attribute parameters to obtain the static features, the following steps are also included: The principal component analysis method is used to eliminate the redundancy of static attributes.
7. A flood simulation system based on dynamic parameters and physical deep learning, characterized by: The method for performing the flood simulation as claimed in claim 1 comprises: The first training module is used to train the Transformer model using known watershed classification parameters and preset hydrological parameters to obtain a known watershed dynamic parameter model; The training process of the known watershed dynamic parameter model is as follows: Acquire the known watershed classification parameters, and classify the known watershed classification parameters to obtain the known watershed type; Inputting the preset hydrological parameters and the known watershed type into the Transformer model to update the parameters, and calculating the runoff parameters based on the updated preset hydrological parameters; The predicted total runoff is calculated using runoff parameters; Calculating the difference between the predicted total runoff and the observed actual flow as a model loss, and using the model loss to train the Transformer model; Iterative training is performed until preset conditions are met to obtain the known watershed dynamic parameter model; A first processing module is used to fix the attention layer and the feedforward neural network layer of the known watershed dynamic parameter model to obtain a fixed known watershed dynamic parameter model; A second training module is used to train the fixed known watershed dynamic parameter model using the target watershed parameters and the preset hydrological parameters to obtain the target watershed dynamic parameter model; The prediction module is used to input the target basin parameters and the preset hydrological parameters into the target basin dynamic parameter model to obtain the target basin flood prediction result.
Citation Information
Patent Citations
Runoff forecasting method and processor
CN112686481A