Dam break flow rapid prediction method and system adopting Transform-ResUNet model

Through the Transformer-ResUNet model, the existing dam burst flow prediction model has solved the problem of insufficient utilization of flow field image information and low computational efficiency in flow field, and achieved high-precision and rapid dam burst flow field prediction, breaking through the limitations of space-time coupling effect modeling of traditional methods, and supporting long-term prediction and real-time analysis.

CN120524818AActive Publication Date: 2025-08-22WUHAN UNIV

Patent Information

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

AI Technical Summary

Technical Problem

The existing dam burst flow prediction model fails to make full use of flow field image information, resulting in reduced accuracy when predicting complex phenomena such as local sudden changes in the flow field and propagation attenuation, and low calculation efficiency, making it difficult to achieve long-term prediction.

Method used

Using the Transformer-ResUNet model, combined with the high-precision deep feature extraction module of ResUNet and the remote timing correlation mechanism of Transformer, a deep hybrid network architecture suitable for dam collapse flow is designed. Through jump connection and multi-head self-attention mechanism, a deep hybrid network architecture is designed to capture the propagation and energy dissipation of flood waves, and realize the space-time coupling prediction of the water level field and the flow velocity field.

Benefits of technology

It significantly improves the accuracy and efficiency of dam collapse flow prediction, can quickly and accurately capture the details of the flow field and long-term evolution laws, and realizes the full-cycle evolution prediction from shock wave formation to energy dissipation, providing a reliable basis for disaster development analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524818A_ABST
    Figure CN120524818A_ABST
Patent Text Reader

Abstract

The invention discloses a dam break flow rapid prediction method and a dam break flow rapid prediction system adopting a Transform-ResUNet model. Comprising the steps of obtaining 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 Transform and ResUNet is constructed, the dam break flow space-time coupling prediction model is an encoder-decoder architecture, an encoder extracts spatial features of a water flow field through a plurality of residual convolutional layers, then feature maps are partitioned and flattened into time sequence features, and the time sequence features are input into a parallel stacked Transform module for time dynamic modeling; the decoder fuses the spatial features and Transform enhanced time sequence features through cross-layer connection, and reconstructs a predicted water flow field at a future moment through bottleneck residual blocks which are up-sampled and stacked step by step; and training the constructed dam break flow space-time coupling prediction model, and realizing rapid prediction of the dam break flow by using the trained prediction model. According to the method, high-fidelity flow field detail reconstruction is realized in flow field prediction based on an improved ResUNet encoder-decoder structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of machine learning, and in particular relates to a method and system for quickly predicting dam break flows using a Transformer-ResUNet model. Background Art

[0002] Dam-break flood simulation methods have evolved over decades, gradually forming three complementary technical systems. Traditional analytical methods simplify the governing equations to construct a theoretical framework, providing a fundamental understanding of dam-break flow dynamics. For example, linearized solutions based on the Saint-Venant equation can derive key parameters such as the propagation velocity of the dam-break wave. However, these methods are only applicable to idealized scenarios such as regular river channels and homogeneous materials, and are difficult to handle nonlinear effects caused by sudden changes in real terrain or complex boundary conditions. Physical model testing, a second approach, enables intuitive observation of the dam-break process by constructing scaled physical models. In flume experiments, researchers precisely control parameters such as the initial water level and dam structure, capturing detailed flow field information using techniques such as high-speed photography and particle image velocimetry. While these methods can capture key data such as velocity distribution and water level fluctuations, they are limited by similarity criteria such as the Reynolds number and Froude number, and scale effects prevent small-scale models from accurately reproducing actual flow patterns. Furthermore, the high cost of modeling complex terrain and the difficulty of deploying sensors severely limit their application in large-scale projects. With the rapid advancement of computing power, numerical simulation technology has gradually become a core tool for dam-break analysis. This method reconstructs the entire fluid motion process in digital space by solving a complete set of governing equations (such as the one-dimensional Saint-Venant equations, the two-dimensional shallow water equations, or the three-dimensional Navier-Stokes equations). Advances in discretization techniques such as the finite difference method and the finite volume method have enabled simulation accuracy to be improved to centimeter-level resolution. However, numerical stability is constrained by step-size constraints. When simulating strongly nonlinear phenomena such as dam-break shock waves and free surfaces, the time step must be compressed to the millisecond level, resulting in a single simulation taking up to several weeks. This computational bottleneck is particularly prominent when it comes to long-term evolution predictions.

