Tunnel fire data generation method based on generative adversarial network
Through a GAN-based method, the two-way LSTM network and Wasserstein distance loss are used to generate tunnel fire data, solving the difficulty of obtaining tunnel fire data in the prior art, and achieving fast and accurate data generation.
Patent Information
- Application Number
- CN202411983633.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-31
AI Technical Summary
It is difficult for the existing technology to quickly and accurately obtain tunnel fire data, and traditional methods have problems such as high costs, high security risks or high computing resources consumption.
Using a method based on a generative adversarial network (GAN), the tunnel fire scenes under different fire source locations, fire source power and longitudinal jet fan wind speed are simulated through FDS, data is collected and network training data is constructed, a two-way LSTM network and discriminant network are built, and the Wasserstein distance loss is used for confrontation training to generate fire data.
It realizes the rapid and accurate generation of tunnel fire data under different working conditions, avoiding the cumbersome and high computing resource requirements of traditional numerical simulation, and improving the stability and authenticity of data generation.
Smart Images

Figure CN119903737A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the intersection of civil engineering disaster prevention and mitigation, fire engineering and artificial intelligence, and in particular to a method for generating tunnel fire data based on a generative adversarial network. Background Art
[0002] In the study of tunnel fires, how to accurately obtain fire data is a key link in tunnel fire research. Traditionally, fire data is mainly obtained through two ways: fire experiments and numerical simulations. Full-scale or scaled fire experiments can directly provide real fire data, but they are expensive and there are great safety risks during the experiment, which limits their application in large-scale research. The numerical simulation method constructs a mathematical-physical model of tunnel fires and uses computers for simulation calculations. Although the cost is low and the safety risk is small, the simulation process is cumbersome and time-consuming, and the computing resources are high. It is 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 achieved remarkable results in the fields of image generation and text generation. Through adversarial training of the generator and the discriminator, GAN can generate data that is highly similar to the real data distribution, providing a new idea for the rapid and accurate acquisition of tunnel fire data. However, the application of the GAN algorithm to tunnel fire data generation still faces the following challenges: (1) Tunnel fire data contains complex "time series" features. How to design a reasonable generative adversarial network architecture so that it can accurately capture the data feature distribution is a difficult problem at present; (2) Tunnel fire data has a high dimensionality. How to effectively reduce the dimensionality of the data and improve the interpretability of the generated data is also one of the problems that need to be solved urgently. Summary of the invention
[0004] In view of the above-mentioned technical deficiencies, the purpose of the present invention is to provide a method for generating tunnel fire data 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 progress in the fields of civil engineering disaster prevention and mitigation, fire protection engineering and artificial intelligence technology.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] The present invention provides a method for generating tunnel fire data based on a generative adversarial network, comprising the following steps:
[0007] Step 1: For existing or planned highway tunnels, FDS is used to simulate tunnel fire scenarios under different fire source locations, fire source power, and longitudinal jet fan wind speeds. The temperature, smoke flow rate, and concentration data at different locations in the tunnel are collected, and the data are preprocessed to construct a network training data set.
[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 generation 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, and 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 in 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 value is 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 for easy reading during network training.
[0016] Preferably, the specific method of step 1.1 is:
[0017] Step 1.1.1: Assume that the tunnel length × width × height is 300m × 6m × 6m; select three fire source locations of 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 source power of the fire simulation increases, and the simulation time is 300s; heptane gas is used as the combustion material, and the carbon monoxide and smoke production are 0.006 and 0.015 respectively; the tunnel wall is concrete, and its thermal parameters use the default values of FDS software;
[0019] Step 1.1.3: Dynamically divide the grid according to the location of the fire source. The grid size within 50m around the fire source and within 5m around the fan is 0.5m×0.5m×0.5m, and 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. Two fans are placed at 75m and 225m away from the left entrance of the tunnel. The distance between each fan and the tunnel ceiling is 1m. The fan length × width × height is 3m × 1.5m × 1.5m. The diameter of the air supply duct is 1m. Set the air supply volume corresponding to the target wind speed.
[0021] Step 1.1.5: Within 50m of the fire source, 0.5m below the center of the tunnel ceiling, a thermocouple, flue gas flow velocity and concentration sensor is arranged every 5m in the longitudinal direction, and a thermocouple, flue gas flow velocity and concentration sensor is arranged every 1m in the range of 2.5-5.5m in the height direction of the tunnel. Data is collected every 0.25s until the end of the simulation.
[0022] Preferably, the specific method of step 2 is:
[0023] Step 2.1: The generated network includes 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 unit 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 bidirectional LSTM network with a total of 2 layers.
[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 5 fully connected layers and nonlinear activation layers in sequence;
[0026] The number of input / output channels of the first fully connected layer is 512, which is consistent with the number of output channels of the bidirectional LSTM and is connected 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 uses the ReLU activation function.
[0029] The fourth fully connected layer has 2048 / 4096 input / output channels and uses 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 unit in the Pytorch library to build a bidirectional LSTM network. The number of network input channels is 1201×N, the hidden layer size is 256, bidirectional is set to True, and num_layers is set to 2, forming a bidirectional LSTM network with a total of 2 layers;
[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 turn;
[0034] The number of input / output channels of the first fully connected layer is 512 / 1024. The input channels must ensure consistency with the number of bidirectional LSTM output channels and be connected to the ReLU nonlinear activation function.
[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 uses 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 in the Pytorch library to randomly initialize the generator and discriminator network parameters, and initialize the RMSprop optimizer parameters by example;
[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 together, 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 through Wasserstein distance and add the gradient penalty term to ensure the stability of the training process and avoid the discriminator's gradient disappearance or explosion. 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 satisfy the Lipschitz continuity condition, λ is the penalty coefficient, x` is the interpolation between the real sample and the generated sample, P x` is the interpolated distribution;
[0047] Step 3.2.5: Calculate the discriminator loss value and propagate the loss gradient to the discriminator parameters through back propagation;
[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 them to the discriminator for scoring, and output the discriminant 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 according to 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 the discriminator have reached a relatively balanced state, and the training is completed.
[0057] Step 3.4: Train for 50,000 rounds in total, using the torch.save.state_dict function in the Pytorch library to save the generator network weights every 5,000 rounds.
[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 torch.load.load_state_dict 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, and denormalize and store the data;
[0060] Step 4.2: Use the sqrt and mean_squared_error functions provided in the Numpy library to calculate the root mean square error between the generated data and the real data, and save the error results in the form of .txt;
[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 law 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 pictures;
[0064] Step 4.6: Use the TSNE function provided by the sklearn library to calculate the two-dimensional distribution law 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 pictures.
[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 the temperature, smoke concentration and flow rate data of the measuring points under different fire source positions, powers 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 change smoother, reduce the mode 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 realize 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.
[0067] Figure 1 A diagram of the architecture of a 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 150m-5MW-1m / s measuring point 10 provided by the present invention;
[0070] Figure 4 The 150m-5MW-1m / s measurement point 10 provided by the present invention is generated and the dimension reduction analysis of the real temperature data is performed: (a) PCA dimension reduction, (b) t-SNE dimension reduction diagram;
[0071] Figure 5 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 real smoke concentration data: (a) PCA dimensionality reduction, (b) t-SNE dimensionality reduction diagram;
[0073] Figure 7 The data generation diagram of the flue gas velocity at 10 measuring points of 150m-5MW-1m / s provided by the present invention;
[0074] Figure 8 Dimensionality reduction analysis of the 150m-5MW-1m / s measuring 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 be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work 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, FDS is used to simulate tunnel fire scenarios under different fire source locations, fire source power, and longitudinal jet fan wind speeds. The temperature, smoke flow rate, and concentration data at different locations in the tunnel are collected, and the data are preprocessed to construct a network training data set.
[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 that the tunnel length × width × height is 300m × 6m × 6m; select three fire source locations of 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 source power of the fire simulation increases, and the simulation time is 300s; heptane gas is used as the combustion material, and the carbon monoxide and smoke production are 0.006 and 0.015 respectively; the tunnel wall is concrete, and its thermal parameters use the default values of FDS software;
[0082] Step 1.1.3: Dynamically divide the grid according to the location of the fire source. The grid size within 50m around the fire source and within 5m around the fan is 0.5m×0.5m×0.5m, and 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. Two fans are placed at 75m and 225m away from the left entrance of the tunnel. The distance between each fan and the tunnel ceiling is 1m. The fan length × width × height is 3m × 1.5m × 1.5m. The diameter of the air supply duct is 1m. Set the air supply volume corresponding to the target wind speed.
[0084] Step 1.1.5: Within 50m of the fire source, 0.5m below the center of the tunnel ceiling, a thermocouple, flue gas flow velocity and concentration sensor is arranged every 5m in the longitudinal direction, and a thermocouple, flue gas flow velocity and concentration sensor is arranged every 1m in the range of 2.5-5.5m in the height direction of the tunnel. Data is collected every 0.25s 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 in 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 value is 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 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: The generated network includes 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 unit 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 bidirectional LSTM network with a total of 2 layers.
[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 5 fully connected layers and nonlinear activation layers in sequence;
[0092] The number of input / output channels of the first fully connected layer is 512, which is consistent with the number of output channels of the bidirectional LSTM and is connected 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 uses the ReLU activation function.
[0095] The fourth fully connected layer has 2048 / 4096 input / output channels and uses 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 unit in the Pytorch library to build a bidirectional LSTM network with 1201×N network input channels, 256 hidden layer size, bidirectional set to True, num_layers set to 2, and a 2-layer bidirectional LSTM network is formed; 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 turn;
[0100] The number of input / output channels of the first fully connected layer is 512 / 1024. The input channels must ensure consistency with the number of bidirectional LSTM output channels and be connected to the ReLU nonlinear activation function.
[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 uses 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 generation model;
[0105] Step 3.1: Perform adversarial training on the generator and discriminator networks; use the randn function provided in the Pytorch library to randomly initialize the generator and discriminator network parameters, and initialize the RMSprop optimizer parameters by example;
[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 together, 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 through Wasserstein distance and add the gradient penalty term to ensure the stability of the training process and avoid the discriminator's gradient disappearance or explosion. 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 satisfy the Lipschitz continuity condition, λ is the penalty coefficient, x` is the interpolation between the real sample and the generated sample, P x` is the interpolated distribution;
[0113] Step 3.2.5: Calculate the discriminator loss value and propagate the loss gradient to the discriminator parameters through back propagation;
[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 them to the discriminator for scoring, and output the discriminant 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 according to 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 the discriminator have reached a relatively balanced state, and the training is completed.
[0123] Step 3.4: Train for 50,000 rounds in total, using the torch.save.state_dict function in the Pytorch library to save the generator network weights every 5,000 rounds.
[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, and 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 torch.load.load_state_dict 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, and denormalize and store the data;
[0126] Step 4.2: Use the sqrt and mean_squared_error functions provided in the Numpy library to calculate the root mean square error between the generated data and the real data, and save the error results in the form of .txt;
[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 the form of .txt;
[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 law 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 pictures;
[0130] Step 4.6: Use the TSNE function provided by the sklearn library to calculate the two-dimensional distribution law 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 pictures.
[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 can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
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, FDS is used to simulate tunnel fire scenarios under different fire source locations, fire source power, and longitudinal jet fan wind speeds. The temperature, smoke flow rate, and concentration data at different locations in the tunnel are collected, and the data are preprocessed to construct a network training data set. 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 generation 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, and use principal component analysis and t-SNE data dimensionality reduction visualization technology to evaluate the distribution difference between real and generated data.
2. A method for generating tunnel fire data based on a generative adversarial network as claimed in claim 1, characterized in that: 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 in 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 value is between 0 and 1; Step 1.4: Use the torch.tensor function to convert the dictionary data into a 32-bit floating-point tensor for easy reading during network training.
3. A method for generating tunnel fire data based on a generative adversarial network as claimed in claim 2, characterized in that: The specific method of step 1.1 is: Step 1.1.1: Assume that the tunnel length × width × height is 300m × 6m × 6m; select three fire source locations of 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 source power of the fire simulation increases, and the simulation time is 300s; heptane gas is used as the combustion material, and the carbon monoxide and smoke production are 0.006 and 0.015 respectively; the tunnel wall is concrete, and its thermal parameters use the default values of FDS software; Step 1.1.3: Dynamically divide the grid according to the location of the fire source. The grid size within 50m around the fire source and within 5m around the fan is 0.5m×0.5m×0.5m, and the remaining grid size 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. Two fans are placed at 75m and 225m away from the left entrance of the tunnel. The distance between each fan and the tunnel ceiling is 1m. The fan length × width × height is 3m × 1.5m × 1.5m. The diameter of the air supply duct is 1m. Set the air supply volume corresponding to the target wind speed. Step 1.1.5: Within 50m of the fire source, 0.5m below the center of the tunnel ceiling, a thermocouple, flue gas flow velocity and concentration sensor is arranged every 5m in the longitudinal direction, and a thermocouple, flue gas flow velocity and concentration sensor is arranged every 1m in the range of 2.5-5.5m in the height direction of the tunnel. Data is collected every 0.25s until the end of the simulation.
4. A method for generating tunnel fire data based on a generative adversarial network as claimed in claim 3, characterized in that: The specific method of step 2 is: Step 2.1: The generated network includes 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 unit 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 bidirectional LSTM network with a total of 2 layers. Step 2.1.2: Use the nn.Linear module unit, nn.ReLU and nn.Tanh nonlinear activation units in the Pytorch library to build 5 fully connected layers and nonlinear activation layers in sequence; The number of input / output channels of the first fully connected layer is 512, which is consistent with the number of output channels of the bidirectional LSTM and is connected 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 uses the ReLU activation function. The fourth fully connected layer has 2048 / 4096 input / output channels and uses 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 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; Step 2.2.1: Use the nn.LSTM module unit in the Pytorch library to build a bidirectional LSTM network with a network input channel number of 1201×N, a hidden layer size of 256, and bidirectional set to True. num_layers is set to 2 to form a bidirectional LSTM network with a total of 2 layers; 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 turn; The number of input / output channels of the first fully connected layer is 512 / 1024. The input channels must ensure consistency with the number of bidirectional LSTM output channels and be connected to the ReLU nonlinear activation function. 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 uses the ReLU activation function. The fourth fully connected layer has an input / output channel number of 256 / 1 and outputs the discriminant score.
5. The method for generating tunnel fire data based on a generative adversarial network according to claim 4, 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 in the Pytorch library to randomly initialize the generator and discriminator network parameters, and initialize the RMSprop optimizer parameters by example; 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 together, 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 through Wasserstein distance and add the gradient penalty term to ensure the stability of the training process and avoid the discriminator's gradient disappearance or explosion. The loss calculation formula is as follows: 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 satisfy 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 back propagation; 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 them to the discriminator for scoring, and output the discriminant 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: 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 according to 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 the discriminator have reached a relatively balanced state, and the training is completed. Step 3.4: Train for 50,000 rounds in total, using the torch.save.state_dict function in the Pytorch library to save the generator network weights every 5,000 rounds.
6. A method for generating tunnel fire data based on a generative adversarial network as claimed in claim 5, 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 torch.load.load_state_dict 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, and denormalize and store the data; Step 4.2: Use the sqrt and mean_squared_error functions provided in the Numpy library to calculate the root mean square error between the generated data and the real data, and save the error results in the form of .txt; 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 the form of .txt; 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 law 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 pictures; Step 4.6: Use the TSNE function provided by the sklearn library to calculate the two-dimensional distribution law 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 pictures.
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
Forest lightning stroke fire monitoring method and system based on artificial intelligence
CN119027766A
Cited By
Indoor fire prediction method and device based on generative adversarial network, and electronic equipment
CN120338218A
Tunnel fire video data generation method based on space-time perception CGAN model
CN120388103A
A tunnel fire video data generation method based on spatiotemporal perception CGAN model
CN120388103B