A method for predicting maximum water depth in urban flooding

CN122986409APending Publication Date: 2026-10-27POWERCHINA ZHONGNAN ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611469635.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]传统城市内涝分析通常依赖水文水动力模型、排水管网模型、二维地表汇流模拟或人工经验分析,但预测准确度较低,计算资源消耗量较大

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986409A_ABST
    Figure CN122986409A_ABST
Patent Text Reader

Abstract

This application provides a method for predicting the maximum water depth in urban flooding, applicable to the field of urban flooding water depth prediction technology. The method includes: acquiring spatial raster feature data of a target rainfall event and acquiring rainfall process data of the target rainfall event; dividing the rainfall process data into multiple rainfall time windows based on a preset fixed time window length and time step; inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into a pre-trained water depth prediction model to obtain the predicted water depth value corresponding to each spatial raster in each rainfall time window; comparing the predicted water depth values ​​to obtain the maximum predicted water depth value corresponding to each spatial raster, which is used as the prediction result of the maximum water depth over at least a certain duration. By dividing the rainfall event into fixed-length time windows and taking the peak value for each raster, the model can uniformly handle rainfall events of different durations, eliminating the need to separately label the water depth for each time window and reducing supervision costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of urban flooding depth prediction, specifically to a method for predicting the maximum depth of urban flooding. Background Technology

[0003] Traditional urban flooding analysis typically relies on hydrological and hydrodynamic models, drainage network models, two-dimensional surface runoff simulations, or manual experience analysis, but the prediction accuracy is low and the computational resources consumed are large. Summary of the Invention

[0004] In view of the above problems, embodiments of this application provide a method for predicting the maximum water depth of urban flooding, comprising: acquiring spatial raster feature data of a target rainfall event, and acquiring rainfall process data for at least a period of time from the start point to the end point of the target rainfall event, wherein the at least a period of time includes the complete duration of rainfall; dividing the rainfall process data into multiple rainfall time windows based on a preset fixed time window length and time step, wherein each rainfall time window contains at least a portion of the rainfall process data; inputting the rainfall process data and spatial raster feature data corresponding to the multiple rainfall time windows into a pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial raster in each rainfall time window; comparing the water depth prediction value corresponding to each spatial raster in each rainfall time window to obtain the maximum water depth prediction value corresponding to each spatial raster; and using the maximum water depth prediction value corresponding to each spatial raster as the prediction result of the maximum water accumulation depth of the target rainfall event.

[0005] According to an embodiment of this application, based on a preset fixed time window length and time step, rainfall process data is divided into multiple rainfall time windows. Specifically, this includes: determining the rainfall duration corresponding to the rainfall process data based on the start and end points of at least one duration; when the rainfall duration is less than or equal to the fixed time window length, constructing a first rainfall time window using the start point as the start point of the time window, and padding the end of the first rainfall time window with zeros until the length of the first rainfall time window is equal to the fixed time window length; when the rainfall duration is greater than the fixed time window length, constructing multiple second rainfall time windows using the start point as the start point of the time window, based on the fixed time window length and time step, where the length of each second rainfall time window is equal to the fixed time window length, and the difference between the start points of adjacent second rainfall time windows is equal to the time step; when the last second rainfall time window does not cover the end point of the target rainfall event, using the end point as the end point of the rainfall time window, and constructing a third rainfall time window based on the fixed time window length.

[0006] According to embodiments of this application, rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows are input into a pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial raster in each rainfall time window. Specifically, this includes: determining the spatial raster size of the target rainfall event and the input size of the water depth prediction model; in response to the spatial raster size of the target rainfall event being larger than the preset input size of the water depth prediction model, determining multiple overlapping spatial prediction blocks from the spatial raster feature data based on a preset spatial step size, each spatial prediction block containing at least a portion of the spatial raster, and the multiple overlapping spatial prediction blocks covering all spatial rasteres; and configuring the spatial raster feature data corresponding to each spatial prediction block... The data and rainfall process data corresponding to multiple rainfall time windows are input into the water depth prediction model to obtain the water depth prediction blocks corresponding to each spatial prediction block. In response to the target spatial grid being covered by only a single spatial prediction block, the target water depth prediction value of the target water depth prediction block corresponding to the single spatial prediction block is determined, and the target water depth prediction value is used as the water depth prediction value of the target spatial grid. In response to the target spatial grid being covered by multiple spatial prediction blocks, the prediction average value of multiple water depth prediction blocks corresponding to multiple spatial prediction blocks at the spatial grid is determined, and the prediction average value is used as the water depth prediction value of the target spatial grid. The entire rainfall time window is traversed to obtain the water depth prediction value corresponding to each spatial grid in each rainfall time window.

[0007] According to embodiments of this application, before inputting rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into a pre-trained water depth prediction model, the method further includes: obtaining rainfall type information of the target rainfall event; determining a target water depth prediction model that matches the rainfall type information from multiple candidate water depth prediction models based on the rainfall type information, wherein each candidate water depth prediction model has matching rainfall type information; and inputting rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the pre-trained water depth prediction model, specifically including: inputting rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the target water depth prediction model.

[0008] According to an embodiment of this application, the water depth prediction model is a two-stream network model, which includes a spatial branch and a rainfall time branch. Rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows are input into a pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial raster in each rainfall time window. Specifically, this includes: extracting spatial features from the spatial raster feature data through the spatial branch; extracting temporal features from the rainfall process data corresponding to the rainfall time window through the rainfall time branch; fusing the spatial features and temporal features through the bottleneck layer of the two-stream network model to obtain fused features; and outputting the water depth prediction value corresponding to each spatial raster in each rainfall time window based on the fused features using the two-stream network model.

[0009] According to an embodiment of this application, before inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the pre-trained water depth prediction model, the method further includes: constructing a training sample data set for the initial water depth prediction model based on training sample data of multiple historical rainfall events, wherein the training sample data of each historical rainfall event includes historical spatial raster feature data, historical rainfall process data, and the maximum water depth label of each historical spatial raster; dividing the historical rainfall process data into multiple training time windows according to a fixed time window length and time step, wherein each training time window contains at least a portion of the historical rainfall process data; and training the initial water depth prediction model based on the historical spatial raster feature data, the maximum water depth label, and the historical rainfall process data corresponding to the multiple training time windows to obtain the water depth prediction model.

[0010] According to an embodiment of this application, an initial water depth prediction model is trained based on historical spatial grid feature data, maximum water depth labels, and historical rainfall data corresponding to multiple training time windows to obtain a water depth prediction model. Specifically, this includes: inputting historical spatial grid feature data and historical rainfall data corresponding to multiple training time windows into the initial water depth prediction model to obtain the historical water depth prediction value corresponding to each historical spatial grid in each training time window; determining the event-level loss of the target historical rainfall event based on the historical water depth prediction value corresponding to each historical spatial grid in each training time window and the maximum water depth label corresponding to each historical spatial grid; and updating the model parameters of the initial water depth prediction model based on the event-level loss to obtain the water depth prediction model.

[0011] According to an embodiment of this application, based on event-level loss, the model parameters of the initial water depth prediction model are updated to obtain the water depth prediction model. Specifically, this includes: for any target historical space grid, determining one or more target training time windows that obtain the maximum water depth prediction value at the target historical space grid; based on event-level loss, by calculating the maximum value at the target historical space grid, the corresponding loss gradient is transferred to the water depth prediction value of one or more target training time windows, and the model parameters of the initial water depth prediction model are updated to obtain the water depth prediction model.

[0012] According to an embodiment of this application, a training sample data set for an initial water depth prediction model is constructed based on training sample data from multiple historical rainfall events. Specifically, this includes: generating a first grid mask with a spatial range consistent with the historical spatial grid feature data, wherein the first grid mask is used to mark the first grid position involved in the loss calculation; and determining the event-level loss of the target historical rainfall event, specifically including: within the first grid mask, determining the event-level loss based on the difference between the maximum historical water depth prediction value and the maximum water accumulation depth label.

[0013] According to an embodiment of this application, within a first grid mask, an event-level loss is determined based on the difference between the maximum historical water depth prediction value and the maximum water accumulation depth label. Specifically, this includes: determining a dry area grid within the first grid mask based on the maximum water accumulation depth label and a preset water accumulation threshold; the dry area grid being a spatial grid where the maximum water accumulation depth label is less than the water accumulation threshold; determining the water depth difference between the maximum historical water depth prediction value and the water accumulation threshold corresponding to the dry area grid; determining a dry area exceeding threshold penalty term based on the water depth difference; and determining the event-level loss based on the basic fitting loss between the maximum historical water depth prediction value and the corresponding maximum water accumulation depth label, and the dry area exceeding threshold penalty term. Attached Figure Description

