A fast dam-break flow prediction method and system using a Transformer-ResUNet model

By using the Transformer-ResUNet model, the problem of insufficient utilization of flow field image information in existing dam-break flow prediction models is solved, achieving high-precision and fast dam-break flow field prediction, breaking through the computational bottleneck of traditional methods, and supporting real-time flood risk assessment.

CN120524818BActive Publication Date: 2026-02-03WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510672648.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-02-03
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

Existing dam-break flow prediction models fail to fully utilize flow field image information, resulting in reduced accuracy when predicting complex phenomena such as local abrupt changes and propagation attenuation in the flow field. Furthermore, they are computationally inefficient and difficult to achieve long-term prediction.

Method used

By employing the Transformer-ResUNet model, combined with a high-precision deep feature extraction module for dam-break flows and an attention-based remote temporal correlation mechanism, a deep learning computation framework suitable for dam-break flows is constructed. The ResUNet branch extracts high-frequency features in the flow abrupt change zone, while the Transformer branch captures the remote correlation of flood wave propagation, thus achieving spatiotemporal coupled prediction of the water level field and the flow velocity field.

Benefits of technology

It significantly improves the accuracy and efficiency of dam-break flow prediction, enabling rapid and accurate capture of transient flow phenomena and long-term evolution patterns of dam-break flows. It achieves prediction of the full-cycle evolution pattern from shock wave formation to flood wave diffusion, supporting real-time flood risk assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524818B_ABST
    Figure CN120524818B_ABST
Patent Text Reader

Abstract

The application discloses a dam-break flow rapid prediction method and system adopting a Transformer-ResUNet model. The method comprises the following steps: acquiring actual dam-break data or obtaining a data set for model training through numerical simulation; a dam-break flow space-time coupling prediction model fusing a Transformer and a ResUNet is constructed, the dam-break flow space-time coupling prediction model is an encoder-decoder architecture, the encoder extracts spatial features of a water flow field through a plurality of residual convolution layers, then, feature maps are divided and flattened into time sequence features, and the time sequence features are input into a parallel stacked Transformer module for time dynamic modeling; the decoder fuses the spatial features and the time sequence features enhanced by the Transformer through cross-layer connection, reconstructs a predicted water flow field at a future moment through step-by-step upsampling and a stacked bottleneck residual block; the constructed dam-break flow space-time coupling prediction model is trained, and the trained prediction model is used to realize rapid prediction of dam-break flow. The method realizes high-fidelity flow field detail reconstruction in flow field prediction based on an improved encoder-decoder structure of the ResUNet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of machine learning, specifically relating to a method and system for fast prediction of dam-break flows using the Transformer-ResUNet model. Background Technology

[0002] Over decades of development, methods for dam-break flood simulation have gradually formed a three-tiered complementary technical system. Traditional analytical methods, by simplifying governing equations to construct a theoretical framework, provide a fundamental understanding of dam-break flow dynamics. For example, linear solutions based on the Saint-Venant equations can derive core parameters such as dam-break wave propagation velocity. However, these methods are only applicable to idealized scenarios such as regular channels and homogeneous materials, and struggle to handle nonlinear effects caused by abrupt changes in actual terrain or complex boundary conditions. Physical model experiments, as the second type of method, enable direct observation of the dam-break process by constructing scaled physical models. Researchers precisely control parameters such as initial water level and dam structure in flume experiments, using high-speed photography and particle image velocimetry to capture flow field details. While this method can obtain key data such as velocity distribution and water level fluctuations, it is constrained by similarity criteria such as Reynolds number and Froude number, and scale effects prevent small-scale models from accurately reproducing the actual flow regime. Furthermore, the high cost of modeling complex terrain and the difficulty of sensor deployment severely limit its application in large-scale engineering projects. With the leap in computing power, numerical simulation technology has gradually become the core tool for dam-break analysis. This method reconstructs the entire fluid motion process in digital space by solving complete sets of governing equations (such as the one-dimensional Saint-Venant equation, the two-dimensional shallow water equation, or the three-dimensional Navier-Stokes equation). Advances in discretization techniques such as the finite difference method and the finite volume method have improved simulation accuracy to centimeter-level resolution. However, numerical stability is limited by time step conditions. When simulating highly nonlinear phenomena such as dam-break shock waves and free surfaces, the time step needs to be compressed to the millisecond level, resulting in a single simulation taking weeks. This computational bottleneck is particularly prominent when long-term evolution prediction is involved.

