Method for predicting indoor fire flashover risk based on flame shape and remote sensing data
By constructing a fire flashover risk prediction method based on flame morphology and remote sensing data, and utilizing fire simulation, high-definition cameras, and methane laser remote sensing detectors, combined with residual networks and LSTM models, the problem of traditional fire monitoring being unable to predict flashover risk was solved, achieving early warning and risk reduction.
Patent Information
- Application Number
- CN202411574732.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-11-06
AI Technical Summary
Traditional fire monitoring methods are unable to accurately predict the risk of flashover in the early stages of a fire, thus failing to buy time for personnel evacuation and firefighting.
An indoor fire flashover risk prediction method based on flame morphology and remote sensing data is proposed. A dataset is constructed using fire simulation software, flame images are acquired and processed using high-definition cameras, the heat release rate is output using a ResNet residual network model, methane gas concentration is monitored using a methane laser remote sensing instrument, and an LSTM model is built to predict flashover risk.
It enables accurate identification and prediction of flashover risk in the early stages of a fire, reducing casualties and property damage.
Smart Images

Figure CN119445801B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for predicting the risk of flashover in indoor fires based on flame morphology and remote sensing data, belonging to the field of fire monitoring technology. Background Technology
[0002] With the rapid pace of urbanization and town development, existing building forms can no longer meet the living and working environment requirements of urban populations, leading to a gradual increase in building height. These high-rise buildings pose significant risks of fire, resulting in severe accidental losses and making firefighting extremely difficult. Therefore, conducting research on building fire prevention is of great importance in reducing casualties and property damage caused by fires.
[0003] The development of indoor fires in buildings can generally be divided into four stages: the initial growth stage, the flashover stage, the full development stage, and the decay stage. In the initial growth stage, as the fire source continues to burn, a layer of high-temperature smoke accumulates and settles indoors, significantly increasing its heat radiation to other combustibles on the ground. When the indoor temperature reaches a certain value, it can induce flashover, causing all combustibles inside to be ignited instantly. Once flashover occurs, it leads to a significant increase in casualties and property damage. However, flashovers are highly complex and sudden, making it difficult for traditional fire monitoring and early warning methods to accurately predict flashover risk in the early stages of a fire, thus failing to buy time for evacuation and firefighting. Summary of the Invention
[0004] This invention provides a method for predicting the risk of flashover in indoor fires based on flame morphology and remote sensing data. This method can accurately identify and predict the risk of flashover in the early stages of fire development and issue early warning signals when the fire is about to enter the flashover stage, thereby reducing casualties and property losses caused by the fire.
[0005] To achieve the above objectives, the present invention provides a method for predicting indoor fire flashover risk based on flame morphology and remote sensing data, comprising the following steps:
[0006] Step 1: Use fire simulation software to simulate fire data and build a fire dataset;
[0007] Step 2: Ignite the fire, acquire images of the indoor fire flames using a high-definition camera, and process the acquired images;
[0008] Step 3: Output the real-time heat release rate (HRR) of the ignition point from the processed image using a ResNet residual network model;
[0009] Step 4: Use a methane laser remote sensing instrument to monitor and acquire methane gas concentration data in real time at a specific height of the indoor flue gas layer;
[0010] Step 5: Build a fire flashover risk prediction model based on the heat release rate of the fire source and the methane gas concentration to predict the flashover risk in advance.
[0011] Furthermore, the specific process of using fire simulation software to simulate fire data and construct a fire dataset in step one is as follows:
[0012] 1-1. Build a fire combustion model and set the geometric structure of the room, the location of the fire source, the heat release rate of the fire source, and the area of the fire source;
[0013] 1-2. Based on the combustible material to be ignited, add chemical reactions, set the fuel and oxidant for the reaction, and define the methane produced by incomplete combustion according to the reaction equation;
[0014] 1-3. Set up a gas monitor directly above the fire source, select Methane for Species and Volume fraction for Quantity; set up a heat release rate measuring point at a specific distance S directly above the fire source.
[0015] 1-4. Set the simulation time and obtain the simulated gas measurement point dataset {V}. t}, V t This represents the methane gas concentration data at second t; the simulated heat release rate dataset from the fire source is obtained. t},H t This represents the heat release rate data of the fire source at second t; {V t} and {H t} Merge to generate dataset {S t The vertical axis represents different times, and the horizontal axis represents the methane gas concentration parameter and the heat release rate parameter of the ignition source.
[0016]
[0017] 1-5. Record the time t when flashover occurs in the simulation software, i.e., when the average temperature of the ceiling in the fire-stricken room reaches 600℃. flashover .
[0018] Furthermore, the specific process of step two is as follows:
[0019] 2-1. For the acquired flame image, use OpenCV to measure the height and area of the flame:
[0020] 2-2. Convert the flame image from BGR to HSV color space, set the HSV color range, extract the flame region, and generate a binary mask matrix, where the pixel value of the flame region is 1 and the pixel value of the non-flame region is 0; denote the mask as M(x,y), where (x,y) is the position of each pixel in the image:
[0021]
[0022] The white area in the mask represents the flame portion; in the HSV color space, the V channel represents the brightness of each pixel. Let the brightness value of each pixel in the image be V(x,y). The average brightness of the flame region is limited to the flame region by the mask, and the average of all brightness values within this region is calculated. Let the total number of pixels in the flame region be N, then the formula for calculating the average brightness is:
[0023]
[0024] In the formula, ∑ x,y V(x,y)·M(x,y) represents the sum of all brightness values within the flame region, ∑ x,y M(x,y) represents the total number of pixels in the flame region;
[0025] The extracted flame region is denoised and holes are filled using morphological methods; the denoising operation is an opening operation, which is a process of erosion followed by dilation. For an image A and a structuring element B, the erosion operation is represented as:
[0026]
[0027] Among them, B z This indicates a translation of the center point of structural element B at position z;
[0028] The expansion operation is represented as:
[0029]
[0030] 2-3. Use OpenCV's findContours() function to extract the contours of the flame region, selecting the largest contour to represent the main area of the flame; the specific implementation process of the findContours() function is as follows:
[0031] 2-3-1. Binarize the processed image to convert it into an image containing only two pixel values, 0 and 255. Using a color threshold, set the flame area to white (255) and the background area to black (0).
[0032] 2-3-2. Edges of an image are identified using gradient changes in pixel intensity. Edges are located by calculating the gradient of pixels in the image. The gradient is defined as the rate of change of image brightness values. For a given pixel (x, y), the gradients in the horizontal and vertical directions are calculated through convolution:
[0033] G x =I(x+1,y)-I(x-1,y)
[0034] G y= I(x,y+1)-I(x,y-1);
[0035] Where I(x,y) represents the gray value of a pixel, and according to the gradient, the direction and magnitude of the image edge are respectively:
[0036]
[0037] Locations with large gradients, i.e., locations where there are significant changes in brightness, are considered edge points.
[0038] 2-3-3. Use connectivity analysis to track and group edge pixels, identify connected edge regions, that is, check whether the neighborhood of each pixel has the same pixel value, which is represented by white area. The findContours() function identifies a group of connected edge pixels, forming a closed contour.
[0039] 2-3-4. Based on chain code representation, the contour is represented as the movement direction between a series of adjacent pixels. When performing edge tracking, start from an edge point in the binary image, determine the next adjacent edge point, and repeat this process until return to the starting point or no new connected edge point can be found, thus forming a closed contour. Record all pixel coordinates in each contour.
[0040] 2-3-5. After finding the flame outline, calculate the vertical span of the flame area, i.e., the height of the flame. The flame height is equal to the maximum Y coordinate value of the flame image outline point minus the minimum Y coordinate value.
[0041] 2-3-6. After finding the flame outline, use OpenCV's contourArea() function to calculate the area of the outline. For the pixel coordinate sequence of all determined outline points (x1, y1), (x2, y2), ..., (x... n ,y n The area S can be expressed in discrete form using Green's formula as follows:
[0042]
[0043] n represents the number of contour points;
[0044] 2-3-7. For the acquired flame video data, extract the flame outline in each frame and calculate its area. Represent the change in flame area as a time series. The calculated flame area A(t) for each frame is used to construct a flame area change sequence with time t. Perform a Fourier transform on A(t) to convert it into a frequency domain representation F(f), where f is the frequency.
[0045]
[0046] Since the frame data of the flame area is a discrete-time series, it is calculated using the discrete Fourier transform, and its expression is:
[0047]
[0048] In the formula, N is the number of samples and k is the discrete frequency index. The spectrum |F(f)| is obtained by Fourier transform of the flame area time series. The amplitude of each frequency component corresponds to the intensity of the flame fluctuation at that frequency. The main frequency, i.e. the main fluctuation frequency, is the non-zero frequency with the largest amplitude in the spectrum, which represents the main fluctuation frequency of the flame profile and corresponds to the oscillation or fluctuation of the flame.
[0049] Furthermore, the specific process of step three is as follows:
[0050] 3-1. The height, area, average brightness, and fluctuation frequency data of each frame of the flame image are used as auxiliary labels and input into the ResNet residual network model. Each image data in the database of the ResNet residual network model has its corresponding HRR label, as well as the flame height, area, average brightness, and fluctuation frequency data as auxiliary labels.
[0051] 3-2. The ResNet model uses ResNet-50 as the backbone network to extract deep features from the flame image, removes the fully connected layers of ResNet-50, retains the convolutional layers, and obtains a high-dimensional feature representation of the flame image.
[0052] 3-3. The ResNet residual network model predicts auxiliary label features through multiple fully connected layers to capture the physical characteristics of flames and improve the prediction accuracy of heat release rate (HRR).
[0053] 3-4. The ResNet residual network model fuses the features output by ResNet-50 with the auxiliary label prediction results, and performs HRR prediction through several fully connected layers. The specific prediction process is as follows:
[0054] 3-4-1. The flame height is predicted using the mean squared error (MSE) loss function, and the formula is as follows:
[0055]
[0056] In the formula, h i It is the true value of the flame height for the i-th sample. It is the model's predicted value for the flame height;
[0057] 3-4-2. The flame area is predicted using the mean squared error (MSE) loss function, and the formula is as follows:
[0058]
[0059] In the formula, a i It is the true value of the flame area of the i-th sample. It is the model's predicted value for the flame area;
[0060] 3-4-3. The mean square error (MSE) loss function is used to predict the average flame brightness. The formula is as follows:
[0061]
[0062] In the formula, b i It is the true average brightness value of the i-th sample. It is the model's predicted value for average brightness;
[0063] 3-4-4. The mean square error (MSE) loss function is used to predict the flame fluctuation frequency. The formula is as follows:
[0064]
[0065] In the formula, f i It is the true value of the flame fluctuation frequency of the i-th sample. It is the model's predicted value for the frequency of flame fluctuations;
[0066] 3-4-5. The mean square error (MSE) loss function is used to predict the heat release rate. The formula is as follows:
[0067]
[0068] In the formula, r i This is the true value of the heat release rate of the i-th sample. It is the model's predicted value for the heat release rate;
[0069] 3-4-6. The total loss is expressed as:
[0070] Total loss = 0.2 * flame height MSE + 0.2 * flame area MSE + 0.2 * average brightness MSE + 0.2 * fluctuation frequency MSE + 1 * heat release rate MSE;
[0071] The heat release rate has a weight of 1, while the flame height, area, average brightness, and fluctuation frequency each have a weight of 0.2.
[0072] Further, step five uses the heat release rate-time data and methane gas concentration-time data from the past T1 seconds as input, and trains a Long Short-Term Memory (LSTM) network model to determine whether a flashover will occur within the next T2 seconds. The LSTM model includes an input layer, an LSTM feature extraction branch, a heat release rate LSTM branch, a methane gas concentration LSTM branch, a feature fusion layer, a fully connected layer, and an output layer. The specific prediction process of the LSTM model is as follows:
[0073] 5-1. The LSTM model has two input layers, which are used to receive the time series data of the heat release rate of the fire source and the methane gas concentration within the past T1 seconds:
[0074] input_hrr: The shape is (T1,1), which represents the heat release rate data of the fire source in the past T1 seconds, with one data point per second;
[0075] input_methane: The shape is (T1,1), representing the methane concentration data of the past T1 seconds;
[0076] 5-2. LSTM Feature Extraction Branch Process:
[0077] Features were extracted from the heat release rate and methane gas concentration sequences of the fire source using LSTM. Each input data branch had an independent LSTM layer, used to capture the time dependence of the heat release rate and methane gas concentration, respectively. Each LSTM layer contained multiple LSTM units. The output calculation process for each LSTM unit at time step t was as follows:
[0078] 5-2-1 Calculate the forgetting gate f t :
[0079] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0080] Among them, W f It is the weight matrix of the forget gate, connected to h t-1 and x t h t-1 It is the hidden state of the previous time step; x t This is the input for the current time step; b f σ represents the bias term of the forget gate; σ denotes the sigmoid function, which restricts the output value to the range [0,1]; the forget gate is used to determine the previous memory state C. t-1 The parts that need to be forgotten;
[0081] 5-2-2, Input Gate i t and candidate memories The input gate determines how much of the current input information should be written into memory:
[0082] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0083]
[0084] W i and W C These are the weight matrices for the input gate and candidate memory units, respectively; b i and b C is the bias term; tanh is the hyperbolic tangent activation function, which restricts the output value to the range [-1, 1].
[0085] 5-2-3, Update memory unit C t :
[0086]
[0087] 5-2-4, Output Gate t and hidden state h t :
[0088]
[0089] h t =o t ·tanh(C t );
[0090] The output gate determines the output content of the hidden state and passes it to the next layer; W o It is the weight matrix of the output gate, connected to h t-1 and x t b o It is the bias term of the output gate;
[0091] 5-3. LSTM branching process for heat release rate:
[0092] 5-3-1. The first layer of LSTM has 64 units. Return_sequences=True enables it to output the features of each time step so that the next layer of LSTM can continue to process the sequence data.
[0093] 5-3-2. The second layer of LSTM has 32 units. Setting return_sequences=False makes it output the features of the last time step, which is used to summarize the information of the previous time steps.
[0094] 5-4. Methane gas concentration LSTM branching process:
[0095] 5-4-1. The first layer of LSTM has 64 hidden units, which are used to output the features at each time step;
[0096] 5-4-2. The second-layer LSTM unit has 32 hidden units, which are used to output the features of the last time step;
[0097] 5-5. Feature fusion layer performs feature fusion: The time series features of HRR and methane gas concentration are extracted by the features output by the LSTM branch of heat release rate and the LSTM branch of methane gas concentration, respectively. The two feature vectors are merged into a comprehensive feature vector.
[0098] 5-6. Based on the fused features, two fully connected layers are used to further extract features and use these features to predict the probability of a flashover. The first fully connected layer contains 64 neurons with the activation function ReLU and is used to extract the deep relationships of the fused features. The second fully connected layer contains 32 neurons with the activation function ReLU and is used to further reduce the feature space.
[0099] 5-7. The final output layer is a binary classification output, used to determine whether a flashover will occur within the next T2 seconds. The specific process is as follows:
[0100] 5-7-1. Using the sigmoid activation function, the output range is restricted to [0,1], where 0 indicates that a bombardment was not predicted and 1 indicates that a bombardment was predicted. The sigmoid activation function maps the output to a probability space. For the input feature z, the mathematical expression of the sigmoid activation function is:
[0101]
[0102] Output of the sigmoid activation function Indicates the probability of flashover occurring: if If the value is close to 1, the LSTM prediction model determines that a flashover will occur. If the value is close to 0, the LSTM prediction model will determine that "flashover will not occur"; setting a threshold of 0.5 converts the predicted flashover probability into a binary classification result:
[0103]
[0104] 5-7-2. Use the binary cross-entropy loss function to measure the difference between the LSTM prediction model's prediction results and the actual labels. Set the Adam optimizer and accuracy as evaluation metrics to assess the reliability of the prediction model during training. The specific process is as follows:
[0105] 5-7-2.1. Gradient Calculation: For each parameter θ t First, calculate the gradient of the loss function L(θ) with respect to the parameters:
[0106]
[0107] 5-7-2.2. First-order momentum estimation: Adam uses an exponentially weighted average method to calculate the first-order momentum estimate of the gradient, i.e., the mean of the gradient, denoted as m. t For gradient-weighted moving average:
[0108] m t =β1·m t-1 +(1-β1)·g t
[0109] Where β1 is the momentum decay rate, with a value of 0.9;
[0110] m t It is an exponentially weighted average of the gradients, which approximately represents the direction of the gradient.
[0111] 5-7-2.3. Second-order momentum estimation: Adam uses the square of the gradient to calculate the second-order momentum estimate, i.e., the variance of the gradient, denoted as v. t The weighted moving average of the gradient squared:
[0112] v t =β2·v t-1 +(1-β2)·g t 2
[0113] Where β² is the variance decay rate, with a value of 0.999; v t It is an exponentially weighted average of the squared gradient;
[0114] 5-7-2.4. Deviation Correction: Due to m t and v t The calculations all use exponentially weighted averages, which can introduce bias in the early stages of training. Adam corrects for this bias using the following formula:
[0115]
[0116] t * This represents the current time step, i.e., the current iteration number of the training.
[0117] 5-7-2.5. Parameter Update: Adam updates the parameters using the corrected momentum and variance estimates. The update formula is as follows:
[0118]
[0119] Where α is the learning rate; ε is a small constant used to prevent division by zero errors;
[0120] 5-7-2.6. Accuracy represents the proportion of correctly predicted samples out of the total number of samples;
[0121]
[0122] Where TP is the number of positive examples correctly predicted by the model; TN is the number of negative examples correctly predicted by the model; FP is the number of positive examples incorrectly predicted by the model; and FN is the number of negative examples incorrectly predicted by the model.
[0123] Furthermore, in step 2-3-2, the process of determining the location of a large gradient is as follows: a threshold T is set, and when the gradient magnitude G ≥ T, the point is considered an edge point. When there is a lot of image noise and it is necessary to retain only significant edges, a higher threshold T is usually set; when it is necessary to retain more edge information, a lower threshold T is usually set. This invention uses the Canny algorithm and a dual-threshold method to define edge points to reduce the influence of noise.
[0124] After calculating the magnitude and direction of the gradient G for each pixel, a high threshold T is set. h and a low threshold T l When the gradient magnitude G ≥ T h When the gradient magnitude T is T, mark the pixel as a strong edge point; when the gradient magnitude T is T, mark the pixel as a strong edge point. l ≤G<T h When a weak edge point is identified, it is marked as a weak edge point. Next, edge connection is performed. For a weak edge point, if there is a strong edge point within its 8-neighborhood (i.e., within 8 adjacent pixels around the weak edge point), it is considered part of the edge; otherwise, it is removed as noise. The operation of connecting weak edge points is iterative. If a weak edge point is connected to a strong edge point through neighborhood check, the weak edge point is remarked as an edge. Then, neighborhood check continues with the newly marked weak edge point as the center until all weak edge points that can be connected to strong edge points have been processed.
[0125] This invention utilizes an LSTM model for predicting flashover risk in indoor fires based on flame morphology and remote sensing data. High-definition cameras acquire image data, which is then input into a ResNet-50 model to output the real-time heat release rate of the fire point. Methane concentration data above the fire point, obtained using a methane laser remote sensing instrument, is input in real-time into the trained LSTM model. This model captures the temporal patterns of flashover across multiple time steps of fire parameter changes and predicts flashover risk in advance. This enables accurate identification and prediction of flashover risk in the early stages of fire development and issues early warning signals when the fire is about to enter the flashover stage, reducing casualties and property damage caused by fires. Attached Figure Description
[0126] Figure 1 This is a schematic diagram of the workflow of the risk prediction LSTM model of the present invention;
[0127] Figure 2 This is a schematic diagram of the residual network structure of the present invention;
[0128] Figure 3 This is a schematic diagram of the feature fusion process of the present invention;
[0129] Figure 4 This is a schematic diagram of the fire combustion model structure of the present invention.
[0130] In the diagram: 1. Fired room, 2. Fire source, 3. Observation window, 4. Ventilation opening, 5. Methane gas remote sensing detector, 6. Computer. Detailed Implementation
[0131] The invention will now be further described with reference to the accompanying drawings.
[0132] like Figure 1 As shown, a method for predicting indoor fire flashover risk based on flame morphology and remote sensing data includes the following steps:
[0133] Step 1: Use fire simulation software to simulate fire data and build a fire dataset;
[0134] Step 2: Ignite the fire, acquire images of the indoor fire flames using a high-definition camera, and process the acquired images;
[0135] Step 3: Output the real-time heat release rate (HRR) of the ignition point from the processed image using a ResNet residual network model;
[0136] Step 4: Use a methane laser remote sensing instrument to monitor and acquire methane gas concentration data in real time at a specific height of the indoor flue gas layer;
[0137] Step 5: Build a fire flashover risk prediction model based on the heat release rate of the fire source and the methane gas concentration to predict the flashover risk in advance.
[0138] like Figure 4 As shown, the present invention also provides a fire combustion model structure for predicting indoor fire flashover risk, including a fire room 1, a fire source 2 and a high-definition camera inside the fire room 1, an observation window 3 and a ventilation opening 4 on the wall of the fire room 1, the ventilation opening 4 can be closed or the size of the opening can be adjusted by adding a fireproof plate to adjust the air flow conditions in the fire room 1 and simulate the fire development under different ventilation conditions, a methane gas remote sensing detector 5 is installed outside the observation window 3, the methane gas remote sensing detector 5 can monitor the methane gas concentration in the fire room 1 in real time through the observation window 3, the high-definition camera and the methane gas remote sensing detector 5 are both connected to a computer 6 outside the fire room 1, and respectively transmit the real-time monitored heat release rate and methane gas concentration data to the computer 6;
[0139] As a preferred implementation, the specific process of constructing a fire dataset by simulating fire data using fire simulation software in step one is as follows:
[0140] 1-1. Build a fire combustion model and set the geometric structure of the room, the location of the fire source, the heat release rate of the fire source, and the area of the fire source;
[0141] 1-2. Based on the combustible material to be ignited, add chemical reactions, set the fuel and oxidant for the reaction, and define the methane produced by incomplete combustion according to the reaction equation;
[0142] 1-3. Install a gas monitor directly above the fire source, near the indoor ceiling, select Methane for Species, and Volume fraction for Quantity; set a heat release rate measuring point at a specific distance S directly above the fire source.
[0143] 1-4. Set the simulation time and obtain the simulated gas measurement point dataset {V}. t}, V t This represents the methane gas concentration data at second t; the simulated heat release rate dataset from the fire source is obtained. t},H t This represents the heat release rate data of the fire source at second t; {V t} and {H t} Merge to generate dataset {S t The vertical axis represents different times, and the horizontal axis represents the methane gas concentration parameter and the heat release rate parameter of the ignition source.
[0144]
[0145] 1-5. Record the time t when flashover occurs in the simulation software, i.e., when the average temperature of the ceiling in the fire-stricken room reaches 600℃. flashover .
[0146] As a preferred embodiment, the specific process of step two is as follows:
[0147] 2-1. For the acquired flame image, use OpenCV to measure the height and area of the flame:
[0148] 2-2. Convert the flame image from BGR to HSV color space, set the HSV color range, extract the flame region, and generate a binary mask matrix, where the pixel value of the flame region is 1 and the pixel value of the non-flame region is 0; denote the mask as M(x,y), where (x,y) is the position of each pixel in the image:
[0149]
[0150] The white area in the mask represents the flame portion; in the HSV color space, the V channel represents the brightness of each pixel. Let the brightness value of each pixel in the image be V(x,y). The average brightness of the flame region is limited to the flame region by the mask, and the average of all brightness values within this region is calculated. Let the total number of pixels in the flame region be N, then the formula for calculating the average brightness is:
[0151]
[0152] In the formula, ∑ x,y V(x,y)·M(x,y) represents the sum of all brightness values within the flame region, ∑ x,y M(x,y) represents the total number of pixels in the flame region;
[0153] The extracted flame region is denoised and holes are filled using morphological methods; the denoising operation is an opening operation, which is a process of erosion followed by dilation. For an image A and a structuring element B, the erosion operation is represented as:
[0154]
[0155] Among them, B z This indicates a translation of the center point of structural element B at position z;
[0156] The expansion operation is represented as:
[0157]
[0158] 2-3. Use OpenCV's findContours() function to extract the contours of the flame region, selecting the largest contour to represent the main area of the flame; the specific implementation process of the findContours() function is as follows:
[0159] 2-3-1. Binarize the processed image to convert it into an image containing only two pixel values, 0 and 255. Using a color threshold, set the flame area to white (255) and the background area to black (0).
[0160] 2-3-2. Edges of an image are identified using gradient changes in pixel intensity. Edges are located by calculating the gradient of pixels in the image. The gradient is defined as the rate of change of image brightness values. For a given pixel (x, y), the gradients in the horizontal and vertical directions are calculated through convolution:
[0161] G x =I(x+1,y)-I(x-1,y)
[0162] G y = I(x,y+1)-I(x,y-1);
[0163] Where I(x,y) represents the gray value of a pixel, and according to the gradient, the direction and magnitude of the image edge are respectively:
[0164]
[0165] Locations with large gradients, i.e., locations where there are significant changes in brightness, are considered edge points.
[0166] 2-3-3. Use connectivity analysis to track and group edge pixels, identify connected edge regions, that is, check whether the neighborhood of each pixel has the same pixel value, which is represented by white area. The findContours() function identifies a group of connected edge pixels, forming a closed contour.
[0167] 2-3-4. Based on chain code representation, the contour is represented as the movement direction between a series of adjacent pixels. When performing edge tracking, start from an edge point in the binary image, determine the next adjacent edge point, and repeat this process until return to the starting point or no new connected edge point can be found, thus forming a closed contour. Record all pixel coordinates in each contour.
[0168] 2-3-5. After finding the flame outline, calculate the vertical span of the flame area, i.e., the height of the flame. The flame height is equal to the maximum Y coordinate value of the flame image outline point minus the minimum Y coordinate value.
[0169] 2-3-6. After finding the flame outline, use OpenCV's contourArea() function to calculate the area of the outline. For the pixel coordinate sequence of all determined outline points (x1, y1), (x2, y2), ..., (x... n,y n The area S can be expressed in discrete form using Green's formula as follows:
[0170]
[0171] n represents the number of contour points;
[0172] 2-3-7. For the acquired flame video data, extract the flame outline in each frame and calculate its area. Represent the change in flame area as a time series. The calculated flame area A(t) for each frame is used to construct a flame area change sequence with time t. Perform a Fourier transform on A(t) to convert it into a frequency domain representation F(f), where f is the frequency.
[0173]
[0174] Since the frame data of the flame area is a discrete-time series, it is calculated using the discrete Fourier transform, and its expression is:
[0175]
[0176] In the formula, N is the number of samples and k is the discrete frequency index. The spectrum |F(f)| is obtained by Fourier transform of the flame area time series. The amplitude of each frequency component corresponds to the intensity of the flame fluctuation at that frequency. The main frequency, i.e. the main fluctuation frequency, is the non-zero frequency with the largest amplitude in the spectrum, which represents the main fluctuation frequency of the flame profile and corresponds to the oscillation or fluctuation of the flame.
[0177] like Figure 1 As shown, in a preferred embodiment, the specific process of step three is as follows:
[0178] 3-1. The height, area, average brightness, and fluctuation frequency data of each frame of the flame image are used as auxiliary labels and input into the ResNet residual network model. Each image data in the database of the ResNet residual network model has its corresponding HRR label, as well as the flame height, area, average brightness, and fluctuation frequency data as auxiliary labels.
[0179] 3-2. The ResNet model uses ResNet-50 as the backbone network to extract deep features from the flame image, removes the fully connected layers of ResNet-50, retains the convolutional layers, and obtains a high-dimensional feature representation of the flame image.
[0180] 3-3. The ResNet residual network model predicts auxiliary label features through multiple fully connected layers to capture the physical characteristics of flames and improve the prediction accuracy of heat release rate (HRR).
[0181] 3-4. The ResNet residual network model fuses the features output by ResNet-50 with the auxiliary label prediction results, and performs HRR prediction through several fully connected layers. The specific prediction process is as follows:
[0182] 3-4-1. The flame height is predicted using the mean squared error (MSE) loss function, and the formula is as follows:
[0183]
[0184] In the formula, h i It is the true value of the flame height for the i-th sample. It is the model's predicted value for the flame height;
[0185] 3-4-2. The flame area is predicted using the mean squared error (MSE) loss function, and the formula is as follows:
[0186]
[0187] In the formula, a i It is the true value of the flame area of the i-th sample. It is the model's predicted value for the flame area;
[0188] 3-4-3. The mean square error (MSE) loss function is used to predict the average flame brightness. The formula is as follows:
[0189]
[0190] In the formula, b i It is the true average brightness value of the i-th sample. It is the model's predicted value for average brightness;
[0191] 3-4-4. The mean square error (MSE) loss function is used to predict the flame fluctuation frequency. The formula is as follows:
[0192]
[0193] In the formula, f i It is the true value of the flame fluctuation frequency of the i-th sample. It is the model's predicted value for the frequency of flame fluctuations;
[0194] 3-4-5. The mean square error (MSE) loss function is used to predict the heat release rate. The formula is as follows:
[0195]
[0196] In the formula, r i This is the true value of the heat release rate of the i-th sample. It is the model's predicted value for the heat release rate;
[0197] 3-4-6. The total loss is expressed as:
[0198] Total loss = 0.2 * flame height MSE + 0.2 * flame area MSE + 0.2 * average brightness MSE + 0.2 * fluctuation frequency MSE + 1 * heat release rate MSE;
[0199] The heat release rate has a weight of 1, while the flame height, area, average brightness, and fluctuation frequency each have a weight of 0.2.
[0200] like Figure 1 As shown, in a preferred embodiment, step five uses the heat release rate-time data and methane gas concentration-time data from the past T1 seconds as input, and trains a Long Short-Term Memory (LSTM) network model to determine whether a flashover will occur within the next T2 seconds. The LSTM model includes an input layer, an LSTM feature extraction branch, a heat release rate LSTM branch, a methane gas concentration LSTM branch, a feature fusion layer, a fully connected layer, and an output layer. The specific prediction process of the LSTM model is as follows:
[0201] 5-1. The LSTM model has two input layers, which are used to receive the time series data of the heat release rate of the fire source and the methane gas concentration within the past T1 seconds:
[0202] input_hrr: The shape is (T1,1), which represents the heat release rate data of the fire source in the past T1 seconds, with one data point per second;
[0203] input_methane: The shape is (T1,1), representing the methane concentration data of the past T1 seconds;
[0204] 5-2. LSTM Feature Extraction Branch Process:
[0205] Features were extracted from the heat release rate and methane gas concentration sequences of the fire source using LSTM. Each input data branch had an independent LSTM layer, used to capture the time dependence of the heat release rate and methane gas concentration, respectively. Each LSTM layer contained multiple LSTM units. The output calculation process for each LSTM unit at time step t was as follows:
[0206] 5-2-1 Calculate the forgetting gate f t :
[0207] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0208] Among them, W fIt is the weight matrix of the forget gate, connected to h t-1 and x t h t-1 It is the hidden state of the previous time step; x t This is the input for the current time step; b f σ represents the bias term of the forget gate; σ denotes the sigmoid function, which restricts the output value to the range [0,1]; the forget gate is used to determine the previous memory state C. t-1 The parts that need to be forgotten;
[0209] 5-2-2, Input Gate i t and candidate memories The input gate determines how much of the current input information should be written into memory:
[0210] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0211]
[0212] W i and W C These are the weight matrices for the input gate and candidate memory units, respectively; b i and b C is the bias term; tanh is the hyperbolic tangent activation function, which restricts the output value to the range [-1, 1].
[0213] 5-2-3, Update memory unit C t :
[0214]
[0215] 5-2-4, Output Gate t and hidden state h t :
[0216]
[0217] h t =o t ·tanh(C t );
[0218] The output gate determines the output content of the hidden state and passes it to the next layer; W o It is the weight matrix of the output gate, connected to h t-1 and x t ;
[0219] b o It is the bias term of the output gate;
[0220] 5-3. LSTM branching process for heat release rate:
[0221] 5-3-1. The first layer of LSTM has 64 units. Return_sequences=True enables it to output the features of each time step so that the next layer of LSTM can continue to process the sequence data.
[0222] 5-3-2. The second layer of LSTM has 32 units. Setting return_sequences=False makes it output the features of the last time step, which is used to summarize the information of the previous time steps.
[0223] 5-4. Methane gas concentration LSTM branching process:
[0224] 5-4-1. The first layer of LSTM has 64 hidden units, which are used to output the features at each time step;
[0225] 5-4-2. The second-layer LSTM unit has 32 hidden units, which are used to output the features of the last time step;
[0226] 5-5, such as Figure 2 and Figure 3 As shown, the feature fusion layer performs feature fusion: the time series features of HRR and methane gas concentration are extracted by the features output by the LST M branch of heat release rate and the LSTM branch of methane gas concentration, respectively, and the two feature vectors are merged into a comprehensive feature vector;
[0227] 5-6. Based on the fused features, two fully connected layers are used to further extract features and use these features to predict the probability of a flashover. The first fully connected layer contains 64 neurons with the activation function ReLU and is used to extract the deep relationships of the fused features. The second fully connected layer contains 32 neurons with the activation function ReLU and is used to further reduce the feature space.
[0228] 5-7. The final output layer is a binary classification output, used to determine whether a flashover will occur within the next T2 seconds. The specific process is as follows:
[0229] 5-7-1. Using the sigmoid activation function, the output range is restricted to [0,1], where 0 indicates that a bombardment was not predicted and 1 indicates that a bombardment was predicted. The sigmoid activation function maps the output to a probability space. For the input feature z, the mathematical expression of the sigmoid activation function is:
[0230]
[0231] Output of the sigmoid activation function Indicates the probability of flashover occurring: if If the value is close to 1, the LSTM prediction model determines that a flashover will occur. If the value is close to 0, the LSTM prediction model will determine that "flashover will not occur"; setting a threshold of 0.5 converts the predicted flashover probability into a binary classification result:
[0232]
[0233] 5-7-2. Use the binary cross-entropy loss function to measure the difference between the LSTM prediction model's prediction results and the actual labels. Set the Adam optimizer and accuracy as evaluation metrics to assess the reliability of the prediction model during training. The specific process is as follows:
[0234] 5-7-2.1. Gradient Calculation: For each parameter θ t First, calculate the gradient of the loss function L(θ) with respect to the parameters:
[0235]
[0236] 5-7-2.2. First-order momentum estimation: Adam uses an exponentially weighted average method to calculate the first-order momentum estimate of the gradient, i.e., the mean of the gradient, denoted as m. t For gradient-weighted moving average:
[0237] m t =β1·m t-1 +(1-β1)·g t
[0238] Where β1 is the momentum decay rate, with a value of 0.9; m t It is an exponentially weighted average of the gradients, which approximately represents the direction of the gradient.
[0239] 5-7-2.3. Second-order momentum estimation: Adam uses the square of the gradient to calculate the second-order momentum estimate, i.e., the variance of the gradient, denoted as v. t The weighted moving average of the gradient squared:
[0240] v t =β2·v t-1 +(1-β2)·g t 2
[0241] Where β² is the variance decay rate, with a value of 0.999; v t It is an exponentially weighted average of the squared gradient;
[0242] 5-7-2.4. Deviation Correction: Due to m t and v tThe calculations all use exponentially weighted averages, which can introduce bias in the early stages of training. Adam corrects for this bias using the following formula:
[0243]
[0244] t * This represents the current time step, i.e., the current iteration number of the training.
[0245] 5-7-2.5. Parameter Update: Adam updates the parameters using the corrected momentum and variance estimates. The update formula is:
[0246]
[0247] Where α is the learning rate; ε is a small constant used to prevent division by zero errors;
[0248] 5-7-2.6. Accuracy represents the proportion of correctly predicted samples out of the total number of samples:
[0249]
[0250] Where TP is the number of positive examples correctly predicted by the model; TN is the number of negative examples correctly predicted by the model; FP is the number of positive examples incorrectly predicted by the model; and FN is the number of negative examples incorrectly predicted by the model.
[0251] In a preferred embodiment, the process of determining the location of a large gradient in step 2-3-2 is as follows: a threshold T is set, and when the gradient magnitude G ≥ T, the point is considered an edge point. When there is a lot of image noise and it is necessary to retain only significant edges, a higher threshold T is usually set; when it is necessary to retain more edge information, a lower threshold T is usually set. This invention uses the Canny algorithm and a dual-threshold method to define edge points to reduce the influence of noise.
[0252] After calculating the magnitude and direction of the gradient G for each pixel, a high threshold T is set. h and a low threshold T l When the gradient magnitude G ≥ T h When the gradient magnitude T is T, mark the pixel as a strong edge point; when the gradient magnitude T is T, mark the pixel as a strong edge point. l ≤G<T hWhen a weak edge point is identified, it is marked as a weak edge point. Next, edge connection is performed. For a weak edge point, if there is a strong edge point within its 8-neighborhood (i.e., within 8 adjacent pixels around the weak edge point), it is considered part of the edge; otherwise, it is removed as noise. The operation of connecting weak edge points is iterative. If a weak edge point is connected to a strong edge point through neighborhood check, the weak edge point is remarked as an edge. Then, neighborhood check continues with the newly marked weak edge point as the center until all weak edge points that can be connected to strong edge points have been processed.
[0253] Flashover prediction experiments were conducted using existing full-scale fire test equipment. The fire simulation model described in the invention is consistent with the actual full-scale fire test setup. The average temperature of the fire ceiling reaching 600℃ is used as the node for entering the flashover stage, and the time point is recorded. Six sets of full-scale fire experiments were conducted to verify the model's effect in predicting flashover. The result of the fire flashover risk prediction model built based on the heat release rate of the fire source and the methane gas concentration is the time node 30 seconds before the flashover occurs, i.e., T2 = 30 seconds.
[0254] The experimental data obtained are as follows:
[0255]
[0256]
[0257] Mean absolute error (MAE) is used to measure the average deviation of predictions.
[0258]
[0259] The average absolute error across all groups was 21 seconds. Among all groups, group 2 had the largest error at 66 seconds, while group 6 had the smallest error at only 2 seconds. This indicates that the model's predictions in these groups were very close to the actual flashover time. The errors, ranging from 2 to 66 seconds, suggest some fluctuation in the model's prediction accuracy across different experimental groups. However, most errors remained within a small range, especially in groups 1, 3, 4, 5, and 6, where the errors were all within 30 seconds, meeting the requirements for early warning.
[0260] Based on the above full-scale fire experiments, the following conclusions were drawn: Considering a 30-second advance warning, the model's average absolute error is 21 seconds, which is good and can provide accurate flashover warning; the prediction error for the vast majority of groups is within 30 seconds, making the model suitable for tasks that provide a 30-second advance warning of flashover.
Claims
1. A method for predicting indoor fire flashover risk based on flame morphology and remote sensing data, characterized in that, Includes the following steps: Step 1: Use fire simulation software to simulate fire data and build a fire dataset; Step 2: Ignite the fire, acquire indoor fire flame images using a high-definition camera, and process the acquired images; specifically including: 2-1. For the acquired flame image, use OpenCV to measure the height and area of the flame: 2-2. Convert the flame image from BGR to HSV color space, set the HSV color range, extract the flame region, and generate a binary mask matrix; 2-3. Use OpenCV's findContours() function to extract the contours of the flame region, and select the largest contour to represent the main area of the flame; Step 3: Output the real-time heat release rate (HRR) of the ignition point from the processed image using a ResNet residual network model; specifically including: 3-1. The height, area, average brightness, and fluctuation frequency data of each frame of the flame image are used as auxiliary labels and input into the ResNet residual network model. Each image data in the database of the ResNet residual network model has its corresponding HRR label, as well as the flame height, area, average brightness, and fluctuation frequency data as auxiliary labels. 3-2. The ResNet model uses ResNet-50 as the backbone network to extract deep features from the flame image, removes the fully connected layers of ResNet-50, retains the convolutional layers, and obtains a high-dimensional feature representation of the flame image. 3-3. The ResNet residual network model predicts auxiliary label features through multiple fully connected layers to capture the physical characteristics of flames and improve the prediction accuracy of heat release rate (HRR). 3-4. The ResNet residual network model fuses the features output by ResNet-50 with the auxiliary label prediction results, and performs HRR prediction through several fully connected layers. Step 4: Use a methane laser remote sensing instrument to monitor and acquire methane gas concentration data in real time at a specific height of the indoor flue gas layer; Step 5: Build a fire flashover risk prediction model based on the heat release rate of the fire source and the methane gas concentration to predict the flashover risk in advance; specifically: use the heat release rate-time data of the fire source and the methane gas concentration-time data in the past T1 seconds as input, use the Long Short-Term Memory (LSTM) network model for training, and determine whether a flashover will occur in the future T2 seconds.
2. The indoor fire flashover risk prediction method based on flame morphology and remote sensing data according to claim 1, characterized in that, The specific process of using fire simulation software to simulate fire data and construct a fire dataset in step one is as follows: 1-1. Build a fire combustion model and set the geometric structure of the room, the location of the fire source, the heat release rate of the fire source, and the area of the fire source; 1-2. Based on the combustible material to be ignited, add chemical reactions, set the fuel and oxidant for the reaction, and define the methane produced by incomplete combustion according to the reaction equation; 1-3. Set up a gas monitor directly above the fire source, select Methane for Species and Volume fraction for Quantity; set up a heat release rate measuring point at a specific distance S directly above the fire source. 1-4. Set the simulation time and obtain the simulated gas measurement point dataset {V}. t }, V t This represents the methane gas concentration data at second t; the simulated heat release rate dataset from the fire source is obtained. t },H t This represents the heat release rate data of the fire source at second t; {V t } and {H t } Merge to generate dataset {S t The vertical axis represents different times, and the horizontal axis represents the methane gas concentration parameter and the heat release rate parameter of the ignition source. 1-5. Record the time t when flashover occurs in the simulation software, i.e., when the average temperature of the ceiling in the fire-stricken room reaches 600℃. flashover .
3. The indoor fire flashover risk prediction method based on flame morphology and remote sensing data according to claim 2, characterized in that, The specific process of converting the flame image from BGR to HSV color space, setting the HSV color range, extracting the flame region, and generating a binary mask matrix in step 2-2 of the second step is as follows: In this image, the pixel value in the flame region is 1, and the pixel value in the non-flame region is 0; the mask is denoted as M(x,y), where (x,y) is the position of each pixel in the image. The white area in the mask represents the flame portion; in the HSV color space, the V channel represents the brightness of each pixel. Let the brightness value of each pixel in the image be V(x,y). The average brightness of the flame region is limited to the flame region by the mask, and the average of all brightness values within this region is calculated. Let the total number of pixels in the flame region be N, then the formula for calculating the average brightness is: In the formula, ∑ x,y V(x,y)·M(x,y) represents the sum of all brightness values within the flame region, ∑ x,y M(x,y) represents the total number of pixels in the flame region; The extracted flame region is denoised and holes are filled using morphological methods; the denoising operation is an opening operation, which is a process of erosion followed by dilation. For an image A and a structuring element B, the erosion operation is represented as: Among them, B z This indicates a translation of the center point of structural element B at position z; The expansion operation is represented as: The specific implementation process of the findContours() function in step 2-3 is as follows: 2-3-1. Binarize the processed image to convert it into an image containing only two pixel values, 0 and 255. Using a color threshold, set the flame area to white (255) and the background area to black (0). 2-3-2. Edges of an image are identified using gradient changes in pixel intensity. Edges are located by calculating the gradient of pixels in the image. The gradient is defined as the rate of change of image brightness values. For a given pixel (x, y), the gradients in the horizontal and vertical directions are calculated through convolution: G x =I(x+1,y)-I(x-1,y) G y =I(x,y+1)-I(x,y-1); Where I(x,y) represents the gray value of a pixel, and according to the gradient, the direction and magnitude of the image edge are respectively: Locations with large gradients, i.e., locations where there are significant changes in brightness, are considered edge points. 2-3-3. Use connectivity analysis to track and group edge pixels, identify connected edge regions, that is, check whether the neighborhood of each pixel has the same pixel value, which is represented by white area. The findContours() function identifies a group of connected edge pixels, forming a closed contour. 2-3-4. Based on chain code representation, the contour is represented as the movement direction between a series of adjacent pixels. When performing edge tracking, start from an edge point in the binary image, determine the next adjacent edge point, and repeat this process until return to the starting point or no new connected edge point can be found, thus forming a closed contour. Record all pixel coordinates in each contour. 2-3-5. After finding the flame outline, calculate the vertical span of the flame area, i.e., the height of the flame. The flame height is equal to the maximum Y coordinate value of the flame image outline point minus the minimum Y coordinate value. 2-3-6. After finding the flame outline, use OpenCV's contourArea() function to calculate the area of the outline. For the pixel coordinate sequence of all determined outline points (x1, y1), (x2, y2), ..., (x... n ,y n The area S can be expressed in discrete form using Green's formula as follows: n represents the number of contour points; 2-3-7. For the acquired flame video data, extract the flame outline in each frame and calculate its area. Represent the change in flame area as a time series. The calculated flame area A(t) for each frame is used to construct a flame area change sequence with time t. Perform a Fourier transform on A(t) to convert it into a frequency domain representation F(f), where f is the frequency. Since the frame data of the flame area is a discrete-time series, it is calculated using the discrete Fourier transform, and its expression is: In the formula, N is the number of samples and k is the discrete frequency index. The spectrum |F(f)| is obtained by Fourier transform of the flame area time series. The amplitude of each frequency component corresponds to the intensity of the flame fluctuation at that frequency. The main frequency, i.e. the main fluctuation frequency, is the non-zero frequency with the largest amplitude in the spectrum, which represents the main fluctuation frequency of the flame profile and corresponds to the oscillation or fluctuation of the flame.
4. The indoor fire flashover risk prediction method based on flame morphology and remote sensing data according to claim 3, characterized in that, In step 3-4, the ResNet residual network model fuses the features output by ResNet-50 with the auxiliary label prediction results. The specific process of HRR prediction through several fully connected layers is as follows: 3-4-1. The flame height is predicted using the mean squared error (MSE) loss function, and the formula is as follows: Flame height In the formula, h i It is the true value of the flame height for the i-th sample. It is the model's predicted value for the flame height; 3-4-2. The flame area is predicted using the mean square error (MSE) loss function, and the formula is as follows: Flame area In the formula, a i It is the true value of the flame area of the i-th sample. It is the model's predicted value for the flame area; 3-4-3. The mean square error (MSE) loss function is used to predict the average flame brightness. The formula is as follows: Average brightness In the formula, b i It is the true average brightness value of the i-th sample. It is the model's predicted value for average brightness; 3-4-4. The mean square error (MSE) loss function is used to predict the flame fluctuation frequency. The formula is as follows: Fluctuation frequency In the formula, f i It is the true value of the flame fluctuation frequency of the i-th sample. It is the model's predicted value for the frequency of flame fluctuations; 3-4-5. The mean square error (MSE) loss function is used to predict the heat release rate. The formula is as follows: Heat release rate In the formula, r i This is the true value of the heat release rate of the i-th sample. It is the model's prediction of the heat release rate; 3-4-6. The total loss is expressed as: Total loss = 0.2 * flame height MSE + 0.2 * flame area MSE + 0.2 * average brightness MSE + 0.2 * fluctuation frequency MSE + 1 * heat release rate MSE; The heat release rate has a weight of 1, while the flame height, area, average brightness, and fluctuation frequency each have a weight of 0.
2.
5. The indoor fire flashover risk prediction method based on flame morphology and remote sensing data according to claim 4, characterized in that, In step five, the specific process of determining whether flashover will occur within the next T2 seconds is as follows: using the past T1 seconds's heat release rate-time data and methane gas concentration-time data as inputs, and training a Long Short-Term Memory (LSTM) network model. The LSTM model includes an input layer, an LSTM feature extraction branch, an LSTM branch for heat release rate, an LSTM branch for methane gas concentration, a feature fusion layer, a fully connected layer, and an output layer; the specific prediction process of the LSTM model is as follows: 5-1. The LSTM model has two input layers, which are used to receive the time series data of the heat release rate of the fire source and the methane gas concentration within the past T1 seconds: input_hrr: The shape is (T1,1), which represents the heat release rate data of the fire source in the past T1 seconds, with one data point per second; input_methane: The shape is (T1,1), representing the methane concentration data of the past T1 seconds; 5-2. LSTM Feature Extraction Branch Process: Features were extracted from the heat release rate and methane gas concentration sequences of the fire source using LSTM. Each input data branch had an independent LSTM layer, used to capture the time dependence of the heat release rate and methane gas concentration, respectively. Each LSTM layer contained multiple LSTM units. The output calculation process for each LSTM unit at time step t was as follows: 5-2-1 Calculate the forgetting gate f t : f t =σ(W f ·[h t-1 ,x t ]+b f ); Among them, W f It is the weight matrix of the forget gate, connected to h t-1 and x t h t-1 It is the hidden state of the previous time step; x t This is the input for the current time step; b f It is the bias term of the forget gate; σ represents the sigmoid function, which restricts the output value to [0,1]. The forget gate is used to determine the previous memory state C. t-1 The parts that need to be forgotten; 5-2-2, Input Gate i t and candidate memories The input gate determines how much of the current input information should be written into memory: i t =σ(W i ·[h t-1 ,x t ]+b i ) W i and W C These are the weight matrices for the input gate and candidate memory units, respectively; b i and b C is the bias term; tanh is the hyperbolic tangent activation function, which restricts the output value to the range [-1, 1]. 5-2-3, Update memory unit C t : 5-2-4, Output Gate t and hidden state h t : h t =o t ·tanh(C t ); The output gate determines the output content of the hidden state and passes it to the next layer; W o It is the weight matrix of the output gate, connected to h t-1 and x t b o It is the bias term of the output gate; 5-3. LSTM branching process for heat release rate: 5-3-1. The first layer of LSTM has 64 units. Return_sequences=True enables it to output the features of each time step so that the next layer of LSTM can continue to process the sequence data. 5-3-2. The second layer of LSTM has 32 units. Setting return_sequences=False makes it output the features of the last time step, which is used to summarize the information of the previous time steps. 5-4. Methane gas concentration LSTM branching process: 5-4-1. The first layer of LSTM has 64 hidden units, which are used to output the features at each time step; 5-4-2. The second-layer LSTM unit has 32 hidden units, which are used to output the features of the last time step; 5-5. Feature fusion layer performs feature fusion: The time series features of HRR and methane gas concentration are extracted by the features output by the LSTM branch of heat release rate and the LSTM branch of methane gas concentration, respectively. The two feature vectors are merged into a comprehensive feature vector. 5-6. Based on the fused features, two fully connected layers are used to further extract features and use these features to predict the probability of a flashover. The first fully connected layer contains 64 neurons with the activation function ReLU and is used to extract the deep relationships of the fused features. The second fully connected layer contains 32 neurons with the activation function ReLU and is used to further reduce the feature space. 5-7. The final output layer is a binary classification output, used to determine whether a flashover will occur within the next T2 seconds. The specific process is as follows: 5-7-1. Using the sigmoid activation function, the output range is restricted to [0,1], where 0 indicates that a bombardment was not predicted and 1 indicates that a bombardment was predicted. The sigmoid activation function maps the output to a probability space. For the input feature z, the mathematical expression of the sigmoid activation function is: Output of the sigmoid activation function Indicates the probability of flashover occurring: if If the value is close to 1, the LSTM prediction model determines that "a flashover will occur." If the value is close to 0, the LSTM prediction model will determine that "flashover will not occur"; setting a threshold of 0.5 converts the predicted flashover probability into a binary classification result: 5-7-2. Use the binary cross-entropy loss function to measure the difference between the LSTM prediction model's prediction results and the actual labels. Set the Adam optimizer and accuracy as evaluation metrics to assess the reliability of the prediction model during training. The specific process is as follows: 5-7-2.
1. Gradient Calculation: For each parameter θ t First, calculate the gradient of the loss function L(θ) with respect to the parameters: 5-7-2.
2. First-order momentum estimation: Adam uses an exponentially weighted average method to calculate the first-order momentum estimate of the gradient, i.e., the mean of the gradient, denoted as m. t For gradient-weighted moving average: m t =β1·m t-1 +(1-β1)·g t Where β1 is the momentum decay rate, with a value of 0.9; m t It is an exponentially weighted average of the gradients, which approximately represents the direction of the gradient. 5-7-2.
3. Second-order momentum estimation: Adam uses the square of the gradient to calculate the second-order momentum estimate, i.e., the variance of the gradient, denoted as v. t The weighted moving average of the gradient squared: v t =β2·v t-1 +(1-β2)·g t 2 Where β² is the variance decay rate, with a value of 0.999; v t It is an exponentially weighted average of the squared gradient; 5-7-2.
4. Deviation Correction: Due to m t and v t The calculations all use exponentially weighted averages, which can introduce bias in the early stages of training. Adam corrects for this bias using the following formula: t * This represents the current time step, i.e., the current iteration number of the training. 5-7-2.
5. Parameter Update: Adam updates the parameters using the corrected momentum and variance estimates. The update formula is as follows: Where α is the learning rate; ε is a small constant used to prevent division by zero errors; 5-7-2.
6. Accuracy represents the proportion of correctly predicted samples out of the total number of samples; Where TP is the number of positive examples correctly predicted by the model; TN is the number of negative examples correctly predicted by the model; FP is the number of positive examples incorrectly predicted by the model; and FN is the number of negative examples incorrectly predicted by the model.
6. The indoor fire flashover risk prediction method based on flame morphology and remote sensing data according to claim 3, characterized in that, In step 2-3-2, the process of determining the location of the large gradient is as follows: Using the Canny algorithm, a threshold T is set, with its endpoints being T1, T2, and T3, T4, T5, T6, T7, T8, T9, T1, T1, T2, T1, T2, T3, T4 ... l and T h When the gradient magnitude G ≥ T h When the gradient magnitude T is T, mark the pixel as a strong edge point; when the gradient magnitude T is T, mark the pixel as a strong edge point. l ≤G<T h When a weak edge point is identified, it is marked as a weak edge point. For a weak edge point, if there is a strong edge point within 8 neighboring pixels around it, it is considered part of the edge; otherwise, it is removed as noise. The weak edge points are connected through iterative operations. If a weak edge point is connected to a strong edge point through neighborhood check, it is remarked as an edge. Then, neighborhood check is continued with the newly marked weak edge point as the center until all weak edges that can be connected to strong edge points have been processed.
Citation Information
Patent Citations
BIM data-based method and system for dispatching and allocating fire-fighting resources in building
CN117035323A
Pipe gallery fire risk assessment method based on convolutional neural network image processing
CN118015198A