A method and system for propagating and predicting urban waterlogging state by terrain prior collaborative constraint
By combining static water inflow direction and dynamic direction quantity with a multi-scale coding structure to generate state transition weights, the problem of combining static and dynamic information in urban waterlogging state propagation prediction is solved. This enables pixel-by-pixel continuous prediction of urban waterlogging state and effective constraints on water accumulation growth, thereby improving the accuracy and continuity of prediction.
Patent Information
- Application Number
- CN202611379457.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies for predicting the propagation of urban flooding conditions struggle to effectively combine prior information on static water inflow direction with dynamic direction information to achieve continuous prediction on a pixel-by-pixel basis, and lack effective constraints on the neighborhood relationships of positive water accumulation growth.
By constructing a multi-scale coding structure, combining static water inflow direction priors and dynamic direction quantities to generate state transition weights, only the previous time step is transferred to decode historical states. In the training phase, partition-weighted water depth regression loss, time increment consistency loss, and terrain inflow direction consistency loss are constructed to achieve collaborative updating of model parameters.
It achieves continuous pixel-by-pixel prediction of urban flooding conditions, maintains spatial consistency, and effectively constrains the neighborhood relationship of water accumulation growth, thereby improving the accuracy and continuity of prediction.
Smart Images

Figure CN123179353A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent prediction of urban flooding and computer spatiotemporal data processing technology. Specifically, it relates to a method and system for predicting the propagation of urban flooding state under terrain prior collaborative constraints. Background Technology
[0002] Urban flooding prediction methods mainly include two technical approaches: hydrodynamic numerical simulation and data-driven prediction. Hydrodynamic numerical simulation calculates water accumulation evolution based on the exchange processes of rainfall-runoff generation, surface runoff, and drainage systems. In high-resolution, multi-scenario applications, parameter calibration is usually required, resulting in high computational costs. Data-driven prediction utilizes convolutional recurrent networks, attention networks, or encoder-decoder networks to learn the mapping between rainfall, topography, surface attributes, and water accumulation states, which can improve the efficiency of continuous inference.
[0003] In data-driven prediction, one type of method uses terrain as an input feature or as a basis for adjusting feature weights, while another type utilizes spatial attention to form location associations, or performs spatial diffusion based on slope, flow direction, and confluence information after obtaining the point prediction results. Multi-scale encoding-decoding and dynamic spatial connectivity can provide a foundation for spatiotemporal representation, but when decoding iteratively time-by-time within a regular grid, it is still necessary to clarify the state objects controlled by the terrain information and the spatial correspondence between the encoded state and the original pixels.
[0004] Therefore, the problem with the existing technology is: while maintaining the correspondence between the encoded state and the original pixel space, how to enable the prior static water inflow direction determined by the local relative elevation and the dynamic direction information determined by the current spatiotemporal state to jointly control the neighborhood propagation of the cyclic decoding historical state, and to enable the same prior static water inflow direction to continue to constrain the neighborhood water depth relationship corresponding to the positive growth of water accumulation during the training phase, thereby forming a pixel-by-pixel continuous prediction process in which state propagation and parameter learning cooperate with each other. Summary of the Invention
[0005] The purpose of this application is to provide a method and system for predicting urban flooding state propagation with terrain priors and collaborative constraints. This method constructs a rainfall sliding window for each prediction time, and obtains the in-situ encoded state through multi-scale encoding. In the decoding stage, the state transition weights are jointly determined by the static inflow direction prior and the dynamic direction quantity, and only the decoded historical state from the previous time step is transitioned, allowing it to complete cyclic updates together with the encoded state that maintains the original pixel spatial position. In the training stage, a partition-weighted water depth regression loss, an independent temporal increment consistency loss, and a terrain inflow direction consistency loss that reuses the static inflow direction prior are constructed sequentially, and the model parameters are jointly updated accordingly.
[0006] This invention is achieved through the following technical solution: In a first aspect, the present invention provides a method for predicting the propagation of urban flooding conditions under terrain-a priori collaborative constraints, comprising: Acquire measured or predicted rainfall sequences, digital elevation data, and static surface attributes covering the process to be predicted; for each prediction time, extract instantaneous and cumulative rainfall for K consecutive time moments from the measured or predicted rainfall sequences, and combine them with static surface attributes to form a multi-channel input; The local relative elevation relationship between the target pixel and each effective neighbor pixel is calculated based on digital elevation data, forming a terrain-oriented probability field that corresponds to the regular grid pixel by pixel and can be shared during the training and prediction stages. The multi-channel inputs are sequentially fed into a multi-scale convolutional recurrent coding structure according to the prediction time to generate coding states at different spatial scales; dynamic directional quantities that change with the current spatiotemporal state are generated based on the current decoding input, the corresponding scale coding state, the previous decoding history state, and static surface attributes. The terrain orientation probability field is used as a static water inflow direction prior and fused with the dynamic direction quantity to form a state transition weight. The state transition weight is used to only transition the previous decoding history state, so that the same-scale encoded state that maintains the original pixel spatial position and the transitioned decoding history state participate together in the current loop state update. The state transition and cyclic update are repeatedly performed at multiple decoding scales to restore the spatial resolution on a scale-by-scale and output the per-pixel water depth field at each prediction time. During the training phase, a partition-weighted water depth regression loss is constructed, the predicted increment and the actual increment are independently compared to construct a temporal increment consistency loss, and the static water direction prior is reused to construct the terrain for the direction consistency loss.
[0007] Preferably, forming a multi-channel input includes: Obtain continuous instantaneous rainfall and cumulative rainfall sequences covering the process to be predicted, and obtain digital elevation, impervious surface ratio, and spatial distribution data of drainage outlets or manholes corresponding to the prediction area; All types of data are unified to the same coordinate system and spatial grid, missing values and out-of-bounds values are processed and normalized respectively; for each prediction time, instantaneous rainfall and cumulative rainfall of K consecutive time moments are extracted, and then combined with static surface attributes along the channel dimension to obtain the spatiotemporal input tensor corresponding to that prediction time.
[0008] Preferably, the calculation of the local relative elevation relationship between the target pixel and each effective neighboring pixel based on digital elevation data includes: For each target pixel, a neighborhood is established, the positive elevation difference between the elevation of each neighboring pixel and the elevation of the target pixel is calculated, and the positive elevation difference is multiplied by the terrain sensitivity coefficient to obtain the static direction score of each neighboring direction. An invalid mask is set for the neighboring directions that exceed the prediction area, and the static direction fraction of the valid directions is normalized by the direction dimension to obtain the static inflow direction prior.
[0009] Preferably, obtaining the static direction scores for each neighbor direction includes:
[0010] In the formula, For static direction fractions, Indicates the target pixel, Indicates the direction of the neighbor. Represents a cell Normalized elevation at the location, Represents neighbor pixels Normalized elevation at the location, Indicates the terrain sensitivity coefficient. This is a positive part operator, which takes the larger value between the value inside the parentheses and zero.
[0011] Preferably, the fusion with dynamic direction quantities to form state transition weights includes: The prior logarithmic value of the static water inflow direction is combined with the dynamic direction quantity according to a preset fusion coefficient, and normalized in the direction dimension to obtain the direction weight corresponding to each neighbor direction. The same-scale encoded state and the migrated decoded historical state are used together for cyclic state updates, including: The decoding history states of adjacent pixels at the previous time step are weighted and aggregated based on directional weights to obtain the propagation decoding state of the target pixel. The encoded state, which maintains the spatial correspondence, and the propagated decoded state are input together into the convolutional gated recurrent unit to obtain the decoded state at the current time and current scale.
[0012] Preferably, obtaining the direction weights corresponding to each neighbor direction includes:
[0013] In the formula, The directional weights generated for the current spatiotemporal state. To normalize along the neighbor direction, The static-dynamic fusion coefficient is between 0 and 1. The static inflow direction is a priori. To prevent the positive stable term from being numerically unstable in logarithmic operations, It is a dynamic direction quantity generated from the current spacetime state.
[0014] Preferably, the weighted aggregation of the decoding history states of neighboring pixels at the previous time step based on direction weights includes:
[0015] In the formula, To propagate the decoding state, Let p be the set of effective neighbor directions. To decode historical states.
[0016] Preferably, the step of restoring spatial resolution by scale and outputting the pixel-by-pixel water depth field at each prediction time includes: Upsample the current scale's decoding output to the next decoding scale, and update the state together with the encoding state and decoding history state of that scale until the target spatial resolution is restored. Perform water depth regression on the final decoded features to obtain the pixel-by-pixel water depth field at each prediction time.
[0017] Preferred options also include: Calculate the predicted water depth increment and the actual water depth increment at adjacent prediction times, and construct the time increment consistency loss based on the difference between the two. Based on the prior knowledge of the static water inflow direction, a terrain inflow consistency loss is constructed: when the target cell experiences a positive water depth increase, a weighted penalty is applied to the positive difference between the predicted water depth of neighboring cells in the high probability direction of the static water inflow and the predicted water depth of the target cell. We construct a partition-weighted water depth regression loss and combine it with time increment consistency loss and terrain orientation consistency loss to update the multi-scale encoding, dynamic orientation generation, decoding historical state propagation and prediction output parameters.
[0018] Secondly, the present invention also provides an urban flooding state propagation prediction system with terrain prior collaborative constraints, used to execute the above-described urban flooding state propagation prediction method with terrain prior collaborative constraints, comprising: The input construction module is configured to acquire the measured or predicted rainfall sequence, digital elevation data and static surface attributes covering the process to be predicted, and to extract the instantaneous rainfall and cumulative rainfall for K consecutive moments for each prediction moment to form a multi-channel input; The terrain orientation probability field construction module is configured to calculate the local relative elevation relationship between the target cell and each effective neighbor cell based on digital elevation data, forming a terrain orientation probability field that corresponds to the regular grid cell by cell and can be shared during the training and prediction phases. The multi-scale coding module is configured to generate coding states at different spatial scales using a multi-scale convolutional recurrent coding structure; The dynamic direction generation module is configured to generate dynamic direction quantities based on the current decoding input, the corresponding scale encoding state, the decoding history state at the previous moment, and static surface attributes. The orientation state propagation module is configured to fuse terrain to form state transfer weights to the probability field and dynamic orientation quantities, only transfer the decoded historical state of the previous moment, and make the transferred decoded historical state and the same-scale encoded state that maintains the original pixel spatial position participate in the current loop state update. The multi-scale decoding and prediction output module is configured to perform decoding on a scale-by-scale and output a pixel-by-pixel water depth field; the collaborative constraint training module is configured to construct a partition-weighted water depth regression loss, a temporal increment consistency loss, and a terrain orientation consistency loss; and the model parameter update module is configured to update the model parameters based on the weighted sum and inverse of the three types of losses.
[0019] The technical solution of the present invention has at least the following advantages and beneficial effects: This invention constructs rainfall windows sequentially according to the predicted time and transmits the encoding and decoding states. At each decoding cycle, it fuses the static inflow direction prior with the dynamic direction value generated from the current state, and uses the resulting state transition weights to only transfer the previous decoding history state, ensuring the encoded state maintains the original pixel spatial position. During the training phase, the partition-weighted water depth regression loss measures the water depth error of water-filled and non-water-filled pixels respectively; the temporal increment consistency loss independently compares the predicted increment with the actual increment; and the terrain inflow direction consistency loss reuses the static inflow direction prior to constrain the neighborhood water depth relationship during the positive growth period of water accumulation, thereby coordinating the constraints on the predicted value, temporal variation, and spatial growth relationship. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 This is a schematic diagram of the system structure of the present invention; Figure 3 This is a comparison between the actual value of event70 in experimental region A of this invention and the predicted result of this project. Detailed Implementation
[0022] 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, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0023] The module division presented in this invention is a logical division. In actual applications, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0024] Furthermore, the connection, coupling, or communication in this invention can be a direct connection, coupling, or communication between related objects, or an indirect connection, coupling, or communication through other devices. Moreover, the connection, coupling, or communication between objects can be electrical or other similar forms, and is not limited in this invention. Independently described modules or sub-modules may or may not be physically separated; they can be implemented in software or hardware, and some modules or sub-modules can be implemented in software, with the processor calling the software to implement the function of these modules or sub-modules, while other modules or sub-modules are implemented in hardware, for example, through hardware circuits. Furthermore, some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs.
[0025] Please refer to Figure 1 This implementation method sequentially completes the time-by-time input construction, static inflow direction prior construction, multi-scale encoding and dynamic direction generation, decoding historical state propagation, and multi-scale prediction and collaborative constraint training according to steps S1 to S5, specifically including: Step S1: Obtain the measured or predicted rainfall sequence, digital elevation data, and static surface attributes covering the process to be predicted, and construct multi-channel inputs for each prediction time. Acquire measured or predicted rainfall sequences covering the process to be predicted, and perform spatial registration, gridding, and numerical normalization on rainfall, digital elevation, and static surface attributes from different sources to form a multi-channel input sequence arranged according to the prediction time.
[0026] Step S11: Obtain raw data. Obtain the continuous instantaneous rainfall sequence and cumulative rainfall sequence covering the process to be predicted; the rainfall sequence is either a measured rainfall sequence or a predicted rainfall sequence obtained from external rainfall forecasts. Simultaneously, obtain the digital elevation, impervious surface ratio, and spatial distribution data of drainage outlets or manholes corresponding to the prediction area.
[0027] Step S12: Forming a multi-channel input. For the predicted time t, the instantaneous rainfall and cumulative rainfall up to the predicted time are extracted from the rainfall sequence for K consecutive moments. These are then unified with the static attributes to the same coordinate system and spatial grid, and normalized respectively. Finally, they are combined according to the channel dimension to form a spatiotemporal input tensor X_t. The input tensors for each predicted time are fed into the model in chronological order, and the encoding and decoding state of the model is passed between adjacent predicted times.
[0028] Step S2: Construct a static water inflow direction prior. Based on digital elevation data, calculate the local relative elevation relationship between the target pixel and each effective neighbor pixel to form a terrain inflow probability field corresponding to each pixel of the regular grid. This terrain inflow probability field is used as a static water inflow direction prior for subsequent state propagation and terrain inflow consistency loss. Step S21: Calculate the static orientation score. For each target pixel, establish a neighborhood, calculate the positive elevation difference between the elevation of each neighboring pixel and the elevation of the target pixel, and multiply the positive elevation difference by the terrain sensitivity coefficient to obtain the static orientation score of each neighboring orientation.
[0029]
[0030] In the formula, For static direction fractions, Indicates the target pixel, Indicates the direction of the neighbor. Represents a cell Normalized elevation at the location, For the normalized elevation of the target cell and its neighboring cells, Indicates the terrain sensitivity coefficient. It is a positive part operator, which takes the larger value between the value inside the square brackets and zero.
[0031] Step S22: Generate static inflow direction prior. Set invalid masks for neighboring directions that exceed the prediction area, and normalize the direction dimension of the static direction scores of the valid directions to obtain the static inflow direction prior.
[0032] The prior static water inflow direction is calculated according to the following formula:
[0033] in, Represents the target pixel The set of valid neighbor directions; and Both represent valid neighbor direction indices; Indicates along direction With the target pixel Neighboring neighbor pixels; Indicates direction The corresponding static water inflow direction score; This represents the prior static incoming water direction obtained by exponentially normalizing the static direction scores within the valid direction set, i.e., neighboring pixels. Along direction To target pixel Provides the relative probability of incoming water. Neighboring directions located outside the prediction area boundary are not included. It does not participate in normalization. When adapting the static water inflow direction prior to different decoding scales, spatial resampling is first performed according to the corresponding scale, and then normalization is performed again in the direction dimension so that the sum of the probabilities of each effective direction of each pixel is 1.
[0034] Step S23: The output static inflow direction prior is directly determined by the local relative elevation, which is used in subsequent step S4 to provide a stable neighborhood migration basis for the decoding history state at the previous moment, and in step S54 to constrain the neighborhood water depth relationship during the positive growth of water accumulation. The dynamic direction quantity generated in step S3 changes with the current input, encoding state and decoding history state, and is used to perform time-varying correction on the static inflow direction prior.
[0035] State transition weights apply only to the decoded historical states that carry temporal memory, while the encoded states at the same scale maintain their original pixel spatial positions. Thus, the current-scale spatial representation transmitted by the jump connection maintains spatial anchoring, while the transitioned historical states carry temporal information transmitted from adjacent pixels along terrain-related directions. The two types of states perform mutually defined functions in the cyclical update process.
[0036] Step S3: Perform multi-scale coding and generate dynamic directional quantities. The multi-channel inputs for each prediction time generated in step S1 are fed into the multi-scale convolutional recurrent coding structure in chronological order to generate coding states at different spatial scales; then, combined with the current decoding input, the corresponding scale coding state, the decoding history state at the previous time step, and static surface attributes, dynamic directional quantities are generated. Step S31: Perform multi-scale spatiotemporal coding. Update the coding state using convolutional recurrent coding units at multiple spatial scales; the output of the previous scale is downsampled and input into the next scale, and the coding state of each scale is passed to the decoding end of the corresponding scale through skip connections.
[0037] Step S32: Generate dynamic direction quantities. At at least one decoding scale, combine the current decoding input, the corresponding scale encoding state, the previous decoding history state, and the scale-matched static surface attributes, and obtain the dynamic direction quantities of each neighboring direction through convolution mapping.
[0038] Step S4: Form state transition weights and update the decoding state. The static water direction prior formed in step S2 is fused with the dynamic direction quantity generated in step S3 to obtain the state transition weights; the state transition weights are used to transition only the decoding history state of the previous moment, and then the same-scale encoded state that maintains the original pixel spatial position and the transitioned decoding history state are used together to complete the current loop state update; Step S41: Form directional weights. Combine the prior logarithmic value of the static inflow direction with the dynamic direction value according to a preset fusion coefficient, and normalize it in the direction dimension to obtain the directional weights corresponding to each neighbor direction.
[0039] The static-dynamic fusion direction weights are calculated according to the following formula:
[0040] In the formula, For the target pixel at the current decoding time In direction State transition weights on; This indicates normalization along the effective neighbor direction; The static-dynamic fusion coefficient has a value range of [0,1]. The static direction of incoming water is a priori; This is a numerically stable term greater than 0, used to avoid inputting 0 in logarithmic operations; This is a dynamic directional quantity generated based on the current decoding input, the corresponding scale encoding state, the previous decoding history state, and static surface attributes. The static prior is logarithmically transformed and then fused with the dynamic directional quantity, so that the two jointly determine the state transition weights in the same directional scoring space.
[0041] Step S42: Propagate the decoding history state. The decoding history states of neighboring pixels at the previous time step are weighted and aggregated according to the direction weights to obtain the propagated decoding state of the target pixel; the encoding state at the corresponding scale is not propagated in the neighborhood using the aforementioned direction weights.
[0042] The propagation decoding state is calculated according to the following formula:
[0043] In the formula, To propagate the decoding state, Let p be the set of effective neighbor directions. To decode historical states, directional weights only apply to the decoded historical states; the encoded states at the corresponding scales retain their original spatial positions.
[0044] The directional weights only apply to the decoded historical state that carries the temporal memory; the encoded state at the same scale does not participate in neighborhood migration and maintains the original pixel spatial position. Therefore, the propagated decoded historical state carries the water inflow information of neighboring pixels, and the in-situ encoded state maintains the spatial representation of the current scale. Both are used together in step S43 to perform the current loop state update.
[0045] Steps S41 to S43 can be repeatedly executed at one or more decoding scales and continuous prediction times; the decoding state obtained at the current time is saved as the decoding history state at the next prediction time, thereby forming a state chain that is continuously passed along the prediction time.
[0046] Step S43: Update the current decoding state. Input the encoding state that maintains spatial correspondence and the propagation decoding state into the convolutional gated recurrent unit to obtain the decoding state at the current time and scale.
[0047] Step S5: Perform multi-scale prediction and collaborative constraint training. Recover the spatial resolution on a scale-by-scale and generate the pixel-by-pixel water depth field at each prediction time. Based on this, construct the water depth regression loss, temporal increment consistency loss, and terrain orientation consistency loss. Step S5: Perform multi-scale prediction and collaborative constraint training. Recover the spatial resolution on a scale-by-scale and generate the pixel-by-pixel water depth field at each prediction time. Based on this, construct the partition-weighted water depth regression loss, temporal increment consistency loss, and terrain orientation consistency loss in sequence. First, steps S51 and S52 complete multi-scale decoding, water depth output, and calculation of partition-weighted water depth regression loss. Then, step S53 independently compares the predicted water depth increment with the actual water depth increment. Step S54 reuses the prior constraint of the static inflow direction from step S2 to determine the neighborhood water depth relationship during the positive water growth period. Finally, step S55 weights and combines the three types of losses and updates the model parameters. The above losses are not calculated during the inference phase.
[0048]
[0049] in, This represents pixel-by-pixel multiplication; Indicates the first result obtained after gating. Predicted pixel-by-pixel water depth field at each time point; This represents the ungated water depth regression result output by the water depth branch; This represents the per-pixel flooding probability of the branch output for the water accumulation range; Indicates will Cut off to interval [ ,1]; The lower bound of the gating probability is greater than 0 and less than 1. Soft gating multiplicatively adjusts the regression results with the flooding probability and does not impose a non-negativity constraint on the ungated regression results.
[0050] Step S51: Perform multi-scale decoding. Upsample the decoding output of the current scale to the next decoding scale, and update the state together with the encoding state and decoding history state of that scale until the target spatial resolution is restored.
[0051] Step S52: Generate flood depth prediction results and construct a partition-weighted flood depth regression loss. Perform flood depth regression on the final decoded features to obtain ungated water depth regression results; optionally, generate a flood probability field using parallel branches and perform pixel-by-pixel soft gating with a flood probability having a positive lower bound. Using the gated predicted flood depth field and the actual flood depth field as inputs, calculate the mean square error of flooded pixels and non-flooded pixels respectively, and increase the weight of the flooded pixel error in the training objective.
[0052] The partition-weighted water depth regression loss is calculated according to the following formula:
[0053] In the formula, L_reg represents the partition-weighted regression loss for water depth; MSE_{Y>0} and MSE_{Y≤0} represent the mean square error calculated on the sets of pixels with true water depth greater than 0 and not greater than 0, respectively; α represents the water depth pixel error weight; Y represents the predicted water depth field; Y represents the actual water depth field. If any set of pixels is empty, the mean square error corresponding to that set is set to 0 to avoid generating invalid values.
[0054] Step S53: Construct time increment consistency constraints. Calculate the predicted water depth increment and the actual water depth increment at adjacent prediction times, and construct the time increment consistency loss based on the difference between the two, so that the model learns the continuous changes in water accumulation and receding.
[0055] The time increment consistency loss is calculated according to the following formula:
[0056] In the formula, For time increment consistency loss, To predict the total number of time points, Predict the water depth field at time t. Predict the water depth field at time t-1. Let be the actual water depth field at time t. The true water depth field at time t-1 is represented by this loss metric, which measures the difference between the predicted water depth increment and the true water depth increment.
[0057] Step S54: Construct terrain inflow consistency constraints. Reuse the static inflow direction prior obtained in step S2; when the target pixel experiences a positive water depth increase, apply a weighted penalty to the positive difference between the predicted water depth of neighboring pixels in the high-probability direction of static inflow and the predicted water depth of the target pixel, and obtain the terrain inflow consistency loss.
[0058] To construct the terrain orientation consistency loss, let the number of neighboring directions involved in the loss calculation be K_d; this implementation uses an eight-neighborhood, therefore K_d=8. First, define the positive growth of the predicted water depth for the target pixel:
[0059] The terrain orientation consistency loss is calculated according to the following formula:
[0060] In the formula, Δ _t^+(p) represents the positive increase in predicted water depth of target pixel p from time t-1 to time t; _t(p) and _{t-1}(p) represent the predicted water depth of target pixel p at times t and t-1, respectively; L_topo represents the terrain orientation consistency loss; T represents the set of prediction times involved in the loss calculation, which can be all prediction times or a selected subset thereof; Ω represents the effective pixel set; K_d represents the number of neighbor directions involved in the loss calculation, in this embodiment K_d=8; D_p represents the effective neighbor direction set of pixel p; q_{p,d} represents the static water inflow direction prior corresponding to direction d; _t(p+d) represents the predicted water depth of neighboring pixel p+d at time t; [x]_+=max(x,0) represents taking the positive part. Direction number normalization makes the weighted penalty of the eight directions averaged by direction.
[0061] Step S55: Jointly update model parameters. The partition-weighted water depth regression loss constructed in Step S52, the time-increment consistency loss in Step S53, and the terrain-direction consistency loss in Step S54 are weighted and combined to update the model parameters. Specifically, the static water direction prior is used for the decoding history propagation in Step S41 and the terrain-direction consistency loss in Step S54; the time-increment consistency loss in Step S53 only compares the predicted water depth increment with the actual water depth increment.
[0062]
[0063] in, and These represent the weights of the time consistency term and the terrain consistency term, respectively.
[0064] During the training phase, the rainfall sliding window and static surface attributes for each prediction time are input sequentially according to steps S1 to S5. Multi-scale encoding, dynamic direction generation, state transition weight fusion, decoding historical state propagation, multi-scale water depth output, and calculation of three types of losses are performed, and the model parameters are updated in reverse based on the joint loss. During the inference phase, the model parameters and static inflow direction priors are fixed. For each prediction time, an input window is constructed from the measured or predicted rainfall sequence covering the process to be predicted. At the same time, the encoding and decoding states are propagated along time to generate a pixel-by-pixel water depth field.
[0065] The model directly generates a dense, pixel-by-pixel water depth field during a unified grid recursion process, with predictions obtained from pixel-by-pixel regression of the finest-scale decoded features. The terrain orientation probability field can be pre-computed on the same digital elevation grid and shared during the training phase and continuous prediction time, thus maintaining consistency in the terrain constraint caliber.
[0066] Therefore, the prior knowledge of the same static water inflow direction participates in the formation of state transition weights during the forward propagation stage, enabling the decoded historical state from the previous moment to propagate directionally according to the local topographic direction and combined with the current spatiotemporal state. During the training stage, this prior knowledge further participates in the topographic direction consistency loss, ensuring that the neighborhood water depth relationship during positive water accumulation is supervised by information from the same source direction. The temporal increment consistency loss independently compares the predicted increment with the actual increment, without using the static water inflow direction prior. The encoded state maintaining the original pixel spatial location and the propagated state carrying neighborhood water inflow information jointly complete the cyclical update, thus forming a seamless state propagation and parameter learning process.
[0067] like Figure 2 As shown, the present invention also provides an urban flooding state propagation prediction system with terrain prior collaborative constraints, used to execute the above-described urban flooding state propagation prediction method with terrain prior collaborative constraints, comprising: The input construction module is configured to acquire the measured or predicted rainfall sequence, digital elevation data and static surface attributes covering the process to be predicted, and to extract the instantaneous rainfall and cumulative rainfall for K consecutive moments for each prediction moment to form a multi-channel input; The terrain orientation probability field construction module is configured to calculate the local relative elevation relationship between the target cell and each effective neighbor cell based on digital elevation data, forming a terrain orientation probability field that corresponds to the regular grid cell by cell and can be shared during the training and prediction phases. The multi-scale coding module is configured to generate coding states at different spatial scales using a multi-scale convolutional recurrent coding structure; The dynamic direction generation module is configured to generate dynamic direction quantities based on the current decoding input, the corresponding scale encoding state, the decoding history state at the previous moment, and static surface attributes. The orientation state propagation module is configured to fuse terrain to form state transfer weights to the probability field and dynamic orientation quantities, only transfer the decoded historical state of the previous moment, and make the transferred decoded historical state and the same-scale encoded state that maintains the original pixel spatial position participate in the current loop state update. The multi-scale decoding and prediction output module is configured to repeatedly perform state propagation and cyclic updates at multiple decoding scales, recover spatial resolution scale by scale, and output a pixel-by-pixel water depth field. The collaborative constraint training module is configured to construct a partition-weighted water depth regression loss, an independent comparison of the predicted increment and the actual increment time increment consistency loss, and a terrain direction consistency loss that reuses the prior static water direction, and then weights and combines the three types of losses. The model parameter update module is configured to update the parameters related to multi-scale encoding, dynamic direction generation, decoding historical state propagation, and prediction output in reverse order based on the weighted sum of the three types of losses.
[0068] Steps S1 to S5 will be further explained below with reference to a training and inference example and a prediction result example.
[0069] Example 1: Urban grid-based prediction of waterlogging depth. This embodiment uses urban flooding data from a 400×560 regular grid in experimental area A as an example. The prediction process includes 72 prediction time points; the model adopts a 400-round training plan with a batch size of 1, a random seed of 42, an initial learning rate of 0.001, and a minimum learning rate of 0.0001. The following implementation process corresponds to steps S1 to S5.
[0070] Step S1: Construct spatiotemporal input. In this embodiment, following steps S11 and S12, 15-channel input tensors are constructed for each of the 72 prediction times, and then fed into the multi-scale spatiotemporal encoder in chronological order.
[0071] Step S11: Obtain raw data. Obtain the measured rainfall sequence covering 72 predicted times; construct a sliding window of length K=6 for each predicted time, the window includes the instantaneous rainfall and corresponding cumulative rainfall for 6 consecutive times, and read three types of static data: digital elevation, impervious surface ratio and drainage outlet spatial distribution, forming a total of 12 rainfall channels and 3 static channels.
[0072] Step S12: Generate multi-channel input. Unify the above data to a 400×560 grid. Use 5.0 as the normalization upper limit for instantaneous rainfall, 100.0 as the normalization upper limit for cumulative rainfall, and 5000 mm as the normalization upper limit for water depth; perform grid alignment and normalization on digital elevation, impervious surface ratio, and drainage outlet distribution respectively. For each prediction time, combine the 12 rainfall channels and 3 static channels into an input tensor of shape 15×400×560.
[0073] Step S2: Construct a static water inflow direction prior. In this embodiment, following steps S21 and S22, the eight-directional static water inflow direction prior for each grid cell is calculated from the normalized digital elevation data, and this prior is reused throughout the prediction sequence.
[0074] Step S21: Calculate the static orientation score. An eight-neighborhood is formed using the top, bottom, left, right, and four diagonal pixels surrounding the target pixel. The number of orientations is set to 8, and the terrain sensitivity coefficient β is set to 4.0. For each effective neighbor orientation, the positive elevation difference between the neighbor pixel and the target pixel is calculated and multiplied by 4.0 to obtain the static orientation score.
[0075] Step S22: Generate a static inflow direction prior. For directions outside the grid boundary, set an invalid mask; for valid directions, perform softmax normalization in all eight directions. After adapting the prior to different decoding scales, re-normalize along the direction dimension.
[0076] Step S3: Perform multi-scale spatiotemporal coding and generate dynamic direction variables. In this embodiment, a three-level convolutional cyclic coding state is constructed according to step S31, and eight-directional dynamic direction variables are generated at the decoding end according to step S32.
[0077] Step S31: Perform multi-scale spatiotemporal coding. Three spatial scales are set at the encoding end, with downsampling factors of 1, 2, and 2 respectively, corresponding to 64, 96, and 96 channels in the convolutional gated loop state. The first stage maintains a 400×560 resolution, while the second and third stages progressively reduce the spatial resolution. The encoding states at the three scales are sent to the corresponding decoding scales via skip connections.
[0078] Step S32: Generate dynamic direction variables. At the decoding scale with terrain propagation enabled, the current decoding input, the corresponding scale encoding state, the previous decoding history state, and the scale-matched digital elevation, impervious surface ratio, and drainage outlet distribution are combined and output into 8 channels using a 3×3 convolutional mapping. Each channel corresponds to a dynamic direction variable of a neighboring direction.
[0079] Step S4: Propagate the decoding history state and update the decoding state. In this embodiment, following steps S41 to S43, directional weights are first formed at each prediction time, then the decoding history state is propagated, and finally the current decoding state is updated.
[0080] Step S41: Form directional weights. The static-dynamic fusion coefficient λ is set to 0.7, the weight of the prior logarithmic term of the static inflow direction is 0.7, and the weight of the dynamic direction quantity is 0.3; the logarithmic operation uses ε=1×10 -6 As a stabilizing term, the fusion result is subjected to softmax normalization in eight directions.
[0081] Step S42: Propagate the decoding history state. For each target pixel, obtain the decoding history state of its eight neighboring pixels at the previous time step. Sum these states using the eight directional weights obtained in step S41 to obtain the propagated decoding state. The encoded state retains its original grid position and does not participate in the neighborhood weighting process.
[0082] Step S43: Update the current decoding state. The propagated decoding state and the corresponding scale encoding state are input into the convolutional gated recurrent unit. The current decoding state is calculated through the update gate and the reset gate, and this state is saved as the decoding history state for the next prediction time.
[0083] Step S5: Perform multi-scale prediction and collaborative constraint training. In this embodiment, following steps S51 to S55, the corresponding rainfall windows are read for each of the 72 prediction times, and the encoding and decoding status is passed along time. The three-level decoding, water depth output, partition-weighted water depth regression loss, time increment consistency loss, terrain orientation consistency loss, and parameter update are completed sequentially.
[0084] Step S51: Perform multi-scale decoding. The number of loop state channels at the three scales of the decoder are 96, 96, and 64 respectively, and the spatial upsampling factors are 2, 2, and 1 respectively. The deep decoding output is upsampled and input to the next scale, and is cyclically updated together with the encoding state and decoding history state of that scale, finally restoring the spatial resolution to 400×560.
[0085] Step S52: Generate water depth prediction results and construct a partitioned weighted water depth regression loss. The prediction head outputs single-channel water depth regression results and inundation probability results, using a probability lower limit of 0.2 for soft gating; the output is inversely transformed from normalized quantity to millimeters, and then converted back to meters for visualization. The mean square error is calculated separately for conditions where the actual water depth is greater than 0 and not greater than 0, with the water depth pixel error weight α set to 20; if any pixel set is empty, the mean square error corresponding to that set is counted as 0.
[0086] Step S53: Construct time increment consistency constraints. Compare the predicted water depth difference and the actual water depth difference between adjacent times in the 72 prediction times, calculate the time increment consistency loss using the L1 norm, and set the loss weight to 0.05.
[0087] Step S54: Construct terrain inflow consistency constraints. Reuse the eight-direction static water inflow direction prior obtained in step S2; when the target pixel experiences a positive water depth increase, perform a weighted calculation on the positive difference between the predicted water depth of neighboring pixels in the high-probability direction of static water inflow and the predicted water depth of the target pixel, and set the loss weight to 0.01.
[0088] Step S55: Jointly update model parameters. The partition-weighted water depth regression loss from step S52, the time-increment consistency loss from step S53, and the terrain loss from step S54 are weighted and summed, and then backpropagated. After training, inference is performed using the model parameters determined and saved during training.
[0089] Example 2: Prediction results of event70 rainfall in experimental region A. Event70 rainfall from the test set of experimental region A was selected. The model parameters determined after training in Example 1 were used, and the rainfall windows corresponding to 72 prediction times were input sequentially according to the inference process from steps S1 to S5. The water depth field was output at prediction times 1, 18, 36, and 72, as shown below. Figure 3 As shown; the four rows correspond to the four predicted times mentioned above, the left column is the actual water depth, and the right column is the predicted water depth for this project. All figures use a uniform 0-2.00 m color scale.
[0090] The coefficient of determination (R²) for this test event is 0.9417, the root mean square error is 0.0173 m, the mean absolute error is 0.0067 m, the peak coefficient of determination is 0.9535, and the critical success index is 0.7782. These indicators are used to illustrate the prediction accuracy under the conditions of this embodiment and are not intended to limit the invention to achieving the same values under other datasets, spatial resolutions, or rainfall scenarios.
[0091] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. This computer software product, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting urban flooding state propagation using terrain-based prior collaborative constraints, characterized in that, include: Acquire measured or predicted rainfall sequences, digital elevation data, and static surface attributes covering the process to be predicted; for each prediction time, extract instantaneous and cumulative rainfall for K consecutive time moments from the measured or predicted rainfall sequences, and combine them with static surface attributes to form a multi-channel input; The local relative elevation relationship between the target pixel and each effective neighbor pixel is calculated based on digital elevation data, forming a terrain-oriented probability field that corresponds to the regular grid pixel by pixel and can be shared during the training and prediction stages. The multi-channel inputs are sequentially fed into a multi-scale convolutional recurrent coding structure according to the prediction time to generate coding states at different spatial scales; dynamic directional quantities that change with the current spatiotemporal state are generated based on the current decoding input, the corresponding scale coding state, the previous decoding history state, and static surface attributes. The terrain orientation probability field is used as a static water inflow direction prior and fused with dynamic direction quantities to form state transition weights. The state transition weight is used to transition only the previous decoding history state, so that the same-scale encoded state that maintains the original pixel spatial position and the transitioned decoding history state participate together in the current loop state update. The state transition and cyclic update are repeatedly performed at multiple decoding scales to restore spatial resolution on a scale-by-scale and output the pixel-by-pixel water depth field at each prediction time. The encoding and decoding states of the model are passed sequentially along the prediction time, and the rainfall input at each prediction time is constructed from a rainfall measurement sequence or a rainfall prediction sequence covering the process to be predicted.
2. The method for predicting urban flooding state propagation based on topographic prior collaborative constraints according to claim 1, characterized in that, The formation of multi-channel input includes: Obtain continuous instantaneous rainfall and cumulative rainfall sequences covering the process to be predicted, and obtain digital elevation, impervious surface ratio, and spatial distribution data of drainage outlets or manholes corresponding to the prediction area; All types of data are unified to the same coordinate system and spatial grid, missing values and out-of-bounds values are processed and normalized respectively; for each prediction time, instantaneous rainfall and cumulative rainfall of K consecutive time moments are extracted, and then combined with static surface attributes along the channel dimension to obtain the spatiotemporal input tensor corresponding to that prediction time.
3. The method for predicting urban flooding state propagation based on topographic prior collaborative constraints according to claim 1, characterized in that, The calculation of the local relative elevation relationship between the target pixel and its effective neighboring pixels based on digital elevation data includes: For each target pixel, a neighborhood is established, the positive elevation difference between the elevation of each neighboring pixel and the elevation of the target pixel is calculated, and the positive elevation difference is multiplied by the terrain sensitivity coefficient to obtain the static direction score of each neighboring direction. An invalid mask is set for the neighboring directions that exceed the prediction area, and the static direction score of the valid directions is normalized by the direction dimension to obtain the static inflow direction prior.
4. The method for predicting urban flooding state propagation under terrain prior collaborative constraints according to claim 3, characterized in that, The static direction scores for each neighbor direction are obtained as follows: In the formula, For static direction fractions, Indicates the target pixel, Indicates the direction of the neighbor. Represents a pixel Normalized elevation at the location, For the normalized elevation of the target cell and its neighboring cells, Indicates the terrain sensitivity coefficient. It is a positive part operator, which takes the larger value between the value inside the square brackets and zero.
5. The method for predicting urban flooding state propagation based on terrain prior collaborative constraints according to claim 4, characterized in that, The state transition weights formed by fusing with dynamic direction variables include: The prior logarithmic value of the static water inflow direction is combined with the dynamic direction quantity according to a preset fusion coefficient, and normalized in the direction dimension to obtain the direction weight corresponding to each neighbor direction. The same-scale encoded state and the migrated decoded historical state are used together for cyclic state updates, including: The decoding history states of adjacent pixels at the previous time step are weighted and aggregated based on directional weights to obtain the propagation decoding state of the target pixel. The encoded state, which maintains the spatial correspondence, and the propagated decoded state are input together into the convolutional gated recurrent unit to obtain the decoded state at the current time and current scale.
6. The method for predicting urban flooding state propagation based on terrain prior collaborative constraints according to claim 5, characterized in that, The obtained direction weights corresponding to each neighbor direction include: In the formula, The directional weights generated for the current spatiotemporal state. To normalize along the neighbor direction, The static-dynamic fusion coefficient is between 0 and 1. The static direction of incoming water is a priori. To prevent the positive stable term from being numerically unstable in logarithmic operations, It is a dynamic direction quantity generated from the current spacetime state.
7. The method for predicting urban flooding state propagation based on topographic prior collaborative constraints according to claim 6, characterized in that, The weighted aggregation of the decoding history states of adjacent pixels in the previous time step based on direction weights includes: In the formula, To propagate the decoding state, Let p be the set of effective neighbor directions. To decode historical states.
8. The method for predicting urban flooding state propagation based on terrain prior collaborative constraints according to claim 7, characterized in that, The step-by-scale recovery of spatial resolution and output of the pixel-by-pixel water depth field at each prediction time includes: Upsample the current scale's decoding output to the next decoding scale, and update the state together with the encoding state and decoding history state of that scale until the target spatial resolution is restored. Perform water depth regression on the final decoded features to obtain the pixel-by-pixel water depth field at each prediction time.
9. The method for predicting urban flooding state propagation based on terrain prior collaborative constraints according to claim 8, characterized in that, Also includes: Calculate the predicted water depth increment and the actual water depth increment at adjacent prediction times, and construct the time increment consistency loss based on the difference between the two. Based on the prior knowledge of the static water inflow direction, a terrain inflow consistency loss is constructed: when the target cell experiences a positive water depth increase, a weighted penalty is applied to the positive difference between the predicted water depth of neighboring cells in the high probability direction of the static water inflow and the predicted water depth of the target cell. We construct a partition-weighted water depth regression loss and combine it with time increment consistency loss and terrain orientation consistency loss to update the multi-scale encoding, dynamic orientation generation, decoding historical state propagation and prediction output parameters.
10. A terrain-prior collaborative constraint-based urban flooding state propagation prediction system, characterized in that, A method for predicting urban flooding state propagation based on topographic prior collaborative constraints as described in any one of claims 1-9, comprising: The input construction module is configured to acquire the measured or predicted rainfall sequence, digital elevation data and static surface attributes covering the process to be predicted, and to extract the instantaneous rainfall and cumulative rainfall for K consecutive moments for each prediction moment to form a multi-channel input; The terrain orientation probability field construction module is configured to calculate the local relative elevation relationship between the target cell and each effective neighbor cell based on digital elevation data, forming a terrain orientation probability field that corresponds to the regular grid cell by cell and can be shared during the training and prediction phases. The multi-scale coding module is configured to generate coding states at different spatial scales using a multi-scale convolutional recurrent coding structure. The dynamic direction generation module is configured to generate dynamic direction quantities based on the current decoding input, the corresponding scale encoding state, the decoding history state at the previous moment, and static surface attributes. The orientation state propagation module is configured to fuse terrain to form state transition weights to the probability field and dynamic orientation quantities. The state transition weights are used to transition only the previous decoding history state, and the transitioned decoding history state and the same-scale encoded state that maintains the original pixel spatial position participate in the current loop state update. The multi-scale decoding and prediction output module is configured to perform decoding on a scale-by-scale and output a pixel-by-pixel water depth field; the collaborative constraint training module is configured to construct a partition-weighted water depth regression loss, a temporal increment consistency loss, and a terrain orientation consistency loss; and the model parameter update module is configured to update the model parameters based on the weighted sum and reverse of the three types of losses.