[0003] In recent years, machine learning algorithms have provided new ideas for overcoming the limitations of traditional methods. Early research used artificial neural networks (ANNs) to construct the mapping relationship between input parameters (such as initial water level and dam dimensions) and spatial node water levels, achieving performance superior to analytical solutions under specific conditions. The Bayesian Model Averaging (BMA) framework, by integrating heterogeneous models such as multilayer perceptrons and support vector machines, significantly improved the predictive robustness of dam-break flows from semi-circular obstacles. Two-dimensional convolutional neural networks (2D-CNNs) further realized end-to-end prediction from flow field images to water level distribution, but their single-step prediction mechanism failed to effectively capture the temporal dependence of water flow evolution. The introduction of temporal prediction methods marks a major shift in technical approaches. Reservoir computational echo state network (RC-ESN) utilizes dynamic reservoirs to process time series, accurately predicting the long-term attenuation law of dam-break wave propagation. A hybrid model integrating autoencoders (AEs) and attention-based long short-term memory networks (LSTM-ATTs) achieves full-cycle prediction of water level evolution through spatiotemporal feature decoupling. However, these methods primarily rely on discrete water level data acquired by sensors, failing to fully exploit key features such as frontal morphology contained in flow field images. This limitation in data format leads to a sharp drop in accuracy for existing models when predicting complex phenomena such as local abrupt changes in flow field and propagation attenuation. Despite the aforementioned progress, existing models largely depend on water level sequence data, failing to fully utilize image information. Given the outstanding performance of deep learning in image recognition, developing novel image-driven deep learning models has become an important direction for improving the prediction accuracy of dam-break flows. Summary of the Invention

[0004] To address the problems in existing technologies, this invention proposes a fast dam-break flow prediction method using the Transformer-ResUNet model, with the aim of:

[0005] (1) Solving the problem of rapid prediction of spatiotemporal water level and velocity in dam-break flows: By developing a high-precision deep feature extraction module for dam-break flows (ResUNet) and combining it with the attention-based long-range temporal correlation mechanism (Transformer), the limitations of traditional methods in modeling complex spatiotemporal coupling effects are overcome. This model can simultaneously analyze the spatial heterogeneity distribution patterns and temporal evolution characteristics of the water level field and the velocity field, significantly improving the prediction ability of transient flow phenomena in dam-break flows, and achieving a leapfrog improvement in prediction efficiency while ensuring accuracy.

[0006] (2) Constructing a coupled deep learning computing framework of Transformer and ResUNet suitable for dam-break flows: A special deep hybrid network architecture was designed to address the strong spatiotemporal coupling characteristics of the water level-velocity field in the transient flow of dam-break flows. The ResUNet branch retains the high-frequency flow field features of the flow abrupt change zone through skip connections, while the Transformer branch adopts a multi-head self-attention mechanism to accurately characterize the long-range correlation of flood wave propagation and capture the long-range dependencies of flood wave front propagation and energy dissipation. The framework uses information block extraction and multi-step spatiotemporal feature fusion, and learnable weights dynamically balance spatial details and temporal evolution laws, effectively solving the contradiction between flow field detail characterization and long-term evolution prediction efficiency.

[0007] (3) Implementing a long-term iterative method for predicting dam-break flow: Develop a prediction paradigm based on historical state recursion, using the predicted water depth-velocity tensor at the current moment as the input for the next time step, to achieve a dynamic dam-break flow prediction method. Based on the prediction results, construct a spatiotemporal database (water depth, velocity) to achieve long-term prediction of flood wave propagation. This method can autonomously capture the full-cycle evolution of dam-break flow from shock wave formation and flood wave diffusion to energy dissipation, providing a reliable basis for disaster development analysis.

[0008] The technical solution of this invention is a fast prediction method for dam-break flow using the Transformer-ResUNet model, which specifically includes the following steps:

[0009] Step 1: Obtain actual dam failure data or obtain a dataset for model training through numerical simulation;

[0010] Step 2: Construct a spatiotemporal coupled prediction model for dam-break flows that integrates Transformer and ResUNet. The spatiotemporal coupled prediction model for dam-break flows adopts an encoder-decoder architecture. The encoder extracts spatial features of the flow field through multiple residual convolutional layers. Then, the feature map is flattened into temporal features and input into parallel stacked Transformer modules for dynamic temporal modeling. The decoder fuses spatial features and Transformer-enhanced temporal features through cross-layer connections. It reconstructs the predicted flow field for future moments through progressive upsampling and stacked bottleneck residual blocks.

[0011] Step 3: Train the spatiotemporal coupling prediction model of dam-break flow constructed in Step 2, and use the trained prediction model to achieve rapid prediction of dam-break flow.

[0012] Furthermore, the specific implementation of step 1 includes:

[0013] Using a structured grid discretization method, accurate water flow data within the computational domain is obtained based on computational fluid dynamics. This data is then transformed into a spatiotemporally continuous dam-break flow velocity field and water level field through an interpolation algorithm. Finally, a feature image reconstruction algorithm is used to visualize the dynamic flow field.

[0014] The pixels of the image data are converted into a matrix grid, and then further processed into a feature tensor that can be called by the GPU.