[0003] In recent years, machine learning algorithms have provided new insights to overcome the limitations of traditional methods. Early studies used artificial neural networks (ANNs) to construct mappings between input parameters (such as initial water level and dam dimensions) and water levels at spatial nodes, achieving superior performance to analytical solutions under specific conditions. The Bayesian Model Averaging (BMA) framework significantly improved the robustness of dam-break flow prediction around semicircular obstacles by integrating heterogeneous models such as multilayer perceptrons and support vector machines. Two-dimensional convolutional neural networks (2D-CNNs) further enabled end-to-end prediction of water level distributions from flow field images, but their single-step prediction mechanism failed to effectively capture the temporal dependencies of flow evolution. The introduction of time-series prediction methods marked a significant shift in the technological approach. The Reservoir Computation Echo State Network (RC-ESN) utilizes a dynamic reservoir to process time series and accurately predict the long-term attenuation patterns of dam-break wave propagation. A hybrid model combining an autoencoder (AE) with a long short-term memory network (LSTM-ATT) with an attention mechanism achieved full-cycle prediction of water level evolution by decoupling spatiotemporal features. 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 data limitation leads to a sharp drop in the accuracy of existing models when predicting complex phenomena such as localized sudden changes in the flow field and propagation attenuation. Despite these advances, existing models often rely on water level sequence data and fail to fully utilize image information. Given the outstanding performance of deep learning in image recognition, developing new image-driven deep learning models has become an important direction for improving the accuracy of dam-break flow prediction. Summary of the Invention

[0004] To address the problems in the existing technology, this paper proposes a fast dam-break flow prediction method using the Transformer-ResUNet model, the purpose of which is to: (1) Solve the problem of rapid prediction of spatiotemporal water level and velocity of dam-break flow: By developing a high-precision deep feature extraction module for dam-break flow (ResUNet) combined with the attention-based remote temporal correlation mechanism (Transformer), we break through the limitations of traditional methods in modeling complex spatiotemporal coupling effects. This model can simultaneously analyze the spatial heterogeneity of the water level field and velocity field and their temporal evolution characteristics, significantly improving the ability to predict transient flow phenomena of dam-break flow, while ensuring accuracy and achieving a leap in prediction efficiency.

[0005] (2) Constructing a Transformer and ResUNet coupled deep learning computational framework suitable for dam-break flows: A special deep hybrid network architecture is 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 characteristics of the flow mutation zone through jump connections, while the Transformer branch uses a multi-head self-attention mechanism to accurately depict the long-range correlation of flood wave propagation and capture the long-range dependence of flood wave front propagation and energy dissipation. The framework uses information block extraction and multi-step spatiotemporal feature fusion, and dynamically balances spatial details and temporal evolution laws through learnable weights, effectively resolving the contradiction between flow field detail description and long-term evolution prediction efficiency.

[0006] (3) Implementing an iterative method for long-term dam-break flow prediction: Developing a prediction paradigm based on historical state recursion, using the water depth-velocity tensor predicted at the current moment as the input for the next time step, a method for dynamic dam-break flow prediction is implemented. Based on the prediction results, a spatiotemporal database (water depth, velocity) is constructed 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.

[0007] The technical solution of the present invention is a method for rapid prediction of dam-break flow using a Transformer-ResUNet model, which specifically includes the following steps: Step 1: Obtain actual dam break data or obtain a data set 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. Subsequently, the feature map is flattened into temporal features and input into parallel stacked Transformer modules for temporal dynamic modeling. The decoder fuses the spatial features with the temporal features enhanced by the Transformer through cross-layer connections, and reconstructs the predicted water flow field at the future moment through step-by-step upsampling and stacked bottleneck residual blocks. Step 3: Train the spatiotemporal coupled prediction model for dam-break flow constructed in step 2, and use the trained prediction model to achieve rapid prediction of dam-break flow.

[0008] Furthermore, the specific implementation of step 1 includes: Using a structured grid discretization method and computational fluid dynamics, accurate water flow data within the computational domain is obtained. This data is then converted into a spatiotemporally continuous dam-break flow velocity field and water level field through an interpolation algorithm. The dynamic flow field is then visualized using a feature image reconstruction algorithm. Convert the pixels of the image data into a matrix grid, which is then further processed into a feature tensor that can be called by the GPU; Continuous simulation sequence samples are constructed based on the sliding window mechanism. By saving historical state information, the feature matrix of the previous 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 tasks.

