Urban inland inundation real-time simulation method and system based on Transform and depth residual UNet model

By combining the Transformer and deep residual UNet models, the problems of low computational efficiency and insufficient spatiotemporal feature modeling in urban flooding simulation are solved, enabling real-time prediction and efficient early warning of urban waterlogging processes, and improving the city's disaster prevention and mitigation capabilities.

CN122021418APending Publication Date: 2026-05-12WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN UNIV
Filing Date
2026-01-16
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies for urban flooding simulation suffer from low computational efficiency, inability to meet real-time early warning requirements, and insufficient data-driven models for joint modeling of spatiotemporal features.

Method used

A real-time urban flood simulation method based on Transformer and deep residual UNet models is adopted. By integrating the long sequence modeling capability of Transformer with the spatial feature extraction advantage of deep residual UNet, and combining the attention module and multi-stage attention mechanism of visual Transformer, a deep learning model is constructed to achieve efficient fusion of terrain and rainfall data.

Benefits of technology

It enables real-time analysis of the spatiotemporal evolution of water accumulation in complex urban terrain, provides minute-level prediction support, enhances the dynamic early warning and emergency response capabilities for urban flooding risks, and significantly improves the level of intelligence in disaster prevention and mitigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122021418A_ABST
    Figure CN122021418A_ABST
Patent Text Reader

Abstract

The invention discloses an urban inland inundation real-time simulation method based on Transform and a depth residual UNet model, and the method comprises the following steps: collecting and processing basic geographic data and historical rainfall data of a research region, and constructing a multi-return-period rainstorm event; a pipe network operation and surface ponding data set is generated through an SWMM-LISFLOOD-FP coupling model; dividing a training set and a test set, and training a Transform-ResUnet deep learning model; and realizing waterlogging real-time simulation and performance verification based on actual or designed rainfall. According to the method, the advantages of Transform long sequence modeling capability and ResUnet spatial feature extraction are creatively fused, the problems that a traditional hydrodynamic model is low in calculation efficiency and cannot meet the real-time early warning requirement are effectively solved, and meanwhile the problems that an existing data driving model is insufficient in spatial and temporal feature joint modeling and the like are solved. Model output can analyze the waterlogging spatio-temporal evolution process under the complex urban terrain in real time, minute-level prediction support is provided for waterlogging risk dynamic early warning and emergency response decision making, and the intelligent prevention and control level of urban rainstorm disasters is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of urban flooding simulation technology, and in particular to a real-time urban flooding simulation method and system based on Transformer and deep residual UNet models. Background Technology

[0002] With the rapid development of urbanization, urban surfaces have become harder and underlying surface types more complex, making urban flooding a major problem that seriously threatens urban infrastructure and the safety of residents' lives. High-intensity, short-duration rainfall events lead to frequent urban waterlogging and flooding disasters. Therefore, developing efficient and accurate real-time simulation technology for urban flooding is of great practical significance for improving urban disaster prevention and mitigation capabilities.

[0003] Current urban flooding simulation methods mainly employ a hybrid modeling system that couples one-dimensional pipe network models with two-dimensional surface runoff models. One-dimensional models such as SWMM (Storm Flood Management Model) excel at simulating the hydraulic characteristics of pipe network systems, while two-dimensional models such as LISFLOOD-FP can accurately depict the spatial distribution of surface runoff. While this coupled approach can account for the hydraulic interaction between the pipe network and the surface, its dual numerical solution process generates a huge computational load, resulting in long simulation times that are difficult to meet the timeliness requirements of real-time early warning and emergency response.

[0004] In recent years, deep learning technology has provided new solutions for urban flooding simulation. Existing research attempts to replace traditional numerical calculations with data-driven models such as convolutional neural networks, but significant shortcomings remain in practical applications. These shortcomings primarily stem from the difficulty of conventional network architectures in simultaneously capturing the long-range dependencies of rainfall spatiotemporal sequences and the high-dimensional spatial features of urban terrain, resulting in insufficient accuracy in the dynamic simulation of rainstorm evolution. Therefore, constructing more efficient and accurate deep learning models has become a key issue in overcoming the bottlenecks in real-time urban flooding simulation technology. Summary of the Invention