[0015] By constructing continuous simulation sequence samples based on the sliding window mechanism and saving historical state information, the feature matrix of the preceding time step of the training samples is used as the input of the subsequent features, thereby establishing an image spatiotemporal dataset that supports autoregressive iterative prediction training tasks.

[0016] Furthermore, before entering the encoder, the input data is normalized and noise removed by a 7×7 convolutional layer and a max pooling layer. After being exported from the decoder, the output data is downsampled by a 1×1 convolutional layer to ensure the consistency of input and output specifications.

[0017] Furthermore, the residual convolutional layer includes one feature downsampling bottleneck residual block and two standard bottleneck residual blocks. The standard bottleneck residual block consists of: a 1×1 convolution for channel compression, a 3×3 depthwise separable convolution for spatial feature extraction, and a 1×1 convolution to restore channel dimensions. It uses the same level mapping to form the residual structure and enhances the nonlinear expressive power through batch normalization (BN) and ReLU activation functions.

[0018] The feature downsampling bottleneck residual block is based on the standard bottleneck residual block. It combines 2×2 max pooling with 3×3 depthwise separable convolution of the standard bottleneck residual block to reduce the feature map size by 50%. At the same time, it increases the receptive field and modifies the size of skip connection information through strided convolution, forming a feature sequence with decreasing spatial resolution but enhanced semantic information.

[0019] Furthermore, the Transformer module includes a multi-head self-attention module and a feedforward neural network module, achieving feature fusion through residual connections and layer normalization; the multi-head self-attention module maps the input sequence into multiple sets of query matrices. Key matrix and value matrix Calculate the attention weights in different feature subspaces respectively:

[0020] (1)

[0021] in, Let be the dimension of the key matrix;

[0022] The feedforward network consists of two fully connected layers and a ReLU activation function, used to perform a nonlinear transformation on the features output by the multi-head self-attention module. Its mathematical expression is as follows:

[0023] (2)

[0024] in, For input features, , This is the weight matrix. , This is a bias term.

[0025] Furthermore, using autoregressive sliding window prediction, the spatiotemporal coupled prediction model for dam-break flow is based on historical data. m The water flow field at each moment is taken as input, and the channel dimensions are stacked as follows: T -( m -1) to T ,predict T +1 time state; when obtained T After the prediction result at time +1, the oldest time in the input window will be entered. T -( m -1) Remove the current channel and add the newly predicted channel to the input matrix, thus keeping the input dimension constant. m One channel.

[0026] Furthermore, the training objective is to minimize the prediction result. With high-precision reference solution Mean square error implementation:

[0027] (3)

[0028] in, Here, N is the loss function, and N is the batch size. The L2 regularization coefficient is... These are trainable parameters.

[0029] Furthermore, parameters The update is implemented using the Adam optimizer, and the specific update method is as follows:

[0030] (4)

[0031] (5)

[0032] (6)

[0033] in, and These are the first-order and second-order moment deviation correction terms, respectively. For the number of iterations, For gradient, , Represents the gradient operator; and These are the biased first-order moment estimate and biased second-order moment deviation correction terms, respectively. Initialization of the first-order moment estimate... =0 and second moment estimation =0, The initial learning rate, It is a small constant, and the decay rate is and It is a constant.

[0034] Furthermore, it also includes visualizing the prediction results, specifically including:

[0035] First, spatial non-uniform grid technology is used to perform spatial interpolation on discrete prediction data. Combined with a time-dimensional linear interpolation algorithm, the discrete data is transformed into a continuous spatiotemporal field, accurately representing the dynamic changes in water level and the characteristics of flow velocity direction. Then, a split encoding strategy is adopted: the water level scalar field is mapped to a pseudo-color image channel, and the flow velocity vector field is decomposed into directional components. The color gradient is used to intuitively reflect the water depth and flow velocity distribution. Based on the resolution reconstruction technology of the Python image library, the encoding results are spatially upsampled and denoised to generate a high-resolution spatiotemporal image. The final output supports multiple format conversions and can be directly saved as a visualization file or converted to a structured database format.

[0036] This invention also provides a rapid dam-break flow prediction system using the Transformer-ResUNet model, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a rapid dam-break flow prediction method using the Transformer-ResUNet model as described in the above technical solution.

[0037] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows:

[0038] 1. This method is based on the improved ResUNet encoder-decoder structure, which achieves high-fidelity reconstruction of flow field details in flow field prediction. It can be applied to flow field reconstruction in practical application scenarios such as watershed-scale topographic confluence features and capturing sudden changes in flow velocity in local steep slopes and valleys.

[0039] 2. This method uses a special multi-scale Transformer method. Through adaptive weight allocation of the multi-head attention mechanism, the model can quantify the contribution of the flow field in different time dimensions. Combined with the autoregressive iterative prediction method, it captures the long-term dependence of hydrological data and can be applied to assess the lag correlation between rainfall sequences and flood peaks, the periodic impact of seasonal snowmelt on river flow, etc.

