A tunnel fire detection method, device and medium
By designing a dynamic three-stage neural network architecture and a tunnel-specific attention module, the problems of low accuracy and high computational cost in tunnel fire monitoring were solved, achieving high-precision and low-cost tunnel fire detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2026-02-25
- Publication Date
- 2026-05-01
AI Technical Summary
Existing tunnel fire monitoring methods are not optimized for the special environment of tunnels, resulting in low monitoring accuracy, high false detection rate, and high computational cost.
A dynamic three-stage neural network architecture is designed, including a trigger network, a risk assessment network, and a complete detection network. The network complexity is dynamically adjusted according to the risk level. Combined with a tunnel-specific attention module and the WIoU loss function, the detection accuracy is improved and the computational cost is reduced.
It achieves high-precision fire detection in tunnel environments, reduces energy consumption and computing costs, and improves the detection sensitivity of small targets and distant flames.
Smart Images

Figure CN121725429B_ABST
Abstract
Description
A method, device and medium for detecting tunnel fires Technical Field
[0001] This invention relates to the field of fire monitoring, and in particular to a method, device and medium for detecting fires in tunnels. Background Technology
[0002] For the construction and operation of tunnels in service, the primary issue to address is disaster prevention. Highway tunnels encounter various types of disasters, primarily fire, during operation. Because tunnels are long, narrow, and semi-enclosed tubular structures, temperatures rise rapidly during a fire, and toxic gases quickly accumulate and spread within the tunnel, causing casualties and property damage. The further spread of fire and the difficulty in removing smoke also hinder rapid rescue efforts by firefighters. Based on this situation, tunnel fire detection methods have been developed, which can be divided into traditional sensor-based detection methods and machine learning-based fire identification methods.
[0003] In recent years, emerging information technologies such as artificial intelligence and big data have been widely applied in various fields. Classic intelligent algorithms, such as particle swarm optimization, genetic algorithms, and ant colony optimization, are generally used for optimization problems. Various neural networks and deep learning algorithms have greatly promoted research on tunnel fire identification. With the help of neural networks, algorithms can deeply mine the deep information of video data. One existing technology proposes a method for extracting suspicious fire areas based on superpixels and a fire detection framework based on lightweight convolutional neural networks. It uses local difference binary calculation to calculate the features of superpixels in adjacent frames to locally locate the fire area. Another existing technology proposes a prediction framework for multi-scale fire detection. It obtains multi-scale feature maps through deep stacked convolutional layers and proposes to extract multi-scale prediction information using feature squeezing blocks. Yet another existing technology extends the YOLOv3 network structure to four-scale detection by using a depthwise separable convolutional network and improves the clustering algorithm and loss function, thereby improving the network's ability to detect shallow features of targets. Chinese patent CN114298167A employs a YOLO-based method for detecting abnormal events in tunnel fires. It introduces a triple attention mechanism and a feature pyramid network, optimizes the YOLO network model through cross-layer connections, and combines a comprehensive confidence scoring mechanism to achieve high-precision detection of tunnel fires.
[0004] The aforementioned neural network and deep learning algorithms have good fire detection capabilities, but they still have the following problems: they are not optimized for the special environment of tunnels, such as flames being easily confused with vehicle lights and reflections, and traditional YOLO series models require the entire network to run continuously, resulting in high computational costs and wasted resources. Summary of the Invention
[0005] The purpose of this invention is to address the problems of existing tunnel fire monitoring methods, such as lack of optimization for the special environment of tunnels, low monitoring accuracy, and high false detection rate. This invention provides a tunnel fire detection method, device, and medium, based on the YOLOv8s model. First, a dynamic three-stage neural network architecture is designed, dynamically adjusting the network complexity according to the risk level to reduce energy consumption and computational costs. Second, a tunnel-specific attention module is designed to improve the detection accuracy of small targets. Finally, the WIoU loss function is used to enhance the detection sensitivity of small flames at a distance, accelerating convergence and improving the model's robustness.
[0006] The objective of this invention can be achieved through the following technical solutions:
[0007] A method for detecting tunnel fires includes the following steps:
[0008] S1. Obtain publicly available image datasets and perform data augmentation and annotation to establish a tunnel fire image dataset with tunnel camera perspective videos as the core data source;
[0009] S2. Obtain historical tunnel sensor dataset;
[0010] S3. Construct a three-stage neural network architecture comprising a trigger network, a risk assessment network, and a complete detection network. The trigger network is a continuously running, ultra-lightweight convolutional neural network that performs all-weather anomaly monitoring of the entire tunnel. The risk assessment network is a medium-complexity network that is activated when the trigger network detects a potential risk. The complete detection network is based on the YOLOv8s network architecture and is fully activated when the risk assessment network determines that the risk is high, thereby achieving high-precision fire detection.
[0011] S4. The trigger network and risk assessment network are trained using the historical tunnel sensor dataset and tunnel fire image dataset, and the complete detection network is trained using the tunnel fire image dataset to obtain a trained fire detection model.
[0012] S5. Real-time acquisition of tunnel video and sensor data, input into the trained fire detection model, to obtain tunnel fire detection and identification results.
[0013] The specific steps of obtaining publicly available image datasets and performing data augmentation and annotation are as follows:
[0014] The publicly available tunnel fire images and videos were processed into image format by frame segmentation. Then, the dataset was augmented by slight rotation, cropping and splicing, blurring, and adding noise to form a tunnel fire image dataset. Online annotation tools were used to accurately annotate the images in the tunnel fire image dataset with four types of targets: vehicles, flames, pedestrians, and yellow traffic lights.
[0015] The trigger network includes a vision processing branch and a sensor processing branch. The vision processing branch takes a tunnel fire image as input and outputs pedestrian and vehicle congestion detection results based on an optimized MobileNetV3 model. The sensor processing branch takes smoke concentration sensor, temperature sensor, and CO concentration sensor data as input and outputs sensor anomaly detection results based on a multilayer perceptron. When pedestrian or vehicle congestion or sensor anomalies are detected, the risk assessment network is activated.
[0016] The visual processing branch includes an image preprocessing unit, a feature extraction backbone network, and a classification output unit. The feature extraction backbone network replaces the h-swish and ReLU activation functions of the original MobileNetV3 model with ReLU6 activation functions, replaces the SE module with the SE-Lite module, removes dimensionality reduction operations, adopts a simplified structure that preserves the number of channels, and prunes the 16-layer inverse residual block to an 8-layer core inverse residual block.
[0017] The sensor processing branch includes a data preprocessing unit, a multilayer perceptron network (MLP), and an anomaly detection unit. Upon receiving data from smoke concentration sensors, temperature sensors, and CO concentration sensors, the data preprocessing unit first uses interpolation to process data streams with different sampling frequencies for data synchronization. Then, a Kalman filter is applied to smooth the sensor data. Finally, a sliding window is used for feature extraction to obtain the input feature vector for the MLP network. The MLP network employs a lightweight MLP architecture, and its input feature vector consists of three parts: the current real-time measurement values of the three sensors, the average value of the three sensors over a preset time window, and the rate of change of the three sensors within a preset sampling interval. It outputs predicted probabilities for three anomaly categories. The anomaly detection unit converts the predicted probabilities of the three anomaly categories output by the MLP network into specific anomaly determination results.
[0018] The risk assessment network includes a visual feature extraction module, a sensor feature extraction module, a multimodal feature fusion module, a risk assessment head, and a decision output module. The visual feature extraction module is a backbone network based on the YOLOv8-nano model, receiving tunnel fire images from the trigger network and outputting the visual features in the tunnel fire images. The sensor feature extraction module receives sensor feature sequences from the trigger network's feature buffer within the most recent preset time window. These sensor feature sequences are input feature vectors of a multilayer perceptron network, cached in time order after real-time processing of the original sensor data by the trigger network's sensor processing branch. The sensor feature extraction module first extracts local temporal sequences through convolution, reduces the sequence length through pooling layers, and then analyzes the sequences from both forward and backward directions using a bidirectional LSTM layer. The feature sequence is finally processed by a global pooling and feature refinement network to output sensor features. The multimodal feature fusion module first unifies the visual features and sensor feature dimensions through different fully connected layers, then processes the features after dimensionality increase and decrease using a cross-attention mechanism, and fuses them through a fully connected layer. Then, MLP is used to refine the fused features, and the fused features are obtained through residual connections. The fused features are input to the risk assessment head to calculate the risk level. The decision output module dynamically switches the three-stage neural network according to the risk level output by the risk assessment head. When the risk is determined to be low, it reverts to the basic monitoring state where only the trigger network runs. When the risk is determined to be medium, the risk assessment network continues to run until the risk level changes. When the risk is determined to be high, an activation signal is generated and sent to the complete detection network.
[0019] The complete detection network improves upon the backbone network of the YOLOv8s network architecture. The improved backbone network is based on the CSPDarknet architecture and integrates a tunnel-specific attention module. This module comprises three branches: a geometric attention branch, a smoke diffusion attention branch, and a flame flicker attention branch. The geometric attention branch converts the tunnel fire image into a grayscale image and performs Gaussian denoising to suppress noise. Subsequently, it uses the Sobel operator to calculate gradients, extracts edge gradient maps, and performs thresholding and morphological concatenation on these maps to obtain coherent vertical edge contours. Based on the geometric features of these vertical edge contours, structural regions corresponding to the tunnel walls and lane lines are selected, and corresponding geometric feature masks are generated to assign higher weights to these selected structural regions. Finally, the geometric feature masks are multiplied by the original feature map extracted by the backbone network to generate geometric attention. The attention map consists of three branches: a smoke diffusion attention branch and a flame flicker attention branch. The smoke diffusion attention branch extracts texture features of smoke from tunnel fire images using local binary mode, then calculates pixel displacements of consecutive frames using optical flow estimation to capture the directionality and slow motion features of smoke diffusion. Texture and motion features are then fused to generate a smoke attention map. The flame flicker attention branch processes the input tunnel fire image by channel, enhancing red and orange channel pixel values while weakening blue and green channels to amplify flame color features. Fourier transform is then used to analyze the flicker frequency of the flame, obtaining unique flicker frequency features. Finally, color and flicker frequency features are fused to generate a flame attention map. The outputs of the three branches are weighted to obtain learning parameters. A comprehensive attention map is generated based on these learning parameters and the corresponding attention map. This comprehensive attention map is multiplied by the original feature map to enhance fire-related features and suppress irrelevant features.
[0020] The complete detection network uses the WIoU loss function to optimize bounding box prediction, and its calculation formula is as follows:
[0021] ;
[0022] in, For intersection, union, and comparison; It is the i-th geometric deviation penalty term between the predicted box and the ground truth box. yes The corresponding dynamic weight parameters associated with the target scale, It is the total number of geometric deviation penalty terms considered.
[0023] A tunnel fire detection device includes a memory, a processor, and a program stored in the memory, wherein the processor executes the program to implement the method described above.
[0024] A storage medium having a program stored thereon, which, when executed, implements the method.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] (1) The present invention designs a dynamic three-stage neural network architecture, which dynamically adjusts and calls networks of different complexities according to the risk level. The trigger network for continuous anomaly monitoring is an ultra-lightweight convolutional neural network with low computational cost. Only when the trigger network detects an anomaly will the medium-complexity risk assessment network be triggered for monitoring. When the risk assessment network determines that it is high risk, the complete detection network is activated to achieve high-precision fire detection. This design can reduce energy consumption and computational cost.
[0027] (2) The present invention designs a tunnel-specific attention module, which uses a geometric attention branch to enhance the central region of the tunnel and improve the feature response of the internal region, helping the network to better locate objects in the tunnel. It uses a smoke diffusion attention branch to amplify the feature signal of weak smoke in the early stage, so that the network can identify the fire when the amount of smoke is small and the diffusion range is small, thus providing an early warning. It uses a flame flashing attention branch to enhance fire-related features and suppress irrelevant features of stable light sources such as car lights, thereby improving the detection accuracy of small targets.
[0028] (3) This invention utilizes the WIoU loss function and introduces a geometric deviation penalty term between the predicted box and the real box, which can assign different weights to targets of different sizes and distances, thereby improving the detection sensitivity of small flames in the distance, accelerating the convergence speed and the robustness of the model. Attached Figure Description
[0029] Figure 1 is a flowchart of the method of the present invention;
[0030] Figure 2 is a flowchart of the three-stage neural network architecture of the present invention;
[0031] Figure 3 is a flowchart of the trigger network of the present invention;
[0032] Figure 4 is a schematic diagram comparing the visual processing branch of the present invention with the original model architecture;
[0033] Figure 5 is a flowchart of the risk assessment network workflow of the present invention;
[0034] Figure 6 is a flowchart of the backbone network processing of the complete monitoring network of the present invention;
[0035] Figure 7 is a schematic diagram of data augmentation in one embodiment of the present invention;
[0036] Figure 8 shows the experimental results in one embodiment of the present invention. Detailed Implementation
[0037] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0038] This embodiment first provides a tunnel fire detection method, as shown in Figure 1, including the following steps:
[0039] S1. Obtain publicly available image datasets and perform data augmentation and annotation to establish a tunnel fire image dataset with tunnel camera perspective videos as the core data source.
[0040] Specifically, obtaining publicly available image datasets and performing data augmentation and annotation involves:
[0041] The publicly available tunnel fire images and videos were processed into image format by frame segmentation. Then, the dataset was augmented by slight rotation, cropping and splicing, blurring, and adding noise to form a tunnel fire image dataset. The online annotation tool Label Studio was used to accurately annotate the images in the tunnel fire image dataset with four types of targets: vehicles, flames, pedestrians, and yellow traffic lights.
[0042] S2. Obtain historical tunnel sensor datasets, including data from smoke concentration sensors, temperature sensors, and CO concentration sensors.
[0043] S3. Construct a three-stage neural network architecture that includes a trigger network, a risk assessment network, and a complete detection network.
[0044] The trigger network is a continuously running, ultra-lightweight convolutional neural network that performs all-weather anomaly monitoring of the entire tunnel. The risk assessment network is a medium-complexity network that is activated when the trigger network detects a potential risk. The complete detection network is based on the YOLOv8s network architecture and is fully activated when the risk assessment network determines a high risk, achieving high-precision fire detection. As shown in Figure 2, the workflow of this three-stage neural network architecture is as follows: The lightweight trigger network runs in real time. When the trigger network detects a potential risk, it activates the risk assessment network. If the risk assessment network detects a high risk, the complete detection network is activated for detailed fire analysis. Otherwise, the risk assessment network continues to perform detection, or the trigger network continues to monitor. If the complete detection network confirms a fire, an alarm is triggered; otherwise, the alert is maintained, and the trigger network continues to monitor.
[0045] As shown in Figure 3, the trigger network includes a vision processing branch and a sensor processing branch. The vision processing branch takes a tunnel fire image as input and outputs pedestrian and vehicle congestion detection results based on an optimized MobileNetV3 model. The sensor processing branch takes smoke concentration sensor, temperature sensor, and CO concentration sensor data as input and outputs sensor anomaly detection results based on a multilayer perceptron. Through dual-modal fusion of vision and sensors, efficient detection of pedestrian and vehicle congestion, smoke, and temperature anomalies can be achieved, and the subsequent risk assessment network is immediately activated when any anomaly is detected.
[0046] In this embodiment, the visual processing branch includes an image preprocessing unit, a feature extraction backbone network, and a classification output unit. As shown in Figure 4, the feature extraction backbone network is optimized based on the original MobileNetV3 model as follows: First, the activation function is optimized. The original neural network uses a mixture of h-swish and ReLU activation functions, but h-swish is computationally complex and has a slow inference speed on devices. The improved feature extraction backbone network uses the ReLU6 activation function uniformly, significantly improving the inference speed and making it more suitable for real-time monitoring scenarios. Next, the attention mechanism is lightweighted. The original SE module includes dimensionality reduction and dimensionality increase operations, which are computationally complex. The improved version is replaced with the SE-Lite module, which removes the dimensionality reduction operation and adopts a simplified structure that maintains the number of channels, achieving more efficient feature labeling in a lightweight network with fewer channels. Finally, the network structure is pruned. Considering the characteristic of small targets in tunnel monitoring, the 16-layer inverted residual block is pruned to 8-layer core inverted residual blocks, and the deep modules designed for large targets in the original network are removed, further reducing the computational load and model size.
[0047] The sensor processing branch includes a data preprocessing unit, a multilayer perceptron network, and an anomaly detection unit. After receiving data from smoke concentration sensors, temperature sensors, and CO concentration sensors, the data preprocessing unit first uses interpolation to process data streams with different sampling frequencies for data synchronization. Then, it applies a Kalman filter to smooth the sensor data. Finally, it uses a sliding window to extract features, obtaining the input feature vector of the multilayer perceptron network. The multilayer perceptron network adopts a lightweight MLP architecture. The input feature vector consists of three parts: the current real-time measurement values of the three sensors, the average values of the three sensors over a past 10-second time window, and the rate of change of the three sensors over five sampling intervals. It outputs the predicted probabilities of three anomaly categories. The anomaly detection unit converts the predicted probabilities of the three anomaly categories output by the multilayer perceptron network into specific anomaly judgment results.
[0048] In this embodiment, the risk assessment network includes a visual feature extraction module, a sensor feature extraction module, a multimodal feature fusion module, a risk assessment head, and a decision output module. As shown in Figure 5, the workflow of the risk assessment network is as follows:
[0049] 1. Visual Feature Extraction. The visual feature extraction module is based on the backbone network of the YOLOv8-nano model. It receives tunnel fire images from the trigger network and outputs the visual features in the tunnel fire images.
[0050] 2. Sensor Feature Extraction. The sensor feature extraction module receives sensor feature sequences within the most recent 10-second time window from the feature buffer of the trigger network. These sensor feature sequences are input feature vectors of a multilayer perceptron network that are cached in chronological order after the sensor processing branch of the trigger network processes the original sensor data in real time. The sensor feature extraction module first extracts local temporal sequences through convolution, reduces the sequence length through pooling layers, then analyzes the feature sequences from both forward and backward directions through a bidirectional LSTM layer, and finally outputs 64-dimensional sensor features through global pooling and feature refinement networks.
[0051] 3. Multimodal Feature Fusion. Since visual features and sensor features have different dimensions and distributions, the multimodal feature fusion module first projects them into a semantic space of the same dimension. Specifically, visual features are reduced to 256 dimensions through a fully connected layer, while sensor features are increased to 256 dimensions through another fully connected layer. To ensure that the features from the two modalities complement each other, a cross-attention mechanism is used to process the dimensionality-incremented and down-processed features, which are then fused through a fully connected layer. The fused features are then refined using an MLP, and a 512-dimensional fused feature is obtained through residual connections.
[0052] 4. Risk assessment calculation. 512-dimensional fusion features are input into the risk assessment head to calculate the risk level: high risk, medium risk, and low risk.
[0053] 5. Decision Output. The decision output module dynamically switches the three-stage neural network based on the risk level output by the risk assessment head. When the risk level is determined to be low, it reverts to the basic monitoring state where only the trigger network runs. When the risk level is determined to be medium, the risk assessment network continues to run until the risk level changes. When the risk level is determined to be high, an activation signal is generated and sent to the complete detection network.
[0054] In this embodiment, the complete detection network improves upon the backbone network of the YOLOv8s network architecture. The improved backbone network is based on the CSPDarknet architecture and integrates a tunnel-specific attention module. This guides the detection model to focus more on high-risk fire areas such as vehicle engine compartments, cargo roofs, and electrical equipment, as shown in Figure 6. The Focus module is a preprocessing module that converts high-resolution images into low-resolution feature maps with doubled channel counts while preserving spatial information through slicing and channel stitching operations, significantly improving the computational efficiency of subsequent convolutions. Conv3×3 represents a standard 3×3 convolutional layer capable of channel transformation and shallow feature extraction, preparing for the subsequent C2f module. The C2f module is a feature extraction module that enhances feature reuse through multi-branch residual structures and cross-layer connections. The SPPF module is a spatial pyramid pooling fusion module used to fuse global features at different scales, improving the model's robustness to detecting targets of varying sizes (such as large trucks and small obstacles) within the tunnel while reducing computational redundancy. The tunnel-specific attention module includes three branches: a geometric attention branch, a smoke diffusion attention branch, and a flame flicker attention branch.
[0055] The geometric attention branch converts the tunnel fire image into a grayscale image and performs Gaussian denoising to suppress noise. Then, the Sobel operator is used to calculate the gradient and extract the edge gradient map. To focus on the tunnel structure, the edge gradient map is thresholded and morphologically connected to obtain a coherent longitudinal edge contour. Then, based on the geometric features such as the aspect ratio and orientation angle of the longitudinal edge contour, the structural regions corresponding to the tunnel walls and lane lines are selected, and corresponding geometric feature masks are generated to give higher weights to the selected structural regions. Finally, the geometric feature mask is multiplied by the original feature map extracted by the backbone network to generate a geometric attention map, thereby enhancing the feature response of the region related to the tunnel structure.
[0056] The smoke diffusion attention branch extracts texture features of smoke in tunnel fire images using local binary patterns. It then calculates pixel displacements across consecutive frames using optical flow estimation to capture the directionality and slow-moving motion features of smoke diffusion. Finally, it fuses these texture and motion features to generate a smoke attention map. Applying this smoke attention map to the original feature map amplifies the characteristic signals of early, weak smoke, enabling the network to identify smoke in the early stages of a fire when its volume and diffusion range are small, thus providing early warning.
[0057] The flame flicker attention branch processes the input tunnel fire image channel by channel, enhancing the pixel values of the red and orange channels while weakening the blue and green channels to amplify the color features of the flame. Then, it analyzes the flicker frequency of the flame using Fourier transform to obtain its unique flicker frequency characteristics. Finally, it fuses the color and flicker frequency features to generate a flame attention map. This flame attention map, applied to the original feature map, increases the weight of regions that exhibit both flame color and flicker, while decreasing the weight of regions that exhibit flame color but not flicker, thus suppressing stable light sources such as vehicle headlights.
[0058] The outputs of the three branches are used to learn the learning parameters α, β, and γ through weight learning. In this embodiment, the values are 0.4, 0.3, and 0.3, respectively. A comprehensive attention map is generated based on the learning parameters and the corresponding attention map. The comprehensive attention map is multiplied with the original feature map to enhance the fire-related features and suppress irrelevant features.
[0059] S4. The trigger network and risk assessment network are trained using the historical tunnel sensor dataset and tunnel fire image dataset, and the complete detection network is trained using the tunnel fire image dataset to obtain a trained fire detection model.
[0060] In this embodiment, the average detection accuracy of the complete detection network is determined according to the following formula:
[0061] ;
[0062] In the formula, represents the detection accuracy of the i-th type of target; c represents the total number of detection categories, which is 4 in this embodiment.
[0063] Traditional IoU loss functions are insensitive to object scale, distance, and shape in tunnel flame detection and converge slowly. In this embodiment, the complete detection network uses the WIoU loss function to optimize bounding box prediction, and its calculation formula is as follows:
[0064] ;
[0065] ;
[0066] in, Intersection over Union (IoU) measures the degree of overlap between the predicted bounding box and the ground truth bounding box. The value range is [0,1]. This indicates that the two boxes completely overlap. 0 indicates that the two boxes do not overlap; It is the i-th geometric deviation penalty term between the predicted bounding box and the ground truth bounding box, such as the center point distance, aspect ratio difference, etc. yes The corresponding dynamic weight parameters associated with the target scale, It is the total number of geometric deviation penalty terms considered; It is the area of the overlapping region between the two boxes; It is the total area of the two boxes minus their overlapping area.
[0067] S5. Real-time acquisition of tunnel video and sensor data, input into the trained fire detection model, to obtain tunnel fire detection and identification results.
[0068] Figure 7 of this embodiment illustrates a data augmentation method, including but not limited to left-right flipping, image rotation, image cropping, grayscale processing, increasing vibrancy, decreasing saturation, blurring, and increasing noise. Figure 8 shows the recognition results of a real-world scenario after training a three-stage neural network on the dataset with this data augmentation. It is evident that the method of this invention can accurately identify tunnel fires.
[0069] The above is an introduction to the method embodiments. The following describes the solution of the present invention further through device embodiments.
[0070] A tunnel fire detection device, comprising:
[0071] Dataset Acquisition Module: Acquire publicly available image datasets and perform data augmentation and annotation; establish a tunnel fire image dataset with tunnel camera perspective videos as the core data source; acquire historical tunnel sensor datasets;
[0072] Model building module: Constructs a three-stage neural network architecture including a trigger network, a risk assessment network, and a complete detection network. The trigger network is a continuously running, ultra-lightweight convolutional neural network that performs all-weather anomaly monitoring of the entire tunnel. The risk assessment network is a medium-complexity network that is activated when the trigger network detects a potential risk. The complete detection network is based on the YOLOv8s network architecture and is fully activated when the risk assessment network determines that there is a high risk, achieving high-precision fire detection.
[0073] Training module: The trigger network and risk assessment network are trained using the historical tunnel sensor dataset and tunnel fire image dataset, and the complete detection network is trained using the tunnel fire image dataset to obtain a trained fire detection model;
[0074] Real-time identification module: Collects tunnel video and sensor data in real time, inputs them into a trained fire detection model, and obtains tunnel fire detection and identification results.
[0075] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0076] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0077] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A method for detecting tunnel fires, characterized in that, Includes the following steps: S1. Obtain publicly available image datasets and perform data augmentation and annotation to establish a tunnel fire image dataset with tunnel camera perspective videos as the core data source; S2. Obtain historical tunnel sensor dataset; S3. Construct a three-stage neural network architecture including a trigger network, a risk assessment network, and a complete detection network. The trigger network is a continuously running, ultra-lightweight convolutional neural network that performs all-weather anomaly monitoring of the entire tunnel; the risk assessment network is a medium-complexity network that is activated when the trigger network detects a potential risk; the complete detection network is based on the YOLOv8s network architecture and is fully activated when the risk assessment network determines that there is a high risk, thereby achieving high-precision fire detection. S4. The trigger network and risk assessment network are trained using the historical tunnel sensor dataset and tunnel fire image dataset, and the complete detection network is trained using the tunnel fire image dataset to obtain a trained fire detection model. S5. Real-time acquisition of tunnel video and sensor data, input into the trained fire detection model, to obtain tunnel fire detection and identification results.
2. The tunnel fire detection method according to claim 1, characterized in that, The specific steps of obtaining and augmenting publicly available image datasets are as follows: publicly available tunnel fire images and videos are processed into image format by frame-slicing, and then the dataset is augmented by slight rotation, cropping and splicing, blurring and adding noise to form a tunnel fire image dataset; online annotation tools are used to accurately annotate the images in the tunnel fire image dataset with four types of targets: vehicles, flames, pedestrians and yellow traffic lights.
3. The tunnel fire detection method according to claim 1, characterized in that, The trigger network includes a vision processing branch and a sensor processing branch. The vision processing branch takes a tunnel fire image as input and outputs pedestrian and vehicle congestion detection results based on an optimized MobileNetV3 model. The sensor processing branch takes smoke concentration sensor, temperature sensor, and CO concentration sensor data as input and outputs sensor anomaly detection results based on a multilayer perceptron. When pedestrian or vehicle congestion or sensor anomalies are detected, the risk assessment network is activated.
4. The tunnel fire detection method according to claim 3, characterized in that, The visual processing branch includes an image preprocessing unit, a feature extraction backbone network, and a classification output unit. The feature extraction backbone network replaces the h-swish and ReLU activation functions of the original MobileNetV3 model with ReLU6 activation functions, replaces the SE module with the SE-Lite module, removes dimensionality reduction operations, adopts a simplified structure that preserves the number of channels, and prunes the 16-layer inverse residual block to an 8-layer core inverse residual block.
5. A tunnel fire detection method according to claim 3, characterized in that, The sensor processing branch includes a data preprocessing unit, a multilayer perceptron network (MLP), and an anomaly detection unit. Upon receiving data from smoke concentration sensors, temperature sensors, and CO concentration sensors, the data preprocessing unit first uses interpolation to process data streams with different sampling frequencies for data synchronization. Then, a Kalman filter is applied to smooth the sensor data. Finally, a sliding window is used for feature extraction to obtain the input feature vector for the MLP network. The MLP network employs a lightweight MLP architecture, and its input feature vector consists of three parts: the current real-time measurement values of the three sensors, the average value of the three sensors over a preset time window, and the rate of change of the three sensors within a preset sampling interval. It outputs predicted probabilities for three anomaly categories. The anomaly detection unit converts the predicted probabilities of the three anomaly categories output by the MLP network into specific anomaly determination results.
6. The tunnel fire detection method according to claim 1, characterized in that, The risk assessment network includes a visual feature extraction module, a sensor feature extraction module, a multimodal feature fusion module, a risk assessment head, and a decision output module. The visual feature extraction module is a backbone network based on the YOLOv8-nano model, receiving tunnel fire images from the trigger network and outputting the visual features in the tunnel fire images. The sensor feature extraction module receives sensor feature sequences from the trigger network's feature buffer within the most recent preset time window. These sensor feature sequences are input feature vectors of a multilayer perceptron network, cached in chronological order after real-time processing of the raw sensor data by the trigger network's sensor processing branch. The sensor feature extraction module first extracts local temporal sequences from the sensor feature sequences through convolution, reduces the sequence length through pooling layers, then analyzes the feature sequences from both forward and backward directions through a bidirectional LSTM layer, and finally outputs the sensor features through a global pooling and feature refinement network. The multimodal feature fusion module first unifies the visual and sensor feature dimensions through different fully connected layers, then processes the features after dimensionality adjustment using a cross-attention mechanism, fuses them through a fully connected layer, refines the fused features using an MLP, and obtains the fused features through residual connections. The fused features are input to the risk assessment head to calculate the risk level. The decision output module dynamically switches the three-stage neural network according to the risk level output by the risk assessment head. When the risk is determined to be low, it reverts to the basic monitoring state where only the trigger network runs. When the risk level is determined to be medium, the risk assessment network should continue to operate until the risk level changes. When a high-risk condition is identified, an activation signal is generated and sent to the complete detection network.
7. The tunnel fire detection method according to claim 1, characterized in that, The complete detection network improves upon the backbone network of the YOLOv8s network architecture. The improved backbone network is based on the CSPDarknet architecture and integrates a tunnel-specific attention module. This module comprises three branches: a geometric attention branch, a smoke diffusion attention branch, and a flame flicker attention branch. The geometric attention branch converts the tunnel fire image into a grayscale image and performs Gaussian denoising to suppress noise. Subsequently, it uses the Sobel operator to calculate gradients, extracts edge gradient maps, and performs thresholding and morphological concatenation on these maps to obtain coherent vertical edge contours. Based on the geometric features of these vertical edge contours, structural regions corresponding to the tunnel walls and lane lines are selected, and corresponding geometric feature masks are generated to assign higher weights to these selected structural regions. Finally, the geometric feature masks are multiplied by the original feature map extracted by the backbone network to generate geometric attention. The attention map consists of three branches: a smoke diffusion attention branch and a flame flicker attention branch. The smoke diffusion attention branch extracts texture features of smoke from tunnel fire images using local binary mode, then calculates pixel displacements of consecutive frames using optical flow estimation to capture the directionality and slow motion features of smoke diffusion. Texture and motion features are then fused to generate a smoke attention map. The flame flicker attention branch processes the input tunnel fire image by channel, enhancing red and orange channel pixel values while weakening blue and green channels to amplify flame color features. Fourier transform is then used to analyze the flicker frequency of the flame, obtaining unique flicker frequency features. Finally, color and flicker frequency features are fused to generate a flame attention map. The outputs of the three branches are weighted to obtain learning parameters. A comprehensive attention map is generated based on these learning parameters and the corresponding attention map. This comprehensive attention map is multiplied by the original feature map to enhance fire-related features and suppress irrelevant features.
8. The tunnel fire detection method according to claim 1, characterized in that, The complete detection network uses the WIoU loss function to optimize bounding box prediction, and its calculation formula is as follows: ;in, For intersection, union, and comparison; It is the i-th geometric deviation penalty term between the predicted box and the ground truth box. yes The corresponding dynamic weight parameters associated with the target scale, It is the total number of geometric deviation penalty terms considered.
9. A tunnel fire detection device, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-8.
10. A storage medium having a program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Tunnel fire detection method based on YOLO neural network
CN114298167A
Tunnel fire monitoring system based on deep learning
CN118172882A
Mail content risk assessment method and system based on triple cascade model and generative adversarial network
CN120150991A