[0005] To overcome the shortcomings of the existing technologies, this invention provides a real-time simulation method for urban flooding based on Transformer and deep residual UNet models. By integrating the long sequence modeling capabilities of Transformer with the spatial feature extraction advantages of deep residual UNet, it effectively solves the problems of low computational efficiency and inability to meet real-time early warning requirements of traditional hydrodynamic models. At the same time, it overcomes the problems of insufficient joint modeling of spatiotemporal features in existing data-driven models.

[0006] According to one aspect of the present invention, a real-time simulation method for urban flooding based on a Transformer and deep residual UNet model is provided, comprising: Acquire rainfall data, topographic data, historical water accumulation data, and masking information for the study area. The masking information is used to distinguish whether the data input into the deep learning model represents the real location within the study area. The acquired data is input into the trained deep learning model, which outputs a predicted future water accumulation situation. The deep learning model embeds a visual Transformer-based attention module on the backbone structure of the deep residual UNet network. The visual Transformer-based attention module adopts a combination of image patch embedding and a multi-stage attention mechanism. In the first stage of the multi-stage attention mechanism, water accumulation is guided by terrain, and in the second stage, fusion is driven by rainfall. The fused feature sequence is then processed by the deep residual UNet network to output the predicted future water accumulation situation.

[0007] As a further technical solution, the execution of the multi-stage attention mechanism also includes: In the first phase, a spatial encoder is used to guide water accumulation based on terrain. In the second stage, a time encoder is used to achieve rainfall-driven fusion.

[0008] As a further technical solution, the execution process of the first stage includes: The water accumulation data and topographic data are divided into image blocks to form two image block sequences; Self-attention calculations were performed on the water accumulation image patch sequence and the terrain image patch sequence respectively, and cross-attention calculations were performed based on the results of the two self-attention calculations.

[0009] As a further technical solution, the execution process of the second stage includes: The rainfall data is divided into image blocks to form an image block sequence; Self-attention calculation is performed on the sequence of rainfall image patches, and self-attention calculation is performed on the output of the spatial encoder. Cross-attention calculation is then performed based on the two self-attention calculation results, and the fused feature sequence is output.

[0010] As a further technical solution, the training of the deep learning model includes: Collect and process basic geographic data and historical rainfall data of the study area to design rainstorm events with different return periods; Based on the collected data, the SWMM model and LISFLOOD-FP model were used to simulate the pipeline operation and surface water accumulation in the study area under the design rainfall scenario, so as to construct a dataset; The deep learning model is trained and validated using the constructed dataset, and the trained deep learning model is output.

[0011] As a further technical solution, basic geographic data and historical rainfall data of the study area are collected and processed to design rainstorm events with different return periods, including: The study area acquires digital elevation data, drainage system data, historical rainfall data, and raster feature data calculated based on the digital elevation data. The raster feature data includes slope, direction, and flow gradient vector. Based on historical rainfall data, the annual maximum value method was used to sample historical rainfall, and the P-III type curve was used for fitting. The relevant parameters in the Chicago rain pattern storm intensity formula were estimated by the least squares method, the comprehensive rain peak location coefficient was determined and the storm intensity formula was calculated, and the corresponding rain pattern formula was derived. Based on the rain pattern formula, the cumulative precipitation and average precipitation in each period were calculated to obtain the design rainstorm scenarios under different return periods.

[0012] As a further technical solution, the SWMM model and LISFLOOD-FP model are used to simulate the pipeline network operation and surface water accumulation in the study area under the design rainfall scenario, including: Input the designed rainfall scenario into the SWMM model, extract the overflow time series of each node, and convert the coordinates of the overflow nodes and the overflow process into the format required by the LISFLOOD-FP model. Convert elevation data to the format required for the LISFLOOD-FP model; Input simulation conditions, run the LISFLOOD-FP model to obtain the surface water conditions at different times, and then construct a dataset suitable for deep learning models.

