A tunnel fire data generation method based on a generative adversarial network
By training tunnel fire data using a generative adversarial network, the cost and security risk issues of data acquisition in tunnel fire research are resolved, fast and accurate fire data generation is achieved, and efficient management of tunnel fires is supported.
Patent Information
- Application Number
- CN202411983633.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In existing technologies for tunnel fire research, fire data acquisition is costly and carries high safety risks. Numerical simulation is cumbersome and time-consuming, making it difficult to quickly generate large amounts of accurate data. In addition, generative adversarial networks face challenges in capturing data features and reducing dimensionality in tunnel fire data generation.
A generative adversarial network-based method is adopted to build a bidirectional LSTM network and Wasserstein distance loss to train a tunnel fire data generation model. The temperature, smoke flow rate and concentration data in the tunnel are used to generate high-precision fire data.
It achieves rapid and accurate acquisition of tunnel fire data, avoids high-cost experiments and tedious simulations, improves the stability and interpretability of data generation, and supports efficient prevention, early warning, and rescue of tunnel fires.
Smart Images

Figure CN119903737B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of civil engineering disaster prevention and mitigation, fire engineering and artificial intelligence, and in particular to a tunnel fire data generation method based on a generative adversarial network. BACKGROUND
[0002] In tunnel fire research, how to accurately obtain fire data is a key link in tunnel fire research. Traditionally, fire data is mainly obtained through fire experiments and numerical simulation. Full-scale or scaled fire experiments can directly provide real fire data, but the cost is high, and there are great safety risks in the experiment process, which limits its application in large-scale research. The numerical simulation method constructs a mathematical-physical model of tunnel fire, and uses a computer to perform simulation calculation. Although the cost is low and the safety risk is small, the simulation process is tedious and time-consuming, and requires high computing resources, making it difficult to generate a large amount of fire data in a short time.
[0003] In recent years, with the rapid development of artificial intelligence technology, generative adversarial networks (GAN) as a powerful deep learning model has made remarkable achievements in image generation, text generation and other fields. GAN can generate data similar to the distribution of real data through the adversarial training of generator and discriminator, providing a new way for fast and accurate acquisition of tunnel fire data. However, the application of GAN algorithm to tunnel fire data generation still faces the following challenges: (1) Tunnel fire data contains complex "time series" characteristics. How to design a reasonable generative adversarial network architecture to accurately capture the data feature distribution is a difficult problem; (2) The dimension of tunnel fire data is high. How to effectively reduce the dimension of data and improve the explainability of generated data is also one of the problems to be solved. SUMMARY
[0004] In view of the above technical deficiencies, the purpose of the present application is to provide a tunnel fire data generation method based on a generative adversarial network, which can overcome the limitations of existing tunnel fire data acquisition methods, provide more efficient and accurate data support for tunnel fire prevention, early warning, control and rescue, and promote the progress of the field of civil engineering disaster prevention and mitigation, fire engineering and artificial intelligence technology.
[0005] To solve the above technical problems, the technical scheme adopted by the present application is as follows:
[0006] The present application provides a tunnel fire data generation method based on a generative adversarial network, comprising the following steps:
[0007] Step 1: For existing or planned highway tunnels, use FDS to simulate tunnel fire scenarios under different fire source locations, fire source power, and longitudinal jet fan wind speeds. Collect temperature, smoke flow rate, and concentration data at different locations in the tunnel, preprocess the data, and construct a network training dataset.
[0008] Step 2: Build a generative adversarial network model, including a generative network and a discriminative network;
[0009] Step 3: Train the network using random vectors and training set data to obtain a generative model;
[0010] Step 4: Generate fire data using the generative model. Use root mean square error, mean absolute error, and R2 to measure the quality of data generation. Use principal component analysis and t-SNE data dimensionality reduction visualization technology to evaluate the distribution difference between real and generated data.
[0011] Preferably, the specific method of step 1 is:
[0012] Step 1.1: Establish a tunnel fire model in FDS to simulate the development of tunnel fire under different working conditions;
[0013] Step 1.2: Convert the data into .csv format for storage, name the files in the format of "fire source location - fire source power - wind speed", and integrate them into the same folder;
[0014] Step 1.3: Use the read_csv function in the Numpy database to read the data, convert it into a dictionary type, and normalize it to ensure that the data values are between 0 and 1;
[0015] Step 1.4: Use the torch.tensor function to convert the dictionary data into a 32-bit floating-point tensor format for easy reading during network training.
[0016] Preferably, the specific method of step 1.1 is:
[0017] Step 1.1.1: Assume the tunnel length × width × height is 300m × 6m × 6m; select three fire source locations at 50m, 150m, and 250m; select eight fire source powers at intervals of 5MW between 5MW and 40MW; and select eight jet fan wind speeds at intervals of 1m / s between 1m / s and 8m / s;
[0018] Step 1.1.2: Assume that the fire source area is 2×5m and the height from the ground is 0.5m; use t 2 The fire simulation used fire source power growth for 300 seconds. Heptane gas was used as the combustion material, with carbon monoxide and smoke production of 0.006 and 0.015, respectively. The tunnel wall was made of concrete, and its thermal parameters used the default values of the FDS software.
[0019] Step 1.1.3: Dynamically divide the grid based on the location of the fire source. The grid size within 50 meters of the fire source and within 5 meters of the fan is 0.5m × 0.5m × 0.5m. The remaining grid size is 1.0m × 1.0m × 1.0m. The boundary conditions of the tunnel entrance and exit are open.
[0020] Step 1.1.4: Use the HVAC system in FDS to set up jet fans. Place two fans at 75m and 225m from the left entrance of the tunnel, with each fan 1m away from the tunnel ceiling. The fan dimensions are 3m x 1.5m x 1.5m, and the air supply duct has a diameter of 1m. Set the air supply volume corresponding to the target wind speed.
[0021] Step 1.1.5: Within 50 m of the fire source, place thermocouples, flue gas flow velocity, and concentration sensors every 5 m along the longitudinal direction and 0.5 m below the center of the tunnel ceiling. Also, place thermocouples, flue gas flow velocity, and concentration sensors every 1 m along the tunnel height within the range of 2.5-5.5 m. Collect data every 0.25 s until the end of the simulation.
[0022] Preferably, the specific method of step 2 is:
[0023] Step 2.1: Generate a network consisting of a 2-layer bidirectional LSTM network module, 5 fully connected layer modules with different numbers of neurons, 4 ReLU nonlinear activation functions, and 1 Tanh nonlinear activation function;
[0024] Step 2.1.1: Use the nn.LSTM module in the Pytorch library to build a bidirectional LSTM network. The number of network input channels is 1201, which is consistent with the length of the real data sequence. The hidden layer size is 256, bidirectional is set to True, and num_layers is set to 2, forming a two-layer bidirectional LSTM network.
[0025] Step 2.1.2: Use the nn.Linear module unit, nn.ReLU and nn.Tanh nonlinear activation units in the Pytorch library to build five fully connected layers and nonlinear activation layers in sequence;
[0026] The number of input and output channels of the first fully connected layer is 512, ensuring consistency with the number of output channels of the bidirectional LSTM, and connecting to the ReLU nonlinear activation function;
[0027] The second fully connected layer has 512 / 1024 input / output channels and uses the ReLU activation function.
[0028] The third fully connected layer has 1024 / 2048 input / output channels and is connected to the ReLU activation function.
[0029] The fourth fully connected layer has 2048 / 4096 input / output channels and is connected to the ReLU activation function.
[0030] The fifth fully connected layer has an input / output channel number of 4096 / 1201×N, where N is the number of measurement points. It is connected to the Tanh activation function and outputs the generated data.
[0031] Step 2.2: The conditional discriminant network includes a 2-layer bidirectional LSTM network module, 5 fully connected layer modules with different numbers of neurons, and 4 ReLU nonlinear activation modules;
[0032] Step 2.2.1: Use the nn.LSTM module in the Pytorch library to build a bidirectional LSTM network with 1201×N input channels, a hidden layer size of 256, bidirectional set to True, and num_layers set to 2, forming a two-layer bidirectional LSTM network.
[0033] Step 2.2.2: Use the nn.Linear module unit and nn.ReLU nonlinear activation unit in the Pytorch library to build the discriminant network in sequence;
[0034] The first fully connected layer has 512 / 1024 input and output channels. The number of input channels must be consistent with the number of output channels of the bidirectional LSTM, and the ReLU nonlinear activation function must be used.
[0035] The second fully connected layer has 1024 / 512 input / output channels and uses the ReLU activation function.
[0036] The third fully connected layer has 512 / 256 input / output channels and is connected to the ReLU activation function.
[0037] The fourth fully connected layer has an input / output channel number of 256 / 1 and outputs the discriminant score;
[0038] Preferably, step 3 specifically includes the following steps:
[0039] Step 3.1: Perform adversarial training on the generator and discriminator networks; use the randn function provided by the Pytorch library to randomly initialize the generator and discriminator network parameters, and initialize the RMSprop optimizer parameters by instance;
[0040] Step 3.2: Train the discriminator network using generated data and real data;
[0041] Step 3.2.1: Sample a batch of data from the training set and initialize a set of random variables whose dimensions are consistent with the real data;
[0042] Step 3.2.2: Input the random variables into the generator network and output the generated tunnel fire data;
[0043] Step 3.2.3: Input the generated fire data and the real data into the discriminator network and output the discriminant score. The discriminator gives a high score to the real data, the closer the score is to 1, and gives a low score to the generated data, the closer the score is to 0.
[0044] Step 3.2.4: Calculate the discriminator loss using the Wasserstein distance and add a gradient penalty term to ensure the stability of the training process and avoid the discriminator's gradient vanishing or exploding. The loss calculation formula is as follows:
[0045]
[0046] In the formula, x is the real data, z is the random noise, P r is the true sample distribution, P z is a random noise distribution, D(x) is the discrimination score of the discriminator output for the real data, G(z) is the generated data output by the generator, D(G(z)) is the discrimination score of the discriminator output for the generated data, the third term is the gradient penalty term, which is used to force the discriminator to meet the Lipschitz continuity condition, λ is the penalty coefficient, x` is the interpolation between the real sample and the generated sample, P x` is the interpolation distribution;
[0047] Step 3.2.5: Calculate the discriminator loss value and propagate the loss gradient to the discriminator parameters through backpropagation;
[0048] Step 3.2.6: Use the RMSprop optimizer to update the discriminator parameters so that it can better distinguish between real data and generated data;
[0049] Step 3.3: Use the discriminator network loss to update the training generator network;
[0050] Step 3.3.1: Initialize a set of random variables and input them into the generator network, output the generated data, and then send it to the discriminator for scoring, and output the discrimination score;
[0051] Step 3.3.2: The loss function of the generator will maximize the discriminant score, making the data generated by the generator as close to the real data as possible, thereby deceiving the discriminator. The loss calculation formula is as follows:
[0052]
[0053] The meaning of each symbol in the formula is consistent with the discriminator loss calculation formula in step 3.2.4;
[0054] Step 3.3.3: Calculate the total loss and pass the loss to the generator through the gradient backpropagation method;
[0055] Step 3.3.4: Use the RMSprop optimizer to update the generator network parameters based on the loss value so that it can generate more realistic data;
[0056] Step 3.3.5: Iterate the above training process. When the discrimination score output by the discriminator approaches 0.5, it indicates that the generator and discriminator have reached a relatively balanced state and the training is completed.
[0057] Step 3.4: Train for 50,000 rounds in total, saving the generator network weights every 5,000 rounds using the torch.save.state_dict function in the Pytorch library.
[0058] Preferably, the data generation quality evaluation index and data visualization dimensionality reduction analysis in step 4 specifically include the following steps:
[0059] Step 4.1: Use the torch.load.load_state_dict function in the Pytorch library to call the trained generator model, use the torch.rand function to generate random variables, and use the torch.tensor function to convert them into vector form. Input them into the generator, output the generated tunnel fire data, denormalize the data, and store it.
[0060] Step 4.2: Use the sqrt and mean_squared_error functions provided by the Numpy library to calculate the root mean square error between the generated data and the real data, and save the error results in .txt format;
[0061] Step 4.3: Use the mean_absolute_error function provided by the Numpy library to calculate the mean absolute error between the generated data and the real data, and save the error results in .txt format;
[0062] Step 4.4: Use the r2_score function provided by the Numpy library to calculate the R2 score between the generated data and the real data. 2 , save the error results in .txt format;
[0063] Step 4.5: Use the PCA function provided by the sklearn library to calculate the two-dimensional distribution between the generated data and the real data, and use the plt function in the matplotlib library to save the analysis results in the form of a picture;
[0064] Step 4.6: Use the TSNE function provided by the sklearn library to calculate the two-dimensional distribution pattern between the generated data and the real data. Use the plt function in the matplotlib library to save the analysis results in the form of a picture.
[0065] The beneficial effects of the present invention are as follows: the present invention introduces a bidirectional LSTM network module and Wasserstein distance loss, and collects temperature, smoke concentration, and flow rate data of measurement points under different fire source locations, power, and longitudinal jet fan wind speeds in the tunnel for network training. Among them, the bidirectional LSTM can help the network better capture the "time series" information of the data, while the Wasserstein loss can make the network gradient changes smoother, reduce the pattern collapse phenomenon, and improve the stability of network training. Compared with traditional data expansion methods, this method can accurately and quickly generate tunnel fire data under different working conditions, avoid tedious and time-consuming numerical simulation work, and achieve efficient and high-precision expansion of the tunnel fire database. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0067] Figure 1 This is a diagram of the architecture of the generative adversarial network provided by the present invention;
[0068] Figure 2 The bidirectional LSTM module architecture diagram provided by the present invention;
[0069] Figure 3 The temperature data generation diagram of 10 measuring points at 150m-5MW-1m / s provided by the present invention;
[0070] Figure 4 Dimensionality reduction analysis of the 150m-5MW-1m / s measurement point 10 generation and real temperature data provided by the present invention: (a) PCA dimensionality reduction, (b) t-SNE dimensionality reduction graph;
[0071] Figure 5 This is the smoke concentration data generation diagram of 10 measuring points at 150m-5MW-1m / s provided by the present invention;
[0072] Figure 6 Dimensionality reduction analysis of the 150m-5MW-1m / s measurement point 10 generated by the present invention and the actual flue gas concentration data: (a) PCA dimensionality reduction, (b) t-SNE dimensionality reduction graph;
[0073] Figure 7 This is the data generation diagram of the flue gas velocity at 10 measuring points (150m-5MW-1m / s) provided by the present invention;
[0074] Figure 8 Dimensionality reduction analysis of the 150m-5MW-1m / s measurement point 10 generated by the present invention and the actual flue gas concentration data: (a) PCA dimensionality reduction, (b) t-SNE dimensionality reduction diagram. DETAILED DESCRIPTION
[0075] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0076] This embodiment provides a method for generating tunnel fire data based on a generative adversarial network, comprising the following steps:
[0077] Step 1: For existing or planned highway tunnels, use FDS to simulate tunnel fire scenarios under different fire source locations, fire source power, and longitudinal jet fan wind speeds. Collect temperature, smoke flow rate, and concentration data at different locations in the tunnel, preprocess the data, and construct a network training dataset.
[0078] Step 1.1: Establish a tunnel fire model in FDS to simulate the development of tunnel fire under different working conditions;
[0079] The specific method of step 1.1 is:
[0080] Step 1.1.1: Assume the tunnel length × width × height is 300m × 6m × 6m; select three fire source locations at 50m, 150m, and 250m; select eight fire source powers at intervals of 5MW between 5MW and 40MW; and select eight jet fan wind speeds at intervals of 1m / s between 1m / s and 8m / s;
[0081] Step 1.1.2: Assume that the fire source area is 2×5m and the height from the ground is 0.5m; use t 2 The fire simulation used fire source power growth for 300 seconds. Heptane gas was used as the combustion material, with carbon monoxide and smoke production of 0.006 and 0.015, respectively. The tunnel wall was made of concrete, and its thermal parameters used the default values of the FDS software.
[0082] Step 1.1.3: Dynamically divide the grid based on the location of the fire source. The grid size within 50 meters of the fire source and within 5 meters of the fan is 0.5m × 0.5m × 0.5m. The remaining grid size is 1.0m × 1.0m × 1.0m. The boundary conditions of the tunnel entrance and exit are open.
[0083] Step 1.1.4: Use the HVAC system in FDS to set up jet fans. Place two fans at 75m and 225m from the left entrance of the tunnel, with each fan 1m away from the tunnel ceiling. The fan dimensions are 3m x 1.5m x 1.5m, and the air supply duct has a diameter of 1m. Set the air supply volume corresponding to the target wind speed.
[0084] Step 1.1.5: Within 50 m of the fire source, place thermocouples, flue gas flow velocity, and concentration sensors every 5 m along the longitudinal direction and 0.5 m below the center of the tunnel ceiling. Also, place thermocouples, flue gas flow velocity, and concentration sensors every 1 m along the tunnel height within the range of 2.5-5.5 m. Collect data every 0.25 s until the end of the simulation.
[0085] Step 1.2: Convert the data into .csv format for storage, name the files in the format of "fire source location - fire source power - wind speed", and integrate them into the same folder;
[0086] Step 1.3: Use the read_csv function in the Numpy database to read the data, convert it into a dictionary type, and normalize it to ensure that the data values are between 0 and 1;
[0087] Step 1.4: Use the torch.tensor function to convert the dictionary data into a 32-bit floating-point tensor format for easy reading during network training.
[0088] Step 2: Build a generative adversarial network model, including a generative network and a discriminative network; see Figure 1 ;
[0089] Step 2.1: Generate a network consisting of a 2-layer bidirectional LSTM network module, 5 fully connected layer modules with different numbers of neurons, 4 ReLU nonlinear activation functions, and 1 Tanh nonlinear activation function;
[0090] Step 2.1.1: Use the nn.LSTM module in the Pytorch library to build a bidirectional LSTM network. The number of network input channels is 1201, which is consistent with the length of the real data sequence. The hidden layer size is 256, bidirectional is set to True, and num_layers is set to 2, forming a two-layer bidirectional LSTM network.
[0091] Step 2.1.2: Use the nn.Linear module unit, nn.ReLU and nn.Tanh nonlinear activation units in the Pytorch library to build five fully connected layers and nonlinear activation layers in sequence;
[0092] The number of input and output channels of the first fully connected layer is 512, ensuring consistency with the number of output channels of the bidirectional LSTM, and connecting to the ReLU nonlinear activation function;
[0093] The second fully connected layer has 512 / 1024 input / output channels and uses the ReLU activation function.
[0094] The third fully connected layer has 1024 / 2048 input / output channels and is connected to the ReLU activation function.
[0095] The fourth fully connected layer has 2048 / 4096 input / output channels and is connected to the ReLU activation function.
[0096] The fifth fully connected layer has an input / output channel number of 4096 / 1201×N, where N is the number of measurement points. It is connected to the Tanh activation function and outputs the generated data.
[0097] Step 2.2: The conditional discriminant network includes a 2-layer bidirectional LSTM network module, 5 fully connected layer modules with different numbers of neurons, and 4 ReLU nonlinear activation modules;
[0098] Step 2.2.1: Use the nn.LSTM module in the Pytorch library to build a bidirectional LSTM network with 1201×N input channels, 256 hidden layers, bidirectional set to True, and num_layers set to 2, forming a two-layer bidirectional LSTM network; see Figure 2 ;
[0099] Step 2.2.2: Use the nn.Linear module unit and nn.ReLU nonlinear activation unit in the Pytorch library to build the discriminant network in sequence;
[0100] The first fully connected layer has 512 / 1024 input and output channels. The number of input channels must be consistent with the number of output channels of the bidirectional LSTM, and the ReLU nonlinear activation function must be used.
[0101] The second fully connected layer has 1024 / 512 input / output channels and uses the ReLU activation function.
[0102] The third fully connected layer has 512 / 256 input / output channels and is connected to the ReLU activation function.
[0103] The fourth fully connected layer has an input / output channel number of 256 / 1 and outputs the discriminant score.
[0104] Step 3: Train the network using random vectors and training set data to obtain a generative model;
[0105] Step 3.1: Perform adversarial training on the generator and discriminator networks; use the randn function provided by the Pytorch library to randomly initialize the generator and discriminator network parameters, and initialize the RMSprop optimizer parameters by instance;
[0106] Step 3.2: Train the discriminator network using generated data and real data;
[0107] Step 3.2.1: Sample a batch of data from the training set and initialize a set of random variables whose dimensions are consistent with the real data;
[0108] Step 3.2.2: Input the random variables into the generator network and output the generated tunnel fire data;
[0109] Step 3.2.3: Input the generated fire data and the real data into the discriminator network and output the discriminant score. The discriminator gives a high score to the real data, the closer the score is to 1, and gives a low score to the generated data, the closer the score is to 0.
[0110] Step 3.2.4: Calculate the discriminator loss using the Wasserstein distance and add a gradient penalty term to ensure the stability of the training process and avoid the discriminator's gradient vanishing or exploding. The loss calculation formula is as follows:
[0111]
[0112] In the formula, x is the real data, z is the random noise, P r is the true sample distribution, P z is a random noise distribution, D(x) is the discrimination score of the discriminator output for the real data, G(z) is the generated data output by the generator, D(G(z)) is the discrimination score of the discriminator output for the generated data, the third term is the gradient penalty term, which is used to force the discriminator to meet the Lipschitz continuity condition, λ is the penalty coefficient, x` is the interpolation between the real sample and the generated sample, P x` is the interpolation distribution;
[0113] Step 3.2.5: Calculate the discriminator loss value and propagate the loss gradient to the discriminator parameters through backpropagation;
[0114] Step 3.2.6: Use the RMSprop optimizer to update the discriminator parameters so that it can better distinguish between real data and generated data;
[0115] Step 3.3: Use the discriminator network loss to update the training generator network;
[0116] Step 3.3.1: Initialize a set of random variables and input them into the generator network, output the generated data, and then send it to the discriminator for scoring, and output the discrimination score;
[0117] Step 3.3.2: The loss function of the generator will maximize the discriminant score, making the data generated by the generator as close to the real data as possible, thereby deceiving the discriminator. The loss calculation formula is as follows:
[0118]
[0119] The meaning of each symbol in the formula is consistent with the discriminator loss calculation formula in step 3.2.4;
[0120] Step 3.3.3: Calculate the total loss and pass the loss to the generator through the gradient backpropagation method;
[0121] Step 3.3.4: Use the RMSprop optimizer to update the generator network parameters based on the loss value so that it can generate more realistic data;
[0122] Step 3.3.5: Iterate the above training process. When the discrimination score output by the discriminator approaches 0.5, it indicates that the generator and discriminator have reached a relatively balanced state and the training is completed.
[0123] Step 3.4: Train for 50,000 rounds in total, saving the generator network weights every 5,000 rounds using the torch.save.state_dict function in the Pytorch library.
[0124] Step 4: Generate fire data using the generative model. Use root mean square error, mean absolute error, and R2 to measure the quality of data generation. Use principal component analysis and t-SNE data dimensionality reduction visualization technology to evaluate the distribution difference between real and generated data. Figure 3-Figure 8 ;
[0125] Step 4.1: Use the torch.load.load_state_dict function in the Pytorch library to call the trained generator model, use the torch.rand function to generate random variables, and use the torch.tensor function to convert them into vector form. Input them into the generator, output the generated tunnel fire data, denormalize the data, and store it.
[0126] Step 4.2: Use the sqrt and mean_squared_error functions provided by the Numpy library to calculate the root mean square error between the generated data and the real data, and save the error results in .txt format;
[0127] Step 4.3: Use the mean_absolute_error function provided by the Numpy library to calculate the mean absolute error between the generated data and the real data, and save the error results in .txt format;
[0128] Step 4.4: Use the r2_score function provided by the Numpy library to calculate the R2 score between the generated data and the real data. 2 , save the error results in .txt format;
[0129] Step 4.5: Use the PCA function provided by the sklearn library to calculate the two-dimensional distribution between the generated data and the real data, and use the plt function in the matplotlib library to save the analysis results in the form of a picture;
[0130] Step 4.6: Use the TSNE function provided by the sklearn library to calculate the two-dimensional distribution pattern between the generated data and the real data. Use the plt function in the matplotlib library to save the analysis results in the form of a picture.
[0131] This method enhances the model's ability to process time series data by integrating a bidirectional LSTM network module, and introduces the Wasserstein distance loss function to optimize the authenticity and stability of the generated data.
[0132] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A method for generating tunnel fire data based on a generative adversarial network, characterized in that: The following steps are involved: Step 1: For existing or planned highway tunnels, use FDS to simulate tunnel fire scenarios under different fire source locations, fire source power, and longitudinal jet fan wind speeds. Collect temperature, smoke flow rate, and concentration data at different locations in the tunnel, preprocess the data, and construct a network training dataset. Step 2: Build a generative adversarial network model, including a generative network and a discriminative network; Step 3: Train the network using random vectors and training set data to obtain a generative model; Step 4: Generate fire data using the generative model. Use root mean square error, mean absolute error, and R2 to measure the quality of data generation. Use principal component analysis and t-SNE data dimensionality reduction visualization technology to evaluate the distribution difference between real and generated data. The specific method of step 1 is: Step 1.1: Establish a tunnel fire model in FDS to simulate the development of tunnel fire under different working conditions; Step 1.2: Convert the data into .csv format for storage, name the files in the format of "fire source location - fire source power - wind speed", and integrate them into the same folder; Step 1.3: Use the read_csv function in the Numpy database to read the data, convert it into a dictionary type, and normalize it to ensure that the data values are between 0 and 1; Step 1.4: Use the torch.tensor function to convert the dictionary data into a 32-bit floating-point tensor format for easy reading during network training. The specific method of step 2 is as follows: Step 2.1: Generate a network including a 2-layer bidirectional LSTM network module, 5 fully connected layer modules with different numbers of neurons, 4 ReLU nonlinear activation functions, and 1 Tanh nonlinear activation function; Step 2.1.1: Use the nn.LSTM module in the Pytorch library to build a bidirectional LSTM network. The number of network input channels is 1201, which is consistent with the length of the real data sequence. The hidden layer size is 256, bidirectional is set to True, and num_layers is set to 2, forming a two-layer bidirectional LSTM network. Step 2.1.2: Use the nn.Linear module unit, nn.ReLU and nn.Tanh nonlinear activation units in the Pytorch library to build five fully connected layers and nonlinear activation layers in sequence; The number of input and output channels of the first fully connected layer is 512, ensuring consistency with the number of output channels of the bidirectional LSTM, and connecting to the ReLU nonlinear activation function; The second fully connected layer has 512 / 1024 input / output channels and uses the ReLU activation function. The third fully connected layer has 1024 / 2048 input / output channels and is connected to the ReLU activation function. The fourth fully connected layer has 2048 / 4096 input / output channels and is connected to the ReLU activation function. The fifth fully connected layer has an input / output channel number of 4096 / 1201×N, where N is the number of measurement points. It is connected to the Tanh activation function and outputs the generated data. Step 2.2: The discriminant network includes a 2-layer bidirectional LSTM network module, 5 fully connected layer modules with different numbers of neurons, and 4 ReLU nonlinear activation modules; Step 2.2.1: Use the nn.LSTM module in the Pytorch library to build a bidirectional LSTM network with 1201×N input channels, a hidden layer size of 256, bidirectional set to True, and num_layers set to 2, forming a two-layer bidirectional LSTM network. Step 2.2.2: Use the nn.Linear module unit and nn.ReLU nonlinear activation unit in the Pytorch library to build the discriminant network in sequence; The number of input / output channels of the first fully connected layer is 512 / 1024. The number of input channels must be consistent with the number of output channels of the bidirectional LSTM, and the ReLU nonlinear activation function must be used. The second fully connected layer has 1024 / 512 input / output channels and uses the ReLU activation function. The third fully connected layer has 512 / 256 input / output channels and is connected to the ReLU activation function. The fourth fully connected layer has an input / output channel number of 256 / 1 and outputs the discriminant score.
2. The method for generating tunnel fire data based on a generative adversarial network according to claim 1, characterized in that: The specific method of step 1.1 is: Step 1.1.1: Assume the tunnel length × width × height is 300m × 6m × 6m; select three fire source locations at 50m, 150m, and 250m; select eight fire source powers at intervals of 5MW between 5MW and 40MW; and select eight jet fan wind speeds at intervals of 1m / s between 1m / s and 8m / s; Step 1.1.2: Assume that the fire source area is 2×5m and the height from the ground is 0.5m; use t 2 The fire simulation used fire source power growth for 300 seconds. Heptane gas was used as the combustion material, with carbon monoxide and smoke production of 0.006 and 0.015, respectively. The tunnel wall was made of concrete, and its thermal parameters used the default values of the FDS software. Step 1.1.3: Dynamically divide the grid based on the location of the fire source. The grid size within 50 meters of the fire source and within 5 meters of the fan is 0.5m × 0.5m × 0.5m, and the grid size for the rest of the area is 1.0m × 1.0m × 1.0m. The boundary conditions of the tunnel entrance and exit are open; Step 1.1.4: Use the HVAC system in FDS to set up jet fans. Place two fans at 75m and 225m from the left entrance of the tunnel, with each fan 1m away from the tunnel ceiling. The fan dimensions are 3m x 1.5m x 1.5m, and the air supply duct has a diameter of 1m. Set the air supply volume corresponding to the target wind speed. Step 1.1.5: Within 50 m of the fire source, place thermocouples, flue gas flow velocity, and concentration sensors every 5 m along the longitudinal direction and 0.5 m below the center of the tunnel ceiling. Also, place thermocouples, flue gas flow velocity, and concentration sensors every 1 m along the tunnel height within the range of 2.5-5.5 m. Collect data every 0.25 s until the end of the simulation.
3. The method for generating tunnel fire data based on a generative adversarial network according to claim 2, characterized in that: Step 3 specifically includes the following steps: Step 3.1: Perform adversarial training on the generator and discriminator networks; use the randn function provided by the Pytorch library to randomly initialize the generator and discriminator network parameters, and initialize the RMSprop optimizer parameters by instance; Step 3.2: Train the discriminator network using generated data and real data; Step 3.2.1: Sample a batch of data from the training set and initialize a set of random variables whose dimensions are consistent with the real data; Step 3.2.2: Input the random variables into the generator network and output the generated tunnel fire data; Step 3.2.3: Input the generated fire data and the real data into the discriminator network and output the discriminant score. The discriminator gives a high score to the real data, the closer the score is to 1, and gives a low score to the generated data, the closer the score is to 0. Step 3.2.4: Calculate the discriminator loss using the Wasserstein distance and add a gradient penalty term to ensure the stability of the training process and avoid the discriminator's gradient vanishing or exploding. The loss calculation formula is as follows: (1) In the formula, x is the real data, z is the random noise, P r is the true sample distribution, P z is a random noise distribution, D(x) is the discriminant score of the discriminant output for the real data, G(z) is the generated data output by the generator, D(G(z)) is the discriminant score of the discriminant output for the generated data, the third term is the gradient penalty term, which is used to force the discriminator to meet the Lipschitz continuity condition, λ is the penalty coefficient, x` is the interpolation between the real sample and the generated sample, P x` is the interpolation distribution; Step 3.2.5: Calculate the discriminator loss value and propagate the loss gradient to the discriminator parameters through backpropagation; Step 3.2.6: Use the RMSprop optimizer to update the discriminator parameters so that it can better distinguish between real data and generated data; Step 3.3: Use the discriminator network loss to update the training generator network; Step 3.3.1: Initialize a set of random variables and input them into the generator network, output the generated data, and then send it to the discriminator for scoring, and output the discrimination score; Step 3.3.2: The loss function of the generator will maximize the discriminant score, making the data generated by the generator as close to the real data as possible, thereby deceiving the discriminator. The loss calculation formula is as follows: (2) The meaning of each symbol in the formula is consistent with the discriminator loss calculation formula in step 3.2.4; Step 3.3.3: Calculate the total loss and pass the loss to the generator through the gradient backpropagation method; Step 3.3.4: Use the RMSprop optimizer to update the generator network parameters based on the loss value so that it can generate more realistic data; Step 3.3.5: Iterate the above training process. When the discrimination score output by the discriminator approaches 0.5, it indicates that the generator and discriminator have reached a relatively balanced state and the training is completed. Step 3.4: Train for 50,000 rounds in total, saving the generator network weights every 5,000 rounds using the torch.save.state_dict function in the Pytorch library.
4. The method for generating tunnel fire data based on a generative adversarial network according to claim 3, characterized in that: The data generation quality evaluation index and data visualization dimensionality reduction analysis in step 4 specifically include the following steps: Step 4.1: Use the torch.load.load_state_dict function in the Pytorch library to call the trained generator model, use the torch.rand function to generate random variables, and use the torch.tensor function to convert them into vector form. Input them into the generator, output the generated tunnel fire data, denormalize the data, and store it. Step 4.2: Use the sqrt and mean_squared_error functions provided by the Numpy library to calculate the root mean square error between the generated data and the real data, and save the error results in .txt format; Step 4.3: Use the mean_absolute_error function provided by the Numpy library to calculate the mean absolute error between the generated data and the real data, and save the error results in .txt format; Step 4.4: Use the r2_score function provided by the Numpy library to calculate the R2 score between the generated data and the real data. 2 , save the error results in .txt format; Step 4.5: Use the PCA function provided by the sklearn library to calculate the two-dimensional distribution between the generated data and the real data, and use the plt function in the matplotlib library to save the analysis results in the form of a picture; Step 4.6: Use the TSNE function provided by the sklearn library to calculate the two-dimensional distribution pattern between the generated data and the real data. Use the plt function in the matplotlib library to save the analysis results in the form of a picture.
Citation Information
Patent Citations
SEMG data enhancement method based on BiLSTM and WGAN-GP network
CN114372490A
Industrial process time series data generation method and system
CN116894186A