A tunnel fire video data generation method based on spatiotemporal perception CGAN model
Through the tunnel fire video data generation method based on the spatiotemporal perception CGAN model, the problems of rapidity and spatiotemporal continuity in multi-condition analysis in tunnel fire data generation are solved, and high-fidelity fire video data is efficiently generated to support real-time decision-making of intelligent fire protection systems.
Patent Information
- Application Number
- CN202510884433.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-30
AI Technical Summary
Existing technologies have difficulty in quickly analyzing multiple working conditions in tunnel fire data generation. Traditional GAN models lack spatiotemporal continuity and diversity in generated data, and the training process is unstable, making it difficult to generate high-fidelity, spatiotemporally consistent fire video data.
A spatiotemporal-aware CGAN model is adopted. By combining a time-aware generator with a spatiotemporal discriminator, gradient penalty constraints and multi-objective loss functions are introduced. The generator generates temperature cloud image videos through a time encoding module and a progressive upsampling structure. The discriminator extracts features through strided convolution and temporal attention mechanism to achieve spatiotemporal consistency and physical rationality.
Generate high-fidelity tunnel fire temperature cloud map videos under multiple working conditions, which have temporal and spatial continuity and physical rationality, support real-time decision-making and emergency plan formulation of intelligent fire protection systems, and reduce computational complexity.
Smart Images