[0040] 3. The proposed Transformer-ResUNet fusion model for dam-break flows achieves spatiotemporal joint prediction, avoiding the problem of spatiotemporal feature fragmentation in traditional methods and alleviating the prediction bias caused by insufficient single-modal data. It can be applied to the processing of image sequence hydrological data and can be applied to application scenarios such as dynamic inundation maps and flood impact pressure fields.

[0041] 4. This method enables the prediction of dam-break flow evolution and can further guide model generation with physical laws, embedding the fundamental conservation laws of fluid motion into the data-driven model. Implicit constraints suppress non-physical solutions that may arise from pure data learning. This soft physical guidance mechanism ensures that the evolution trends of key parameters such as flow velocity and pressure conform to dynamic principles without relying on precise numerical discretization.

[0042] 5. This method can be applied to rapid early warning of actual flood risks, and further constructs the prediction results into a hierarchical early warning indicator system, realizing end-to-end mapping from flow field simulation to flood risk. By quantifying the spatial distribution of disaster-causing parameters such as inundation depth and impact force, it automatically generates impact range assessments for different emergency response levels. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the dataset in an embodiment of the present invention;

[0044] Figure 2 The bottleneck residual block structure in this embodiment of the invention includes (a) a feature downsampling structure (residual convolution A); and (b) a standard structure (residual convolution B).

[0045] Figure 3 This is the Transformer architecture in the embodiments of the present invention;

[0046] Figure 4 This is the Transformer-ResUNet fusion model in this embodiment of the invention;

[0047] Figure 5 This is a schematic diagram of the front section of the particle-induced dam failure numerical model in an embodiment of the present invention;

[0048] Figure 6 The above are the predicted water level and flow velocity fields under trained operating conditions in the embodiments of the present invention.

[0049] Figure 7 These are the water level and flow velocity field prediction results for some untrained working conditions in the embodiments of the present invention;

[0050] Figure 8 This is the prediction result of water level and flow velocity field under a novel working condition in this embodiment of the invention. Detailed Implementation

[0051] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0052] This invention provides a fast prediction method for dam-break flow using the Transformer-ResUNet model. The algorithm implementation process mainly includes three modules: preliminary dataset construction, implementation of deep learning method framework, and visualization of prediction results. Finally, a case study is added for verification.

[0053] (I) Preliminary Dataset Construction

[0054] The developed Transformer-ResUNet model requires a dataset obtained from actual dam failure data or numerical simulations for model pre-training. The dataset is designed to parameterize key variables such as upstream water level and initial particle accumulation height, considering multiple dam failure scenarios. Multiphase flow coupled numerical simulation technology is used to construct high-fidelity data that includes fluid-structure interaction. Figure 1 The specific methods are as follows: (1) Data processing: The structured grid discretization method is adopted. Accurate water flow data in the computational domain is obtained based on computational fluid dynamics-discrete element (CFD-DEM). The data is transformed into a spatiotemporally continuous dam break flow velocity field and water level field through interpolation algorithm. The dynamic visualization of the flow field is completed through feature image reconstruction algorithm; (2) Data processing: The pixels of the image data are transformed into a matrix grid, and further processed into feature tensors that can be called by GPU; (3) Data set construction: Based on the sliding window mechanism, a continuous simulation sequence sample is constructed. By saving historical state information, the feature matrix of the preceding time step of the training sample is used as the input of the subsequent feature, thereby establishing an image spatiotemporal dataset that supports autoregressive iterative prediction training task.

[0055] (II) Implementation of Deep Learning Method Framework

[0056] The deep learning methodology framework implementation modules include: Residual U-Net, Transformer, and Transformer-ResUNet fusion model.

[0057] (1) ResUNet

[0058] This invention proposes an improved U-shaped network architecture that integrates a residual learning mechanism. Targeting high-frequency flow characteristics such as abrupt frontal changes and vortex breakup in dam-break flows, a special residual learning module for dam-break flows is constructed based on the classic U-Net. Multi-level residual connections are embedded in the encoder-decoder symmetric path to stabilize the gradient of the dam-break flow. A cross-layer feature reuse strategy is used to suppress gradient decay during deep network training, enhancing the ability to progressively capture transient features such as the shock wave front of dam-break flows. In the encoding stage, a bottleneck layer replaces the traditional convolutional module (…). Figure 2 To reduce computational redundancy, a channel-dimensional compression and reconstruction strategy is employed, while max pooling is combined to achieve multi-scale downsampling of feature maps, forming a hierarchical feature pyramid. In the decoding stage, a deconvolution and upsampling fusion module is designed to gradually restore spatial resolution and reconstruct detailed flow field features. Skip connections are used to fuse low-order geometric features from the encoder with high-order semantic features from the decoder across scales, ensuring spatial consistency of the flow field topology. The specific multi-level residual network design is as follows:

[0059] In the encoder path, a feature pyramid is constructed using a three-level downsampling module. Each level includes:

[0060] The standard bottleneck residual block (bottleneck residual block-B) consists of a 1×1 convolution for channel compression (reducing dimensionality to 1 / 4 of the original number of channels), a 3×3 depthwise separable convolution for spatial feature extraction, and a 1×1 convolution to restore channel dimensionality (increasing dimensionality to the original number of channels). It uses a hierarchical mapping to form the residual structure and enhances nonlinear expressive power through batch normalization (BN) and ReLU activation functions. See attached details. Figure 2 (b) in the middle;

[0061] Feature downsampling bottleneck residual block (bottleneck residual block-A): A 2×2 max pooling operation is combined with a 3×3 depthwise separable convolution of the bottleneck residual block to reduce the feature map size by 50%. Simultaneously, a stride convolution (stride=2) is used to increase the receptive field and modify the size of skip connection information, forming a feature sequence with decreasing spatial resolution but enhanced semantic information; details are attached. Figure 2 (a) in the middle;

[0062] Establish feature transfer paths between corresponding layers of the encoder and decoder:

[0063] Feature transfer: After channel alignment of the encoder outputs through 1×1 convolution, they are concatenated with the feature maps of the same scale as the decoder along the channel dimension to preserve the geometric boundary details of the dam-break flow field.

[0064] The decoder uses a four-stage upsampling module to reconstruct the flow field.

[0065] Feature upsampling: The feature map size is expanded by 200% through transposed convolution, and bilinear interpolation is used to compensate for spatial details;

[0066] Multi-scale feature fusion: The upsampled features are concatenated with the same-scale encoded features passed through skip connections, and then input into the bottleneck residual block-B for nonlinear transformation. Continuing with the bottleneck structure, the fused information is compressed using 1×1 convolutions (reducing dimensionality to 1 / 4 of the original number of channels), spatial features are extracted using 3×3 depthwise separable convolutions, and channel dimensions are restored using 1×1 convolutions (increasing dimensionality to the original number of channels). Batch normalization (BN) and ReLU activation functions enhance the nonlinear expressive power, maintain the reuse of features at the same level, and alleviate the gradient decay problem in the decoding stage.

[0067] (2) Transformer

[0068] This invention employs a Transformer-based temporal prediction method to improve the prediction accuracy of dam-break flow dynamics models. A dedicated coding architecture is designed to address the temporal correlation characteristics of dam-break flood wave front propagation and nonlinear energy dissipation. The core of the method is a multi-layered stacked Transformer encoder (…). Figure 3 Each encoder layer contains a multi-head self-attention module and a feedforward neural network module, achieving feature fusion through residual connections and layer normalization. The hierarchical design of the encoder can extract local and global correlation features from the time series layer by layer and adaptively learn the multi-scale spatiotemporal evolution of dam-break flow. In the encoder, the multi-head self-attention module maps the input sequence into multiple sets of query matrices (…). ), key matrix ( ) and value matrix ( ), calculate the attention weights in different feature subspaces respectively:

[0069] (1)

[0070] in, The scaling factor, calculated using a scaled dot product, mitigates gradient instability in high-dimensional matrix operations, representing the dimension of the key matrix. The attention function is calculated by concatenating it with the weights through parallel computation, enabling simultaneous attention to water flow state changes at multiple key locations within the time series. The original time series data is divided into multiple subsequences within fixed time windows, linearly projected, and then flattened into a high-dimensional tensor. This process preserves local temporal features while enhancing the model's ability to represent nonlinear dynamic systems through dimensional expansion.

[0071] The feedforward network in the encoder consists of two fully connected layers and a ReLU activation function, used to perform a nonlinear transformation on the features output by the multi-head self-attention module. The mathematical expression of the feedforward network in the encoder, consisting of two fully connected layers and a ReLU activation function, is as follows:

[0072] (2)

[0073] in, As input features, , This is the weight matrix. , The bias term is used as the weight matrix. This network further enhances the model's ability to fit complex dynamics such as sudden changes in water flow and boundary conditions through linear combinations and nonlinear mappings of the weight matrix and the bias term.

[0074] (3) Transformer-ResUNet fusion model

[0075] This invention proposes a hybrid enhancement framework for spatiotemporal coupling prediction of dam-break flows (Transformer-ResUNet), which integrates Transformer and ResUNet. It combines image temporal data-driven modeling and utilizes an improved encoder-decoder architecture to simultaneously extract spatial features and capture long-range temporal dependencies. Figure 4 ).

[0076] The Transformer-ResUNet framework uses ResUNet as the backbone network for spatial feature extraction. Its encoder extracts high-dimensional spatial features of the flow field through residual convolutional layers. Subsequently, the feature maps are flattened into temporal tokens (minimum processing units) and input into parallel stacked Transformer modules for dynamic temporal modeling. The decoder fuses spatial details with the Transformer-enhanced temporal features through cross-layer connections, progressively upsampling to reconstruct the predicted flow field for future timeframes. To ensure the consistency of the input data distribution, the input data undergoes normalization and noise removal through a 7×7 convolutional layer and a max-pooling layer before entering the encoder. The output data is downsampled through a 1×1 convolutional layer after exiting the decoder, ensuring consistency between input and output specifications.