[0009] Furthermore, the input data is normalized and denoised through a 7×7 convolution layer and a maximum pooling layer before entering the encoder. The output data is downsampled through a 1×1 convolution layer after being exported to the decoder to ensure consistency between input and output specifications.

[0010] Furthermore, the residual convolution layer includes one feature downsampling bottleneck residual block and two standard bottleneck residual blocks. The standard bottleneck residual block includes: 1×1 convolution for channel compression, 3×3 depth-separable convolution to extract spatial features, and 1×1 convolution to restore the channel dimension. It uses the same-level mapping to form a residual structure and enhances the nonlinear expression ability through batch normalization BN and ReLU activation function. The feature downsampling bottleneck residual block is based on the standard bottleneck residual block. It combines a 2×2 maximum pooling operation with the 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 through strided convolution and modifies the size of skip connection information, forming a feature sequence with reduced spatial resolution but enhanced semantic information.

[0011] Furthermore, the Transformer module includes a multi-head self-attention module and a feedforward neural network module, which realizes feature fusion through residual connection 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, is the dimension of the key matrix; The feedforward network consists of two fully connected layers and a ReLU activation function, which is used to perform nonlinear transformation on the features output by the multi-head self-attention module. Its mathematical expression is: (2) in, is the input feature, 、 is the weight matrix, 、 is the bias term.

[0012] Furthermore, the autoregressive sliding window prediction is used, and the spatiotemporal coupling prediction model of dam break flow is based on historical m The water flow field at the moment is input, and the channel dimension is stacked as T -( m -1) to T ,predict T +1 moment status; when you get T After the prediction result of +1 moment, the oldest moment in the input window will be T -( m -1) is removed and the newly predicted result is added to the input matrix as the latest channel, keeping the input dimension constant. m channels.

[0013] Furthermore, the training objective is to minimize the prediction results High-precision reference solution The mean square error is achieved by: (3) in, is the loss function, N is the batch size, is the L2 regularization coefficient, is a trainable parameter.

[0014] Furthermore, the parameters The update is implemented using the Adam optimizer, and the specific update method is as follows: (4) (5) (6) in, and are the first-order moment and second-order moment deviation correction terms, is the number of iterations, is the gradient, , represents the gradient operator; and They are biased first-order moment estimation and biased second-order moment deviation correction terms, and initialize the first-order moment estimation. = 0 and second-order moment estimates =0, is the initial learning rate, is a small constant, and the decay rate is and is a constant.

[0015] Furthermore, it also includes visualizing the prediction results, including: First, spatial non-uniform grid technology is used to spatially interpolate discrete prediction data. Combined with the time dimension linear interpolation algorithm, the discrete data is converted into a continuous space-time field to accurately express the dynamic changes of water level and the direction characteristics of flow velocity. Subsequently, a separate encoding strategy is adopted: the water level scalar field is mapped into a pseudo-color image channel, and the flow velocity vector field is decomposed into directional components, and the water depth and flow velocity distribution are intuitively reflected through color gradients. Based on the resolution reconstruction technology of the Python image library, the encoding results are spatially upsampled and denoised to generate high-resolution space-time images. The final output supports multi-format conversion and can be directly saved as a visualization file or converted into a structured database format.

[0016] The present invention also provides a dam-break flow rapid prediction system using a Transformer-ResUNet model, which is characterized by comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a dam-break flow rapid prediction method using a Transformer-ResUNet model as described in the above technical solution is implemented.

[0017] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows: 1. This method is based on the improved encoder-decoder structure of ResUNet and achieves high-fidelity flow field detail reconstruction in flow field prediction. It can be applied to flow field reconstruction in practical application scenarios such as basin-scale terrain confluence characteristics and capturing sudden changes in flow velocity in local steep slope valleys.

[0018] 2. This method uses a special multi-scale Transformer method. Through the adaptive weight allocation of the multi-head attention mechanism, the model can quantify the contribution of flow fields in different time dimensions. Combined with the autoregressive iterative prediction method, it captures the long-term dependencies of hydrological data and is used to evaluate the lagged correlation between rainfall sequences and flood peaks, and the periodic impact of seasonal snowmelt on river flow.

[0019] 3. The Transformer-ResUNet fusion model suitable for dam break flow proposed in this method realizes joint spatiotemporal prediction, avoids the problem of spatiotemporal feature separation in traditional methods, and alleviates 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.