Figure CN120388103B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the interdisciplinary fields of civil engineering disaster prevention and mitigation, fire engineering, and artificial intelligence, and in particular to a method for generating tunnel fire video data based on a spatiotemporal perception CGAN model. Background Art
[0002] Tunnel fires, a major safety hazard in underground transportation projects, are characterized by sudden onset, rapid spread, and high smoke toxicity. High-precision prediction and visualization of their thermodynamic parameters are crucial for disaster prevention and mitigation decision-making and emergency rescue. Currently, the acquisition of tunnel fire data relies primarily on numerical simulation methods and physical experiments. Among these, the Fire Dynamics Simulator (FDS), based on computational fluid dynamics (CFD), is widely used. By specifying parameters such as fire source power, location, and ventilation conditions, it can generate spatiotemporal distribution cloud maps of temperature and smoke concentration. However, this method has limitations. Firstly, high-fidelity three-dimensional simulations require dense meshing, and a single simulation can take hours or even days, making it difficult to rapidly analyze multiple conditions (e.g., different combinations of fire source locations, power, and wind speeds). Secondly, physical experiments, limited by site size, cost, and safety constraints, struggle to cover complex scenarios, limiting the scale and diversity of fire databases.
[0003] In recent years, data-driven approaches have provided new insights into tunnel fire research. While traditional data augmentation techniques (such as rotation and scaling) can expand sample sizes, they cannot generate spatiotemporal dynamic data that conforms to physical laws. Generative Adversarial Networks (GANs) have shown promise in image synthesis due to their powerful data generation capabilities. However, existing GAN models face two major challenges when applied to fire image data generation: First, fire evolution exhibits strong spatiotemporal correlations, and traditional GANs lack the ability to model temporal continuity and spatial consistency, which can easily lead to inter-frame jumps or logical inconsistencies in the generated sequence. Second, model training often encounters issues such as gradient instability and pattern collapse, impacting the diversity and authenticity of the generated data. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for generating tunnel fire video data based on a spatiotemporal perception CGAN model. The method can efficiently generate multi-condition, high-fidelity tunnel fire temperature cloud map videos without the need to repeatedly perform time-consuming CFD calculations. At the same time, the generated dynamic data has both physical rationality and spatiotemporal continuity, providing reliable data support for real-time decision-making and emergency plan formulation of intelligent fire protection systems.
[0005] In order to achieve the above-mentioned object of the invention, the present invention provides a method for generating tunnel fire video data based on a spatiotemporal perception CGAN model, comprising the following steps:
[0006] Step S1: Using fire dynamics simulation software, a tunnel fire numerical model with a multi-dimensional parameter combination is established. Temperature cloud image video sequences under different temporal and spatial conditions are collected and preprocessed to construct a tunnel fire temperature cloud image video dataset.
[0007] Step S2: Construct a spatiotemporal conditional generative adversarial network model, which includes a time-aware generator and a spatiotemporal discriminator. The time-aware generator generates a temperature cloud image video sequence through a temporal encoding module and a progressive upsampling structure, and the spatiotemporal discriminator extracts spatiotemporal features through a downsampling module of a strided convolution structure and a temporal attention mechanism, and introduces a gradient penalty constraint.
[0008] Step S3: Adopting an adversarial training strategy to jointly optimize the adversarial network model, and constraining the spatiotemporal consistency of the generated data through a multi-objective loss function, wherein the multi-objective loss function includes adversarial loss, temporal consistency loss, and optical flow motion field matching loss;
[0009] Step S4: Use the trained adversarial network model to synthesize a tunnel fire temperature cloud map video sequence, and verify the spatiotemporal fidelity of the generated temperature cloud map video sequence using multidimensional evaluation indicators, including peak signal-to-noise ratio, structural similarity, perceptual similarity, and optical flow loss.
[0010] Preferably, the specific method of step S1 is:
[0011] S1.1. Build a three-dimensional tunnel model in fire dynamics simulation software. Set a multi-dimensional parameter combination for fire source location, fire source power, and fan speed. Use the t² dynamic growth model to simulate the dynamic changes in fire source power. Set the fuel type to heptane and configure the combustion product parameters.
[0012] S1.2. Temperature monitoring plane slices are arranged along the longitudinal center of the tunnel. A multi-level grid division strategy is used to locally encrypt the fire source area and the fan area, and temperature cloud map video data at different times is derived.
[0013] S1.3. Perform frame decomposition, time tag encoding, and normalization on the exported temperature cloud image video data. The normalization includes scaling the image to a set pixel using bilinear interpolation, mapping the pixel values to the range [0, 1], and then performing normalization using a set mean and a set standard deviation.
[0014] S1.4. Establish a data loading mechanism that supports time awareness to achieve batch generation of time series samples and form a dynamic training dataset.
[0015] Preferably, the time-aware generator comprises a time encoding module, a progressive upsampling structure and an output layer;
[0016] The time encoding module consists of a 5-layer fully connected network, which is an input layer that inputs a 1-dimensional time variable and converts it into a 512-dimensional feature vector through a linear layer, a SiLU activation function layer that processes the 512-dimensional feature vector, an intermediate linear transformation layer that maintains the 512-dimensional feature vector channel, a second SiLU activation function layer, and an output compression layer, ultimately generating a 128-dimensional time embedding feature;
[0017] The progressive upsampling structure includes three levels of upsampling modules, each of which includes an upsampling layer, a convolutional layer that reduces the number of channels from 512 to 64, a temporal conditional normalization layer that performs temporal conditional batch normalization on channel features, and a ReLU activation layer. In the upsampling layer, the first two levels of upsampling modules use a 2x upsampling rate, and the third level of upsampling modules uses target size adjustment.
[0018] The output layer includes a fully connected layer and a Tanh activation function layer, which are used to adjust the number of channels while outputting the generated image.
[0019] Preferably, the time condition normalization layer is implemented as follows:
[0020] Instance normalization is used as the basic normalization layer for the feature map output by the intermediate linear transformation layer. The scaling factor scale and the translation factor shift are generated respectively through two independent fully connected layers. The time embedding vector is converted into an adjustment parameter that matches the number of feature channels. Feature modulation is performed according to the formula output = norm(x) × (1 + scale) + shift.
[0021] Preferably, the spatiotemporal discriminator network includes a temporal encoding module, a multi-stage downsampling module, a temporal attention mechanism layer and a fully connected output layer;
[0022] The multi-level downsampling module includes a 4-level downsampling structure, each of which includes a convolutional layer with a stride of 2 and a convolution kernel size of 4×4, a temporal conditional normalization layer for normalizing channel features, and a LeakyReLU activation layer with a negative slope of 0.2; wherein the convolutional layer performs a channel number change from 3 to 512 in a step-by-step manner;
[0023] The temporal attention mechanism layer maps the temporal embedding vector to 512 dimensions through a fully connected layer, uses a sigmoid function to generate feature channel attention weights, performs global average pooling on the spatial dimensions of the feature map output by the intermediate linear transformation layer, and then multiplies the attention weights element by element;
[0024] The fully connected output layer adjusts the number of channels from 512 to 1 and outputs the discriminant score.
[0025] Preferably, the adversarial training strategy in step S3 includes:
[0026] S31. Network initialization and training configuration: Use the Adam optimizer to initialize the time-aware generator and the spatiotemporal discriminator respectively, set the initial learning rate and momentum parameters of the time-aware generator to be, set the initial learning rate and momentum parameters of the spatiotemporal discriminator to be, and the training frequency ratio of the spatiotemporal discriminator to the time-aware generator to be 5:1;
[0027] S32, spatiotemporal discriminator adversarial training: Calculate the gradient norm at the linear interpolation point between the real temperature cloud image video data and the generated temperature cloud image video data, that is, add a gradient penalty term, constrain the Lipschitz continuity of the spatiotemporal discriminator, and set the penalty coefficient;
[0028] S33. Adversarial training of the time-aware generator: The adversarial loss maximizes the discrimination score of the spatiotemporal discriminator on the generated temperature cloud image video data, driving it to approach the true distribution. The temporal consistency loss is defined as the ratio of the pixel difference of the generated images at adjacent time points to the time interval. The optical flow motion field matching loss uses the optical flow model to extract the motion field of adjacent frames of the generated sequence and the true sequence. The mean square error between the generated optical flow and the true optical flow is calculated. The generated sequence refers to the tunnel temperature cloud image video sequence generated by the time-aware generator, and the true sequence refers to the real tunnel temperature cloud image video sequence generated by the fire dynamics simulation software.
[0029] S34, training process control: when the peak signal-to-noise ratio of the generated image continuously exceeds a preset value and the structural similarity exceeds a set value, the training is terminated.
[0030] Preferably, the specific steps of step S4 include:
[0031] S4.1: Load the pre-trained time-aware generator model weights, generate a Gaussian random noise vector and a continuous timestamp vector, input them into the time-aware generator, and then output a time-series temperature cloud image video sequence. Perform a denormalization operation on the generated temperature cloud image video sequence, map the pixel values to a preset range, and save it as an image sequence.
[0032] S4.2: Call the peak signal-to-noise ratio module and the structural similarity module to calculate the pixel-level reconstruction accuracy and structural similarity;
[0033] S4.3: Load the pre-trained feature extraction model to calculate the perceptual difference, extract the motion fields of adjacent frames of the generated sequence and the real sequence based on the optical flow model, and calculate the mean square error of the optical flow;
[0034] S4.4: Plot the peak signal-to-noise ratio, structural similarity, perceptual similarity, and optical flow loss as a function of training rounds, and generate a high-dimensional feature dimensionality reduction distribution map and a time series comparison grid map.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] 1. The present invention dynamically injects time codes into the feature space of the time-aware generator and the spatiotemporal discriminator, and combines the spatiotemporal conditional normalization layer to effectively enhance the continuity and physical consistency between frames of the temperature cloud map video sequence.
[0037] 2. The Wasserstein distance loss is used to replace the traditional GAN loss, and the gradient penalty term is combined to constrain the Lipschitz continuity of the spatiotemporal discriminator, significantly improving training stability. At the same time, the temporal consistency loss and optical flow motion field matching loss are introduced to ensure that the spatiotemporal dynamic characteristics of the generated data are highly consistent with the actual fire evolution laws.
[0038] 3. Design a joint training framework for the time-aware generator and the spatiotemporal discriminator. By coupling multi-dimensional conditional inputs (fire source location, power, wind speed) with timestamps, the controllable generation of fire data under different working conditions can be achieved, breaking through the traditional method's reliance on fixed boundary conditions.
[0039] 4. Through the progressive upsampling structure and temporal attention mechanism, while reducing the computational complexity, the spatial resolution of the generated temperature cloud map and the accurate restoration of dynamic details are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0041] Figure 1 A flow chart of a method for generating tunnel fire video data based on a spatiotemporal perception CGAN model provided by the present invention;
[0042] Figure 2 An architectural diagram of the time-aware generator provided by the present invention;
[0043] Figure 3 This is an architectural diagram of the time coding module provided by the present invention;
[0044] Figure 4 This is an architectural diagram of the three-stage upsampling module provided by the present invention;
[0045] Figure 5 This is an architectural diagram of the time condition normalization layer provided by the present invention;
[0046] Figure 6The architecture diagram of the spatiotemporal discriminator provided by the present invention;
[0047] Figure 7 This is an architectural diagram of the 4-level downsampling module and temporal attention mechanism provided by the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0049] like Figure 1-Figure 7 As shown, an embodiment of the present invention provides a method for generating tunnel fire video data based on a spatiotemporal perception CGAN model, comprising the following steps:
[0050] Step S1: Using the fire dynamics simulation software FDS, a tunnel fire numerical model with a multi-dimensional parameter combination is established. Temperature cloud image video sequences under different temporal and spatial conditions are collected and preprocessed to construct a tunnel fire temperature cloud image video dataset. This specifically includes:
[0051] Step 1.1: Establish a tunnel fire model with different fire source locations, fire source power, and fan speed in the fire dynamics simulation software FDS;
[0052] Step 1.1.1: The tunnel dimensions are 300m x 6m x 9m in length, width, and height. Three fire source locations (50m, 150m, and 250m), eight fire source power levels (5MW-40MW, in 5MW increments), and 12 fan speeds (1m / s-12m / s, in 1m / s increments) are selected.
[0053] Step 1.1.2: Use a 2m×5m rectangular fire source, positioned 0.5m above the ground. Apply the t² fire growth model to simulate power dynamics. The total simulation time is 300 seconds. The fuel type is heptane (C7H 16 ), the carbon monoxide generation rate in the combustion products is 0.006, and the smoke particle generation rate is 0.015; the tunnel wall is made of concrete, and its thermal parameters use the default values of FDS software;
[0054] Step 1.1.3: Use a high-precision grid with a grid size of 0.5m in the area within a 50m radius from the fire source and within a 5m radius around the fan. Use a standard grid with a grid size of 1m in the remaining areas. Set both ends of the tunnel as open boundaries.
[0055] Step 1.1.4: Two sets of jet fans are symmetrically arranged at 75m and 225m from the tunnel entrance, with two fans in each set. Each fan has a length × width × height of 3m × 1.5m × 1.5m. They are installed 1m from the arch and equipped with 1m diameter air supply ducts. The air supply volume is dynamically adjusted by the HVAC system to achieve the target wind speed.
[0056] Step 1.1.5: Deploy a temperature monitoring plane slice along the longitudinal center of the tunnel to monitor temperature changes at different times throughout the simulation process, and ultimately export the temperature cloud map video data.
[0057] Step 1.2: Decompose the original temperature cloud image video data into continuous frame images at a fixed sampling rate and store them as a set of ordered image files. Use the file name sequence as the time sequence identifier and store them in the format of frame_0001.png to frame_XXXX.png.
[0058] Step 1.3: Assign a normalized time label to each frame of image to form a time-image pair;
[0059] Step 1.4: Use multi-level image transformation to normalize the original frame to the model input size. Use bilinear interpolation to scale the image to the preset size (50×1800 pixels). Use ToTensor transformation to map the pixel values to the range [0,1], then perform normalization with a mean of 0.5 and a standard deviation of 0.5. Then, force the image to be converted to RGB three-channel format.
[0060] Step 1.5: Establish a time-aware data loading mechanism to generate batch time series samples and form a dynamic training dataset.
[0061] Step S2: Construct a spatiotemporal conditional generative adversarial network model, which includes a time-aware generator and a spatiotemporal discriminator. The time-aware generator generates a temperature cloud image video sequence through a temporal encoding module and a progressive upsampling structure, and the spatiotemporal discriminator extracts spatiotemporal features through a downsampling module of a strided convolution structure and a temporal attention mechanism, and introduces a gradient penalty constraint.
[0062] The time-aware generator consists of a time encoding module, a three-level upsampling module, four time-conditional normalization layers, and a fully connected nonlinear activation output layer;
[0063] The time encoding module uses a 5-layer fully connected network, which is:
[0064] ① Input layer, converting the 1-dimensional time variable into a 512-dimensional feature vector through a linear layer;
[0065] ②SiLU activation function layer, which uses SiLU activation function to process 512-dimensional features;
[0066] ③Intermediate linear transformation layer, maintaining 512-dimensional feature channels;
[0067] ④The second SiLU activation function layer uses the SiLU activation function;
[0068] ⑤ Output compression layer, compressing the 512-dimensional features to the preset time embedding dimension (128 dimensions);
[0069] The three-stage upsampling module adopts a progressive amplification structure, and each stage includes:
[0070] ① Upsampling layer: the first level uses a 2x upsampling rate, the second level uses a 2x upsampling rate, and the third level uses target size adjustment;
[0071] ② Convolutional layer, the number of channels changes from 512 to 256, 256 to 128, and 128 to 64;
[0072] ③ Temporal conditional normalization layer, which performs temporal conditional batch normalization on 256, 128, and 64 channel features respectively;
[0073] ④ReLU activation layer, using ReLU nonlinear activation function;
[0074] The temporal condition normalization layer implements temporal information injection in the following way:
[0075] ①Use instance normalization (InstanceNorm2d) as the basic normalization layer;
[0076] ② Generate the scaling factor (scale) and translation factor (shift) through two independent fully connected layers;
[0077] ③Convert the time embedding vector into a tuning parameter that matches the number of feature channels;
[0078] ④According to the formula output=norm( x )×(1+scale)+shift for feature modulation.
[0079] 1 fully connected nonlinear activation output layer, including 1 fully connected layer and a Tanh activation function layer, is used to adjust the number of channels while outputting the generated image.
[0080] The spatiotemporal discriminator includes a temporal encoding module, a 4-level downsampling module, three temporal conditional normalization layers, a temporal attention mechanism layer, and a fully connected output layer;
[0081] The time encoding module is the same as the time encoding module of the time-aware generator;
[0082] The 4-level downsampling module adopts a strided convolution structure, and each level contains:
[0083] ① Convolutional layer, the number of channels changes from 3 to 64, 64 to 128, 128 to 256, and 256 to 512, with a convolution kernel size of 4×4 and a stride of 2;
[0084] ② Temporal condition normalization layer, which normalizes 128, 256, and 512 channel features;
[0085] ③LeakyReLU activation layer, using LeakyReLU nonlinear activation function with a negative slope of 0.2;
[0086] The temporal attention mechanism is implemented in the following way:
[0087] ① Map the time embedding vector to 512 dimensions through a fully connected layer;
[0088] ② Use Sigmoid function to generate attention weights;
[0089] ③ Perform global average pooling on the spatial dimension of the final feature map;
[0090] ④ Multiply the pooled features by the attention weights element by element;
[0091] In addition, a fully connected output layer adjusts the number of channels from 512 to 1 and outputs the discriminant score.
[0092] Step S3: Adopting an adversarial training strategy to jointly optimize the adversarial network model, and constraining the spatiotemporal consistency of the generated data through a multi-objective loss function, wherein the multi-objective loss function includes adversarial loss, temporal consistency loss, and optical flow motion field matching loss; the specific steps are as follows:
[0093] Step 3.1: Network initialization and training configuration
[0094] Step 3.1.1: Use the PyTorch framework to build a time-aware generator and a spatiotemporal discriminator.
[0095] Step 3.1.2: Use the Adam optimizer to initialize the parameter optimizers of the time-aware generator and the spatiotemporal discriminator respectively, setting the initial learning rate to 0.0001 and the momentum parameters to 0.5 and 0.9;
[0096] Step 3.1.3: Configure training parameters: batch size is 8, total training rounds are 1000 rounds, the spatiotemporal discriminator is trained 5 times, and the time-aware generator is trained once;
[0097] Step 3.2: Adversarial Training of Spatiotemporal Discriminator
[0098] Step 3.2.1: Randomly sample real time-series temperature cloud image video data from the temperature cloud image video dataset and generate Gaussian distributed random noise vectors of the same batch; input the random noise and the corresponding timestamp into the time-aware generator to generate simulated temperature cloud image video data;
[0099] Step 3.2.2: Calculate the difference in discriminant scores between the real temperature cloud video data simulated by the fire dynamics simulation software FDS (i.e., real data) and the temperature cloud video data generated by the time-aware generator (i.e., generated data) as the base loss; add a gradient penalty term: constrain the Lipschitz continuity of the spatiotemporal discriminator by calculating the gradient binorm at the linear interpolation points between the real data and the generated data, and set the penalty coefficient to 10;
[0100] Step 3.2.3: Update the spatiotemporal discriminator network weights through the backpropagation algorithm, prioritizing the ability to distinguish between real data and generated data;
[0101] Step 3.3: Time-aware generator adversarial training
[0102] Step 3.3.1: Design a multi-objective loss, including an adversarial loss to maximize the score of the spatiotemporal discriminator on the generated data, driving the generated data to approach the true distribution; including a temporal consistency loss, calculating the ratio of the pixel difference of the generated images at adjacent time points (referring to the temperature cloud map output by the time-aware generator at a single time stamp) to the time interval, enforcing the temporal continuity of the generated sequence (referring to the set of temperature cloud maps output by the time-aware generator at consecutive time stamps); the loss weight is set to 0.3;
[0103] Step 3.3.2: Adopt an alternating training strategy and perform a time-aware generator parameter update after every 5 spatiotemporal discriminator trainings to maintain the adversarial balance.
[0104] Step 3.4: Training process monitoring and model saving
[0105] Step 3.4.1: Use TensorBoard to record the curves of the time-aware generator loss, spatiotemporal discriminator loss, temporal consistency loss, and gradient penalty value as the training rounds change; periodically calculate the peak signal-to-noise ratio (PSNR), structural similarity (SSIM), perceptual difference (LPIPS), and optical flow error (FlowMSE), and save them to a structured CSV file;
[0106] Step 3.4.2: Save the time-aware generator and spatiotemporal discriminator weight files every 200 rounds of training using the torch.save.state_dict function. Support training interrupt protection and automatically save the intermediate state weights when training terminates abnormally.
[0107] Step 3.4.3: When the PSNR of the generated image exceeds 28dB and the SSIM exceeds 0.85, the adversarial network model is considered to have converged and training is terminated;
[0108] Step 3.4.4: Generate a complete time series temperature cloud sequence every 200 rounds, map the pixel values to the range [0, 1] through the denormalization operation, and save it as a PNG image;
[0109] Step 3.4.5: Use Matplotlib to plot a grid plot comparing the generated sequence and the true sequence to verify spatiotemporal consistency. The generated sequence refers to the video sequence currently output by the time-aware generator during training, and the true sequence refers to the FDS simulated video sequence in the training dataset with the same operating conditions and timestamps as the generated sequence.
[0110] Step S4: Use the trained adversarial network model to synthesize a tunnel fire temperature cloud map video sequence, and verify the spatiotemporal fidelity of the generated temperature cloud map video sequence using multidimensional evaluation indicators, including peak signal-to-noise ratio (PSNR), structural similarity (SSIM), perceptual similarity (LPIPS), and optical flow loss (FlowMSE).
[0111] The specific steps include:
[0112] Step 4.1: Call the torch.load.load_state_dict function of the PyTorch library to load the pre-trained time-aware generator model weight file; use the torch.randn function to generate a Gaussian distributed random noise vector with the same dimension as the time-aware generator's latent space; use the torch.linspace function to generate a continuous timestamp vector, input it to the time-aware generator, and output a sequence of time-series temperature cloud maps; perform a denormalization operation on the generated data to map the pixel values to the range [0,1], and save it as a .png format image sequence using the PIL.Image.save function;
[0113] Step 4.2: Use the torchmetrics.PeakSignalNoiseRatio module in PyTorch to calculate the PSNR between the generated cloud image and the ground-truth cloud image to measure the pixel-level reconstruction accuracy. Also, call the torchmetrics.StructuralSimilarityIndexMeasure module to evaluate the similarity between the generated cloud image and the ground-truth cloud image in terms of brightness, contrast, and structure. Save the above results as floating-point numbers in a .csv file.
[0114] Step 4.3: Load the pre-trained AlexNet model as a feature extractor and use the lpips.LPIPS module to calculate the difference between the generated cloud image and the real cloud image in the deep feature space. Use the optical flow model ( torchvision.models.optical_flow.raft_large ) to extract the motion fields of adjacent frames of the generated sequence and the real sequence respectively. Calculate the mean squared error between the generated optical flow and the real optical flow to measure the temporal dynamic consistency and save the results to a .csv file.
[0115] Step 4.4: Call the plt.plot function of the Matplotlib library to plot the curves of the peak signal-to-noise ratio (PSNR), structural similarity (SSIM), perceptual similarity (LPIPS), and optical flow loss (FlowMSE) as they change with the number of training rounds, and save them as a line graph; use the TSNE function of the Scikit-learn library to reduce the high-dimensional features of the generated cloud image and the real cloud image to two-dimensional space, and use plt.scatter to draw a distribution scatter plot to verify the data distribution overlap; arrange the generated cloud image and the real cloud image in time series, use plt.subplot to generate a comparison grid map, and save it as a high-definition .jpg file.
[0116] The present invention can efficiently generate multi-condition, high-fidelity tunnel fire temperature cloud map videos without the need to repeatedly perform time-consuming CFD calculations. At the same time, the generated dynamic data has both physical rationality and spatiotemporal continuity, providing reliable data support for real-time decision-making and emergency plan formulation of intelligent fire protection systems.
[0117] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating tunnel fire video data based on a spatiotemporal perception CGAN model, characterized in that: The following steps are involved: Step S1: Using fire dynamics simulation software, a tunnel fire numerical model with a multi-dimensional parameter combination is established. Temperature cloud image video sequences under different temporal and spatial conditions are collected and preprocessed to construct a tunnel fire temperature cloud image video dataset. Step S2: Construct a spatiotemporal conditional generative adversarial network model, which includes a time-aware generator and a spatiotemporal discriminator. The time-aware generator generates a temperature cloud image video sequence through a temporal encoding module and a progressive upsampling structure, and the spatiotemporal discriminator extracts spatiotemporal features through a downsampling module of a strided convolution structure and a temporal attention mechanism, and introduces a gradient penalty constraint. The time-aware generator includes a time encoding module, a progressive upsampling structure and an output layer; The time encoding module consists of a 5-layer fully connected network, which is an input layer that inputs a 1-dimensional time variable and converts it into a 512-dimensional feature vector through a linear layer, a SiLU activation function layer that processes the 512-dimensional feature vector, an intermediate linear transformation layer that maintains the 512-dimensional feature vector channel, a second SiLU activation function layer, and an output compression layer, ultimately generating a 128-dimensional time embedding feature; The progressive upsampling structure includes a three-level upsampling module, each of which includes an upsampling layer, a convolutional layer that reduces the number of channels from 512 to 64, a temporal conditional normalization layer that performs temporal conditional batch normalization on channel features, and a ReLU activation layer. In the upsampling layer, the first two upsampling modules use a 2x upsampling rate, and the third upsampling module uses target size adjustment; The output layer includes a fully connected layer and a Tanh activation function layer, which is used to adjust the number of channels and output the generated image; The spatiotemporal discriminator network includes a temporal encoding module, a multi-level downsampling module, a temporal attention mechanism layer, and a fully connected output layer; The multi-level downsampling module includes a 4-level downsampling structure, each of which includes a convolutional layer with a stride of 2 and a convolution kernel size of 4×4, a temporal conditional normalization layer for normalizing channel features, and a LeakyReLU activation layer with a negative slope of 0.2; wherein the convolutional layer performs a channel number change from 3 to 512 in a step-by-step manner; The temporal attention mechanism layer maps the temporal embedding vector to 512 dimensions through a fully connected layer, uses a sigmoid function to generate feature channel attention weights, performs global average pooling on the spatial dimensions of the feature map output by the intermediate linear transformation layer, and then multiplies the attention weights element by element; The fully connected output layer adjusts the number of channels from 512 to 1 and outputs the discriminant score; Step S3: Adopting an adversarial training strategy to jointly optimize the adversarial network model, and constraining the spatiotemporal consistency of the generated data through a multi-objective loss function, wherein the multi-objective loss function includes adversarial loss, temporal consistency loss, and optical flow motion field matching loss; Step S4: Use the trained adversarial network model to synthesize a tunnel fire temperature cloud map video sequence, and verify the spatiotemporal fidelity of the generated temperature cloud map video sequence using multidimensional evaluation indicators, including peak signal-to-noise ratio, structural similarity, perceptual similarity, and optical flow loss.
2. The method for generating tunnel fire video data based on the spatiotemporal perception CGAN model according to claim 1 is characterized in that: The specific method of step S1 is: S1.
1. Build a three-dimensional tunnel model in fire dynamics simulation software. Set a multi-dimensional parameter combination of fire source location, fire source power, and fan speed. Use the t² dynamic growth model to simulate the dynamic change of fire source power. Set the fuel type to heptane and configure the combustion product parameters. S1.
2. Temperature monitoring plane slices are arranged along the longitudinal center of the tunnel. A multi-level grid division strategy is used to locally encrypt the fire source area and the fan area, and temperature cloud map video data at different times is derived. S1.
3. Perform frame decomposition, time tag encoding, and normalization on the exported temperature cloud image video data. The normalization includes scaling the image to a set pixel using bilinear interpolation, mapping the pixel values to the range [0, 1], and then performing normalization using a set mean and a set standard deviation. S1.
4. Establish a data loading mechanism that supports time awareness to achieve batch generation of time series samples and form a dynamic training dataset.
3. The method for generating tunnel fire video data based on the spatiotemporal perception CGAN model according to claim 1 is characterized in that: The time condition normalization layer is implemented as follows: Instance normalization is used as the basic normalization layer for the feature map output by the intermediate linear transformation layer. The scaling factor scale and the translation factor shift are generated respectively through two independent fully connected layers. The time embedding vector is converted into an adjustment parameter that matches the number of feature channels. Feature modulation is performed according to the formula output = norm(x) × (1 + scale) + shift.
4. The method for generating tunnel fire video data based on the spatiotemporal perception CGAN model according to claim 3 is characterized in that: The adversarial training strategy in step S3 includes: S31. Network initialization and training configuration: Use the Adam optimizer to initialize the time-aware generator and the spatiotemporal discriminator respectively, set the initial learning rate and momentum parameters of the time-aware generator to be, set the initial learning rate and momentum parameters of the spatiotemporal discriminator to be, and the training frequency ratio of the spatiotemporal discriminator to the time-aware generator to be 5:1; S32, spatiotemporal discriminator adversarial training: Calculate the gradient norm at the linear interpolation point between the real temperature cloud image video data and the generated temperature cloud image video data, that is, add a gradient penalty term, constrain the Lipschitz continuity of the spatiotemporal discriminator, and set the penalty coefficient; S33. Adversarial training of the time-aware generator: The adversarial loss maximizes the discrimination score of the spatiotemporal discriminator on the generated temperature cloud image video data, driving it to approach the true distribution. The temporal consistency loss is defined as the ratio of the pixel difference of the generated images at adjacent time points to the time interval. The optical flow motion field matching loss uses the optical flow model to extract the motion field of adjacent frames of the generated sequence and the true sequence. The mean square error between the generated optical flow and the true optical flow is calculated. The generated sequence refers to the tunnel temperature cloud image video sequence generated by the time-aware generator, and the true sequence refers to the real tunnel temperature cloud image video sequence generated by the fire dynamics simulation software. S34, training process control: when the peak signal-to-noise ratio of the generated image continuously exceeds a preset value and the structural similarity exceeds a set value, the training is terminated.
5. The method for generating tunnel fire video data based on the spatiotemporal perception CGAN model according to claim 4 is characterized in that: The specific steps of step S4 include: S4.1: Load the pre-trained time-aware generator model weights, generate a Gaussian random noise vector and a continuous timestamp vector, input them into the time-aware generator, and then output a time-series temperature cloud image video sequence. Perform a denormalization operation on the generated temperature cloud image video sequence, map the pixel values to a preset range, and save it as an image sequence. S4.2: Call the peak signal-to-noise ratio module and the structural similarity module to calculate the pixel-level reconstruction accuracy and structural similarity; S4.3: Load the pre-trained feature extraction model to calculate the perceptual difference, extract the motion fields of adjacent frames of the generated sequence and the real sequence based on the optical flow model, and calculate the mean square error of the optical flow; S4.4: Plot the peak signal-to-noise ratio, structural similarity, perceptual similarity, and optical flow loss as a function of training rounds, and generate a high-dimensional feature dimensionality reduction distribution map and a time series comparison grid map.
Citation Information
Patent Citations
Tunnel fire data generation method based on generative adversarial network
CN119903737A