[0014] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which: Figure 1 A flowchart illustrating a method for predicting maximum water depth in urban flooding according to an embodiment of this application is shown.

[0015] Figure 2 A flowchart illustrating a method for determining water depth prediction values ​​according to an embodiment of this application is shown schematically.

[0016] Figure 3 A flowchart illustrating a method for determining the peak envelope of a time window according to an embodiment of this application is shown. Detailed Implementation

[0017] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0018] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0019] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0020] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0021] As used in this paper, the term "model" refers to a model that learns the relationship between inputs and outputs from training data, enabling it to generate corresponding outputs for a given input after training. Model generation can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs using multiple layers of processing units. A neural network model is an example of a deep learning-based model. In this paper, "model" may also be referred to as a "machine learning model," "learning model," "machine learning network," or "learning network," and these terms are used interchangeably.

[0022] It's important to note that the term "neural network" can refer to a machine learning network based on deep learning. A neural network processes input and provides corresponding output, typically consisting of an input layer, an output layer, and one or more hidden layers between them. Neural networks used in deep learning applications often include many hidden layers, increasing the network's depth. The layers of a neural network are connected sequentially, so that the output of the previous layer serves as the input to the next layer. The input layer receives the input to the neural network, while the output layer's output becomes the final output. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each processing the input from the layer above.

[0023] It should be understood that machine learning generally includes three phases: training, testing, and application (also known as inference). In the training phase, a given model is trained using a large amount of training data, iteratively updating parameter values ​​until the model can consistently generate inferences that meet the expected goals from the training data. Through training, the model can be considered to have learned the relationship between inputs and outputs (also known as the input-output mapping) from the training data. The parameter values ​​of the trained model are determined. In the testing phase, test inputs are applied to the trained model to test whether it can provide the correct output, thus determining the model's performance. In the application phase, the model can be used to process actual inputs based on the trained parameter values ​​to determine the corresponding output.

[0024] With the increasing frequency of extreme rainfall events and the intensification of urban construction, urban flooding disasters are having a more significant impact on road traffic, resident safety, infrastructure operation, and flood control scheduling. Traditional urban flooding analysis typically relies on hydrological and hydrodynamic models, drainage network models, two-dimensional surface runoff simulations, or empirical analysis. While these methods can provide relatively detailed results on inundation extent and water depth, they often suffer from problems such as long modeling cycles, complex parameter verification, and lengthy computation times in large-scale, multi-scenario analyses.

[0025] In existing urban flooding depth prediction technologies, deep learning models typically require input with a fixed time length. However, the duration of actual rainfall events varies, making it difficult to train events of different durations uniformly. Furthermore, existing supervision methods often rely on time-window or hour-by-hour water depth labels, while in practice, the maximum water depth of each grid within a single complete rainfall event can usually only be obtained through mechanism simulation, lacking intermediate state water depth labels for each time window. Under these conditions, establishing a backpropagation-enabled supervision relationship between the prediction results of multiple fixed-length time windows and the grid-by-grid maximum water depth labels of the complete rainfall event becomes a key issue restricting the model training effect.

[0026] To address the aforementioned technical problems, this application provides a method for predicting the maximum water depth in urban flooding. Figure 1 A flowchart illustrating a method for predicting maximum water depth in urban flooding according to an embodiment of this application is shown. Figure 1 As shown, the method for predicting the maximum water depth of urban flooding according to an embodiment of this application may include steps S110 to S150.

[0027] In step S110, spatial raster feature data of the target rainfall event is obtained, as well as rainfall process data for at least a period of time from the start point to the end point of the target rainfall event, where the at least a period of time includes the complete duration of rainfall.

[0028] The spatial raster feature data of the target rainfall event consists of multi-channel spatial attribute data corresponding to the spatial range of the target rainfall event. This multi-channel spatial attribute data can include seven channels: relative elevation, slope, cosine of slope aspect, sine of slope aspect, topographic humidity index, pipeline density, and manhole density.

[0029] The rainfall event data refers to a rainfall data sequence of at least one duration within the complete rainfall process from the start to the end of the event. Here, "at least one duration" can also refer to the complete duration of rainfall, i.e., the total duration of rainfall from the start to the end of the event.

[0030] Spatial raster feature data and rainfall process data are used together as inputs to the subsequent water depth prediction model to predict the spatial distribution of water depth for the target rainfall event.

[0031] In step S120, based on a preset fixed time window length and time step, the rainfall process data is divided into multiple rainfall time windows, each containing at least a portion of the rainfall process data.

[0032] Specifically, the rainfall process data can be divided according to a pre-approved fixed time window length and time step to obtain multiple rainfall time windows covering at least a period of rainfall process data, and each rainfall time window contains at least a portion of the rainfall process data.

[0033] Each rainfall time window has a fixed length and includes a first channel and a second channel. The first channel contains the rainfall at each time step, and the second channel contains the cumulative rainfall within the window from the window's starting point to the current time step. The cumulative channel for each rainfall time window uses the window's starting point as the zero point for accumulation, ensuring that time windows with different starting points use a consistent accumulation benchmark and simultaneously characterize the rainfall process and cumulative rainfall within the window.

[0034] In step S130, the rainfall process data and spatial grid feature data corresponding to multiple rainfall time windows are input into the pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial grid in each rainfall time window.

[0035] After obtaining the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows, the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows are input into a pre-trained water depth prediction model. The water depth prediction model is used to predict the spatial water depth distribution corresponding to each spatial raster in each rainfall time window based on the input rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows, thereby obtaining the water depth prediction value corresponding to each spatial raster in each rainfall time window.

[0036] In step S140, the predicted water depth for each spatial grid in each rainfall time window is compared to obtain the maximum predicted water depth for each spatial grid.

[0037] After completing the water depth prediction for all rainfall time windows, for each spatial grid location, the maximum water depth prediction value of that spatial grid in all rainfall time windows is obtained by comparing the water depth prediction values ​​corresponding to that spatial grid location in all rainfall time windows.

[0038] In step S150, the maximum water depth prediction value corresponding to each spatial grid is used as the prediction result of the maximum water depth of the target rainfall event within at least a certain period of time.

[0039] The maximum predicted water depth obtained after comparing each spatial grid is taken as the predicted maximum water depth of that spatial grid over at least a certain period of time. The predicted maximum water depth here represents the maximum water depth reached at each spatial grid location over that at least certain period of time, and does not correspond to the water depth at any given moment.

[0040] It should be noted that the term "prediction" in this application refers to the pre-trained water depth prediction model calculating the maximum water depth of a target rainfall event grid-by-grid based on rainfall event data and spatial grid feature data over at least a period of time. It does not mean extrapolating the water depth for subsequent periods based on partially occurring rainfall data without inputting subsequent rainfall data. Each rainfall time window outputs a grid-by-grid water depth prediction value. Finally, the maximum water depth prediction result for the entire target rainfall event is obtained by aggregating the grid-by-grid maximum values ​​of the water depth prediction values ​​from all rainfall time windows.

[0041] This embodiment divides the rainfall process into fixed-length time windows, enabling the water depth prediction model to uniformly handle rainfall events of different durations. The water depth prediction value output from each rainfall time window is directly output as the maximum water depth for the entire event after taking the maximum value for each grid, eliminating the need to separately label the water depth for each time window and reducing supervision costs. Taking the maximum water depth independently for each spatial grid can retain peak information that may come from different time windows at different locations, improving the accuracy of water depth prediction.

[0042] In one embodiment, based on a preset fixed time window length and time step, the rainfall process data is divided into multiple rainfall time windows. Specifically, this includes: determining the rainfall duration corresponding to the rainfall process data based on the event start point and event end point; if the rainfall duration is less than or equal to the fixed time window length, constructing a first rainfall time window with the event start point as the starting point, and padding the end of the first rainfall time window with zeros until the length of the first rainfall time window is equal to the fixed time window length; if the rainfall duration is greater than the fixed time window length, constructing multiple second rainfall time windows with the event start point as the starting point, based on the fixed time window length and time step, where the time window length of each second rainfall time window is equal to the fixed time window length, and the difference between the starting points of adjacent second rainfall time windows is equal to the time step; if the last second rainfall time window does not cover the event end point of the target rainfall event, using the event end point as the rainfall time window end point, and constructing a third rainfall time window based on the fixed time window length.