[0013] As a further technical solution, after obtaining the predicted future water accumulation situation, it also includes: The water depth and inundation area of ​​each region were statistically analyzed. The predicted results were compared with those generated by the hydrodynamic model to calculate the error. The change process lines of the water inundation area of ​​the deep learning model and the hydrodynamic model were compared to test the performance of the model.

[0014] According to one aspect of the present invention, a real-time urban flooding simulation system based on a Transformer and deep residual UNet model is provided, comprising: The data acquisition module is used to acquire rainfall data, topographic data, historical water accumulation data, and masking information of the study area. The masking information is used to distinguish whether the data input to the deep learning model represents the real location within the study area. A real-time simulation module is used to input the acquired data into a trained deep learning model and output a predicted future water accumulation situation. The deep learning model embeds a visual Transformer-based attention module on the backbone structure of a deep residual UNet network. This visual Transformer-based attention module uses a combination of image patch embedding and a multi-stage attention mechanism. In the first stage of the multi-stage attention mechanism, water accumulation is guided by terrain, and in the second stage, fusion is driven by rainfall. The fused feature sequence is then processed by the deep residual UNet network to output the predicted future water accumulation situation.

[0015] According to one aspect of the present invention, a non-transitory computer-readable storage medium is provided, the non-transitory computer-readable storage medium storing computer instructions that cause the computer to execute the described real-time urban flooding simulation method based on the Transformer and deep residual UNet model.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention innovatively integrates the long sequence modeling capability of Transformer with the spatial feature extraction advantages of deep residual Unet, effectively solving the problems of low computational efficiency and inability to meet real-time early warning requirements of traditional hydrodynamic models. At the same time, it breaks through the problems of insufficient joint modeling of spatiotemporal features in existing data-driven models.

[0017] 2. The model output of this invention can analyze the spatiotemporal evolution of water accumulation under complex urban terrain in real time, providing minute-level prediction support for dynamic early warning of urban flooding risks and emergency response decisions, and significantly improving the intelligent prevention and control level of urban rainstorm disasters. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating the real-time simulation method for urban flooding based on Transformer and deep residual UNet models provided in this embodiment of the invention; Figure 2 A schematic diagram illustrating the training process of a deep learning model provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a deep learning model provided in an embodiment of the present invention; Figure 4The following is a schematic diagram of the simulation results of the hydrodynamic model and the Transformer-ResUnet deep learning model provided in the embodiments of the present invention at the 60th minute of a 25-year return period 6-hour design rainfall. (a)-(c) are schematic diagrams of the hydrodynamic model, and (d)-(f) are schematic diagrams of the Transformer-ResUnet deep learning model. Figure 5 A schematic diagram illustrating the difference between the hydrodynamic model simulation results and the prediction results of the Transformer-ResUnet deep learning model provided in the embodiments of the present invention; Figure 6 A scatter plot of the peak water accumulation values ​​of each grid simulated by the hydrodynamic model provided in this embodiment of the invention and the peak values ​​corresponding to the prediction results of the deep learning model. Figure 7 A schematic diagram of the Nash efficiency coefficient (NSE) calculated for each grid cell in an embodiment of the present invention based on the prediction results of a deep learning model for water depth throughout the entire time period. Figure 8 This is a schematic diagram of the root mean square error (RMSE) provided in an embodiment of the present invention. Detailed Implementation

[0020] The terms “comprising” and “having”, and any variations thereof, in the specification, claims, and accompanying drawings of this invention are intended to cover a non-exclusive inclusion, such as a process, method, system, product, or apparatus that includes a series of steps or units, not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. In addition, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined to form new technical solutions. Such combinations are not bound by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0022] This invention provides a real-time simulation method for urban flooding based on Transformer and deep residual UNet models, referring to... Figure 1As shown, the method first acquires rainfall data, topographic data, historical water accumulation data, and masking information for the study area. The masking information is used to distinguish whether the data input to the deep learning model represents the true location within the study area. Next, the acquired data is input into the trained deep learning model, which outputs a predicted future water accumulation situation. The deep learning model embeds a visual Transformer-based attention module on the backbone structure of a deep residual UNet network. The visual Transformer-based attention module adopts a combination of image patch embedding and a multi-stage attention mechanism. In the first stage of the multi-stage attention mechanism, water accumulation is guided by topography, and in the second stage, fusion is driven by rainfall. The fused feature sequence is processed by the deep residual UNet network to output the predicted future water accumulation situation.