[0077] The model uses an autoregressive sliding window for prediction, and its historical data is used as a reference. m The water flow field at each moment (channel dimensions stacked as follows) T -( m -1) to T Given ) as input, predict T +1 time state. When obtained T After the prediction result at time +1, the oldest time in the input window will be entered. T -( m -1) is removed, and the newly predicted result is added to the input matrix as the latest channel. This mechanism keeps the input dimension constant ( m (Channel), and simultaneously achieves continuous extrapolation of future moments through iterative prediction, effectively simulating the nonlinear propagation process of dam-break water flow. The training objective is to minimize the prediction results. With high-precision reference solution Mean square error implementation:

[0078] (3)

[0079] in, Here, N is the loss function, and N is the batch size. The L2 regularization coefficient is... These are trainable parameters. The update uses the Adam optimizer:

[0080] (4)

[0081] (5)

[0082] (6)

[0083] in, and These are the first-order and second-order moment deviation correction terms, respectively. For the number of iterations, For gradient, , Represents the gradient operator, and These are the biased first-order moment estimate and biased second-order moment deviation correction terms, respectively. Initialization of the first-order moment estimate... =0 and second moment estimation =0, The initial learning rate is a small constant. =10 -8 The attenuation rate is =0.9, =0.999.

[0084] (III) Prediction Result Visualization Module

[0085] This module uses a spatiotemporally continuous data structure to encode multi-physics information such as water level and velocity vectors from dam-break flow prediction results into a standardized tensor sequence, constructing a matrix structure based on GPU-efficient computation. First, spatial non-uniform grid technology is used to perform spatial interpolation on the discrete prediction data, combined with a time-dimensional linear interpolation algorithm, transforming the discrete data into a continuous spatiotemporal field that accurately represents features such as dynamic changes in water level and flow direction. Then, a separate encoding strategy is employed: the water level scalar field is mapped to pseudo-color image channels, while the flow velocity vector field is decomposed into directional components, visually reflecting water depth and flow velocity distribution through color gradients. Based on resolution reconstruction techniques using Python image libraries (such as Matplotlib and OpenCV), spatial upsampling and noise reduction are applied to the encoded results to generate high-resolution spatiotemporal images. The final output supports multiple format conversions, allowing direct saving as PNG, JPG, and other visualization files, or conversion to structured database formats (such as HDF5).

[0086] (iv) Case study on dam break flow prediction

[0087] A high-fidelity numerical model based on CFD-DEM (Computational Fluid Dynamics-Discrete Element Coupling) of coupled particle-flow interaction was constructed, and a multiphysics dataset of dam breakage parameters including different upstream water levels and dam heights was built. Figure 5 The basic model was trained using a full-parameter dataset (including upstream water level and dam height). Subsequently, sensitivity analysis was used to optimize parameters such as model network depth, input historical time step, and numerical simulation time step, resulting in a high-performance Transformer-ResUNet prediction model.

[0088] Model validation is divided into three test scenarios: trained conditions, partially untrained conditions, and entirely new conditions. For each test scenario, water level and flow velocity field information are simulated for 10 time steps (0.1s in total) based on the initial numerical values ​​output by the model. An autoregressive prediction loop is constructed, and the latest prediction result is updated to the input window at each step. The flow field evolution data for the next 200 steps (2s in total) are continuously generated through a sliding window mechanism.

[0089] The new algorithm can complete the dynamic prediction of a 200-step fluid-particle system in just 11 seconds, which is about 1,000 times faster than the traditional CFD-DEM simulation method (which takes 10,800 seconds). This leap in efficiency enables complex multiphase flow simulations that previously took hours or even days to achieve near real-time dynamic prediction (second-level response).

[0090] (1) Training conditions

[0091] The predicted data for the trained working conditions are the combination of initial upstream water level and dam height, which are consistent with the parameter range of the training set, to verify the model's ability to accurately reproduce known working conditions. Figure 6 As shown, regarding the upstream particle dam accumulation height ( H g ) and initial water level ( H w Both simulations used an experimental scale of 0.2 m dam-break conditions. A comparison of the Transformer-ResUNet model's predictions at T=0.2 and 1.2 s (first column) with high-precision CFD-DEM coupled simulations (second column) shows that the model successfully captured the gravity-driven release process of water flow and particles, the dynamic interaction of downstream tailwater, and accurately reproduced the downstream propagation of the dam-break flood wave and the trend of the water surface gradually smoothing under the dominance of wavefront resistance. Although local differences in wavefront velocity and height gradually accumulated over time, the average prediction results for the dam-break flow process were highly consistent with the CFD-DEM simulation, with final prediction errors of only 0.2% for water level and 3.8% for flow velocity, successfully capturing the nonlinear characteristics of fluid flow.

[0092] (2) Some untrained working conditions

[0093] Some untrained operating conditions involve fixing the trained upstream water level parameters and inputting dam height data that exceeds the training range to test the model's adaptability to extrapolation of a single variable. Figure 7 As shown, regarding the upstream particle dam accumulation height ( H g Known and initial water level ( H w For unknown experimental scale dam-break conditions, the Transformer-ResUNet model's predictions at T=0.2 and 1.2s (first column) are compared with high-precision CFD-DEM coupled simulations (second column). The results show that although local errors accumulate over time, it can still accurately reconstruct the dam-break flow characteristics at 1.2s. Moreover, the prediction results at all times are in high agreement with the CFD-DEM simulations. The final prediction errors for water level and flow velocity are only 0.5% and 6.0%, respectively.

[0094] (3) New operating conditions

[0095] The new operating condition uses a combination of water level and dam height that has not been trained at all to evaluate the model's generalization prediction performance for unknown parameters. Figure 8 As shown, although the local errors in details of dam-break flow, such as particle front propagation delay, are amplified over time, they can still reconstruct the overall flow characteristics with high fidelity at 1.2s, with the final prediction errors for water level and flow velocity being only 2.0% and 14.2%, respectively.

[0096] In summary, this invention provides a dynamic prediction model based on dam-break flow image sequence data, achieving high-precision and rapid prediction of dam-break flow fields (water level, velocity), overcoming the bottleneck of excessively long prediction times in traditional numerical simulation methods, and improving prediction efficiency by approximately a thousandfold. This enables near real-time dynamic prediction (second-level response) of complex multiphase flow simulations that previously required hours or even days. To address the strong spatiotemporal coupling characteristics of the water level-velocity field in transient dam-break flows, a deep hybrid architecture based on Transformer-ResUNet is designed. The ResNet module enhances the extraction capability of high-frequency features such as the dam-break shock wave front through residual skip connections; the U-Net branch constructs a multi-scale spatial encoder to accurately characterize spatial heterogeneity; and the embedded Transformer temporal attention submodule analyzes the long-range spatiotemporal correlation of dam-break flood wave propagation, forming a dedicated spatiotemporal coupling analysis module for dam-break flows, overcoming the bottleneck of traditional models in representing the evolution of unsteady flow states.

[0097] This invention also provides a method for high-fidelity flow field detail reconstruction in flow field prediction, achieving high-resolution detail reconstruction in dam-break flow fields. A deep learning framework for multi-physics coupling in dam-break flows is constructed. The encoder extracts abstract flow field features at different scales through layer-by-layer downsampling, while the decoder dynamically fuses low-level details with deep semantic features using skip connections.

[0098] This invention also provides a method for generating and converting physically constrained datasets into tensor data, used to construct physically reliable training samples. The model completes the conversion of numerical simulation data into computer encoding for prediction and visualizes the results as image data. Water level, flow velocity, and pressure fields are encoded into spatiotemporal tensor sequences, constructing a standardized input format for multi-physics coupling. A separate encoding strategy is adopted to convert the flow field into a high-resolution image, enhancing the model's ability to identify complex flow states.

[0099] This invention also provides a method for predicting the autonomous evolution of dam-break flows, capturing the long-term dependencies of hydrological data and enabling long-term predictions based on short-term initial real data. An error correction module suppresses error accumulation, and each iteration only learns the deviation between the current prediction and the actual value. The multi-scale Transformer method used employs adaptive weight allocation through a multi-head attention mechanism, enabling the model to quantify the contribution of the flow field at different time dimensions, combined with an autoregressive iterative prediction method.

[0100] On the other hand, the present invention also provides a dam-break flow rapid prediction system using the Transformer-ResUNet model, characterized in that: it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements a dam-break flow rapid prediction method using the Transformer-ResUNet model as described in the above technical solution.

[0101] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A fast prediction method for dam-break flow using the Transformer-ResUNet model, characterized in that, Includes the following steps: Step 1: Obtain actual dam failure data or obtain a dataset for model training through numerical simulation; Step 2: Construct a spatiotemporal coupled prediction model for dam-break flow that integrates Transformer and ResUNet. The spatiotemporal coupled prediction model for dam-break flow is an encoder-decoder architecture. The encoder extracts the spatial features of the water flow field through multiple residual convolutional layers. Then, the feature map is flattened into temporal features and input into a parallel stacked Transformer module for time dynamic modeling. The decoder fuses spatial features with Transformer-enhanced temporal features through cross-layer connections, and reconstructs the predicted water flow field for future moments through progressive upsampling and stacked bottleneck residual blocks; The residual convolutional layer includes one feature downsampling bottleneck residual block and two standard bottleneck residual blocks. The standard bottleneck residual block consists of a 1×1 convolution for channel compression, a 3×3 depthwise separable convolution for spatial feature extraction, and a 1×1 convolution to restore the channel dimension. It uses the same level mapping to form the residual structure and enhances the nonlinear expressive power through batch normalization (BN) and ReLU activation functions. The feature downsampling bottleneck residual block is based on the standard bottleneck residual block. It combines 2×2 max pooling with 3×3 depthwise separable convolution of the standard bottleneck residual block to reduce the feature map size by 50%. At the same time, it increases the receptive field and modifies the size of skip connection information through strided convolution, forming a feature sequence with decreasing spatial resolution but enhanced semantic information. Step 3: Train the spatiotemporal coupling prediction model of dam-break flow constructed in Step 2, and use the trained prediction model to achieve rapid prediction of dam-break flow.

2. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 1, characterized in that: The specific implementation of step 1 includes: Using a structured grid discretization method, accurate water flow data within the computational domain is obtained based on computational fluid dynamics. This data is then transformed into a spatiotemporally continuous dam-break flow velocity field and water level field through an interpolation algorithm. Finally, a feature image reconstruction algorithm is used to visualize the dynamic flow field. The pixels of the image data are converted into a matrix grid, and then further processed into a feature tensor that can be called by the GPU. By constructing continuous simulation sequence samples based on the sliding window mechanism and saving historical state information, the feature matrix of the preceding time step of the training samples is used as the input of the subsequent features, thereby establishing an image spatiotemporal dataset that supports autoregressive iterative prediction training tasks.

3. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 1, characterized in that: Before entering the encoder, the input data is normalized and noise is removed by a 7×7 convolutional layer and a max pooling layer. After being exported from the decoder, the output data is downsampled by a 1×1 convolutional layer to ensure the consistency of input and output specifications.

4. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 1, characterized in that: The Transformer module includes a multi-head self-attention module and a feedforward neural network module, achieving feature fusion through residual connections and layer normalization; the multi-head self-attention module maps the input sequence into multiple sets of query matrices. Key matrix and value matrix Calculate the attention weights in different feature subspaces respectively: (1) in, Let be the dimension of the key matrix; The feedforward network consists of two fully connected layers and a ReLU activation function, used to perform a nonlinear transformation on the features output by the multi-head self-attention module. Its mathematical expression is as follows: (2) in, For input features, , This is the weight matrix. , This is a bias term.

5. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 1, characterized in that: Using autoregressive sliding window prediction, the spatiotemporal coupled prediction model for dam-break flow is based on historical data. m The water flow field at each moment is taken as input, and the channel dimensions are stacked as follows: T -( m -1) to T ,predict T +1 time state; when obtained T After the prediction result at time +1, the oldest time in the input window will be entered. T -( m -1) Remove the current channel and add the newly predicted channel to the input matrix, thus keeping the input dimension constant. m One channel.

6. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 1, characterized in that: The training objective is to minimize the prediction result. With high-precision reference solution Mean square error implementation: (3) in, Here, N is the loss function, and N is the batch size. The L2 regularization coefficient is... These are trainable parameters.

7. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 6, characterized in that: parameter The update is implemented using the Adam optimizer, and the specific update method is as follows: (4) (5) (6) in, and These are the first-order and second-order moment deviation correction terms, respectively. For the number of iterations, For gradient, , Represents the gradient operator; and These are the biased first-order moment estimate and biased second-order moment deviation correction terms, respectively. Initialization of the first-order moment estimate... =0 and second moment estimation =0, The initial learning rate, It is a small constant, and the decay rate is and It is a constant.

8. The method for fast prediction of dam-break flow using the Transformer-ResUNet model as described in claim 1, characterized in that: This also includes visualizing the prediction results, specifically including: First, spatial non-uniform grid technology is used to perform spatial interpolation on discrete prediction data. Combined with a time-dimensional linear interpolation algorithm, the discrete data is transformed into a continuous spatiotemporal field, accurately representing the dynamic changes in water level and the characteristics of flow velocity direction. Then, a split encoding strategy is adopted: the water level scalar field is mapped to a pseudo-color image channel, and the flow velocity vector field is decomposed into directional components. The color gradient is used to intuitively reflect the water depth and flow velocity distribution. Based on the resolution reconstruction technology of the Python image library, the encoding results are spatially upsampled and denoised to generate a high-resolution spatiotemporal image. The final output supports multiple format conversions and can be directly saved as a visualization file or converted to a structured database format.

9. A fast dam-break flow prediction system using the Transformer-ResUNet model, characterized in that: The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements a method for fast prediction of dam-break flows using a Transformer-ResUNet model as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Image segmentation method based on full-scale jump connection U-shaped structure

    CN116958541A

  • Method and system for predicting flow peak value of debris flow of barrier dam of loose rock-soil body

    CN117744535A