[0020] 4. This method enables the prediction of dam-break flow evolution and further allows physical laws to guide model generation. Fundamental conservation laws of fluid motion are embedded in data-driven models, and implicit constraints are used to suppress non-physical solutions that may arise from pure data learning. This soft physics guidance mechanism ensures that the evolution of key parameters such as flow velocity and pressure conforms to dynamic principles without relying on precise numerical discretization.

[0021] 5. This method can be applied to rapid early warning of actual flood risks. The prediction results can be further constructed into a graded early warning indicator system, achieving an 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, impact range assessments for different emergency response levels can be automatically generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a schematic diagram of a data set in an embodiment of the present invention; Figure 2 This is the bottleneck residual block structure in the embodiment of the present invention, where (a) feature downsampling structure (residual convolution A); (b) standard structure (residual convolution B); Figure 3 This is the Transformer architecture in the embodiment of the present invention; Figure 4 It is the Transformer-ResUNet fusion model in the embodiment of the present invention; Figure 5 Schematic diagram of the front section of the particle dam-break numerical model in an embodiment of the present invention; Figure 6 The trained working condition water level and flow velocity field prediction results in the embodiment of the present invention; Figure 7 The water level and flow velocity field prediction results of some untrained working conditions in the embodiment of the present invention; Figure 8 This is the prediction result of the water level and flow velocity field under the new working condition in the embodiment of the present invention. DETAILED DESCRIPTION

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

[0024] An embodiment of the present invention provides a method for rapid prediction of dam-break flow using the Transformer-ResUNet model. The algorithm implementation process mainly includes three modules: preliminary dataset construction, deep learning method framework implementation, and visualization of prediction results. Finally, a case verification is supplemented.