[0043] Based on the start and end points of the event, which represent at least a certain duration, the duration of rainfall corresponding to the rainfall process data is determined, and the rainfall time series duration is denoted as T. The rainfall time series duration T is used to determine the method and number of rainfall time windows.

[0044] The duration of the rainfall sequence, T, is compared with the fixed time window length, L. When T ≤ L, only one rainfall time window is generated. For ease of distinction, this type of rainfall time window is called the first rainfall time window. The first rainfall time window starts from the beginning of at least one duration (i.e., the first time step of the rainfall process data). Its effective part includes the rainfall process data of all T time steps. At the end of the first rainfall time window (i.e., from the Tth time step to the (L-1)th time step), it is padded with zero values ​​to make the length of the first rainfall time window reach the fixed time window length L.

[0045] When T>L, starting from the preset time step S (time step 0), second rainfall time windows are generated sequentially with starting points of 0, S, 2S, ... until the starting point of the last second rainfall time window generated by sliding does not exceed TL. The length of each second rainfall time window is L, and the interval between the starting points of adjacent time windows is S.

[0046] Check whether the last second rainfall time window generated by sliding according to time step S covers at least the end of a duration (i.e., time step T-1). If the end position (starting point + L-1) of the last second rainfall time window is less than T-1, then the second rainfall time window does not cover the end of the duration. In this case, a third rainfall time window is constructed with TL as the starting point. The length of the third rainfall time window is L, and its coverage range is from time step TL to time step T-1, ensuring that the end of the duration is covered by the third rainfall time window. When TL is exactly equal to the starting point of a second rainfall time window, the third rainfall time window coincides with the existing second rainfall time window, and no duplicate time windows are generated after deduplication.

[0047] This application embodiment adopts different time window division strategies based on the comparison results of rainfall duration and fixed time window length, so that rainfall events of different durations can be converted into model inputs of uniform length. For short events, zero padding at the end ensures that the single window input meets the model's fixed length requirement. For long events, a combination of conventional sliding and tail window closure ensures that the rainfall information at the end of the event is covered by at least one time window, avoiding the omission of peak information at the end, while ensuring that all time windows use a consistent cumulative benchmark.

[0048] Figure 2 A flowchart illustrating a method for determining water depth prediction values ​​according to an embodiment of this application is shown schematically. Figure 2 As shown, the method for determining the predicted water depth may include steps S210 to S260.

[0049] In step S210, the spatial grid size of the target rainfall event and the input size of the water depth prediction model are determined.

[0050] Before inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows of the target rainfall event into the water depth prediction model, it is necessary to determine the spatial raster size of the target rainfall event and the input size of the water depth prediction model.

[0051] In step S220, in response to the target rainfall event having a spatial grid size larger than the preset input size of the water depth prediction model, multiple overlapping spatial prediction blocks are determined from the spatial grid feature data based on a preset spatial step size. Each spatial prediction block contains at least a portion of the spatial grid, and the multiple overlapping spatial prediction blocks can cover the entire spatial grid.

[0052] The spatial raster size of the target rainfall event is compared with the preset input size of the water depth prediction model. When the number of rows or columns of the spatial raster exceeds the preset input size of the model, multiple spatial prediction blocks are extracted from the spatial raster features along the row and column directions according to the preset spatial step size. The size of each spatial prediction block is consistent with the preset input size of the model, and adjacent spatial prediction blocks may overlap in the row and column directions. When the spatial raster boundary positions are not covered by conventional partitioning, an additional end spatial prediction block is added so that every boundary position and all internal positions in the spatial raster are covered by at least one spatial prediction block.

[0053] In step S230, the spatial raster feature data corresponding to each spatial prediction block and the rainfall process data corresponding to multiple rainfall time windows are input into the water depth prediction model to obtain the water depth prediction block corresponding to each spatial prediction block.

[0054] The extracted spatial prediction blocks and rainfall process data corresponding to all rainfall time windows are input into the water depth prediction model. The water depth prediction model performs predictions for each set of inputs and outputs water depth prediction blocks corresponding to the spatial locations of each spatial prediction block. The above operation is performed for each rainfall time window to obtain the water depth prediction blocks corresponding to each spatial prediction block under each rainfall time window.

[0055] In step S240, in response to the target spatial grid being covered by only a single spatial prediction block, the target depth prediction value of the target depth prediction block corresponding to the single spatial prediction block is determined, and the target depth prediction value is used as the depth prediction value of the target spatial grid.

[0056] Based on the row and column starting positions of each spatial prediction block in the original spatial raster features, the corresponding water depth prediction blocks are placed back into their corresponding positions in the complete spatial region, forming a preliminary water depth prediction stitching result covering the entire spatial region. Simultaneously, the positional relationship between each water depth prediction block and each spatial raster is determined.

[0057] For any target spatial raster in the complete spatial region, check how many spatial prediction blocks cover the target spatial raster location. If the raster location is covered by only one spatial prediction block, determine the target depth prediction value of the target depth prediction block corresponding to the single spatial prediction block, and use the target depth prediction value as the depth prediction value of the target spatial raster.

[0058] In step S250, in response to the target spatial grid being covered by multiple spatial prediction blocks, the average prediction value of the multiple depth prediction blocks corresponding to the multiple spatial prediction blocks at the spatial grid is determined, and the average prediction value is used as the depth prediction value of the target spatial grid.

[0059] For a given spatial grid location within a complete spatial region, if that location is simultaneously covered by multiple spatial prediction blocks, the predicted values ​​for that location in each depth prediction block are collected. The arithmetic mean of these predicted values ​​is calculated, and this average is used as the predicted depth value for that spatial grid location. After performing the above processing on all grid locations, the predicted depth value corresponding to the current rainfall time window is generated.

[0060] In step S260, all rainfall time windows are traversed to obtain the predicted water depth value corresponding to each spatial grid in each rainfall time window.

[0061] The above steps are performed on all rainfall time windows of the target rainfall event to generate the water depth prediction value for each spatial grid in each rainfall time window.

[0062] This application embodiment extracts overlapping spatial prediction blocks by setting a preset spatial step size and adds boundary blocks, ensuring that each location of the spatial raster is covered by at least one prediction block, thus eliminating the boundary blind spots in spatial block prediction. The overlapping areas are reconstructed using an arithmetic mean, effectively solving the problem of multiple values ​​for the same raster, enabling each rainfall time window to obtain a complete spatial depth map, providing spatially complete and numerically smooth input for subsequent raster-by-raster temporal peak reduction.

[0063] In one embodiment, Figure 3 A flowchart illustrating a method for determining the peak envelope of a time window according to an embodiment of this application is shown. Figure 3 As shown, the method for determining the peak envelope of the time window may include steps S310 to S330.

[0064] In step S310, all rainfall time windows corresponding to at least one duration are divided into multiple time window batches. Each time window batch together constitutes all rainfall time windows corresponding to at least one duration, and different time window batches do not contain the same rainfall time window repeatedly.

[0065] Specifically, when generating the peak envelope map of the time window, all rainfall time windows corresponding to at least a certain duration of the target rainfall event are divided into multiple time window batches according to a preset number of time windows per batch. The union of each time window batch constitutes all rainfall time windows corresponding to at least a certain duration of the target rainfall event. There is no overlap between any two different time window batches, that is, the same rainfall time window is not repeatedly divided into multiple batches.

[0066] In step S320, for each time window batch, among the water depth prediction values ​​corresponding to all rainfall time windows included in the time window batch, the maximum value of the water depth prediction value at each spatial grid is taken to obtain the batch peak map corresponding to the time window batch.

[0067] For each time window batch, the maximum value is taken for each spatial grid position among all the predicted water depth values ​​for all rainfall time windows included in that batch, forming the intra-batch peak map for that time window batch. The value at each grid position in the intra-batch peak map is the maximum predicted water depth value for each rainfall time window within that batch at that position.

[0068] In step S330, between the peak values ​​within each time window batch, the maximum value of the peak value at each spatial grid is taken again to obtain a peak envelope map of at least one time window duration.

[0069] After reducing the intra-batch maximum value across all time windows, the intra-batch peak value map for each batch is obtained. Between the intra-batch peak value maps, the maximum value is taken again for each spatial grid location to obtain the time window peak envelope map for at least a certain duration within the target rainfall event. The time window peak envelope map can intuitively determine the maximum predicted water depth value for each spatial grid location across all time windows.

