Application method of deep learning model embedded based on physical mechanism in urban flood ponding point identification
By embedding the Saint-Venant equations into the deep learning model, the problems of low computational efficiency and insufficient accuracy of the existing urban flood warning model are solved, and high-precision, real-time identification of urban flood waterlogging points and emergency deployment are achieved.
Patent Information
- Application Number
- CN202510903100.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-10-14
AI Technical Summary
Existing urban flood warning models have deficiencies in computational efficiency and accuracy. Pure physical mechanism models have low computational efficiency, while pure data-driven models lack physical constraints, resulting in large errors and an inability to provide disaster cause analysis. Data-physical overlay models have not achieved deep integration, leading to error amplification.
The Saint-Venant equations are used as the hydrodynamic equations, which are discretized and linearized through the finite difference method. A differentiable physics module is constructed. Combined with a deep learning model, including a backbone network, a differentiable physics module, an attention-guided fusion module and a hybrid loss function, pre-training, joint fine-tuning and constrained reinforcement training are performed, and adversarial training is added to simulate extreme scenarios.
The model's generalization ability and interpretability are improved, the prediction results follow physical laws, avoid violating common sense, reduce the risk of overfitting, and achieve high-precision real-time prediction and traffic emergency deployment.
Smart Images

Figure CN120781618A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the cross field of urban flood disaster management and artificial intelligence application, and particularly relates to an application method of a deep learning model based on physical mechanism embedding in urban floodwater accumulation point identification. BACKGROUND
[0002] With the increase of global temperature and the acceleration of urbanization, the frequency of urban flood disasters caused by extreme rainstorms has increased significantly. The hardening of the urban underlying surface leads to a decrease in surface permeability, and the insufficient drainage capacity of drainage facilities further exacerbates the waterlogging problem. The high concentration of urban population and property makes the impact of flood disasters more serious. Therefore, it is urgent to improve the flood drainage facilities and strengthen the early warning and forecasting capability of flood disasters.
[0003] In the field of urban flood early warning and forecasting, three types of models are currently used: pure physical mechanism model, pure data-driven model and data-physical simple superposition model. The pure physical mechanism model is mostly based on physical laws such as SWMM and MIKE, which are used to simulate the urban flood evolution process by discretization. However, this type of model has low computational efficiency and takes a long time, and is highly sensitive to data parameters. It is not suitable for simulating complex urban flood scenarios. The pure data-driven model mostly uses CNN or LSTM to process multi-source data to achieve end-to-end prediction in the urban flood simulation process. However, this type of model does not have good physical characteristics constraints, and may have "sourceless" water accumulation and "negative water depth". Due to its black box characteristics, it cannot provide physical mechanism analysis of disaster causes. Based on the above two types of models, subsequent scholars use physical models to generate training data, and then use the training data to drive data models. This model can better balance efficiency and accuracy, but since the physical process and data process are independent, there is no deep integration of equations and network structure, which may amplify errors to some extent.
[0004] In view of the defects of the prior art, a deep learning model embedding physical mechanism construction method and its application in urban floodwater accumulation point identification are urgently needed. SUMMARY
[0005] To solve the above technical problems, the application provides an application method of a deep learning model based on physical mechanism embedding in urban floodwater accumulation point identification.
[0006] The application provides an application method of a deep learning model based on physical mechanism embedding in urban floodwater accumulation point identification, which comprises the following steps:
[0007] Collecting basic data of the research area and preprocessing;
[0008] The preprocessed basic data is taken as input, Saint-Venant equation sets are taken as hydrodynamic equation sets for deformation processing, finite difference method is used for discretization processing of the deformed hydrodynamic equation sets, and linearization processing is performed;
[0009] A differentiable physical module is constructed based on the discretized deformed hydrodynamic equation sets;
[0010] A deep learning model is constructed based on the differentiable physical module, the deep learning model comprising a backbone network, a differentiable physical module, an attention-guided fusion module, an iterative correction mechanism and a hybrid loss function;
[0011] The deep learning model is pre-trained, jointly fine-tuned and constraint-strengthened, and adversarial training is added in the training process to simulate extreme scenarios;
[0012] Urban floodwater accumulation point identification is performed based on the trained deep learning model.
[0013] Optionally, the basic data of the research area includes meteorological data, hydrological data, geographic information data, urban infrastructure data and historical water accumulation data, the basic data is classified into time data and space data, and pre-processing is performed.
[0014] Optionally, the process of taking Saint-Venant equation sets as hydrodynamic equations for deformation processing, using finite difference method for discretization processing of the deformed hydrodynamic equations, and performing linearization processing includes:
[0015] The viscous force of the Saint-Venant equation set and the velocity in the Y direction and the Z direction are ignored, it is assumed that the pressure distribution is approximately hydrostatic pressure, the Saint-Venant equation set is dimensionless, then equation linearization is performed, and the deformation of the Saint-Venant equation set is completed.
[0016] Optionally, the process of taking Saint-Venant equation sets as hydrodynamic equations for deformation processing, using finite difference method for discretization processing of the deformed hydrodynamic equations, and performing linearization processing includes:
[0017] Based on the implicit Euler method, the continuous time variable is discretized into a series of discrete time steps, and based on the central difference method, the continuous spatial domain is discretized into a finite number of grid cells or nodes.
[0018] Optionally, the process of constructing a differentiable physical module based on the discretized deformed hydrodynamic equation sets includes:
[0019] The PyTorch framework is used as a framework of a differentiable physical module, then relevant parameters are imported and a time step and a space step are initialized, and an automatic differentiation function is realized by adjusting the discretized deformation hydrodynamic equation set; a forward propagation process of a preset solver is realized and a gradient is automatically calculated, so that compatibility of physical calculation and automatic differentiation is realized; based on the range of a research area and the discretized deformation hydrodynamic equation set, a boundary condition is set, the normal flux is set to zero on the fixed wall boundary, the reflection condition is realized through a ghost cell, and the water level or flow is preset on the open boundary, and the value of the ghost cell is dynamically adjusted; finally, the central difference method is used to update the mass conservation equation, the upwind difference method is used to update the momentum conservation equation, the boundary condition is adjusted based on the updated water depth and flow velocity, and the construction of the differentiable physical module is completed.
[0020] Optionally, based on the differentiable physical module, the process of constructing the deep learning model comprises:
[0021] Spatial features and time sequence features are extracted based on the backbone network, then the backbone network is connected with the differentiable physical module in a residual manner, data features extracted in the backbone network are input into the differentiable physical module, and physical residuals are output; the attention-guided fusion module dynamically fuses the data features and the physical residuals using a cross-attention mechanism, so as to complete the construction of the deep learning model, and an iterative correction mechanism and a hybrid loss function are preset to iteratively correct and optimize the deep learning model.
[0022] The hybrid loss function comprises a data matching item, a physical conservation item and a regularization item.
[0023] Optionally, the process of pre-training, jointly fine-tuning and constraint strengthening the deep learning model comprises:
[0024] The data matching item is used to train the backbone network in the pre-training stage; in the jointly fine-tuning stage, the physical conservation item and the regularization item are started on the basis of the pre-training, and the two items are used as a single scheme and a combined scheme to jointly fine-tune the deep learning model; in the constraint strengthening training stage, the weight of the regularization item is increased to a preset threshold, and forced physical conservation is performed, so as to complete the three-stage training process.
[0025] Optionally, the process of identifying urban flood accumulation points based on the trained deep learning model comprises:
[0026] In the system deployment preparation stage, real-time access of data sources is performed, and model lightweight and edge deployment are performed; in the real-time prediction and early warning system building stage, the trained deep learning model is used to design a prediction service architecture, and then early warning information is generated; in the business scenario landing application stage, the trained deep learning model is used for high-risk emergency dispatch, driving path planning and subway entrance waterlogging early warning.
[0027] The application also provides a computer device comprising a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps of the method.
[0028] The application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the method.
[0029] Compared with the prior art, the application has the following advantages and technical effects:
[0030] The application uses the Saint-Venant equation set as a physical mechanism, which is embedded in a deep learning model, significantly providing high generalization ability and interpretability of the model. Compared with a pure data-driven black box model, the prediction result more strictly follows the physical law, avoiding absurd output that violates physical common sense. At the same time, introducing physical constraints in deep learning can effectively reduce the hypothesis space and reduce the risk of overfitting, so that the model prediction can remain reliable in the case of insufficient sample data in the simulation process.
[0031] In the process of identifying urban flood accumulation points by using a deep learning model embedded with a physical mechanism, complex patterns in the data can be captured, and the model can automatically meet the physical characteristics in the prediction process. Compared with traditional physical mechanism models, the physical guidance significantly accelerates the training convergence process in terms of simulation efficiency, effectively provides the simulation rate of the flood process, and provides a new paradigm for constructing high-precision real-time prediction models. At the same time, high-precision real-time prediction is realized in the process of predicting accumulation points, which can better realize traffic and emergency deployment. BRIEF DESCRIPTION OF DRAWINGS
[0032] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The embodiments of this application and their description together with the drawings serve to explain the application. In the drawings:
[0033] Figure 1 The method flowchart of the embodiments of the application is shown in the accompanying drawings. DETAILED DESCRIPTION
[0034] It should be noted that the embodiments and features in the embodiments of the application can be combined with each other without conflict. The application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0035] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from that shown here.
[0036] Embodiment One
[0037] With the intensification of urbanization process and the increasing frequency of extreme climate events, the probability of urban flooding is rising, leading to increasing economic losses and casualties. Global researchers have used model simulation methods to study urban flood prediction, but traditional hydrological models have limited simulation accuracy in complex urban underlying surfaces, pipe network coupling mechanisms, and dynamic boundary conditions. Data-driven deep learning models lack physical constraints and can produce predictions that violate conservation laws. Therefore, when high-precision and high-speed prediction results are needed, model simulation techniques need to be improved.
[0038] At the same time, the improvement of multi-source sensor networks (weather stations, water level gauges, remote sensing satellites) and urban infrastructure databases (drainage pipe networks, DEMs, land use) provides a data basis for the fusion of physical mechanisms and deep learning. The development of differentiable programming frameworks such as PyTorch makes it possible to embed Saint-Venant equations and other research techniques, thereby improving model generalization while ensuring the physical reasonableness of prediction results, meeting the dual needs of real-time and explainability for urban emergency management.
[0039] Based on this, the embodiment provides an application method of a deep learning model embedded with physical mechanisms in urban floodwater accumulation point identification, as shown in Figure 1 The method includes the following steps:
[0040] Collecting basic data of the study area and performing preprocessing;
[0041] Using the Saint-Venant equation set as the hydrodynamic equation set for deformation processing, using the finite difference method for discretization processing of the deformed hydrodynamic equation set, and performing linearization processing;
[0042] Based on the discretized deformed hydrodynamic equation set, a differentiable physical module is constructed;
[0043] Based on the differentiable physical module, a deep learning model is constructed, which includes a backbone network, a differentiable physical module, an attention-guided fusion module, an iterative correction mechanism, and a hybrid loss function;
[0044] The deep learning model is pre-trained, jointly fine-tuned, and constraint-strengthened, and adversarial training is added during training to simulate extreme scenarios;
[0045] Based on the trained deep learning model, urban floodwater accumulation point identification is performed.
[0046] As a specific embodiment, the following steps are included: S1: model construction preparation and data preprocessing; S2: using Saint-Venant equation or equation set as the core of physical constraint, discretizing and deforming it as an embedded equation; S3: developing a differentiable physical module using PyTorch; S4: constructing a deep learning network architecture, completing the construction of a three-stage hybrid architecture of "physical constraint layer + spatiotemporal feature extraction layer + multi-task output layer"; S5: building a hybrid training strategy process, completing the training and verification of the deep learning model embedded with the physical mechanism; S6: using the calibrated deep learning model embedded with the physical mechanism to identify and apply urban floodwater accumulation points.
[0047] In S1: model construction preparation and data preprocessing, the type and channel of the data to be collected need to be determined, and the specific operation process is as follows:
[0048] S11: Determine the basic information of the study area and build a collection scheme for the required information of the study area, and clarify the types and sources of basic information required in the modeling process;
[0049] S12: The types of information to be collected are divided into: meteorological data (rainfall data, other meteorological data), hydrological data (water level data, flow data), geographic information data (digital elevation model data, land use data), urban infrastructure data (drainage pipe network data, road data), historical water accumulation data (water accumulation point location, water accumulation depth, water accumulation area, etc.);
[0050] S13: Collect detailed data for the listed information types according to the sources of the information collection scheme, and store them in time and space;
[0051] S14: Clarify the steps of data preprocessing, including: data cleaning, data fusion, data standardization, feature extraction and selection, data enhancement and segmentation. Preprocess the collected data according to the steps of data cleaning, fusion, standardization, feature extraction and selection, enhancement and segmentation, to generate a suitable deep learning model training data set.
[0052] Data cleaning: check if there are duplicate records in the data, and delete or merge the duplicate records; identify and correct abnormal values or error records in the data to avoid obvious errors such as negative water depth.
[0053] Integrate data sources from different sources, clarify the format, resolution and time scale of different data, and fuse the same series of data together to form a complete data set, for example: data reflecting urban floodwater accumulation information caused by a certain rainfall.
[0054] Data standardization is performed on the same game data to normalize data of different dimensions and ranges, so that they can be mapped and similar scale learning can be performed in the deep learning process.
[0055] In the feature extraction and selection step, features valuable for predicting urban waterlogging points are extracted from the original data, including rainfall intensity, cumulative rainfall, duration, terrain slope, and drainage pipe diameter. Through statistical analysis, key features closely related to waterlogging points are selected, ambiguous or irrelevant data are removed, data disparity is reduced, and model prediction efficiency is improved.
[0056] Data augmentation and segmentation is an operation that needs to be performed in the presence of a small amount of data samples. Data augmentation techniques are used to expand the data volume. For time series data, random sampling and time step adjustment can be performed. Then, the preprocessed data is divided into training set, validation set, and test set according to a certain proportion. Usually, a 70:20:10 proportion is used for data segmentation.
[0057] S2: In the water power equation selection and deformation stage, Saint-Venant equation or equation set is selected as the core equation of the model physical constraint. Finite difference method is used to discretize the equation, then simplified hypothesis and neglect of secondary items are performed on the equation set, and finally nonlinear to linearization processing is performed on the discretized equation. The specific operation process is as follows:
[0058] S21: Select Saint-Venant equation or equation set as the physical mechanism embedded core equation. The equation processing is divided into equation deformation and equation discretization two parts. Equation deformation includes: simplified hypothesis, dimensionless processing, equation linearization three parts; equation discretization includes: time discretization and space discretization two parts.
[0059] S22: In the equation deformation process, Saint-Venant equation set is appropriately simplified, ignoring viscous force, considering friction force, ignoring Y and Z direction velocity, assuming pressure distribution is approximately hydrostatic pressure; then dimensionless processing is performed on the equation set to eliminate the influence of dimension; finally, equation linearization is performed, which is linearized and approximated by Taylor expansion method, and is converted into a linear equation set, completing the deformation of Saint-Venant equation set. The mass conservation equation and momentum conservation equation contained in Saint-Venant equation are as follows:
[0060]
[0061]
[0062] Another expression formula of the mass conservation and momentum conservation equations of Saint-Venant equation set is as follows:
[0063]
[0064] S23: Time discretization and spatial discretization of the Saint-Venant equations, discretizing continuous time variables into a series of discrete time steps, and discretizing the continuous spatial domain into a finite number of grid cells or nodes. Time discretization uses the implicit Euler method, and spatial discretization uses the central difference method.
[0065] S3: During the construction of the differentiable physical module, PyTorch is selected as the deep learning framework, and the relevant dependent libraries are installed while the model environment is configured. The discretized Saint-Venant equations are used to define the differentiable physical module, and the physical simulation process is written in Python, including defining system parameters, defining initial conditions, simulating the process, calculating the loss function, etc. The construction of the differentiable physical module is completed, and the specific operation process is as follows:
[0066] S31: Use PyTorch as the deep learning differentiable framework, import torch and torch.nn, then initialize time step, spatial step and other conditional parameters, and adjust the discretized Saint-Venant equations to realize the automatic differentiation function.
[0067] S32: Gradient calculator implementation, ensuring compatibility between physical calculation and automatic differentiation, using autograd function, automatically calculating gradients by defining the forward propagation process of the solver.
[0068] S33: According to the research area range and deformation and the discretized Saint-Venant equations, set the boundary conditions, which can be divided into: solid wall boundary and open boundary, set the normal flux to zero on the solid wall boundary, and realize the reflection condition through the ghost cell; specify the water level or flow rate on the open boundary, and dynamically adjust the ghost cell value.
[0069] S34: Update the mass conservation equation using central difference method, update the momentum conservation equation using upwind difference method, return the updated water depth and flow rate and adjust the boundary conditions, complete the development of the differentiable physical module.
[0070] S35: After completing the development of the differentiable physical module, use the vectorization function of NumPy library to realize efficient numerical calculation, then customize a class inherited from nn.Module to realize encapsulation, so as to encapsulate it as a differentiable layer or module.
[0071] S36: Test the individual differentiable physical module, input the known water depth and flow rate initial conditions, check whether the module output meets the analytical solution or high-precision numerical solution of the physical equation.
[0072] Implementable, in S4: building a deep learning framework process, need to carry out multi-source feature extraction and other operations, the specific operation process as follows:
[0073] S41: Based on the constructed differentiable physical module as the foundation, build a deep learning model architecture, including: main network design, physical constraint module embedding, attention guide fusion module, iterative correction mechanism, hybrid loss function design.
[0074] S42: The main network design is a data-driven feature extraction step, including spatial feature extraction, input: terrain, pipe network, city structure distribution, real-time rainfall distribution and other information, using U-Net structure to extract multi-scale features; Time series feature extraction, input: rainfall time series, using LSTM-TCN hybrid module for feature extraction.
[0075] S43: Use the differentiable physical module and the main network to arrange residual connection, input the predicted water depth and flow rate output by the main network into the differentiable physical module, which is the Saint-Venant layer, and then output the physical equation residual.
[0076] S44: Determine the attention weight and use the cross-attention mechanism to dynamically fuse data features and physical residuals to complete the feature fusion of the model.
[0077] S45: Define the iterative correction mechanism to perform prediction-correction cycles. Through the initial prediction of the main network, the physical residual calculation of the embedded physical mechanism is performed, and then the residual feedback correction is performed to complete the iterative correction in the architecture.
[0078] S45: Design a hybrid loss function to guide the training process of the model. The loss function includes: data matching term, physical conservation term, and regularization term. Total loss function = data matching term + physical conservation term + regularization term.
[0079] Data matching term: L data = α·MSE(h pred ,h obs ) + β·MAE(u pred , u lidar );
[0080] Physical conservation term:
[0081] Regularization term: L reg = δ·KL(n pred || n prior );
[0082] Total loss function: L total = L data + L physics + Lreg ;
[0083] wherein: R u , R v , R h is the residual term of Saint-Venant equation, h pred is the predicted water depth, u pred is the predicted flow velocity.
[0084] S5: The purpose of implementing the mixed training strategy process is to complete the multi-stage training of the embedded physical mechanism model and complete the verification, and the specific operation steps are as follows:
[0085] S51: The deep learning model network architecture that has been built is trained in stages, including: pre-training stage, joint fine-tuning stage, and constraint reinforcement stage. The pre-training stage is to train the backbone network only using data matching items. The joint fine-tuning stage starts on the basis of pre-training, and the physical conservation term and the regularization term are used as a single scheme and a combination scheme as the setting of joint fine-tuning. The constraint reinforcement stage needs to increase the weight of the regularization term and enforce the physical conservation, so as to complete the three-stage training process. Then increase the adversarial training appropriately in the process to generate adversarial samples to simulate extreme rainfall conditions and realize the simulation of urban waterlogging process under extreme rainstorm conditions.
[0086] S52: Self-adaptive weight adjustment is needed during training to ensure dynamic balance of loss terms:
[0087] α(t)=1-σ(0.1t),γ(t)=σ(0.1t),
[0088] wherein, σ is the sigmoid function, and t is the training step number.
[0089] S53: After the training is completed, the model is verified for physical consistency, the change of total water quantity in the region is calculated, and the relative error of total water quantity is required to be less than 5%, and the calculation formula is as follows:
[0090]
[0091] S54: Sensitivity analysis is performed on the deep learning model embedded with physical mechanism, the evaluation indexes before and after removing the terrain gradient feature are compared, and then the evaluation indexes before and after closing the physical constraint are compared. Determine the influence sensitivity of terrain gradient and physical constraint on the deep learning model embedded with physical mechanism.
[0092] S6: After the embedded deep learning model is built, the calibrated model is used for urban waterlogging accumulation point application, and in the application process, hardware and software integration, actual scene verification, and business scene landing operations are needed, and the specific steps are as follows:
[0093] S61: In the process of using the embedded physical mechanism deep learning model to complete the urban floodwater point recognition application, the following three steps are mainly included: system deployment preparation stage, real-time prediction and early warning system building stage, and business scenario landing application stage.
[0094] S62: The purpose of the system deployment and preparation step is to perform real-time access of data sources and model lightweight and edge deployment. When performing real-time access of data sources, water level sensors, cameras and other devices need to be deployed in urban flood-prone areas. The collected data is transmitted through 5G technology, and the completed model is connected with the meteorological bureau API to receive real-time rainfall forecast and short-term rainfall data. After completing the data source access, the data preprocessing module of the model is used to complete the data preprocessing. Then, the model is lightweight and deployed: using TensorRT to lightweight the model, reducing the calculation amount in the prediction process, and deploying the model in the municipal cloud edge node, and optimizing the model code (such as parallel computing, instruction set acceleration, etc.) according to the hardware platform.
[0095] S63: When performing the real-time prediction and early warning system building stage, the completed model is used to design the prediction service architecture, and then the early warning information is generated. When designing the prediction service architecture, the edge can perform high-frequency local prediction (floodwater depth prediction in flood-prone areas), the cloud aggregates regional data to run a macro model, and uses Docker containers to encapsulate the prediction service to complete the design of the prediction service architecture. In the process of generating early warning information, the model's early warning threshold is dynamically adjusted according to historical data to determine the early warning time, and then the early warning map is generated based on the early warning dynamic threshold combined with the GIS platform, and the control screen of the roadside is accessed through the municipal interface to realize the warning of the floodwater depth.
[0096] S64: In the business scenario landing application process stage, it mainly includes three parts: high-risk emergency dispatch, driving path planning, and subway entrance flood warning.
[0097] (1) The embedded physical mechanism deep learning model is connected to the urban emergency command system, and the digital twin platform dynamically monitors the urban floodwater risk area. According to the set threshold, the area with water depth exceeding 30 cm is defined as a high-risk area, and the flood emergency dispatch is completed in advance according to the prediction result.
[0098] (2) The embedded physical mechanism deep learning model is connected to the intelligent transportation system. Through the connection with the Gaode API, the predicted urban floodwater points are displayed on the Gaode map, and the driving path planning function of the Gaode map is used to avoid the floodwater point area and plan the driving path.
[0099] (3) The deep learning model embedded in the physical mechanism is connected to the municipal service interface, and the subway entrance area is set as a high-frequency prediction area. According to the terrain of the subway entrance, the warning threshold is set. When the predicted value exceeds the threshold, the subway department is communicated to inform the subway operator to close the subway operation entrance in advance.
[0100] The embodiment adopts a three-stage hybrid architecture of "physical constraint layer + space-time feature extraction layer + multi-task output layer", embeds the Saint-Venant equation set into the deep learning framework as a physical constraint, realizes high-precision real-time prediction of urban flood simulation, and provides a strong scientific basis for urban flood emergency deployment.
[0101] Embodiment two
[0102] The urban floodwater accumulation point identification method based on the deep learning model in the embodiment includes the following steps:
[0103] In the early preparation stage of model construction, the basic information of the study area needs to be determined and the characteristic data of the study area needs to be collected. The types of collected data include: measured rainfall data, topographic data, urban pipe network data, land use data, etc. The collected data is divided into spatial feature data and temporal feature data. Then, the collected data is subjected to outlier processing and missing value filling, and the space-time asynchronous data is subjected to space-time alignment operation. Coordinate unification and time synchronization are completed. Based on this, the early preparation for model construction is completed.
[0104] In the selection and deformation stage of the water dynamic equation, the Saint-Venant equation or equation set is used as the core equation of the model physical constraint. The finite difference method is used to discretize the equation, and then the equation set is simplified and the secondary term is ignored. Finally, the discretized equation is subjected to nonlinear linearization processing.
[0105] In the development stage of the differentiable physical module, PyTorch is selected as the deep learning framework, and the related dependent libraries are installed while the model environment is configured. The discretized Saint-Venant equation set is used to define the model physical module, and the Python language is used to write the physical simulation process, including: defining system parameters, defining initial state, simulation process, calculating loss function, etc. The development of the differentiable physical module is completed.
[0106] The process of constructing the deep learning network architecture mainly includes: the construction of input layer, fusion layer and output layer. The input layer is mainly based on multi-source data fusion, using U-Net and LSTM-TCN to process static and dynamic data. The fusion layer is mainly based on physical perception attention mechanism to calculate physical feature weight. The output layer is mainly based on multi-task prediction, and the prediction results include: water accumulation probability and water depth distribution.
[0107] The process of building a mixed training strategy divides the model main training process into three stages, while appropriately increasing the adversarial training of the model. The three stages of training include: pre-training stage, joint fine-tuning stage, and constraint reinforcement stage. The pre-training stage initializes the network parameters using historical disaster data, the fine-tuning stage adds a physical constraint loss term for joint optimization, and the constraint reinforcement stage increases the weight of the regularization term to enforce physical conservation. In adversarial training, the main generation of adversarial samples simulates extreme rainfall conditions to simulate urban flooding processes under extreme storm conditions.
[0108] After completing the embedded deep learning model building, the calibrated model is used for urban flood accumulation point application. In the application process, it needs to combine software and hardware integration, actual scene verification and business scene landing, etc. The application process mainly includes: system deployment preparation stage, real-time prediction and early warning system building stage, and business scene landing application stage.
[0109] When building the basin feature data collection scheme, it is necessary to accurately collect relevant data according to the modeling needs of the deep learning model. The data collection categories include: rainfall data, terrain data, land use data, soil type and parameters, underlying surface parameters, drainage pipe network distribution and attributes, drainage pipe network operation data, and surface hydrological monitoring data.
[0110] In the data preprocessing process, the main task is to clean and standardize the data, and complete the spatio-temporal alignment of asynchronous data. In the process of handling outliers, the Isolation Forest algorithm is used to detect outliers, and the abnormal rainfall data is corrected by comparing the data of meteorological radar and ground rain stations. Missing values need to be filled, and in the filling process, Kriging interpolation or linear interpolation is used to supplement. In the spatio-temporal alignment step, all spatial data need to be converted to the same coordinate system and unified resolution, and time asynchronous data is aligned to the standard timestamp to complete the time alignment.
[0111] In the water power equation selection and deformation stage, the Saint-Venant equation set is selected as the embedded equation, and the finite difference method is used for discretization. The implicit Euler method is used for time discretization, and the central difference is used for spatial discretization of the convection term. The discretized equation is simplified and assumed, including: ignoring the secondary term, and converting the nonlinear term to a linear term.
[0112] The development process of the implementable, differentiable physical module first needs to import necessary modules such as torch and torch.nn, then initialize time step, space step and other conditional parameters, then define the forward propagation logic of the module, update the mass conservation equation using the central difference method, and update the momentum conservation equation using the upwind difference method, and finally return the updated water depth and flow rate and handle the boundary conditions, complete the setting of the fixed boundary, free outflow boundary and period, and complete the development of the differentiable physical module.
[0113] The process of constructing the deep learning network architecture needs to use a feature encoder to extract features from the input multi-source data, then construct a physical-data fusion layer to implement the injection of physical equation constraints, use a space-time evolution module to implement physical-data joint calculation, and finally use a multi-task decoder to complete data output.
[0114] When processing multi-source data, spatial feature extraction is performed, inputting information such as terrain, pipe network, urban structure distribution, and real-time rainfall distribution, and using a U-Net structure to extract multi-scale features; temporal feature extraction is performed, inputting rainfall time series and using an LSTM-TCN hybrid module for feature extraction. The physical-data fusion layer uses hard constraint injection and soft constraint guidance for fusion, where hard constraint injection inserts the discretized Saint-Venant equation into the deep learning architecture in the form of a differentiable physical module, and soft constraint guidance dynamically adjusts the weights of physics and data through an attention mechanism. The space-time evolution module defines ConvLSTM and GCNConv modules to process the time and space dimensions of spatio-temporal data, then performs physical evolution and data evolution, and completes joint updating. The multi-task decoder defines waterlogging point classification, water depth regression, and other information, and performs terrain condition constraint to complete data output design.
[0115] The process of building a hybrid training strategy uses three stages to train the model and increases adversarial training during the process. The three-stage training includes a pre-training stage, a joint fine-tuning stage, and a constraint reinforcement stage. During the pre-training stage, the physical module parameters are frozen, only the training data is used to drive the components, and only the data matching loss is used, with precision, recall, water depth prediction RMSE, and convergence speed as monitoring indicators. The fine-tuning stage jointly optimizes physics and data, unfreezes the physical module and adjusts the learning rate, then defines a hybrid loss function including physical conservation parameters and dynamic weight adjustment. The constraint reinforcement stage needs to increase the weight of the regularization term to force physical conservation. At the same time, adversarial training is added during model training, and PGD attacks are used to add perturbations in the rainfall sequence to simulate extreme rainstorm events.
[0116] The implemented model can be verified and deployed to optimize the scheme, and the physical consistency of the model is verified, including: mass conservation test and extreme scene test, monitoring whether the model appears unreasonable values such as negative water depth. At the same time, dynamic weight optimization is carried out on the model, and Bayesian optimization is used to automatically adjust the loss weight.
[0117] The three processes that can be implemented for urban floodwater points are: system deployment preparation stage, real-time prediction and early warning system building stage, and business scenario landing application stage.
[0118] Further, the system deployment and preparation stage: In the waterlogging area, according to the water level sensor, camera and other equipment, the data is transmitted through 5G technology, the deep learning model embedded with physical mechanism is connected with the meteorological bureau API, and the rainfall forecast and short-term rainfall prediction data are obtained in real time; Through the data preprocessing module of the model, the data is cleaned; use TensorRT to quantize the model, reduce the calculation amount in the prediction process, and deploy the model in the municipal cloud edge node, and at the same time optimize the model code according to the hardware platform. Real-time prediction and early warning system building stage: deploy the prediction service architecture, in which: execute high-frequency local prediction (such as single-point water depth) at the edge, run the macro model on the cloud by aggregating regional data, and use Docker container to encapsulate the prediction service; According to the historical research data, determine the early warning dynamic threshold to determine the early warning time, then generate the early warning map according to the early warning dynamic threshold combined with the GIS platform, and access the roadside control screen through the municipal interface to realize the display of the water depth. Business scenario landing stage: according to the government demand, the urban floodwater point application combined with software and hardware is connected to the city emergency command system or intelligent transportation system, and the digital twin platform is used to dynamically monitor the high-risk areas of urban floodwater, and the emergency dispatch is carried out according to the high-risk areas. The combination with the intelligent transportation system is to push the floodwater point information in real time through the API of Gaode map, use the Gaode route planning function to guide the vehicle to change the driving path in real time, and predict the water risk of the urban subway entrance, and according to the prediction result, notify the subway operator to close the subway entrance in advance.
[0119] Embodiment three
[0120] The urban floodwater point recognition method based on the deep learning model in this embodiment includes the following steps:
[0121] S1: Model construction preparation and data preprocessing; S2: Use Saint-Venant equation or equation set as physical constraint core, and discretize it; S3: Use PyTorch to develop differentiable physical modules; S4: Build deep learning network architecture, complete the three-stage hybrid architecture construction of "physical constraint layer + spatiotemporal feature extraction layer + multi-task output layer"; S5: Build a hybrid training strategy process, complete the training and verification of the deep learning model embedded with physical mechanisms; S6: Use the calibrated deep learning model embedded with physical mechanisms to identify and apply urban floodwater points.
[0122] S1: Model construction preparation and data preprocessing:
[0123] According to the geographical range and urban characteristics of the target area, the hourly rainfall intensity and cumulative amount data are obtained through meteorological monitoring stations, combined with real-time water level and flow records of hydrological stations; 30-meter resolution digital elevation model (DEM) and land use type raster data are extracted using satellite remote sensing and GIS platform, and municipal engineering database is used to synchronize drainage pipe network topology (pipe diameter, slope) and road network vector data. Historical water accumulation point data are collected by Internet of Things sensors, including: spatiotemporal location, water depth, and submerged area information.
[0124] Then, when preprocessing the collected data, use the Pandas library to remove duplicate records, and use the 3σ principle to identify and correct outliers (such as negative water depth). Perform spatiotemporal alignment on the spatiotemporal heterogeneous data: convert rainfall data to 1 km grid through Kriging interpolation, hydrological data to 10-minute interval through linear interpolation, and DEM data to the same resolution. Use Min-Max normalization to scale the input features, the calculation formula is as follows:
[0125]
[0126] Then, some features are enhanced, time series sliding window (window length 6 hours, step 1 hour) is used to expand data, and random noise injection (±5% amplitude) is used to improve robustness. Finally, the data is divided into training set, validation set and test set in the ratio of 7:2:1, ensuring that the time of each data set does not overlap.
[0127] S2: Physical equation embedding and discretization:
[0128] The original Saint-Venant equation set is simplified to one-dimensional form along the main flow direction (X-axis), ignoring the vertical flow velocity component, and assuming that the pressure follows the hydrostatic distribution. By introducing characteristic length L, characteristic velocity U, and characteristic time T = L / U, the dimensionless equation set is obtained after eliminating the dimensional terms:
[0129]
[0130] where: h', u' are dimensionless water depth and velocity, S f is the friction slope, S0 is the terrain slope.
[0131] The space-time discretization operation is performed on the equation, and the implicit Euler method is used to discretize the time item (time step Δt = 10s), and the central difference method is used for spatial discretization (grid size Δx = 50m). The convection term in the momentum equation is discretized using a second-order upwind scheme to suppress numerical oscillations.
[0132] S3: Development of differentiable physical modules:
[0133] PyTorch is used as a deep learning differentiable framework, and necessary modules such as torch and torch.nn are imported, and then the time step, spatial step and other conditional parameters are initialized, and then the forward propagation logic of the module is defined, and the central difference method is used to update the mass conservation equation, and the upwind difference method is used to update the momentum conservation equation, and finally the updated water depth and flow velocity are returned and the boundary conditions are processed, and the fixed boundary, free outflow boundary and periodic boundary are set, and the development of the differentiable physical module is completed.
[0134] Then its boundary conditions are processed, and the solid wall boundary is achieved by mirror filling to achieve zero flux, and the open boundary uses LSTM to predict the external water level and dynamically updates the ghost grid value.
[0135] S4: Build deep learning network architecture, complete the three-stage hybrid architecture of "physical constraint layer + space-time feature extraction layer + multi-task output layer":
[0136] In the process of multi-modal feature extraction, the spatial feature branch: U-Net inputs DEM, pipe network density and rainfall spatial distribution (256x256 grid), and the encoder uses ResNet-18 to extract multi-scale features, and the decoder restores spatial details through jump connection. Time feature branch: LSTM-TCN module processes rainfall sequence, and TCN layer contains 4 dilated convolution blocks (dilation coefficient [1,2,4,8]) to capture long-range dependencies.
[0137] Among them, the spatial feature extraction uses the U-Net structure to extract multi-scale features; the time feature extraction uses the LSTM-TCN hybrid module.
[0138] When setting the residual connection structure, the predicted water depth h pred , flow velocity u pred , v pred output by the backbone network are input into the Saint-Venant layer.
[0139] In the process of physical constraint fusion, the initial water depth h pred and flow velocity u pred, input the Saint-Venant solver to calculate the physical residual: R = || hphys -h pred || 2 , the residual is weighted and fused with the original features through the cross-attention mechanism, and the attention weight is calculated as:
[0140]
[0141] Where: Q is the data feature projection, K is the physical residual projection, and d is the feature dimension.
[0142] Then increase the iterative correction mechanism, perform 3 prediction-correction cycles, and each cycle will feed back the physical residual to the backbone network, and the update formula is:
[0143]
[0144] Where: λ is the learnable step size coefficient.
[0145] S5: Training strategy and verification in stages:
[0146] The training process is divided into three stages: pre-training stage, joint fine-tuning stage, and constraint reinforcement stage, and appropriate adversarial training is added in the process to simulate extreme rainstorm events.
[0147] (1) Pre-training stage: freeze the physical module and only optimize the data matching loss.
[0148]
[0149] Then use the Adam optimizer (lr = 1e-3) to train the model, and the training times is 50 rounds.
[0150] (2) Joint fine-tuning stage: start the physical conservation loss: and the L2 regularization term, the total loss is:
[0151] L total = 0.7L data + 0.2L phys + 0.1||θ||2,
[0152] According to the learning rate reduction effect, reasonably arrange the training times.
[0153] (3) Constraint reinforcement stage: increase the physical loss weight to 0.5, and add the mass conservation hard constraint:
[0154] |ΔW / W0|<0.05,
[0155] If the constraint is violated, the parameter update is rejected and the learning rate is reduced.
[0156] After the training is completed, the model is physically consistent, the change of the total water quantity in the region is calculated, and the relative error of the total water quantity is required to be less than 5%, and the calculation formula is as follows:
[0157]
[0158] The relative error of the total water quantity is required to be less than 5%. Sensitivity analysis is performed on the deep learning model embedded with physical mechanism, the evaluation indexes before and after removing the terrain gradient feature are compared, and then the evaluation indexes before and after closing the physical constraint are compared. Determine the sensitivity of the influence of terrain gradient and physical constraint on the deep learning model embedded with physical mechanism.
[0159] S6: Application of deep learning model embedded with physical mechanism in prediction of urban floodwater accumulation points:
[0160] The application of the completed deep learning model in urban floodwater accumulation points mainly includes three processes, namely: system deployment preparation stage, real-time prediction and early warning system building stage, and business scenario landing application stage.
[0161] (1) System deployment and preparation stage: Install water level sensors and cameras and other equipment in urban flood-prone areas, use 5G technology to transmit the collected data in real time, and connect the model with the meteorological bureau API to obtain rainfall forecast data. After data access, the data preprocessing module of the model is used for processing. Then, use TensorRT to make the model lightweight, reduce the amount of calculation, and deploy the model on the municipal cloud edge node, and optimize the hardware platform, such as parallel computing and instruction set acceleration, to improve the running efficiency.
[0162] (2) Real-time prediction and early warning system building stage: Use the completed model to design the prediction service architecture, the edge is responsible for high-frequency local prediction (such as floodwater depth prediction in flood-prone areas), and the cloud aggregates research area data to run the macro model. At the same time, encapsulate the prediction service through Docker container. When generating early warning information, dynamically adjust the early warning threshold of the model according to historical data, determine the early warning time, and generate an early warning map combined with the GIS platform, and access the roadside control screen through the municipal interface to realize real-time display of the floodwater depth.
[0163] (3) Business scenario landing application stage, mainly contains three parts: high-risk emergency dispatch, driving path planning, subway entrance waterlogging early warning. 1) The deep learning model embedded with the physical mechanism is connected to the urban emergency command system, and the digital twin platform is used to dynamically monitor the urban floodwater risk area. According to the set threshold, the area with water depth exceeding 30cm is defined as a high-risk area, and the flood emergency dispatch is completed in advance according to the prediction result. 2) The deep learning model embedded with the physical mechanism is connected to the intelligent transportation system, and through the connection with the Gaode API, the predicted urban floodwater points are displayed on the Gaode map. Through the driving path planning function of the Gaode map, the floodwater point area is avoided, and the driving path planning is performed. 3) The deep learning model embedded with the physical mechanism is connected to the municipal service interface, and the subway entrance area is set as a high-frequency prediction area. According to the subway entrance terrain, the early warning threshold is set. When the prediction value exceeds the threshold, the subway department is communicated, and the subway operator is notified to close the subway operation port in advance.
[0164] Embodiment four
[0165] The embodiment also discloses a computer device, which comprises a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to realize the steps of the method in the embodiment one.
[0166] Embodiment five
[0167] The embodiment also discloses a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the method in the embodiment one.
[0168] Embodiment six
[0169] The embodiment also discloses a computer program product, which comprises a computer program, and the computer program is executed by a processor to realize the steps of the method in the embodiment one.
[0170] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts in each of the embodiments can be referred to each other. The difference between the embodiments is mainly described. Especially, for the method embodiment, since it is basically similar to the system embodiment, the description is relatively simple, and the related parts refer to the part of the system embodiment. It should be noted that, each technical feature of the above-mentioned embodiments can be combined arbitrarily, in order to make the description simple, each technical feature of the above-mentioned embodiments is not described all possible combinations, however, as long as the combination of these technical features does not exist contradictory, it should be considered that it is within the scope of the description.
[0171] The above merely provides the preferred embodiments of the present application, and the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed by the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for applying a deep learning model based on physical mechanism embedding to identify urban flooding waterlogging points, characterized in that: The following steps are involved: Collect basic data of the study area and perform preprocessing; The pre-processed basic data is used as input, and Saint-Venant equations are used as hydrodynamic equations for deformation processing. The deformed hydrodynamic equations are discretized and linearized using the finite difference method. Construct a differentiable physics module based on the discretized deformation hydrodynamic equations; Based on the differentiable physics module, a deep learning model is constructed, which includes a backbone network, a differentiable physics module, an attention-guided fusion module, an iterative correction mechanism, and a hybrid loss function; Pre-training, joint fine-tuning, and constrained reinforcement training are performed on deep learning models, and adversarial training is added during the training process to simulate extreme scenarios; Identify urban flood waterlogging points based on the trained deep learning model.
2. The method according to claim 1, characterized in that The basic data of the study area include: meteorological data, hydrological data, geographic information data, urban infrastructure data and historical waterlogging data. The basic data are classified into time data and spatial data and preprocessed.
3. The method according to claim 1, characterized in that The Saint-Venant equations are used as the hydrodynamic equations for deformation processing. The process of discretizing and linearizing the deformed hydrodynamic equations using the finite difference method includes: Ignoring the viscous force and the velocities in the Y and Z directions of the Saint-Venant equations, assuming that the pressure distribution is approximately the hydrostatic pressure, the Saint-Venant equations are dimensionless, and then linearized to complete the deformation of the Saint-Venant equations.
4. The method according to claim 3, characterized in that The Saint-Venant equations are used as the hydrodynamic equations for deformation processing, the deformed hydrodynamic equations are discretized using the finite difference method, and the linearization process also includes: The deformation hydrodynamic equations are time discretized based on the implicit Euler method, and the continuous time variables are discretized into a series of discrete time steps. The deformation hydrodynamic equations are spatially discretized based on the central difference method, and the continuous spatial domain is discretized into a finite number of grid elements or nodes.
5. The method according to claim 1, wherein The process of building a differentiable physics module based on the discretized deformed hydrodynamic equations includes: The PyTorch framework is used as the framework of the differentiable physics module. Then, relevant parameters are imported and the time step and space step are initialized. The discretized deformed hydrodynamic equations are adjusted to realize the automatic differentiation function. The forward propagation process of the solver is preset and the gradient is automatically calculated to achieve the compatibility of physical calculations and automatic differentiation. Based on the scope of the study area and the discretized deformed hydrodynamic equations, boundary conditions are set, the normal flux is set to zero on the solid wall boundary, the reflection condition is realized through ghost cells, the water level or flow is preset on the open boundary, and the ghost cell value is dynamically adjusted. Finally, the mass conservation equation is updated using the central difference method, and the momentum conservation equation is updated using the upwind difference method. The boundary conditions are adjusted based on the updated water depth and flow velocity to complete the construction of the differentiable physics module.
6. The method according to claim 1, characterized in that Based on the differentiable physics module, the process of building a deep learning model includes: The backbone network extracts spatial and temporal features, then performs a residual connection between the backbone network and the differentiable physics module. The data features extracted from the backbone network are input into the differentiable physics module, and the physical residual is output. The attention-guided fusion module uses a cross-attention mechanism to dynamically fuse the data features and the physical residual to complete the construction of the deep learning model. It also presets an iterative correction mechanism and a hybrid loss function to iteratively correct and optimize the deep learning model. The hybrid loss function includes a data matching term, a physical conservation term, and a regularization term.
7. The method according to claim 6, characterized in that The process of pre-training, joint fine-tuning, and constrained reinforcement training of a deep learning model includes: In the pre-training phase, the backbone network is trained using data matching terms. In the joint fine-tuning training phase, based on the pre-training, the physical conservation terms and regularization terms are activated, and these two terms are used as single and combined schemes to jointly fine-tune the deep learning model. In the constrained reinforcement training phase, the weight of the regularization term is increased to the preset threshold to enforce physical conservation, thereby completing the three-stage training process.
8. The method according to claim 1, characterized in that The process of identifying urban flooding waterlogging points based on the trained deep learning model includes: During the system deployment preparation phase, real-time access to data sources is performed, and model lightweighting and edge deployment are carried out. During the real-time prediction and early warning system construction phase, the trained deep learning model is used to design the prediction service architecture, and then early warning information is generated. During the business scenario application phase, high-risk emergency dispatch, driving route planning, and subway entrance water accumulation warnings are carried out based on the trained deep learning model.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Knowledge-driven urban drainage system liquid level prediction method and device and storage medium
CN121168769A
Underground water level change prediction method and system based on machine learning
CN121765398A
Physical mechanism and large model coupled urban inland inundation model parameter rapid calibration method
CN122264311A