[0025] (1) Preliminary dataset construction The developed Transformer-ResUNet model requires a dataset obtained through actual dam break data or numerical simulation for model pre-training. The dataset parameterizes key variables such as upstream water level and initial particle accumulation height, considers multiple reservoir dam break modes, and uses multiphase flow coupling numerical simulation technology to construct high-fidelity data that includes fluid-solid coupling effects ( Figure 1 The specific methods are as follows: (1) Data processing: Using the structured grid discretization method, based on computational fluid dynamics-discrete element (CFD-DEM), accurate water flow data in the computational domain is obtained, which is converted into a spatiotemporal continuous dam break flow velocity field and water level field through the interpolation algorithm, and the dynamic visualization of the flow field is completed through the feature image reconstruction algorithm; (2) Data processing: The pixels of the image data are converted into a matrix grid, which is further processed and converted into a feature tensor that can be called by the GPU; (3) Data set construction: Based on the continuous simulation sequence sample constructed by the sliding window mechanism, by saving the historical state information, the feature matrix of the previous time step of the training sample is used as the input of the subsequent feature, thereby establishing an image spatiotemporal dataset that supports the autoregressive iterative prediction training task.

[0026] (2) Implementation of Deep Learning Method Framework The deep learning method framework implementation modules include: Residual U-type network (ResUNet), Transformer, and Transformer-ResUNet fusion model.

[0027] (1) ResUNet This paper proposes an improved U-shaped network architecture that integrates residual learning mechanism. Aiming at high-frequency flow characteristics such as sudden change of dam-break flow front and vortex breaking, a special dam-break flow residual learning module is constructed based on the classic U-Net. Multi-level residual connections are embedded in the encoding-decoding symmetric path to stabilize the dam-break flow gradient module. The gradient attenuation in deep network training is suppressed through the cross-layer feature reuse strategy, and the step-by-step capture capability of transient features such as dam-break flow shock wave front is enhanced. In the encoding stage, the bottleneck layer is used to replace the traditional convolution module ( Figure 2 ), reduces computational redundancy through channel dimension compression and reconstruction strategies, and combines the maximum pooling operation to achieve multi-scale downsampling of feature maps to form a hierarchical feature pyramid; in the decoding stage, a deconvolution and upsampling fusion module is designed to gradually restore spatial resolution and reconstruct flow field detail features. Through skip connections, the encoder's low-order geometric features and the decoder's high-order semantic features are fused across scales to ensure the spatial consistency of the flow field topology. The specific multi-level residual network design is as follows: In the encoder path, a three-level downsampling module is used to build a feature pyramid. Each level consists of: Standard bottleneck residual block (bottleneck residual block-B): It consists of 1×1 convolution for channel compression (reducing the dimension to 1 / 4 of the original number of channels), 3×3 depth-separable convolution to extract spatial features, and 1×1 convolution to restore the channel dimension (increasing the dimension to the original number of channels). It uses the same-level mapping to form a residual structure and enhances the nonlinear expression ability through batch normalization (BN) and ReLU activation function. Figure 2 (b) Feature downsampling bottleneck residual block (bottleneck residual block-A): A 2×2 maximum pooling operation is combined with a 3×3 depthwise separable convolution of the bottleneck residual block to reduce the feature map size by 50%. At the same time, strided convolution (stride=2) is used to increase the receptive field and modify the size of the skip connection information, forming a feature sequence with reduced spatial resolution but enhanced semantic information. Figure 2 (a) in Establish a feature transfer path between the corresponding layers of the encoder and decoder: Feature transfer: After the output of each layer of the encoder is aligned through 1×1 convolution, it is spliced ​​with the feature map of the same scale of the decoder in the channel dimension to preserve the geometric boundary details of the dam break flow field; The decoder uses a four-level upsampling module to achieve flow field reconstruction: Feature upsampling: The feature map size is expanded by 200% through transposed convolution, and bilinear interpolation is used to compensate for spatial details; Multi-scale feature fusion: The upsampled features are concatenated with the same-scale encoded features transmitted via skip connections, and then fed into the bottleneck residual block (B) for nonlinear transformation. Continuing with the bottleneck structure, the fused information is compressed using 1×1 convolutions (reducing the dimensionality to 1 / 4 of the original number of channels), followed by 3×3 depthwise separable convolutions to extract spatial features, and 1×1 convolutions to restore the channel dimension (increasing the dimensionality to the original number of channels). Batch normalization (BN) and the ReLU activation function enhance nonlinear representation, preserve feature reuse at the same level, and mitigate gradient decay during the decoding phase.

[0028] (2) Transformer This paper adopts a Transformer-based time series prediction method to improve the prediction accuracy of the dam-break water flow dynamics model. A special encoding architecture is designed for the time series correlation characteristics such as the propagation of dam-break flood wave fronts and nonlinear energy dissipation. The core of the method is a multi-layer stacked Transformer encoder ( Figure 3). Each encoder layer contains a multi-head self-attention module and a feedforward neural network module, which achieves feature fusion through residual connection and layer normalization. The hierarchical design of the encoder can extract local and global correlation features in the time series layer by layer, and adaptively learn the multi-scale spatiotemporal evolution of the dam burst flow. In the encoder, the multi-head self-attention module maps the input sequence into multiple sets of query matrices ( ), key matrix( ) and the value matrix ( ), calculate the attention weights in different feature subspaces respectively: (1) in, The scaling factor is the dimension of the key matrix. By scaling the dot product calculation, it mitigates gradient instability issues in high-dimensional matrix operations. The purpose of the attention function is to parallelize computation and weight concatenation. This mechanism can simultaneously focus on changes in flow states at multiple key locations in the time series. Specifically, the original time series data is divided into multiple subsequences according to fixed time windows, and then flattened into a high-dimensional tensor after linear projection. This process preserves local characteristics of the time series while enhancing the model's ability to represent nonlinear dynamic systems through dimensional expansion.

[0029] The feedforward network in the encoder consists of two fully connected layers and a ReLU activation function, which is used to perform nonlinear transformation on the features output by the multi-head self-attention module. The feedforward network in the encoder consists of two fully connected layers and a ReLU activation function, and its mathematical expression is: (2) in, is the input feature, 、 is the weight matrix, 、 The network further enhances the model's ability to fit complex dynamics such as sudden changes in water flow and boundary conditions through the linear combination and nonlinear mapping of the weight matrix and the bias term.

[0030] (3) Transformer-ResUNet fusion model This paper proposes a hybrid enhancement framework for spatiotemporal coupling prediction of dam break flow that integrates Transformer and ResUNet (Transformer-ResUNet), which combines image temporal data-driven modeling and uses an improved encoder-decoder architecture to simultaneously extract spatial features and capture long-range temporal dependencies ( Figure 4 ).

[0031] The Transformer-ResUNet framework uses ResUNet as the backbone network for spatial feature extraction. Its encoder extracts high-dimensional spatial features of the water flow field through residual convolutional layers. The feature map is then flattened into temporal tokens (minimum processing units) and fed into parallel stacked Transformer modules for temporal dynamic modeling. The decoder fuses spatial details with the temporal features enhanced by the Transformer through cross-layer connections, progressively upsampling to reconstruct the predicted water flow field for the future. To ensure consistent input data distribution, the input data is normalized and denoised through a 7×7 convolutional layer and a max pooling layer before entering the encoder. After exiting the decoder, the output data is downsampled through a 1×1 convolutional layer to ensure consistent input and output specifications.

[0032] Using autoregressive sliding window prediction, the model is based on historical m The water flow field at the moment (the channel dimension is stacked as T -( m -1) to T ) is the input, prediction T +1 moment status. When you get T After the prediction result of +1 moment, the oldest moment in the input window will be 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 through iterative prediction, continuous deduction of future moments is achieved, effectively simulating the nonlinear propagation process of dam-break water flow. The training objective is to minimize the prediction results. High-precision reference solution The mean square error is achieved by: (3) in, is the loss function, N is the batch size, is the L2 regularization coefficient, are trainable parameters. Update using Adam optimizer: (4) (5) (6) in, and are the first-order moment and second-order moment deviation correction terms, is the number of iterations, is the gradient, , represents the gradient operator, and They are biased first-order moment estimation and biased second-order moment deviation correction terms, and initialize the first-order moment estimation. = 0 and second-order moment estimates =0, is the initial learning rate, a small constant =10 -8 , the attenuation rate is =0.9, =0.999.

[0033] (3) Prediction result visualization module This module encodes multi-physics field information, such as water level and velocity vectors, from dam-break flow prediction results by processing them in a spatiotemporally continuous data structure into a standardized tensor sequence, constructing a matrix structure for efficient GPU-based computation. First, spatially interpolating the discrete prediction data using spatial nonuniform gridding techniques, combined with a linear interpolation algorithm in the time dimension, transforms the discrete data into a continuous spatiotemporal field, accurately representing characteristics such as water level dynamics and flow velocity direction. Subsequently, a separate encoding strategy is employed: the water level scalar field is mapped into pseudo-color image channels, while the velocity vector field is decomposed into directional components, using color gradients to visually represent water depth and velocity distribution. Based on resolution reconstruction techniques from Python image libraries (such as Matplotlib and OpenCV), the encoded results are spatially upsampled and denoised to generate high-resolution spatiotemporal images. The final output supports multiple format conversions and can be saved directly as visualization files such as PNG and JPG, or converted to structured database formats such as HDF5.

[0034] (IV) Dam break flow prediction case Based on the coupled particle-water interaction CFD-DEM (computational fluid dynamics-discrete element coupling) high-fidelity numerical model, a dam-break multi-physics data set with different upstream water levels and dam height parameters was constructed. Figure 5 A full-parameter dataset (including upstream water level and dam height) was used for basic model training. Subsequently, sensitivity analysis was performed to optimize parameters such as model network depth, input history time step, and numerical simulation time step, resulting in a high-performance Transformer-ResUNet prediction model.

[0035] Model validation was divided into three test scenarios: trained conditions, partially untrained conditions, and completely new conditions. Each test scenario simulated water level and velocity field information for 10 time steps (a total of 0.1 seconds) based on the initial numerical output of the model. An autoregressive prediction loop was constructed, with the latest prediction results updated to the input window at each step. A sliding window mechanism was then used to continuously iterate and generate flow field evolution data for the next 200 steps (a total of 2 seconds).

[0036] The new algorithm completes a 200-step dynamic prediction of a fluid-particle system in just 11 seconds, a computational speed increase of approximately 1,000 times compared to traditional CFD-DEM simulation methods (which typically run in 10,800 seconds). This significant improvement in efficiency enables near-real-time dynamic prediction (with response times in seconds) for complex multiphase flow simulations that previously took hours or even days.

[0037] (1) Trained working conditions The prediction data for the trained working condition is the combination data of the initial upstream water level and dam height that are consistent with the parameter range of the training set, which verifies the model's ability to accurately reproduce the known working conditions. Figure 6 As shown, for the upstream particle dam accumulation height ( H g ) and the initial water level ( H w ) are experimental-scale dam-break conditions at a scale of 0.2 m. A comparison of the Transformer-ResUNet model's predictions at T = 0.2 and 1.2 s (first column) with a high-precision CFD-DEM coupled simulation (second column) shows that the model successfully captures the gravity-driven release of water and particles, as well as the dynamic interaction of downstream tailwater. It accurately reproduces the downstream propagation of the dam-break flood wave, with the water surface gradually smoothed by wavefront resistance. Although local differences in wave front velocity and crest height accumulate over time, the average predictions for the dam-break flow process closely match the CFD-DEM simulations, with final prediction errors of only 0.2% for water level and 3.8% for flow velocity, successfully capturing the nonlinear characteristics of the fluid flow.

[0038] (2) Some untrained working conditions Some untrained working conditions are to fix the trained upstream water level parameters and input dam height data beyond the training range to test the adaptability of the model to single variable extrapolation. Figure 7 As shown, for the upstream particle dam accumulation height ( H g ) is known to be related to the initial water level ( H w ) For an unknown experimental-scale dam break condition, the Transformer-ResUNet model's prediction results at T = 0.2 and 1.2s (first column) are compared with the high-precision CFD-DEM coupled simulation (second column). The results show that although local errors accumulate over time, the dam break flow characteristics can still be accurately reconstructed at 1.2s. The prediction results at all times are highly consistent with the CFD-DEM simulation, with final prediction errors of only 0.5% for water level and 6.0% for flow velocity.

[0039] (3) New working conditions The new working condition uses a water level-dam height combination that has not participated in training at all to evaluate the model's generalization prediction performance for unknown parameters. Figure 8 As shown in the figure, although the local errors of dam-break flow details such as particle front propagation delay are amplified over time, the overall flow characteristics can still be reconstructed with high fidelity at 1.2 s, and the final prediction errors of water level and flow velocity are only 2.0% and 14.2%.

[0040] In summary, the present invention provides a dynamic prediction model based on dam-break flow image sequence data, which realizes high-precision and rapid prediction of dam-break flow fields (water level, flow velocity), breaking through the bottleneck of traditional numerical simulation methods that take too long to make high-precision predictions, and improving prediction efficiency by about a thousand times. This enables complex multiphase flow simulations that originally took hours or even days to achieve near-real-time dynamic predictions (response in seconds). In view of the strong spatiotemporal coupling characteristics of the water level-velocity field in the transient flow of dam-break flow, a deep hybrid architecture based on Transformer-ResUNet is designed. The ResNet module enhances the ability to extract high-frequency features such as the dam-break shock wave front through residual jump connections; the U-Net branch constructs a multi-scale spatial encoder to accurately characterize spatial heterogeneity; the Transformer temporal attention submodule is embedded to analyze the long-range spatiotemporal correlation of dam-break flood wave propagation, forming a spatiotemporal coupling analysis module dedicated to dam-break flow, breaking through the bottleneck of traditional models in characterizing the evolution of non-steady flow states.

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

[0042] This invention also provides a method for converting physically constrained datasets into tensor data, used to construct physically reliable training samples. The model converts numerical simulation data into computer code for prediction and visualizes the results as image data. Water level, flow velocity, and pressure fields are encoded as a sequence of spatiotemporal tensors, creating a standardized input format for multi-physics field coupling. Using a separate encoding strategy, the flow field is converted into high-resolution images, enhancing the model's ability to identify complex flow regimes.

[0043] This paper also provides a prediction method for dam-break flows that autonomously evolves, capturing the long-term dependencies of hydrological data and enabling long-term predictions based on short-term initial real-world data. A residual correction module suppresses error accumulation, with each iteration learning only the deviation between the current prediction and the true value. The multi-scale Transformer approach, with adaptive weight allocation through a multi-head attention mechanism, enables the model to quantify the contribution of flow fields in different time dimensions, combined with an autoregressive iterative prediction method.

[0044] On the other hand, the present invention also provides a dam-break flow rapid prediction system using the Transformer-ResUNet model, which is characterized by comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a dam-break flow rapid prediction method using the Transformer-ResUNet model as described in the above technical solution is implemented.

[0045] The above shows and describes 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 above embodiments and descriptions merely illustrate the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.

Claims

1. A fast dam-break flow prediction method using the Transformer-ResUNet model, characterized in that: The steps include: Step 1: Obtain actual dam break data or obtain a data set for model training through numerical simulation; Step 2: Build 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. Subsequently, the feature map is flattened into temporal features and input into parallel stacked Transformer modules for temporal dynamic modeling. The decoder fuses spatial features with temporal features enhanced by Transformer through cross-layer connections, and reconstructs the predicted water flow field at future moments through step-by-step upsampling and stacked bottleneck residual blocks; Step 3: Train the spatiotemporal coupled prediction model for 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 rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: The specific implementation of step 1 includes: Using a structured grid discretization method and computational fluid dynamics, accurate water flow data within the computational domain is obtained. This data is then converted into a spatiotemporally continuous dam-break flow velocity field and water level field through an interpolation algorithm. The dynamic flow field is then visualized using a feature image reconstruction algorithm. Convert the pixels of the image data into a matrix grid, which is then further processed into a feature tensor that can be called by the GPU; Continuous simulation sequence samples are constructed based on the sliding window mechanism. By saving historical state information, the feature matrix of the previous 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 tasks.

3. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: Before entering the encoder, the input data is normalized and denoised through a 7×7 convolution layer and a maximum pooling layer. After being exported to the decoder, the output data is downsampled through a 1×1 convolution layer to ensure consistency between input and output specifications.

4. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: The residual convolution layer includes one feature downsampling bottleneck residual block and two standard bottleneck residual blocks. The standard bottleneck residual block consists of 1×1 convolution for channel compression, 3×3 depth-separable convolution for spatial feature extraction, and 1×1 convolution for channel dimension recovery. It uses the same-level mapping to form a residual structure and enhances nonlinear expression capabilities through batch normalization (BN) and ReLU activation function. The feature downsampling bottleneck residual block is based on the standard bottleneck residual block. It combines a 2×2 maximum pooling operation with the 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 through strided convolution and modifies the size of skip connection information, forming a feature sequence with reduced spatial resolution but enhanced semantic information.

5. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: The Transformer module consists of a multi-head self-attention module and a feedforward neural network module, which realizes feature fusion through residual connection 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, is the dimension of the key matrix; The feedforward network consists of two fully connected layers and a ReLU activation function, which is used to perform nonlinear transformation on the features output by the multi-head self-attention module. Its mathematical expression is: (2) in, is the input feature, 、 is the weight matrix, 、 is the bias term.

6. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: Using autoregressive sliding window prediction, the spatiotemporal coupling prediction model of dam break flow is based on historical m The water flow field at the moment is input, and the channel dimension is stacked as T -( m -1) to T ,predict T +1 moment status; when you get T After the prediction result of +1 moment, the oldest moment in the input window will be T -( m -1) is removed and the newly predicted result is added to the input matrix as the latest channel, keeping the input dimension constant. m channels.

7. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: The training objective is to minimize the prediction results High-precision reference solution The mean square error is achieved by: (3) in, is the loss function, N is the batch size, is the L2 regularization coefficient, is a trainable parameter.

8. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 7, 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 are the first-order moment and second-order moment deviation correction terms, is the number of iterations, is the gradient, , represents the gradient operator; and They are biased first-order moment estimation and biased second-order moment deviation correction terms, and the first-order moment estimation is initialized. = 0 and second-order moment estimates =0, is the initial learning rate, is a small constant, and the decay rate is and is a constant.

9. The method for rapid prediction of dam-break flow using the Transformer-ResUNet model according to claim 1, characterized in that: It also includes visualization of prediction results, including: First, spatial non-uniform grid technology is used to spatially interpolate discrete prediction data. Combined with the time dimension linear interpolation algorithm, the discrete data is converted into a continuous space-time field to accurately express the dynamic changes of water level and the direction characteristics of flow velocity. Subsequently, a separate encoding strategy is adopted: the water level scalar field is mapped into a pseudo-color image channel, and the flow velocity vector field is decomposed into directional components, and the water depth and flow velocity distribution are intuitively reflected through color gradients. Based on the resolution reconstruction technology of the Python image library, the encoding results are spatially upsampled and denoised to generate high-resolution space-time images. The final output supports multi-format conversion and can be directly saved as a visualization file or converted into a structured database format.

10. A dam-break flow rapid prediction system using the Transformer-ResUNet model, characterized by: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for rapid prediction of dam break flow using a Transformer-ResUNet model as claimed in any one of claims 1 to 9 is implemented.

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

  • Transform and large kernel convolution-based space-time process prediction method and system

    CN118332517A

  • Remote sensing image space-time fusion method and system based on Swin Transform and CNN parallel interaction

    CN118470479A

Cited By

  • Prediction method based on pyramid decomposition framework and multi-scale stacked LSTMs

    CN120822666A

  • Earth and rockfill dam outburst flow prediction method based on physical consistency and attention mechanism

    CN121256223A

  • Machine learning system for predicting evolution state of multi-class fluid equation

    CN121435786A

  • A machine learning system for multi-class fluid equation evolution state prediction

    CN121435786B

  • River flow field state determination method, device and equipment and storage medium

    CN121936371A