[0070] This embodiment of the application reduces the number of time-window prediction maps that need to be directly retained during the calculation process by dividing all time windows into multiple batches and performing two-level peak reduction, thereby reducing memory usage. At the same time, based on the associative law of maximum value operation, the two-level reduction within and between batches ensures complete consistency with the one-time reduction result, without losing the accuracy of the final peak envelope map.

[0071] In one embodiment, before inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the pre-trained water depth prediction model, the method further includes: obtaining rainfall type information of the target rainfall event; determining a target water depth prediction model that matches the rainfall type information from multiple candidate water depth prediction models based on the rainfall type information, wherein each candidate water depth prediction model has matching rainfall type information; and inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the pre-trained water depth prediction model, specifically including: inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the target water depth prediction model.

[0072] Specifically, before inputting rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the water depth prediction model, rainfall type information of the target rainfall event is obtained. Rainfall type information is used to characterize the rainfall feature category of the target rainfall event.

[0073] Multiple candidate water depth prediction models are pre-set, each corresponding to a different rainfall type. Each model is trained based on training sample data corresponding to its respective rainfall type. Based on the obtained rainfall type information of the target rainfall event, one candidate water depth prediction model that matches the rainfall type information is selected from the multiple candidate models as the target water depth prediction model.

[0074] When predicting water depth, rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows are input into the selected target water depth prediction model, and the target water depth prediction model outputs the water depth prediction value corresponding to each rainfall time window.

[0075] This application embodiment selects a matching target model from multiple candidate models based on rainfall type information for prediction, enabling different rainfall types to be handled by models specifically trained for that type of rainfall. This improves the model's adaptability to different rainfall characteristics and avoids prediction biases that may occur when a single model handles multiple rainfall types.

[0076] In one embodiment, the water depth prediction model is a two-stream network model, which includes a spatial branch and a rainfall time branch. Rainfall process data corresponding to multiple rainfall time windows and spatial raster feature data are input into the pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial raster in each rainfall time window. Specifically, this includes: extracting spatial features from the spatial raster feature data through the spatial branch; extracting temporal features from the rainfall process data corresponding to the rainfall time windows through the rainfall time branch; fusing the spatial features and temporal features through the bottleneck layer of the two-stream network model to obtain fused features; and outputting the water depth prediction value corresponding to each spatial raster in each rainfall time window based on the fused features using the two-stream network model.

[0077] Specifically, the pre-trained water depth prediction model can employ a two-stream network structure. This two-stream network model contains two independent branches: a spatial branch and a rainfall temporal branch. The spatial branch processes the input spatial raster features, while the rainfall temporal branch processes the input rainfall time windows. The spatial branch encodes the input spatial raster features, extracting spatial feature information from them. The rainfall temporal branch encodes the input rainfall time windows, extracting temporal feature information from them, including the time series features of single-time-step rainfall and cumulative rainfall within the window.

[0078] The spatial branch outputs spatial features at the bottleneck layer, while the rainfall time branch outputs window-level temporal features, which are then broadcast to various spatial locations to form a rainfall feature map with the same spatial dimensions as the spatial feature map. The spatial features and the expanded rainfall features are concatenated along the channel dimension and then convolved to obtain a fused feature. Based on this fused feature, the two-stream network model decodes and outputs the predicted water depth values ​​corresponding to each rainfall time window.

[0079] This application embodiment extracts spatial and temporal features through spatial and rainfall time branches respectively, and fuses them at the bottleneck layer, enabling the model to simultaneously utilize spatial static information and rainfall dynamic information for water depth prediction. The structure of independently encoding the two branches before fusion avoids mutual interference that may be caused by the mixing of different types of features in shallow layers, and improves the effectiveness of feature representation.

[0080] In one embodiment, before inputting the rainfall process data and spatial raster feature data corresponding to multiple rainfall time windows into the pre-trained water depth prediction model, the method further includes: constructing a training sample data set for the initial water depth prediction model based on training sample data from multiple historical rainfall events, wherein the training sample data for each historical rainfall event includes historical spatial raster feature data, historical rainfall process data, and the maximum water depth label for each historical spatial raster; dividing the historical rainfall process data into multiple training time windows according to a fixed time window length and time step, wherein each training time window contains at least a portion of the historical rainfall process data; and training the initial water depth prediction model based on the historical spatial raster feature data, the maximum water depth label, and the historical rainfall process data corresponding to the multiple training time windows to obtain the water depth prediction model.

[0081] The training sample data for each historical rainfall event includes spatial raster features, complete rainfall event data, and the maximum water depth label per raster within that complete rainfall event. The spatial raster features consist of seven channels: relative elevation, slope, aspect cosine, aspect sine, topographic humidity index, pipeline density, and manhole density. The first five categories are calculated using the Digital Elevation Model (DEM), while the latter two can be generated by rasterizing the vector data of pipeline lines and manhole points.

[0082] The maximum water depth label represents the maximum water depth at each historical spatial grid location during a historical rainfall event. It does not correspond to the water depth at any specific moment, nor does it represent a single maximum water depth value or measured water depth across the entire area. Before pruning the spatial prediction blocks, the training sample dataset is divided into training, validation, and test sets according to complete rainfall events. The same complete rainfall event belongs to only one set.

[0083] The method of dividing historical rainfall data into multiple training time windows is the same as the method of dividing rainfall time windows mentioned earlier, and will not be repeated here. After dividing historical rainfall data into multiple training time windows, the initial water depth prediction model can be trained using historical spatial raster feature data, maximum water depth labels, and multiple training time windows to obtain the water depth prediction model.

[0084] Furthermore, based on historical spatial grid feature data, maximum water depth labels, and historical rainfall data corresponding to multiple training time windows, the initial water depth prediction model is trained to obtain the water depth prediction model. Specifically, this includes: inputting historical spatial grid feature data and historical rainfall data corresponding to multiple training time windows into the initial water depth prediction model to obtain the historical water depth prediction value corresponding to each historical spatial grid in each training time window; determining the event-level loss of the target historical rainfall event based on the historical water depth prediction value corresponding to each historical spatial grid in each training time window and the maximum water depth label corresponding to each historical spatial grid; and updating the model parameters of the initial water depth prediction model based on the event-level loss to obtain the water depth prediction model.

[0085] Specifically, the initial depth prediction model receives historical spatial raster feature data and a fixed-length training time window, and outputs a single-channel depth prediction map corresponding to the raster area covered by the input historical spatial raster feature data. For each training time window, the historical spatial raster feature data is paired with that training time window and input into the model to obtain the historical depth prediction value corresponding to each historical spatial raster in that training time window.

[0086] For historical water depth predictions belonging to the same historical rainfall event across different training time windows, the maximum historical water depth prediction value is taken at each historical spatial grid location to obtain a training peak envelope map. The maximum historical water depth prediction values ​​at different historical spatial grid locations can come from different training time windows.

[0087] The predicted maximum historical water depth and the label of maximum water depth corresponding to the same historical spatial grid location are compared to calculate an event-level loss. The event-level loss is calculated only after the training peak envelope is formed, and the same maximum water depth label is not applied to the output of a single training time window.

[0088] After obtaining the event-level loss, backpropagation can be performed based on the event-level loss to update the model parameters of the initial water depth prediction model, thereby obtaining the water depth prediction model.

[0089] This embodiment of the application, under the condition of only having grid-by-grid maximum water depth labels for rainfall events, divides each historical rainfall event into a fixed-length training time window, and takes the maximum historical water depth prediction value for each grid to form a training peak envelope map. Then, it calculates the event-level loss with the overall event label, enabling the model to use single-label supervision for multi-time-window output. The gradient is selectively backpropagated through the maximum path, realizing a backpropagable supervision relationship between the multi-time-window prediction results and the overall event label, without the need to construct separate water depth labels for each time window.

[0090] In one embodiment, the model parameters of the initial water depth prediction model are updated based on event-level loss to obtain the water depth prediction model. Specifically, this includes: for any target historical space grid, determining one or more target training time windows that achieve the maximum water depth prediction value at the target historical space grid; based on event-level loss, using the maximum value at the target historical space grid, passing the corresponding loss gradient to the water depth prediction value of one or more target training time windows, and updating the model parameters of the initial water depth prediction model to obtain the water depth prediction model.