[0023] The deep learning model is built based on the Transformer and deep residual UNet models, referring to... Figure 2 As shown, its training process includes the following steps: Step 1: Collect and process basic geographic data and historical rainfall data of the study area to design rainstorm events of different recurrence periods; Step 2: Based on the collected data, use the SWMM and LISFLOOD-FP models to simulate the pipeline operation and surface water accumulation in the study area under the design rainfall scenario, and construct a dataset; Step 3: Divide the results of running the SWMM and LISFLOOD-FP models into training and testing sets, and use the training set data to train the Transformer-based and deep residual UNet (Transformer-ResUnet) model; Step four: Apply the trained deep learning model to actual rainfall or designed rainfall to simulate the flooding situation in the study area in real time and test the model performance.

[0024] Further, in step one, the collected basic data includes digital elevation data (DEM) of the study area, drainage system data, raster feature data calculated based on the DEM, and historical rainfall data from regional meteorological stations. The raster feature data calculated based on the DEM mainly refers to slope, azimuth, and the flow gradient vector obtained by calculating partial derivatives based on topography. Based on historical rainfall data, the annual maximum value method is used to sample historical rainfall, and a P-III type curve is used for fitting. The relevant parameters in the Chicago rainfall pattern storm intensity formula are estimated using the least squares method, the comprehensive rainfall peak location coefficient is determined, and the storm intensity formula is calculated. The corresponding rainfall pattern formula is derived, and the cumulative and average precipitation for each time period are calculated using this formula to obtain design storm scenarios under different return periods.

[0025] Furthermore, in step two, the SWMM and LISFLOOD-FP models are used to simulate the pipeline operation and surface water accumulation in the study area under the design rainfall scenario. The specific data set is as follows: SWMM generalizes storm runoff processes into runoff generation and confluence processes. For the runoff generation process, three different infiltration models can be used: Horton, Green-Ampt, and Curve Number. The calculation formula for the Horton model is: , In the formula, f t For soil t Infiltration rate at any given time; f c This represents the initial infiltration rate. f w To stabilize the infiltration rate; t For time; k This is the decay index.

[0026] The simulation of water flow in a pipeline involves solving one-dimensional unsteady flow equations to calculate the dynamic process of water flow within the pipeline, thereby obtaining the flow rate and water level at each moment. Its core is based on the Saint-Venant Equations, including the continuity equation and the momentum equation. The continuity equation describes the conservation of flow rate; for any segment of a drainage pipeline, its continuity equation can be expressed as: , In the formula, A c The cross-sectional area of ​​the pipe (m²) 2 ), Q c The flow rate in the pipe (m 3 / s), t For time (s), x c Here are the spatial coordinates (m) along the length of the pipe. q c External inflow flow rate per unit length of pipe (m 3 / s / m).

[0027] The momentum equation is used to describe the momentum change of water flow. Taking into account factors such as the inertia, gravity, and friction of the water flow, the momentum equation can be expressed as: , In the formula, V The velocity of the water flow inside the pipe (m / s). g Acceleration due to gravity (m / s²) 2 ), H The water level is in meters (m).S f The friction slope is usually calculated using the Manning formula.

[0028] The LISFLOOD-FP model uses a square grid as its computational unit, enabling hydrodynamic simulation of one-dimensional river channels and two-dimensional floodplains. The one-dimensional river channel solver in the LISFLOOD-FP model includes a moving wave solver and a spreading wave solver, both essentially simplified versions of the Saint-Venant equations: , In the formula, Q For flow rate (m) 3 / s); A The cross-sectional area of ​​the river channel (m²) 2 ); q Unit width flow rate (m 2 / s); S 0 represents the slope; R Wet perimeter (m); n This is the Manning coefficient; h Water depth (m); t Time (s); x This is the distance (m) from the fixed cross-section.

