PINNs-based flood prediction method, device, equipment and medium
Through the PINNs-based method, combining physical constraints and data-driven loss functions to train the flood prediction model, the prediction inaccuracy problem caused by ignoring physical laws in the prior art is solved, and high-accuracy flood prediction under extreme events is achieved.
Patent Information
- Application Number
- CN202510646514.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-05-20
AI Technical Summary
Existing flood prediction methods rely on data-driven models and ignore physical laws, resulting in inaccurate prediction results under sparse data or extreme events.
Using a PINNs-based method, combining physical constraint loss function and data-driven loss function, the target loss function is constructed through the Shengweinan equation, the initial PINNs model is trained, and multi-source data and physical laws are fused to improve prediction accuracy.
It effectively improves the accuracy of flood prediction results, can follow flood physical laws in extreme events, and provide high-reliability flood prediction.
Smart Images

Figure CN120181152B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the field of flood risk prediction technology, and in particular to a flood prediction method, apparatus, device, and medium based on PINNs. Background Art
[0002] Currently, flood forecasting typically relies on data-driven models. Specifically, by collecting historical rainfall and river flow data at the target detection location and combining it with historical flood time points, the rainfall and water level trigger values for the next flood are predicted. Real-time monitoring of rainfall and river levels at the target detection location is then used to predict the risk of flooding. This approach requires the collection of a large, high-quality database and statistical analysis, and ignores the laws of physical conservation. In the case of sparse data or extreme events (such as sudden floods), flood forecasts can easily deviate from actual physical laws, making it difficult to guarantee accurate flood forecasts. Summary of the Invention
[0003] The embodiments of the present application provide a flood prediction method, apparatus, device, and medium based on PINNs, which can effectively improve the accuracy of flood prediction results.
[0004] In a first aspect, an embodiment of the present application provides a flood prediction method based on PINNs, comprising:
[0005] Acquiring geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data corresponding to a target watershed within a preset time period, and preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a preprocessed first target data set;
[0006] Obtaining an initial PINNs model, and constructing a first target loss function based on the initial PINNs model and the first target data set, wherein the first target loss function is formed based on a physical constraint loss function and a data-driven loss function, the physical constraint loss function is constructed based on the Saint-Venant equation, and the data-driven loss function is constructed based on the predicted flow output by the initial PINNs model and the corresponding actual flow;
[0007] Training the initial PINNs model based on the first target loss function and the first target data set to obtain a trained target model;
[0008] Flood prediction is performed on the target basin based on the target model.
[0009] In some embodiments, preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a preprocessed first target data set includes:
[0010] performing data cleaning on the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a first intermediate data set;
[0011] Decomposing the first intermediate data set into a plurality of sub-signals based on a preset wavelet basis function and a number of decomposition layers, wherein different sub-signals correspond to different frequencies, and removing high-frequency components from the sub-signals to obtain a second intermediate data set;
[0012] Using a preset GAN network to perform missing data filling processing on the second intermediate data set to obtain the third intermediate data set;
[0013] The data of different time resolutions in the third intermediate data set are unified into the same time grid by a time series alignment algorithm to obtain the first target data set.
[0014] In some embodiments, constructing a first target loss function based on the initial PINNs model and the first target dataset includes:
[0015] Calculating derivatives of the predicted flow output by the initial PINNs model based on the first target data set with respect to the input variables in the first target data set;
[0016] Substituting each of the derivatives into the Saint-Venant equation to obtain the physical constraint loss function;
[0017] Calculating a first mean square error between the predicted flow and the actual flow corresponding to the target watershed, and constructing the data-driven loss function based on the first mean square error;
[0018] Determine a trade-off coefficient, and construct the first objective loss function based on the physical constraint loss function, the data-driven loss function, and the trade-off coefficient, wherein the trade-off coefficient is a parameter that weighs the relative importance between the physical constraint loss function and the data-driven loss function.
[0019] In some embodiments, the expression of the first objective loss function is as follows:
[0020] ;
[0021] ;
[0022] ;
[0023] ;
[0024] ( ) 2 ;
[0025] in, is the first objective loss function, is the trade-off coefficient, is the physical constraint loss function, is the first weight parameter, is the second weight parameter, is the predicted flow of the target basin output by the initial PINNs model, is the cross-sectional area of the target basin, is the water level of the target basin, is the acceleration due to gravity, is the momentum equation loss function, N1 and N2 are the number of samples, is the time derivative of the predicted flow, is the spatial gradient of the momentum flux term, is the spatial gradient of the water level, is the friction slope of the target basin, is the riverbed slope of the target basin, is the loss function of the continuity equation, is the rate of change of the cross-sectional area with time, is the spatial gradient of the predicted flow, is the data-driven loss function, is the actual flow rate.
[0026] In some embodiments, training the initial PINNs model based on the first target loss function and the first target dataset to obtain a trained target model includes:
[0027] Dividing the first target data set into a training set and a validation set according to a preset ratio, and generating training points corresponding to the training set and validation points corresponding to the validation set using the LHS sampling strategy;
[0028] Determining physical a priori parameters, and constructing a second objective loss function based on the physical a priori parameters and the first objective loss function, wherein the physical a priori parameters include the Manning coefficient and the riverbed slope corresponding to the target watershed;
[0029] Based on the training set and the training points, the initial PINNs model is iteratively updated using the ADAM optimization algorithm in combination with the second objective loss function to obtain an updated first intermediate model;
[0030] Based on the training set and the training points, iteratively updating the first intermediate model using the L-BFGS algorithm in combination with the second objective loss function to obtain an updated second intermediate model;
[0031] The verification set and the verification points are input into the second intermediate model to obtain prediction results and physical posterior parameters, and a second mean square error is calculated based on the prediction results and the corresponding true results. When the second mean square error and the physical posterior parameters meet preset conditions, the second intermediate model is determined as the target model.
[0032] In some embodiments, the method further comprises:
[0033] When the second mean square error and the physical posterior parameter do not meet the preset condition, re-based on the training set and the training points, using the ADAM optimization algorithm combined with the second objective loss function to iteratively update the initial PINNs model to obtain a new first intermediate model;
[0034] Based on the training set and the training points, the new first intermediate model is iteratively updated using the L-BFGS algorithm in combination with the second objective loss function to obtain a new second intermediate model;
[0035] The verification set and the verification points are input into a new second intermediate model to obtain a new prediction result and a new physical posterior parameter. A new second mean square error is calculated based on the new prediction result and the corresponding true result. Until the new second mean square error and the new physical posterior parameter meet the preset conditions, the second intermediate model is determined as the target model.
[0036] In some embodiments, the method is applied to a flood prediction system, wherein the target model and a GIS system are deployed, and flood prediction for the target basin is performed based on the target model, including:
[0037] acquiring, in real time, the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data corresponding to the target watershed, and preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a preprocessed second target data set;
[0038] Inputting the second target data set into the target model to obtain a flood prediction result, wherein the flood prediction result includes the water level, water flow and spatiotemporal distribution information of flood propagation in the target basin;
[0039] The GIS system generates a flood risk warning map based on the water level, the water flow and the spatiotemporal distribution information of the flood propagation, and sends the flood risk warning map to the emergency management system.
[0040] In a second aspect, an embodiment of the present application provides a control device comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the PINNs-based flood prediction method as described in the first aspect.
[0041] In a third aspect, an embodiment of the present application further provides an electronic device comprising the control device of the second aspect.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the flood prediction method based on PINNs as described in the first aspect.
[0043] An embodiment of the present application provides a flood prediction method, apparatus, device, and medium based on PINNs. The method includes: obtaining geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data corresponding to a target basin within a preset time period, preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a preprocessed first target data set; obtaining an initial PINNs model, and constructing a first target loss function based on the initial PINNs model and the first target data set, wherein the first target loss function is formed based on a physical constraint loss function and a data-driven loss function, the physical constraint loss function is constructed based on the Saint-Venant equation, and the data-driven loss function is constructed based on the predicted flow output by the initial PINNs model and the corresponding actual flow; training the initial PINNs model based on the first target loss function and the first target data set to obtain a trained target model; and performing flood prediction for the target basin based on the target model. According to the solution provided in the embodiment of the present application, a physical loss function and a data-driven loss function are introduced in the process of training the flood prediction model to optimize the model, so that the target model finally used for flood prediction can fit the actual monitoring data while following the physical laws of floods. In this way, the accuracy of flood prediction results can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flowchart of the steps of a flood prediction method based on PINNs provided in one embodiment of the present application;
[0045] Figure 2 This is a structural diagram of a control device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0047] It is understood that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and the like in the specification, claims, or accompanying drawings are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0048] Currently, flood forecasting typically relies on data-driven models. Specifically, by collecting historical rainfall and river flow data at the target detection location and combining it with historical flood time points, the rainfall and water level trigger values for the next flood are predicted. Real-time monitoring of rainfall and river levels at the target detection location is then used to predict the risk of flooding. This approach requires the collection of a large, high-quality database and statistical analysis, and ignores the laws of physical conservation. In the case of sparse data or extreme events (such as sudden floods), flood forecasts can easily deviate from actual physical laws, making it difficult to guarantee accurate flood forecasts.
[0049] To solve the above-mentioned problems, an embodiment of the present application provides a flood prediction method, device, equipment and medium based on PINNs, the method including: obtaining geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data and environmental data corresponding to a target basin within a preset time period, preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data and the environmental data to obtain a preprocessed first target data set; obtaining an initial PINNs model, and constructing a first target loss function based on the initial PINNs model and the first target data set, wherein the first target loss function is formed based on a physical constraint loss function and a data-driven loss function, the physical constraint loss function is constructed based on the Saint-Venant equation, and the data-driven loss function is constructed based on the predicted flow output by the initial PINNs model and the corresponding actual flow; training the initial PINNs model based on the first target loss function and the first target data set to obtain a trained target model; and performing flood prediction for the target basin based on the target model. According to the solution provided in the embodiment of the present application, a physical loss function and a data-driven loss function are introduced in the process of training the flood prediction model to optimize the model, so that the target model finally used for flood prediction can fit the actual monitoring data while following the physical laws of floods. In this way, the accuracy of flood prediction results can be effectively improved.
[0050] The embodiments of the present application are further described below with reference to the accompanying drawings.
[0051] refer to Figure 1 , Figure 1 This is a flowchart of a flood prediction method based on PINNs provided in one embodiment of the present application. The present application embodiment provides a flood prediction method based on PINNs, which includes but is not limited to the following steps:
[0052] Step S10, obtaining geospatial remote sensing data, precipitation intensity distribution data, meteorological data, meteorological data, hydrological data and environmental data corresponding to the target watershed within a preset time period, preprocessing the geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data and environmental data to obtain a preprocessed first target data set.
[0053] Specifically, the embodiments of the present application do not limit the specific preset time period, and can be hourly data during the flood season every year within 5 years, which can be determined by those skilled in the art based on actual conditions.
[0054] Specifically, the geospatial remote sensing data of this embodiment is acquired via satellite, including remote sensing data such as the spatial location of the target watershed, the coverage of large water bodies, and vegetation conditions. Precipitation intensity distribution data is acquired via radar. Meteorological and hydrological data are collected via ground observation stations. Meteorological data includes rainfall, temperature, and humidity in the target watershed, while hydrological data includes water level and flow in the target watershed. Environmental data is collected by IoT sensors, and environmental information includes surface and soil data and watershed ecological data (e.g., soil moisture, topography, slope, and sediment content) corresponding to the target watershed. It is understood that in the process of predicting floods in a target watershed, it is necessary to collect multi-dimensional data related to the environment, hydrology, and meteorology, and combine these multi-dimensional data for comprehensive analysis and prediction. Therefore, by acquiring geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data corresponding to the target watershed within a preset time period, an effective data foundation can be provided for subsequent training of a target model for accurate flood prediction.
[0055] Specifically, in some embodiments, preprocessing the geospatial remote sensing data, precipitation intensity distribution data, hydrological data, and environmental data in step S10 to obtain a preprocessed first target data set includes, but is not limited to, the following steps:
[0056] Step S11, performing data cleaning on the geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data to obtain a first intermediate data set;
[0057] Step S12: decomposing the first intermediate data set into a plurality of sub-signals based on a preset wavelet basis function and a number of decomposition layers, wherein different sub-signals correspond to different frequencies, and removing high-frequency components from the sub-signals to obtain a second intermediate data set;
[0058] Step S13, using a preset GAN network to perform missing data filling processing on the second intermediate data set to obtain a third intermediate data set;
[0059] Step S14 , using a time series alignment algorithm, unifies the data of different time resolutions in the third intermediate data set to the same time grid to obtain a first target data set.
[0060] It is understandable that the data collected from various devices such as satellites, radars, ground observation stations, and IoT sensors contain noise, erroneous values, and missing values, which will affect the accuracy of subsequent flood prediction results. Therefore, it is necessary to preprocess the collected multi-dimensional data. The data preprocessing steps of this embodiment include: cleaning the geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data, removing obviously unreasonable data, and obtaining a first intermediate data set; then, using wavelet transform to remove high-frequency noise from the data in the first intermediate data set. Specifically, based on the preset wavelet basis function and the number of decomposition layers, the first intermediate data set is decomposed into multiple sub-signals, where different sub-signals have different frequencies. The signals of the high-frequency components in the sub-signals are removed to obtain a second intermediate data set; then, a GAN network is used to fill in the missing data of the second intermediate data set. The third intermediate data set is obtained by supplementary processing. Since the GAN network consists of a generator and a discriminator, the generator is used to learn the data distribution to generate missing data, and the discriminator is used to judge the authenticity of the generated missing data. The generator and the discriminator are trained adversarially to improve the quality of the generated data, thereby ensuring the authenticity of the third intermediate data set. Since the third intermediate data set contains data of multiple dimensions, the acquisition time of data of different dimensions is often inconsistent. For example, the rainfall corresponds to the rainfall per hour, while the water level is the water level data every 10 minutes. In this embodiment, these data of different step lengths are unified to the same time base through the time series alignment algorithm for subsequent fusion or modeling.
[0061] It should be noted that the GAN network can also be replaced by a variational autoencoder VAE based on deep learning to fill missing values, and the empirical mode decomposition EMD algorithm can be used for denoising. Those skilled in the art can choose according to actual conditions.
[0062] Step S20: Obtain an initial PINNs model, and construct a first target loss function based on the initial PINNs model and the first target data set, wherein the first target loss function is formed based on a physical constraint loss function and a data-driven loss function, the physical constraint loss function is constructed based on the Saint-Venant equation, and the data-driven loss function is constructed based on the predicted flow output by the initial PINNs model and the corresponding actual flow.
[0063] Specifically, the initial PINNs model of this embodiment is a fully connected feedforward neural network, including an input layer, a hidden layer and an output layer, wherein the input layer is used to receive multiple variable parameters, for example, the spatial position, time, time derivative and spatial derivative of the water level of the target basin, so as to capture the dynamic changes of the flood in the time dimension. The spatial position is used to accurately determine the specific location in the basin, which is represented by geographic coordinates (such as longitude and latitude). The water level is a value obtained by real-time measurement at the actual monitoring station. The time derivative and spatial derivative of the water level are obtained by numerical calculation methods (such as finite difference method) and water level calculation. Taking a one-dimensional river channel as an example, it is assumed that there are several monitoring points evenly distributed on the river channel. The water level at each monitoring point Measurements are made using water level data from adjacent time steps or adjacent spatial locations, using the central difference formula ( Indicates the location of the monitoring point, △ t is the time interval) to calculate the time derivative of the water level, and use (△ x The spatial derivatives of water levels are calculated using these variables as input to the input layer, providing basic flood-related information for the initial PINNs model. The hidden layer has L layer, the hidden layer uses the hyperbolic tangent activation function tanh as the activation function, and the number of neurons in each hidden layer is ( ), in this embodiment, there are 4 hidden layers, each layer has 20 neurons, and the neurons are connected by weight matrix and the bias vector Connect and calculate, for the The first hidden layer neurons, whose input Is the output of the previous layer With the weight matrix The product of plus the bias ,Right now , after being processed by the tanh activation function, the output is Through layer-by-layer calculation and feature extraction of multiple hidden layers, deep-level features related to floods are gradually extracted. The output layer outputs the predicted value of water flow in the river. Specifically, after the multiple hidden layers extract and transform the features of the input variables, the output layer maps the information processed by the hidden layers into the final predicted value of water flow. , the calculation process of the output layer is also based on the weight matrix and the bias vector ,Right now ,here is the output of the last hidden layer.
[0064] Specifically, in some embodiments, step S20 of constructing a first target loss function based on the initial PINNs model and the first target dataset includes but is not limited to the following steps:
[0065] Step S21, calculating each derivative of the predicted flow output by the initial PINNs model based on the first target data set with respect to each input variable in the first target data set;
[0066] Step S22, substituting each derivative into the Saint-Venant equation to obtain a physical constraint loss function;
[0067] Step S23, calculating a first mean square error between the predicted flow and the actual flow corresponding to the target basin, and constructing a data-driven loss function based on the first mean square error;
[0068] Step S24, determine the trade-off coefficient, and construct a first target loss function based on the physical constraint loss function, the data-driven loss function and the trade-off coefficient, wherein the trade-off coefficient is a parameter that weighs the relative importance between the physical constraint loss function and the data-driven loss function.
[0069] It is understandable that in the process of training the initial PINNs model, this embodiment uses the automatic derivation function provided by the deep learning framework such as TensorFlow or PyTorch to calculate the predicted flow output by the initial PINNs model based on the first target data set. The derivatives of the associated input variables (such as the spatial derivative of the water level representing the spatial gradient of the water level) are substituted into the Saint-Venant equation to construct a physical constraint loss function. In addition, by calculating the first mean square error between the predicted flow and the actual flow corresponding to the target basin, a data-driven loss function is constructed based on the first mean square error. The first target loss function is constructed based on the physical constraint loss function, the data-driven loss function and the trade-off coefficient. The initial PINNs model is trained with the first target loss function, so that multi-source data and physical laws are deeply integrated during the training process, so that the model can comprehensively capture flood characteristics and accurately learn the physical laws of floods. Compared with traditional models that simply rely on data-driven, this embodiment can significantly improve the accuracy and reliability of flood prediction.
[0070] It should be noted that the expression of the first objective loss function of this embodiment is as follows:
[0071] ;
[0072] ;
[0073] ;
[0074] ;
[0075] ( ) 2 ;
[0076] in, is the first objective loss function, is the trade-off coefficient, is the physical constraint loss function, is the first weight parameter, used to weigh the physical constraint loss function The importance of is the difference between the model output and the physical laws. , which can control the degree to which the model follows physical laws during training; is the second weight parameter, used to weigh the momentum equation loss function The importance of is measured by the difference between the model output and the momentum equation. , which can control how closely the model follows the momentum equation during training; 、 is the predicted flow of the target basin output by the initial PINNs model, is the cross-sectional area of the target watershed, is the water level of the target basin, is the acceleration due to gravity, is the momentum equation loss function, N1 and N2 are the number of samples, is the time derivative of the predicted flow rate, is the spatial gradient of the momentum flux term, is the spatial gradient of water level, is the friction slope of the target basin, is the riverbed slope of the target basin, is the loss function of the continuity equation, is the rate of change of cross-sectional area with time, To predict the spatial gradient of flow, is the data-driven loss function, is the actual flow rate.
[0077] It should be noted that the friction slope in this embodiment Calculated according to the following formula:
[0078] ;
[0079] in, n is the Manning coefficient, R is the hydraulic radius.
[0080] Step S30: training the initial PINNs model based on the first target loss function and the first target data set to obtain a trained target model.
[0081] Specifically, in some embodiments, step S30 includes but is not limited to the following steps:
[0082] Step S31, dividing the first target data set into a training set and a validation set according to a preset ratio, and generating training points corresponding to the training set and validation points corresponding to the validation set using the LHS sampling strategy;
[0083] Step S32: determining physical a priori parameters, and constructing a second objective loss function based on the physical a priori parameters and the first objective loss function, wherein the physical a priori parameters include the Manning coefficient and the riverbed slope corresponding to the target watershed;
[0084] Step S33, based on the training set and the training points, the initial PINNs model is iteratively updated using the ADAM optimization algorithm combined with the second objective loss function to obtain an updated first intermediate model;
[0085] Step S34, based on the training set and the training points, the first intermediate model is iteratively updated using the L-BFGS algorithm in combination with the second objective loss function to obtain an updated second intermediate model;
[0086] In step S35, the verification set and verification points are input into the second intermediate model to obtain the prediction results and physical posterior parameters, and the second mean square error is calculated based on the prediction results and the corresponding true results. When the second mean square error and the physical posterior parameters meet the preset conditions, the second intermediate model is determined as the target model.
[0087] Specifically, in this embodiment, the preset ratio of the training set and the validation set obtained by dividing the first target data set is 7:3, which can be determined by those skilled in the art according to actual conditions and is not limited here.
[0088] It can be understood that the process of implementing model training in this embodiment includes four steps: (1) data preparation; (2) model initialization; (3) loss function training and updating; and (4) model verification. Among them, (1) the data preparation process is: the preprocessed first target data set is divided into a training set and a validation set in a ratio of 7:3. The training set includes hourly data of the target basin during the flood season (April to September) from 2015 to 2020, a total of 1,200 time points, including synchronous data of the upstream, midstream and downstream areas of the target basin; the validation set includes synchronous data of the upstream, midstream and downstream areas of the target basin corresponding to the flood event, a total of 500 time points; the LHS algorithm is used to generate corresponding training points and validation points for the training set and validation set, wherein the training points include 50,000 LHS points, and the training points cover the entire spatiotemporal domain (i.e., covering the flood season from April to September from 2015 to 2020), and the validation points include 30,000 LHS points, and the validation points focus on the flood peak period (12 to 48 hours); (2) the model initialization process is: determine the physical prior parameters, which include the Manning coefficient and riverbed slope Manning coefficient The corresponding prior distribution is ; This formula indicates that the Manning coefficient n obeys the lognormal distribution, where is the mean parameter of the lognormal distribution, which represents the mean of the logarithmic values of n; is the standard deviation parameter of the lognormal distribution, which represents the standard deviation of the logarithmic value of n; the riverbed slope The corresponding prior distribution is , represents the riverbed slope Obey the truncated normal distribution, which is obtained by partially truncating the standard normal distribution. In the formula, μ2=0.0003 is the mean parameter of the truncated normal distribution, indicating The mean of =0.0001 is the standard deviation parameter of the truncated normal distribution, indicating The standard deviation of ; and initialize the model architecture of the initial PINNs model; (3) The process of loss function training update is: based on the physical prior parameters and the first objective loss function, the second objective loss function is constructed, first based on the training points and the verification points, the initial PINNs model is iteratively updated using the ADAM optimization algorithm combined with the second objective loss function to obtain the updated first intermediate model; then based on the training points and the verification points, the first intermediate model is iteratively updated using the L-BFGS algorithm combined with the second objective loss function to obtain the updated second intermediate model. That is to say, the training update has two stages, stage 1 is implemented by the ADAM optimization algorithm, and stage 2 is implemented by the L-BFGS algorithm; among them, the second objective loss function The expression is as follows:
[0089] ;
[0090] Among them, during the training process, the second objective loss function The composition of will vary according to the different training stages. In this embodiment, in The value of N2 is 1200, that is, , The value of N1 is 50000, that is, , is the regularization term corresponding to the physical prior parameter, which is used to indicate the Manning coefficient and riverbed slope Specifically, in the training update phase 1, the first intermediate model is updated for 500 rounds using the ADAM optimization algorithm combined with the second objective loss function to obtain the second intermediate model with a learning rate of 0.001 and a dynamic adjustment. and To update the second objective loss function The composition, according to , Adjustments are made, and each round of iterative update operation updates the physical prior parameters based on the following formula:
[0091]
[0092]
[0093] in, is the updated mean of the Manning coefficient n in the t+1th iteration, is the historical value set of Manning coefficient n recorded during the training process, is the updated standard deviation of the Manning coefficient n in the t+1th iteration.
[0094] Specifically, in the training update phase 2, the L-BFGS algorithm is used in combination with the second objective loss function to perform 1000 rounds of iterative updates on the second intermediate model to achieve full batch optimization. After the iteration is completed, the second intermediate model is obtained. During the update process, the second objective loss function The value is 1. 0.5. (4) Model verification. After obtaining the second intermediate model, this embodiment uses the verification set and verification points to verify the second intermediate model, considering the physical consistency and the second mean square error between the prediction result and the true value to ensure the accuracy of the flood prediction result of the target model. When the second mean square error is less than the preset threshold and the Manning coefficient in the physical posterior parameter is Falling within the target range (0.033-0.038), the riverbed slope The slope of the remote sensing terrain corresponding to the target watershed is consistent, the second mean square error and the physical posterior parameters are determined to meet the preset conditions, and the second intermediate model is determined as the target model.
[0095] It is understood that during the model training process, this embodiment uses the ADAM optimization algorithm for initial parameter updates, followed by a switch to the L-BFGS algorithm for refined training to improve the model's convergence speed and accuracy. During training, a Latin hypercube sampling strategy is used to generate points to enhance the model's ability to learn flood characteristics at different locations and times within the basin. A Bayesian inference mechanism is introduced to improve the PINNs model training process. By setting the physical prior distribution of the parameters, prior knowledge of the physical parameters is incorporated into the model training, preventing parameter estimation from falling into non-physical areas, improving the accuracy and reliability of parameter estimation, and thereby ensuring the accuracy of the target model's flood prediction results.
[0096] In addition, in some embodiments, the flood prediction method based on PINNs of this embodiment further includes but is not limited to the following steps:
[0097] Step S36: When the second mean square error and the physical posterior parameters do not meet the preset conditions, the initial PINNs model is iteratively updated based on the training point distribution and the verification point distribution using the ADAM optimization algorithm combined with the second objective loss function to obtain a new first intermediate model;
[0098] Step S37, based on the training points and the verification points, the new first intermediate model is iteratively updated using the L-BFGS algorithm combined with the second objective loss function to obtain a new second intermediate model;
[0099] In step S38, the verification set and verification points are input into the new second intermediate model to obtain new prediction results and new physical posterior parameters. A new second mean square error is calculated based on the new prediction results and the corresponding true results until the new second mean square error and the new physical posterior parameters meet the preset conditions, and the second intermediate model is determined as the target model.
[0100] It can be understood that, referring to the description of the above embodiment, when the second mean square error and the physical posterior parameters do not meet the preset conditions, the initial PINNs model is iteratively updated based on the training points and the verification points using the ADAM optimization algorithm combined with the second objective loss function to obtain a new first intermediate model; based on the training points and the verification points, the new first intermediate model is iteratively updated using the L-BFGS algorithm combined with the second objective loss function to obtain a new second intermediate model; the verification set and the verification points are input into the new second intermediate model to obtain new prediction results and new physical posterior parameters, and a new second mean square error is calculated based on the new prediction results and the corresponding true results, until the new second mean square error and the new physical posterior parameters meet the preset conditions, and the second intermediate model is determined as the target model. That is, this embodiment uses the LHS algorithm, Bayesian mechanism, and physical constraints to collaboratively train the target model for flood prediction. The LHS algorithm calculates points to fill data gaps, the physical loss function constrains the entire domain, and the Bayesian prior prevents parameter deviation. Combined with the adjustment of dynamic physical prior parameters (large-scale exploration is allowed in the early stage of training, and gradually tightened to a physically reasonable range in the later stage), this process ensures high-reliability flood prediction for the target basin under small samples through the deep integration of data-driven, physical constraints, and probability calibration.
[0101] Step S40: Flood prediction for the target basin based on the target model.
[0102] Specifically, in some embodiments, the flood prediction method based on PINNs of this embodiment is applied to a flood prediction system, which is deployed with a target model and a GIS system. Step S40 includes but is not limited to the following steps:
[0103] Step S41, acquiring in real time geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data corresponding to the target watershed, and preprocessing the geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data to obtain a preprocessed second target data set;
[0104] Step S42: inputting the second target data set into the target model to obtain a flood prediction result, wherein the flood prediction result includes the water level, water flow and spatiotemporal distribution information of the flood propagation in the target basin;
[0105] Step S43: Generate a flood risk warning map based on the spatiotemporal distribution information of water level, water flow and flood propagation based on the GIS system, and send the flood risk warning map to the emergency management system.
[0106] It is understood that the target model is the trained PINNs model. This embodiment deploys the target model within a flood prediction system and receives real-time multi-source data input from the target basin (including a second target dataset pre-processed from geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data corresponding to the target basin). The system then outputs flood prediction results, including water level, flow rate, and spatiotemporal distribution information of flood propagation within the target basin. In conjunction with the flood prediction system's GIS system, a visual flood risk warning map is generated based on the spatiotemporal distribution of water level, flow rate, and flood propagation, providing a scientific basis for flood prevention and mitigation decision-making. Furthermore, the prediction results are integrated with the emergency management system, sending the flood risk warning map to the system to provide intelligent support for emergency rescue efforts.
[0107] like Figure 2 As shown, Figure 2 : is a structural diagram of a control device provided in one embodiment of the present application. The present invention also provides a control device 200, comprising:
[0108] The processor 210 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0109] The memory 220 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 220 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 220 and is called by the processor 210 to execute the flood prediction method based on PINNs in the embodiments of this application.
[0110] Input / output interface 230, used to implement information input and output;
[0111] Communication interface 240, used to implement communication interaction between the apparatus and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0112] bus 250 , which transmits information between various components of the device (e.g., processor 210 , memory 220 , input / output interface 230 , and communication interface 240 );
[0113] The processor 210 , the memory 220 , the input / output interface 230 and the communication interface 240 are connected to each other in communication within the device via the bus 250 .
[0114] In addition, an embodiment of the present application further provides an electronic device, including the control device 200 of the above embodiment.
[0115] In addition, an embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned PINNs-based flood prediction method is implemented.
[0116] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory optionally includes a memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of the above-mentioned networks include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0117] Those skilled in the art will appreciate that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, or any suitable combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVDs) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0118] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above implementation. Those skilled in the art can also make various equivalent modifications or substitutions under the shared conditions that do not violate the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A flood prediction method based on PINNs, characterized in that: include: Acquiring geospatial remote sensing data, precipitation intensity distribution data, meteorological data, hydrological data, and environmental data corresponding to a target watershed within a preset time period, and preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a preprocessed first target data set; Obtaining an initial PINNs model, and constructing a first target loss function based on the initial PINNs model and the first target data set, wherein the first target loss function is formed based on a physical constraint loss function and a data-driven loss function, the physical constraint loss function is constructed based on the Saint-Venant equation, and the data-driven loss function is constructed based on the predicted flow output by the initial PINNs model and the corresponding actual flow; Training the initial PINNs model based on the first target loss function and the first target data set to obtain a trained target model; Performing flood prediction on the target basin based on the target model; The step of constructing a first target loss function based on the initial PINNs model and the first target data set includes: Calculating derivatives of the predicted flow output by the initial PINNs model based on the first target data set with respect to the input variables in the first target data set; Substituting each of the derivatives into the Saint-Venant equation to obtain the physical constraint loss function; Calculating a first mean square error between the predicted flow and the actual flow corresponding to the target watershed, and constructing the data-driven loss function based on the first mean square error; Determining a trade-off coefficient, and constructing the first objective loss function based on the physical constraint loss function, the data-driven loss function, and the trade-off coefficient, wherein the trade-off coefficient is a parameter that weighs the relative importance between the physical constraint loss function and the data-driven loss function; The expression of the first objective loss function is as follows: ; ; ; ; ( ) 2 ; in, is the first objective loss function, is the trade-off coefficient, is the physical constraint loss function, is the first weight parameter, is the second weight parameter, is the predicted flow of the target basin output by the initial PINNs model, is the cross-sectional area of the target basin, is the water level of the target basin, is the acceleration due to gravity, is the momentum equation loss function, N1 and N2 are the number of samples, is the time derivative of the predicted flow, is the spatial gradient of the momentum flux term, is the spatial gradient of the water level, is the friction slope of the target basin, is the riverbed slope of the target basin, is the loss function of the continuity equation, is the rate of change of the cross-sectional area with time, is the spatial gradient of the predicted flow, is the data-driven loss function, is the actual flow rate.
2. The flood prediction method based on PINNs according to claim 1, characterized in that: Preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a preprocessed first target data set includes: performing data cleaning on the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data to obtain a first intermediate data set; Decomposing the first intermediate data set into a plurality of sub-signals based on a preset wavelet basis function and a number of decomposition layers, wherein different sub-signals correspond to different frequencies, and removing high-frequency components from the sub-signals to obtain a second intermediate data set; Using a preset GAN network to perform missing data filling processing on the second intermediate data set to obtain a third intermediate data set; The data of different time resolutions in the third intermediate data set are unified into the same time grid by a time series alignment algorithm to obtain the first target data set.
3. The flood prediction method based on PINNs according to claim 1, characterized in that: The initial PINNs model is trained based on the first target loss function and the first target data set to obtain a trained target model, including: Dividing the first target data set into a training set and a validation set according to a preset ratio, and generating training points corresponding to the training set and validation points corresponding to the validation set using the LHS sampling strategy; Determining physical a priori parameters, and constructing a second objective loss function based on the physical a priori parameters and the first objective loss function, wherein the physical a priori parameters include the Manning coefficient and the riverbed slope corresponding to the target watershed; Based on the training set and the training points, the initial PINNs model is iteratively updated using the ADAM optimization algorithm in combination with the second objective loss function to obtain an updated first intermediate model; Based on the training set and the training points, iteratively updating the first intermediate model using the L-BFGS algorithm in combination with the second objective loss function to obtain an updated second intermediate model; The verification set and the verification points are input into the second intermediate model to obtain prediction results and physical posterior parameters, and a second mean square error is calculated based on the prediction results and the corresponding true results. When the second mean square error and the physical posterior parameters meet preset conditions, the second intermediate model is determined as the target model.
4. The flood prediction method based on PINNs according to claim 3, characterized in that: The method further comprises: When the second mean square error and the physical posterior parameter do not meet the preset condition, re-based on the training set and the training points, using the ADAM optimization algorithm combined with the second objective loss function to iteratively update the initial PINNs model to obtain a new first intermediate model; Based on the training set and the training points, the new first intermediate model is iteratively updated using the L-BFGS algorithm in combination with the second objective loss function to obtain a new second intermediate model; The verification set and the verification points are input into a new second intermediate model to obtain a new prediction result and a new physical posterior parameter. A new second mean square error is calculated based on the new prediction result and the corresponding true result. Until the new second mean square error and the new physical posterior parameter meet the preset conditions, the second intermediate model is determined as the target model.
5. The flood prediction method based on PINNs according to claim 1, characterized in that: Applied to a flood prediction system, the flood prediction system deploys the target model and a GIS system, and performs flood prediction for the target basin based on the target model, including: acquiring, in real time, the geospatial remote sensing data, the precipitation intensity distribution data, the meteorological data, the hydrological data, and the environmental data corresponding to the target watershed, and preprocessing the geospatial remote sensing data, the precipitation intensity distribution data, the hydrological data, and the environmental data to obtain a preprocessed second target data set; Inputting the second target data set into the target model to obtain a flood prediction result, wherein the flood prediction result includes the water level, water flow and spatiotemporal distribution information of flood propagation in the target basin; The GIS system generates a flood risk warning map based on the water level, the water flow and the spatiotemporal distribution information of the flood propagation, and sends the flood risk warning map to the emergency management system.
6. A control device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the PINNs-based flood prediction method as described in any one of claims 1 to 5.
7. An electronic device, characterized in that: Includes the control device according to claim 6.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the flood prediction method based on PINNs according to any one of claims 1 to 5.
Citation Information
Patent Citations
Flood forecasting method based on SCM-PINNs
CN116975513A
Dam break prediction and model training method and device, electronic equipment and storage medium
CN117875504A