[0091] Specifically, after determining the historical water depth prediction values ​​for each training time window, for any target historical spatial grid location, the water depth prediction values ​​for that location are compared among the prediction results of each training time window. One or more training time windows that achieve the maximum historical water depth prediction value are determined as the target training time windows corresponding to that target historical spatial grid. Different target historical spatial grids may have different target training time windows corresponding to one or more of them; when multiple training time windows produce the same maximum prediction value at the same target historical spatial grid location, all of these training time windows are determined as the target training time windows corresponding to that location. During the backpropagation of event-level loss, for each target historical spatial grid location, the gradient of the event-level loss is passed to the output of one or more target training time windows that produce the maximum historical water depth prediction value at that location through the maximum value calculation at that target historical spatial grid location, and further propagated back to the model parameters of the initial water depth prediction model to update the model parameters; the output of training time windows that do not produce the maximum historical water depth prediction value at that target historical spatial grid location do not receive the gradient of that target historical spatial grid location.

[0092] Traverse all historical spatial grid positions, and each position's corresponding one or more target training time windows receive the event-level loss gradients of the corresponding position, which together participate in the update of model parameters.

[0093] This application embodiment determines one or more target training time windows that generate the maximum predicted value at each grid position. This allows the event-level loss to be backpropagated to the corresponding target training time window via the gradient path formed by calculating the maximum value per grid, achieving differentiated supervision of the output of multiple time windows for a single label of the entire event. Each grid position determines its corresponding gradient propagation path, and the same time window may receive gradients at some grid positions but not at others. When multiple training time windows generate the same maximum predicted value at the same grid position, the gradient can be propagated to the output of multiple training time windows.

[0094] In one embodiment, a training sample data set for an initial water depth prediction model is constructed based on training sample data from multiple historical rainfall events. Specifically, this includes: generating a first grid mask with a spatial range consistent with the historical spatial grid feature data, the first grid mask being used to mark the first grid positions involved in loss calculation; and determining the event-level loss for the target historical rainfall event, specifically including: within the first grid mask, determining the event-level loss based on the difference between the maximum historical water depth prediction value and the maximum water accumulation depth label.

[0095] The first raster mask is a binary raster with the same number of rows and columns as the historical spatial raster feature data. It is used to mark whether each spatial raster location participates in the event-level loss calculation. The raster location with the first value in the first raster mask is designated as the first raster location, indicating that this location participates in the event-level loss calculation; the raster location with the second value is designated as the second raster location, indicating that this location does not participate in the event-level loss calculation. The maximum water depth label and predicted value corresponding to the second raster location are ignored in the event-level loss calculation.

[0096] The difference between the maximum historical water depth prediction and the maximum water depth label is calculated only within the range of the first grid positions marked by the first grid mask as participating in the loss calculation, and the event-level loss is determined based on this difference. The second grid positions do not participate in the calculation of the event-level loss and do not generate gradient contributions caused by the second grid positions.

[0097] In this embodiment, the first grid mask marks the grid positions that participate in the loss calculation and those that do not, so that the calculation of event-level loss and the updating of model parameters are performed only for the effective spatial region, eliminating the interference of invalid grid positions on the training process and improving the relevance of model training and the accuracy of parameter updates.

[0098] In one embodiment, within the first grid mask, an event-level loss is determined based on the difference between the maximum historical water depth prediction value and the maximum water accumulation depth label. Specifically, this includes: determining a dry area grid within the first grid mask based on the maximum water accumulation depth label and a preset water accumulation threshold; the dry area grid being a spatial grid where the maximum water accumulation depth label is less than the water accumulation threshold; determining the water depth difference between the maximum historical water depth prediction value and the water accumulation threshold corresponding to the dry area grid; determining a dry area exceeding threshold penalty term based on the water depth difference; and determining the event-level loss based on the basic fitting loss between the maximum historical water depth prediction value and the corresponding maximum water accumulation depth label, as well as the dry area exceeding threshold penalty term.

[0099] Specifically, within the range of the first grid positions marked on the first grid mask for loss calculation, the maximum water depth label value of each spatial grid position is compared with a preset water accumulation threshold. When the maximum water depth label value of a spatial grid position is less than the water accumulation threshold, that spatial grid position is determined as a dry area grid; when the maximum water depth label value is greater than or equal to the water accumulation threshold, that spatial grid position is determined as a water accumulation grid. Through the above comparison, dry area grids and water accumulation grids are distinguished within the first grid mask.

[0100] For each spatial grid location identified as a dry area, the difference between the maximum historical water depth prediction value and the water accumulation threshold at that location is determined. When the maximum historical water depth prediction value exceeds the water accumulation threshold, the difference is positive; when the maximum historical water depth prediction value does not exceed the water accumulation threshold, the difference is not greater than zero.

[0101] For the portion of the maximum historical water depth prediction value at a dry area grid that exceeds the water accumulation threshold, a dry area threshold exceedance penalty is determined based on this excess. When the maximum historical water depth prediction value does not exceed the water accumulation threshold, the penalty value corresponding to that location is zero. The dry area threshold exceedance penalty is used to apply additional penalties when the maximum historical water depth prediction value incorrectly exceeds the water accumulation threshold at a dry area grid.

[0102] The event-level loss consists of two parts: the first part is the basic fitting loss, calculated based on the difference between the training peak envelope and the maximum water depth label within the first grid mask; the second part is the dry area over-threshold penalty, calculated based on the amount by which the predicted maximum historical water depth at the dry area grid exceeds the water depth threshold. The basic fitting loss and the dry area over-threshold penalty are added together, or weighted together, to obtain the final event-level loss. When there are no valid dry area grids in the training samples, the dry area over-threshold penalty is zero.

[0103] This application embodiment distinguishes between dry area grids and water accumulation grids within a first grid mask, and sets an over-threshold penalty term for dry area grids. This allows the model to focus not only on the water depth fitting accuracy in water accumulation areas during training, but also to impose additional constraints on false alarms in dry areas. This helps to suppress erroneous water depth predictions by the model in areas without water accumulation, and improves the spatial rationality and physical consistency of the prediction results.

[0104] The following is an example of a training method for a water depth prediction model in an embodiment of this application. First, the initial water depth prediction model needs to be trained using training sample data. Therefore, it is necessary to determine historical rainfall events and the maximum water depth label per grid within each historical rainfall event. Each historical rainfall event may include historical spatial grid feature data, historical rainfall process data, the maximum water depth label per grid within the historical rainfall event obtained from mechanism simulation, and a first grid mask. The maximum water depth label per grid within a historical rainfall event represents the maximum water depth at each historical spatial grid location during that historical rainfall event; it does not correspond to the water depth at any given moment, nor does it represent a single maximum water depth value or measured water depth across the entire region. When training the model, the training, validation, and test sets are divided according to complete events before pruning the spatial prediction blocks, and the same event belongs to only one set.

[0105] After obtaining the training sample dataset, a closed-end training time window needs to be constructed. The construction of the training time window during training follows the same window construction rules as the construction of the rainfall time window during model inference, and will not be elaborated further here. After constructing multiple training time windows, the historical water depth prediction value corresponding to each historical spatial grid within each training time window is predicted. The initial water depth prediction model receives historical spatial grid feature data and a fixed-length training time window, and outputs a single-channel water depth map corresponding to the historical spatial grid region covered by the input historical spatial grid features.

[0106] The initial water depth prediction model here can use a dual-stream Transformer-CNN as an example. First, spatial features are extracted through a U-Net-style spatial branch. The Transformer branch encodes the single-time-step rainfall and local cumulative rainfall within the window, and feature processing is completed at the bottleneck layer. The above network components are only used as an implementation method; effective grid supervision, false alarm suppression in dry areas, and rainfall expert model routing are all optional subordinate measures.

[0107] (1) In formula (1), This represents a fixed-length training time window for the input model. To determine the number of time steps included in the training time window, the two channels represent the rainfall at a single time step and the cumulative rainfall within the window, respectively. For a trainable weight matrix, is a trainable bias vector. The embedding dimension for rainfall features; This is the rainfall feature sequence obtained after linear mapping. Formula (1) is used to convert the dual-channel rainfall data at each time step into a format that the Transformer encoder can process. Dimensional features.

[0108] (2) In formula (2), Indicates position In the position encoding matrix Encoded values ​​on the dimension; This indicates the position number of the current time step within the training time window; For a fixed time window length; Dimension-pair index for location encoding; The even-numbered dimension representing the positional encoding; 1 represents the embedding dimension of the rainfall feature; the constant 10000 is used to control the scale of change of the position encoding in different dimensions. Formula (2) uses a sine function to generate even-dimensional position encoding, enabling the Transformer encoder to identify the sequential position of each time step within the training time window.