[0029] The two-dimensional floodplain solver includes a confluence solver, a flow-limiting solver, an adaptive solver, an accelerated solver, and a Roe solver. The water flow process is still discretized on a square grid and described using continuity and momentum equations as follows: , In the formula, h i,j for i , j Height of the free water surface at the grid boundary (m); Grid size (m); n This is the Manning coefficient; Q x , Q y For inter-mesh flow, Q y The calculation method and Q x similar; h f The water depth (m) represents the water flow depth between two grids.

[0030] The designed rainfall scenario was input into the SWMM model. The overflow time series of each node was extracted using the pyswmm package in Python. The coordinates of the overflow nodes and the overflow process were compiled into .bci and .bdy files required for LISFLOOD-FP execution. Elevation data was converted to .ascii format. The simulation conditions and simulation time were filled into the parameter .par file. After running the LISFLOOD-FP program, the surface water accumulation at different times was obtained and stored in .wd files. The water depth information in the files was extracted in batches using Python and then processed to construct a dataset suitable for input into the Transformer-ResUnet model. The dataset includes historical rainfall information, historical water accumulation information, topographic information, and a mask (composed of 0s and 1s; since the study area is not a regular shape, a mask is used to indicate whether a location is within the study area).

[0031] Furthermore, in step three, the specific steps for training the Transformer-ResUnet model using the training set data are as follows: ResUNet is a deep learning model that combines residual learning and the U-Net architecture. Its core idea is to alleviate the vanishing gradient problem in deep networks through residual connections, while utilizing the skip connections of U-Net to preserve multi-scale features. The ResUNet architecture can be divided into three parts: an encoder, a decoder, and skip connections. The encoder progressively extracts high-level semantic features, reducing the resolution. It consists of multiple residual blocks and max-pooling layers stacked alternately. At the end of each stage, max-pooling halves the resolution. The formula for the residual block is: , In the formula, x For the input feature map, F It is a combination of two convolutional layers (convolution + batch normalization + ReLU activation function); y This is the output of the residual block.

[0032] The decoder progressively restores spatial resolution by combining low-level details with high-level semantics; it consists of transposed convolutions and residual blocks. Skip connections concatenate the encoder's low-level feature maps with the decoder's high-level feature maps along the channel dimension, enhancing detail recovery capabilities.

[0033] To enhance the model's ability to model the evolution of urban waterlogging driven by complex terrain and time-varying rainfall, this invention embeds a visual Transformer-based attention module into the deep residual U-Net backbone structure. This module employs a combination of image patch embedding and a multi-stage attention mechanism, which can significantly improve the model's ability to capture long-range spatiotemporal dependencies and enhance the modeling accuracy of urban flooding evolution.

[0034] Reference Figure 3 As shown, the execution process of the image patch embedding + multi-stage attention mechanism structure combination is as follows: The first stage is implemented using a spatial encoder, which includes: dividing the water accumulation data and terrain data into image blocks to form two image block sequences; performing self-attention calculations on the water accumulation image block sequence and the terrain image block sequence respectively, and performing cross-attention calculations based on the results of the two self-attention calculations.

[0035] The second stage is implemented using a temporal encoder, which includes: dividing the rainfall data into image blocks to form an image block sequence; performing self-attention calculation on the rainfall image block sequence; performing self-attention calculation on the output of the spatial encoder; performing cross-attention calculation based on the two self-attention calculation results; and outputting the fused feature sequence to the deep residual U-Net encoder.

[0036] The specific components involved in the structural combination of image patch embedding and multi-stage attention mechanism are as follows: (1) Input representation and image embedding Let the number of original input features be... Where B is the batch size, C is the number of channels, and H and W are the spatial dimensions, the two-dimensional image of each channel is divided into segments of size [missing information]. Non-overlapping patches, totaling There are 10 patches. Each patch is flattened and linearly mapped to a vector of dimension D, and then an absolute position code E is added. pos : , In the formula, i = 1, 2, ..., N, and the final patch sequence is represented as follows: .