[0109] (3) In formula (3), Indicates position In the position encoding matrix Encoded values ​​on the dimension; This indicates the position number of the current time step within the training time window; For a fixed time window length; Dimension-pair index for location encoding; Odd-numbered dimensions representing positional encoding; Embedding dimension of rainfall features; constant This is used to control the scale of change of positional encoding in different dimensions. Formula (3) uses a cosine function to generate odd-dimensional positional encoding, which together with the even-dimensional positional encoding generated by formula (2) represents the sequential position of each time step within the training time window.

[0110] (4) In formula (4), This represents the rainfall feature sequence obtained through linear mapping; This represents the position coding matrix generated by formulas (2) and (3); For a fixed time window length; The embedding dimension for rainfall features; This represents the feature sequence obtained by element-wise addition of the rainfall feature sequence and the location encoding matrix. Formula (4) is used to add the location information of each time step within the training time window to the rainfall features, and to obtain the feature sequence. As input to the Transformer encoder.

[0111] (5) In formula (5), This represents the rainfall feature sequence after adding location encoding; This indicates the feature encoding operation performed by the Transformer encoder; For a fixed time window length; The embedding dimension for rainfall features; This represents the rainfall time series features output by the Transformer encoder. Formula (5) is used to extract the correlation information between different time steps within the same training time window, so that the output features of each time step simultaneously contain the rainfall information of that time step and its relationship with other time steps within the window.

[0112] (6) In formula (6), Indicates the first element in the output sequence of the Transformer encoder. Feature vectors at each time step; This is the index of the time step within the training time window, with a value ranging from 0 to L. 1; The length of the time window; The embedding dimension for rainfall features; This represents the window-level rainfall feature obtained by taking the arithmetic mean of the feature vectors of all time steps within the window, where the subscript... This indicates a time branch, not a specific time step. Formula (6) is used to divide a time branch of length... The rainfall time series features are aggregated into a fixed-dimensional feature vector so that it can be subsequently expanded to the spatial dimension and fused with the spatial branch features.

[0113] After obtaining the window-level rainfall feature vector, spatial coverage averaging reconstruction is performed for each training time window. For complete regions with spatial dimensions larger than the fixed input size of the model, overlapping spatial prediction blocks are extracted along the row and column directions according to a preset spatial step size. End spatial prediction blocks are added at the ends of uncovered regions during conventional segmentation to ensure that each historical spatial raster within the complete region is covered by at least one spatial prediction block. For the same training time window, each spatial prediction block is input into the water depth prediction model along with that training time window to obtain single-channel water depth prediction blocks corresponding to the positions of each spatial prediction block. These water depth prediction blocks are then placed back into their corresponding positions within the complete region. When the same historical spatial raster is covered by multiple water depth prediction blocks, the water depth prediction values ​​of the multiple water depth prediction blocks corresponding to that historical spatial raster are arithmetically averaged to obtain the water depth prediction value corresponding to that training time window.

[0114] (7) (8) (9) In formula (7), This represents the window-level rainfall feature vector obtained from formula (6). Number of rainfall characteristic channels; and These represent the number of rows and columns of the spatial bottleneck feature map, respectively. This means copying the window-level rainfall feature vector to each spatial location to obtain a rainfall feature map. Formula (7) is used to expand window-level rainfall features that do not contain spatial dimensions into spatial feature maps.

[0115] In formula (8), This represents the spatial bottleneck characteristics of the spatial branch output. The number of spatial feature channels; Indicates connection along the channel dimension and To obtain the features before fusion Formula (8) is used to connect spatial features and rainfall features.

[0116] In formula (9), This indicates that convolution processing is performed on the concatenated features to obtain fused features. Formula (9) is used to perform convolutional fusion of the two types of features. In this embodiment, , After being connected, a 320-channel feature is formed, which is then compressed into a 256-channel feature through convolution.

[0117] In the spatial sample block training method, the same spatial sample block is paired with all training time windows of the event, and the spatial coverage average degenerates into the output of the sample block itself. In the full-region inference, the spatial coverage average is first performed for each training time window, and then the temporal peak reduction is performed. In the optional dual-stream model, the 256-channel spatial bottleneck and the 64-channel rainfall feature are concatenated into 320 channels, and then compressed back to 256 channels through convolutional fusion.

[0118] After obtaining the predicted water depth values ​​for each training time window, the maximum value is taken at each historical spatial grid position for the predicted water depth values ​​of each training time window belonging to the same historical rainfall event, resulting in a peak envelope map for the time window. During the training phase, after completing this grid-by-grid peak aggregation, a supervisory relationship is established between the peak envelope map of the time window and the unique grid-by-grid maximum water depth label of the historical rainfall event, without applying the grid-by-grid maximum water depth label of the complete rainfall event to individual training time windows.

[0119] (10) In formula (10), Indicates the decoding level; This represents the low-resolution features output by the previous decoding layer, where the input of the first decoding layer is the fused feature output by the bottleneck layer. This indicates an upsampling operation, used to improve the spatial resolution of the feature map so that it has the same spatial size as the skip connection features output by the current layer encoder. This represents the encoder skip connection feature corresponding to the current decoding layer spatial resolution; This indicates that the upsampled features and skip connection features are concatenated along the channel dimension; This indicates that the concatenated features are processed by convolution to obtain the output features of the current decoding layer. By executing three decoding layers sequentially, the model recovers the spatial resolution of the feature maps step by step, and supplements local terrain and spatial structure information by utilizing spatial features at different scales retained by the encoder.

[0120] (11) In formula (11), This represents the spatial features output by the third-level decoding layer, where 32 is the number of feature channels. and These represent the number of rows and columns of the input spatial raster, respectively. This indicates that the number of output channels is 1. The convolution operation is used to perform a learnable linear combination of the decoded features of 32 channels at each grid position, mapping the multi-channel features to a water depth prediction value. This represents the single-channel preliminary depth prediction map corresponding to the current training time window, where... Indicates grid position The initial predicted water depth is obtained. This operation only completes the mapping from feature channels to water depth values, does not change the spatial size of the feature map, and does not perform peak aggregation across time windows; its output also needs to be processed by the non-negative constraint of formula (12) to form the water depth prediction map for the current rainfall time window.

[0121] (12) In formula (12), when using optional nonnegative post-processing, This represents a single-channel preliminary water depth prediction map for a historical time window obtained from formula (11); This indicates a grid-by-grid nonnegative constraint operation, which compares the initial predicted value with 0 at each grid position. When, the predicted value at that position is set to 0, when When necessary, retain the original predicted value; This represents the water depth prediction map obtained after non-negativity constraint processing for the training time window. This operation ensures that the output meets the physical requirement that the water depth cannot be negative. It only applies to the prediction results of a single training time window and does not perform peak aggregation between different training time windows. This processing is optional and does not constitute a necessary constraint for event-level peak envelope supervision.

[0122] After forming the peak envelope of the event-level time window, the event-level loss is calculated and backpropagated. First, for all training time window water depth prediction maps corresponding to the same historical rainfall event, the maximum value is taken at each grid position to form the event-level time window peak envelope map; the maximum predicted value at different grid positions can come from different time windows. Then, the event-level loss is calculated once by combining the event-level time window peak envelope map with the grid-by-grid maximum water depth label of the historical rainfall event. During backpropagation, for a certain historical spatial grid position, the loss gradient is passed to one or more training time window outputs that produce the maximum predicted value at that position through the grid-by-grid maximum value calculation; the output of training time windows that do not produce the maximum predicted value at that historical spatial grid position does not receive the gradient of that historical spatial grid position, but can receive gradients at other historical spatial grid positions. When multiple training time windows produce the same maximum historical water depth prediction value at the same historical spatial grid position, the gradient can be passed to the outputs of multiple training time windows.

[0123] Optionally, based on the maximum water depth label and water threshold of each historical spatial raster of historical rainfall events. Determine the dry area grid: Within the effective grid mask, the label value is less than The grid was identified as the dry region grid. When the predicted value of the peak envelope within the dry region grid exceeds... When the threshold exceeds the limit, a penalty for exceeding the dry area is calculated by squaring the excess portion and treated as an additional loss term. The key calculation relationships are as follows.