[0037] (2) Multi-head attention mechanism For an input sequence Z, a linear transformation yields a query, key, and value matrix: , Among them W Q W K W V Given trainable parameters, the self-attention output is: , To enhance expressiveness, this operation is expanded to output h concatenated headers: , in head i= Attention( Q i ,K i ,V i ).

[0038] (3) Transformer layer structure Each Transformer layer consists of a multi-head attention module, a feedforward fully connected network (MLP), and a residual structure, calculated as follows: , In the formula, LN represents Layernorm operation, MLP is a two-layer fully connected network, and GELU is used as the activation function.

[0039] (4) Multi-dimensional fusion of cross-attention mechanisms To couple the physical dependencies between multiple heterogeneous inputs (rainfall, topography, historical waterlogging status), this invention introduces a multi-stage cross-attention structure. Its core is to use one modality as the query and another modality as the key-value pair to achieve cross-modal guidance. In the first stage, the terrain guides the water accumulation: , In the second phase, rainfall drives fusion: , In the formula, W Q1 W K1 W V1 W Q2 W K2 W V2 Z is a trainable parameter. inundation Z represents the features of the water accumulation data after self-attention computation. elevation Z represents the features of the terrain data after self-attention computation. rain Z represents the features of the rainfall data after self-attention computation. stage1 Z represents the features calculated from water accumulation data and topographic data after cross-attention processing. stage2 For Z stage2 Features of rainfall data after cross-attention calculation.

[0040] Furthermore, in step four, the trained deep learning model is applied to actual rainfall or designed rainfall to simulate the flooding situation in the study area in real time. The specific performance tests of the model are as follows: The actual or designed rainfall, topographic information, masking information, and historical water accumulation information generated by the hydrodynamic model are compiled into the format required for model input and fed into the pre-trained model to predict future water accumulation. The water depth and inundation area of ​​each region are statistically analyzed. The predicted results are compared with those generated by the hydrodynamic model, and the error is calculated. The main error indicators include RMSE and R². 2 The performance of the model was tested by comparing the change process lines of the flooded area of ​​the deep learning model and the hydrodynamic model.

[0041] The present invention will be further described below with reference to specific embodiments, but these are not intended to limit the scope of the invention.

[0042] This embodiment selects a key area of ​​a city as a research example. Rainfall events with return periods of 2 years, 5 years, 10 years, 25 years, 50 years, and 100 years, and peak rainfall coefficients of 0.3, 0.5, and 0.7, respectively, were designed for a 2-hour duration. These events were input into the SWMM-LISFLOOD-FP coupled model to simulate urban flooding and create a rainstorm-waterlogging dataset. Waterlogging data, topographic data, pipe network data, and rainfall data were then input into the deep learning model Transformer-ResUnet to train the model. The trained model was then tested and evaluated.

[0043] The structure diagram of the Transformer-ResUnet deep learning model is as follows: Figure 3 As shown. Taking 2-hour rainfall with a 10-year return period as an example, the simulation results of the SWMM and LISFLOOD-FP models at different times (time periods 9, 12, and 18, corresponding to minutes 45, 60, and 90) and the prediction results of the Transformer-ResUnet model are as follows. Figure 4 As shown, the difference between the hydrodynamic model simulation results and the deep learning model prediction results is as follows: Figure 5 As shown in the figure, the scatter plot between the peak water accumulation values ​​of each grid simulated by the hydrodynamic model and the peak values ​​predicted by the deep learning model is as follows. Figure 6 As shown, the Nash efficiency coefficient (NSE) calculated for each grid cell based on the water depth prediction results of the deep learning model throughout the entire time period is as follows: Figure 7 As shown, the root mean square error (RMSE) is as follows: Figure 8 As shown.

[0044] The implementation of the various embodiments of the present invention is based on programmed processing through a device with processor functionality. Therefore, in practical engineering, the technical solutions and functions of the various embodiments of the present invention are encapsulated into various modules. Based on this reality, and building upon the above embodiments, the embodiments of the present invention provide a real-time urban flooding simulation system based on a Transformer and deep residual UNet model. This system is used to execute the real-time urban flooding simulation method based on a Transformer and deep residual UNet model described in the above method embodiments.