[0124] (13) In formula (13), Indicates length is The set of starting points of time windows corresponding to historical rainfall events; This indicates the number of time steps included in a historical rainfall event; Indicates the length of a fixed time window; This indicates the time step between the start points of adjacent training time windows; This indicates the floor function. When At that time, first follow the step size The starting point for generation shall not exceed The training time window, whose last regular starting point is .when no When the value is an integer multiple of the event, the last training time window cannot be aligned with the true end of the historical rainfall event, therefore... Merge into the starting set and append a true tail window covering the end of the event; when It is already When it is an integer multiple of, Since it is already included in the regular starting set, the set union operation will not produce a repeated time window. When At that time, a training time window is generated starting from 0, and zeros are padded to the right of the complete rainfall sequence to the length. Formula (13) is used to ensure that historical rainfall events of different durations can use a unified time window input interface while maintaining a fixed time window length, and to guarantee that the actual end of the event is covered by at least one training time window. The local cumulative rainfall within window s is: (14) In formula (14), This indicates the starting point of the current training time window within a historical rainfall event; This represents the time step number within the current training time window, with a value range of [value missing]. ; This indicates the index of the time step within the window used in the cumulative summation process; Indicates the index in the complete rainfall sequence. Single-time step rainfall; Indicates the starting point is The training time window extends from the start of the window to the end of the window. The cumulative rainfall at each time step. Each training time window uses its own starting point as the cumulative zero point, therefore when hour, ;along with Increase, and sequentially accumulate the rainfall at each time step within the current training time window. Formula (14) is used to construct the second channel of the training time window, so that the model can obtain the cumulative rainfall information within the window while receiving the rainfall at each time step. For the right-hand zero-padding part of short events, it is agreed that... Therefore, the cumulative channel remains unchanged after the actual rainfall ends, retaining the cumulative value from the last actual time step. The average spatial coverage of the same training time window s is: (15) In formula (15), p represents the spatial prediction block number; Indicates the starting point of the current training time window; Indicates the grid position within a complete spatial region; Indicates the training time window The number of spatial prediction blocks used when performing full-region prediction; Indicates the first Each spatial prediction block is located in the raster position of the complete region. The predicted water depth at the location; Indicates the corresponding spatial coverage indicator, when the first Spatial prediction block covers raster location The value is 1 if the condition is met, and 0 otherwise; the numerator represents the sum of the predicted water depth values ​​of all spatial prediction blocks covering the grid location, and the denominator... This indicates the actual number of times the historical spatial grid location was covered; This represents the training time window obtained by averaging the overlapping predictions. The corresponding full-area water depth prediction value. Formula (15) is used to eliminate the multi-value problem caused by overlapping spatial prediction blocks at the same grid position, so that each training time window forms a water depth prediction value. By adding the end spatial prediction block, it is ensured that each historical spatial grid position in the full area is covered by at least one spatial prediction block, so the denominator of formula (15) is not 0. This spatial coverage average is used for full-area inference; during the training of a single spatial sample block, the full-area spatial coverage average is not performed. The multi-time window grid-by-grid peak envelope is: Training path: (16a).

[0125] Full-area reasoning path: (16b).

[0126] In formulas (16a) and (16b), This represents the set of starting points of the time window corresponding to a complete rainfall event; This indicates the starting point of one of the training time windows; Indicates the historical spatial raster position of the current spatial sample block or the entire spatial region; This indicates that the model in the training path is for the time window. Output spatial sample block water depth prediction values; This indicates that after the spatial coverage averaging is completed according to formula (15) in the entire region reasoning path, the time window... In the full area grid location Predicted water depth at the location; This means taking the maximum value for each grid position across all time windows belonging to the same complete rainfall event; and These represent the event-level time window peak envelopes formed by the training path and the full-region inference path, respectively. The maximum predicted value at different grid positions can come from different training time windows. The training path does not perform full-region spatial coverage averaging, but directly performs grid-by-grid maximum aggregation on the prediction maps of all time windows for the same spatial sample block; the full-region inference path first performs spatial coverage averaging on each time window, and then performs grid-by-grid maximum aggregation across time windows. Equations (16a) and (16b) are used to clarify how the event peak envelope is formed in the two processing paths and to ensure that the full-region inference follows the operation order of "spatial coverage averaging first, time peak reduction later".

[0127] One implementation of event-level loss can be:

[0128] In formulas (17a) and (17b), This represents the event-level loss calculated for a complete rainfall event; This represents the peak envelope of the training path event-level time window obtained by formula (16a); This represents the weight of the penalty term for exceeding the threshold in the dry region. Where, mean(·) represents the weight of the penalty term for all regions satisfying the threshold. The effective dry area raster values ​​are taken as the arithmetic mean; max(a,0) represents taking the larger value between a and 0; x and y represent the two spatial coordinate components of the effective dry area raster position, respectively. This means that only when the valid raster conditions are met simultaneously... And dry area indication On the grid set, the arithmetic mean of the dry area exceeding the threshold penalty term within the square brackets is calculated; when the grid set is empty, the additional penalty term is defined as 0. This indicates the unique historical spatial grid maximum water depth label for this complete rainfall event; This represents the effective grid mask, where grids with a value of 1 are included in the loss calculation, and invalid grids with a value of 0 are not included in the loss calculation. This represents the base water depth fitting loss calculated within the effective grid mask. One implementation is a weighted mean square error that assigns appropriate weights to the water accumulation grid and the dry area grid. This indicates the water accumulation threshold that distinguishes waterlogged grids from dry grids; This indicates the dry area indication value when the label value of the effective grid position is lower than... The value is 1 if the condition is met, and 0 otherwise. This represents the weight of the dry area exceeding the threshold penalty term. The second term is calculated only within the effective dry area raster: when the peak envelope prediction value does not exceed... When the predicted value exceeds 0, this item is 0; when the predicted value exceeds 0... When the threshold is exceeded, a squared penalty is calculated. If there are no valid dry area grids in the current sample, the additional penalty term is 0. Formulas (17a) and (17b) are calculated only once after the grid-by-grid maximum value aggregation is completed for all training time window prediction results of the same historical rainfall event. They are used to establish a supervision relationship between the event peak envelope and the unique grid-by-grid maximum water depth label of the event, and to complete backpropagation through the grid-by-grid maximum value path in the peak envelope. The equivalent relationship of time window batch reduction is: Training path (18a) Full-area reasoning path (18b) In formulas (18a) and (18b), Indicates the batch sequence number within the time window; each batch Together constitute Each batch of starting point subsets together constitutes a complete set of starting points for the time window, and different batches do not contain the same starting point for the time window repeatedly. Indicates the time window in the training path The corresponding spatial sample block water depth prediction value; Represents the time window in the entire inference path. Predicted water depth for the entire region after spatial coverage averaging.

[0129] During calculation, the maximum value of the predicted values ​​at the same historical spatial raster position within each time window batch is first taken to obtain the intra-batch peak map. Then, the maximum value is taken again grid-by-grid across all intra-batch peak maps to obtain the event-level time window peak envelope. Since the maximum value operation satisfies the associative law, performing intra-batch maximum value reduction followed by inter-batch maximum value reduction yields the same result as taking the maximum value of all time window predictions at once. The number of time window batches and the number of time windows included in each batch are optional implementation parameters and do not constitute a necessary constraint for event-level peak envelope monitoring; this batch processing can reduce the number of time-window prediction maps directly retained during the calculation process. The calculation relationship for the optional MC Dropout overall standard deviation is as follows: (19a) (19b) In formulas (19a) and (19b), This indicates the number of forward predictions in MC Dropout; Indicates the first Sub-random forward prediction; Indicates the first The next prediction is at the grid location. Output at; for The arithmetic mean of the predictions; To use the denominator The calculated overall standard deviation. This indicator only represents the dispersion of multiple random forward outputs and does not represent confidence intervals, reliability, or guarantees of measured accuracy; MC Dropout is an optional subordinate measure.

[0130] After calculating the event-level loss and backpropagating, inference can be performed and the results output. Rainfall time windows are constructed according to the same tail window closure rule as training; spatial coverage averaging is performed for each time window, and then the maximum value is taken grid-by-grid across time windows to output the maximum water depth grid-by-grid within a single complete rainfall event.

[0131] Optionally, rainfall expert model routing and MC Dropout can be used; the overall standard deviation of MC Dropout is only used as an indicator of output dispersion and does not represent confidence intervals, reliability, or guarantees of measured accuracy. Where T is the number of rainfall steps for a complete event, L is the time window length, S is the time step size, s is the time window start point, W is the number of time windows for the same complete event, r is the rainfall per time step, m is the spatial coverage indicator, and M is the effective grid mask. For each grid cell of a complete rainfall event, the maximum water depth is labeled. This is the event peak envelope diagram. Let N be the water accumulation threshold, and N be the number of forward predictions using MC Dropout, where N≥2. Time windows can be processed in batches: first, the maximum value per grid within a batch is calculated, then the maximum value between batches is calculated; the result is the same as taking the maximum value for all time windows at once. Finally, based on the peak envelope map of the time windows, the predicted maximum water accumulation depth for each spatial grid within the target rainfall event is determined.