[0045] The system includes: a data acquisition module, used to acquire rainfall data, topographic data, historical water accumulation data and masking information of the study area, wherein the masking information is used to distinguish whether the data input to the deep learning model represents the real location within the study area; A real-time simulation module is used to input the acquired data into a trained deep learning model and output a predicted future water accumulation situation. The deep learning model embeds a visual Transformer-based attention module on the backbone structure of a deep residual UNet network. This visual Transformer-based attention module uses a combination of image patch embedding and a multi-stage attention mechanism. In the first stage of the multi-stage attention mechanism, water accumulation is guided by terrain, and in the second stage, fusion is driven by rainfall. The fused feature sequence is then processed by the deep residual UNet network to output the predicted future water accumulation situation.

[0046] The urban flooding real-time simulation system based on Transformer and deep residual UNet models provided in this invention addresses the shortcomings of existing technologies by employing several modules mentioned above. By integrating the long sequence modeling capabilities of Transformer with the spatial feature extraction advantages of deep residual UNet, it effectively solves the problems of low computational efficiency and inability to meet real-time early warning requirements of traditional hydrodynamic models. At the same time, it overcomes the problems of insufficient joint modeling of spatiotemporal features in existing data-driven models.

[0047] It should be noted that the system embodiments provided by the present invention are used not only to implement the methods in the above method embodiments, but also to implement the methods in other method embodiments provided by the present invention. The only difference is that corresponding functional modules are set. The principle is basically the same as that of the above system embodiments provided by the present invention. As long as those skilled in the art can improve the modules in the above system embodiments by referring to the specific technical solutions in other method embodiments and combining technical features to obtain corresponding technical means and technical solutions composed of these technical means, on the basis of the above system embodiments, and on the premise of ensuring the practicality of the technical solutions, they can obtain corresponding system-like embodiments for implementing the methods in other method-like embodiments.

[0048] Based on the same inventive concept as the foregoing embodiments, this embodiment of the invention also provides a non-transitory computer-readable storage medium storing computer instructions that cause the computer to execute the aforementioned real-time urban flooding simulation method based on the Transformer and deep residual UNet model.

[0049] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0050] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0051] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0052] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0053] In summary, this invention provides a real-time urban flooding simulation method based on the Transformer and deep residual Unet models, comprising the following steps: collecting and processing basic geographic data and historical rainfall data of the study area to construct multiple current rainstorm events; generating pipeline operation and surface water accumulation datasets through a SWMM-LISFLOOD-FP coupled model; dividing the training and testing sets and training the Transformer-ResUnet deep learning model; and implementing real-time flooding simulation and performance verification based on actual or designed rainfall. This invention innovatively integrates the long-sequence modeling capabilities of Transformer with the spatial feature extraction advantages of ResUnet, effectively solving the problems of low computational efficiency and inability to meet real-time early warning requirements of traditional hydrodynamic models, while also overcoming the shortcomings of existing data-driven models in jointly modeling spatiotemporal features. The model output can analyze the spatiotemporal evolution of water accumulation under complex urban terrain in real time, providing minute-level prediction support for dynamic early warning of urban flooding risks and emergency response decisions, significantly improving the intelligent prevention and control level of urban rainstorm disasters.