[0132] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A method for predicting the maximum water depth in urban flooding, characterized in that, The method includes: Acquire spatial raster feature data of the target rainfall event, and acquire rainfall process data for at least a period of time from the start point to the end point of the target rainfall event, wherein the at least a period of time includes the complete duration of rainfall; Based on a preset fixed time window length and time step, the rainfall process data is divided into multiple rainfall time windows, each containing at least a portion of the rainfall process data; The rainfall process data corresponding to multiple rainfall time windows and the spatial grid feature data are input into the pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial grid in each rainfall time window. By comparing the predicted water depth values ​​for each spatial grid in each rainfall time window, the maximum predicted water depth value for each spatial grid is obtained. The maximum water depth prediction value corresponding to each spatial grid is used as the maximum water depth prediction result of the target rainfall event within the at least one time period.

2. The method for predicting maximum water depth in urban flooding according to claim 1, characterized in that, The rainfall process data is divided into multiple rainfall time windows based on a preset fixed time window length and time step, specifically including: Based on the start and end points of the at least one duration, the duration of rainfall corresponding to the rainfall process data is determined; If the duration of rainfall is less than or equal to the length of the fixed time window, the starting point of the duration is used as the starting point of the time window to construct a first rainfall time window, and zeros are padded at the end of the first rainfall time window until the length of the first rainfall time window is equal to the length of the fixed time window. When the duration of rainfall is greater than the fixed time window length, the duration start point is taken as the time window start point, and multiple second rainfall time windows are constructed based on the fixed time window length and the time step. The time window length of each second rainfall time window is equal to the fixed time window length, and the difference between the time window start points of adjacent second rainfall time windows is equal to the time step. If the last second rainfall time window does not cover the end of the duration of the target rainfall event, the end of the duration is taken as the end of the rainfall time window, and a third rainfall time window is constructed based on the fixed time window length.

3. The method for predicting maximum water depth in urban flooding according to claim 1, characterized in that, The step of inputting rainfall process data corresponding to multiple rainfall time windows and the spatial grid feature data into a pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial grid in each rainfall time window specifically includes: Determine the spatial grid size of the target rainfall event and the input size of the water depth prediction model; In response to the target rainfall event having a spatial grid size larger than the preset input size of the water depth prediction model, multiple overlapping spatial prediction blocks are determined from the spatial grid feature data based on a preset spatial step size. Each spatial prediction block contains at least a portion of the spatial grid, and the multiple overlapping spatial prediction blocks can cover the entire spatial grid. The spatial raster feature data corresponding to each spatial prediction block and the rainfall process data corresponding to the multiple rainfall time windows are input into the water depth prediction model to obtain the water depth prediction block corresponding to each spatial prediction block. In response to the fact that the target spatial grid is covered by only a single spatial prediction block, the target depth prediction value of the target depth prediction block corresponding to the single spatial prediction block is determined, and the target depth prediction value is used as the depth prediction value of the target spatial grid. In response to the fact that the target spatial grid is covered by multiple spatial prediction blocks, the average prediction value of multiple depth prediction blocks corresponding to the multiple spatial prediction blocks at the spatial grid is determined, and the average prediction value is used as the depth prediction value of the target spatial grid. By iterating through all rainfall time windows, the predicted water depth value corresponding to each spatial grid in each rainfall time window is obtained.

4. The method for predicting maximum water depth in urban flooding according to claim 1, characterized in that, Before inputting the rainfall process data corresponding to multiple rainfall time windows and the spatial raster feature data into the pre-trained water depth prediction model, the method further includes: Obtain the rainfall type information of the target rainfall event; Based on the rainfall type information, a target water depth prediction model matching the rainfall type information is determined from multiple candidate water depth prediction models, and each candidate water depth prediction model has matching rainfall type information; The rainfall process data corresponding to multiple rainfall time windows and the spatial raster feature data are input into a pre-trained water depth prediction model, specifically including: The rainfall process data corresponding to multiple rainfall time windows and the spatial raster feature data are input into the target water depth prediction model.

5. The method for predicting maximum water depth in urban flooding according to claim 1, characterized in that, The water depth prediction model is a two-stream network model, which includes a spatial branch and a rainfall time branch. The step of inputting rainfall process data corresponding to multiple rainfall time windows and the spatial grid feature data into a pre-trained water depth prediction model to obtain the water depth prediction value corresponding to each spatial grid in each rainfall time window specifically includes: Spatial features are extracted from the spatial raster feature data through the spatial branching; By using the rainfall time branch, the temporal features of the rainfall process data corresponding to the rainfall time window are extracted; The spatial features and temporal features are fused through the bottleneck layer of the dual-stream network model to obtain fused features; Based on the fusion features, the dual-stream network model outputs the predicted water depth value for each spatial grid cell in each rainfall time window.

6. The method for predicting maximum water depth in urban flooding according to claim 1, characterized in that, Before inputting the rainfall process data corresponding to multiple rainfall time windows and the spatial raster feature data into the pre-trained water depth prediction model, the method further includes: Based on training sample data from multiple historical rainfall events, a training sample data set for an initial water depth prediction model is constructed. The training sample data for each historical rainfall event includes historical spatial raster feature data, historical rainfall process data, and the maximum water depth label for each historical spatial raster. According to the fixed time window length and the time step, the historical rainfall process data is divided into multiple training time windows, and each training time window contains at least a portion of the historical rainfall process data; Based on the historical spatial raster feature data, the maximum water depth label, and the historical rainfall process data corresponding to the multiple training time windows, the initial water depth prediction model is trained to obtain the water depth prediction model.

7. The method for predicting maximum water depth in urban flooding according to claim 6, characterized in that, The process of training the initial water depth prediction model based on the historical spatial raster feature data, the maximum water depth label, and the historical rainfall process data corresponding to the multiple training time windows to obtain the water depth prediction model specifically includes: The historical spatial grid feature data and the historical rainfall process data corresponding to the multiple training time windows are input into the initial water depth prediction model to obtain the historical water depth prediction value corresponding to each historical spatial grid in each training time window. Based on the predicted historical water depth at each historical spatial grid in each training time window, and the maximum water depth label corresponding to each historical spatial grid, the event-level loss of the target historical rainfall event is determined. Based on the event-level loss, the model parameters of the initial water depth prediction model are updated to obtain the water depth prediction model.

8. The method for predicting maximum water depth in urban flooding according to claim 7, characterized in that, The step of updating the model parameters of the initial water depth prediction model based on the event-level loss to obtain the water depth prediction model specifically includes: For any target historical space grid, determine one or more target training time windows at the target historical space grid where the maximum water depth prediction value is obtained; Based on the event-level loss, the corresponding loss gradient is passed to the water depth prediction value of the one or more target training time windows by calculating the maximum value at the target historical space grid, and the model parameters of the initial water depth prediction model are updated to obtain the water depth prediction model.

9. The method for predicting maximum water depth in urban flooding according to claim 7, characterized in that, The training sample data set for constructing the initial water depth prediction model based on training sample data from multiple historical rainfall events specifically includes: A first grid mask is generated that is consistent with the spatial range of the historical spatial grid feature data. The first grid mask is used to mark the first grid position involved in the loss calculation. The event-level loss for determining the target historical rainfall event specifically includes: Within the first grid mask, the event-level loss is determined based on the difference between the maximum historical water depth prediction and the maximum water depth label.

10. The method for predicting maximum water depth in urban flooding according to claim 9, characterized in that, Within the first grid mask, determining the event-level loss based on the difference between the maximum historical water depth prediction value and the maximum water accumulation depth label specifically includes: Based on the maximum water depth label and the preset water depth threshold, a dry area grid is determined within the first grid mask. The dry area grid is a spatial grid where the maximum water depth label is less than the water depth threshold. Determine the difference between the maximum historical water depth prediction value corresponding to the dry area grid and the water depth difference of the water accumulation threshold; Based on the water depth difference, a penalty term for exceeding the threshold in the dry area is determined; The event-level loss is determined based on the basic fitting loss between the maximum historical water depth prediction value and the corresponding maximum water accumulation depth label, as well as the dry area over-threshold penalty term.