[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.

Claims

1. A real-time simulation method for urban flooding based on Transformer and deep residual UNet models, characterized in that, include: Acquire rainfall data, topographic data, historical water accumulation data, and masking information for the study area. The masking information is used to distinguish whether the data input into the deep learning model represents the real location within the study area. The acquired data is input into the trained deep learning model, which outputs a predicted future water accumulation situation. The deep learning model embeds a visual Transformer-based attention module on the backbone structure of the deep residual UNet network. The visual Transformer-based attention module adopts a combination of image patch embedding and a multi-stage attention mechanism. In the first stage of the multi-stage attention mechanism, water accumulation is guided by terrain, and in the second stage, fusion is driven by rainfall. The fused feature sequence is then processed by the deep residual UNet network to output the predicted future water accumulation situation.

2. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 1, characterized in that, The execution of the multi-stage attention mechanism also includes: In the first phase, a spatial encoder is used to guide water accumulation based on terrain. In the second stage, a time encoder is used to achieve rainfall-driven fusion.

3. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 2, characterized in that, The execution process of the first stage includes: The water accumulation data and topographic data are divided into image blocks to form two image block sequences; Self-attention calculations were performed on the water accumulation image patch sequence and the terrain image patch sequence respectively, and cross-attention calculations were performed based on the results of the two self-attention calculations.

4. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 3, characterized in that, The execution process of the second phase includes: The rainfall data is divided into image blocks to form an image block sequence; Self-attention calculation is performed on the sequence of rainfall image patches, and self-attention calculation is performed on the output of the spatial encoder. Cross-attention calculation is then performed based on the two self-attention calculation results, and the fused feature sequence is output.

5. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 1, characterized in that, The training of the deep learning model includes: Collect and process basic geographic data and historical rainfall data of the study area to design rainstorm events with different return periods; Based on the collected data, the SWMM model and LISFLOOD-FP model were used to simulate the pipeline operation and surface water accumulation in the study area under the design rainfall scenario, so as to construct a dataset; The deep learning model is trained and validated using the constructed dataset, and the trained deep learning model is output.

6. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 5, characterized in that, Collect and process basic geographic data and historical rainfall data of the study area to design rainstorm events with different return periods, including: The study area acquires digital elevation data, drainage system data, historical rainfall data, and raster feature data calculated based on the digital elevation data. The raster feature data includes slope, direction, and flow gradient vector. Based on historical rainfall data, the annual maximum value method was used to sample historical rainfall, and the P-III type curve was used for fitting. The relevant parameters in the Chicago rain pattern storm intensity formula were estimated by the least squares method, the comprehensive rain peak location coefficient was determined and the storm intensity formula was calculated, and the corresponding rain pattern formula was derived. Based on the rain pattern formula, the cumulative precipitation and average precipitation in each period were calculated to obtain the design rainstorm scenarios under different return periods.

7. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 6, characterized in that, The SWMM and LISFLOOD-FP models were used to simulate the pipeline network operation and surface water accumulation in the study area under the design rainfall scenario, including: Input the designed rainfall scenario into the SWMM model, extract the overflow time series of each node, and convert the coordinates of the overflow nodes and the overflow process into the format required by the LISFLOOD-FP model. Convert elevation data to the format required for the LISFLOOD-FP model; Input simulation conditions, run the LISFLOOD-FP model to obtain the surface water conditions at different times, and then construct a dataset suitable for deep learning models.

8. The real-time urban flooding simulation method based on Transformer and deep residual UNet model according to claim 1, characterized in that, After obtaining the predicted future water accumulation, it also includes: The water depth and inundation area of ​​each region were statistically analyzed. The predicted results were compared with those generated by the hydrodynamic model to calculate the error. The change process lines of the water inundation area of ​​the deep learning model and the hydrodynamic model were compared to test the performance of the model.

9. A real-time urban flood simulation system based on Transformer and deep residual UNet models, characterized in that, include: The data acquisition module is used to acquire rainfall data, topographic data, historical water accumulation data, and masking information of the study area. The masking information is used to distinguish whether the data input to the deep learning model represents the real location within the study area. A real-time simulation module is used to input the acquired data into a trained deep learning model and output a predicted future water accumulation situation. The deep learning model embeds a visual Transformer-based attention module on the backbone structure of a deep residual UNet network. This visual Transformer-based attention module uses a combination of image patch embedding and a multi-stage attention mechanism. In the first stage of the multi-stage attention mechanism, water accumulation is guided by terrain, and in the second stage, fusion is driven by rainfall. The fused feature sequence is then processed by the deep residual UNet network to output the predicted future water accumulation situation.

10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to execute the real-time urban flooding simulation method based on the Transformer and deep residual UNet model as described in any one of claims 1 to 8.