Expressway tunnel fire smoke recognition algorithm
Through the highway tunnel fire smoke recognition algorithm, real-time video streaming is used to process the camera and deep learning model to identify the highway tunnel fire smoke, which solves the problems of high maintenance costs and poor accuracy in the existing technology, and realizes the problem of in different environments. Stable and high accuracy identification.
Patent Information
- Application Number
- CN202410872932.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-12-10
AI Technical Summary
It is difficult to quickly identify fire smoke in high-speed tunnels. The existing technology relies on sensor systems, and the maintenance costs are high and the accuracy and reliability are difficult to guarantee.
Design a highway tunnel fire smoke recognition algorithm, obtain real-time video streams through the camera, extract images frame by frame and preprocess them, use the improved YOLOv5 target detection model and CNN-LSTM model to detect and classify fire smoke, and generate small videos for Comparison and identify.
This method does not require frequent maintenance or maintenance, reduces operation and maintenance costs, has strong environmental adaptability, can work stably under different lighting, weather and traffic conditions, and improves the accuracy and reliability of identification.
Smart Images

Figure CN119107576A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of fire smoke recognition, and in particular relates to a fire smoke recognition algorithm for a highway tunnel. Background Art
[0002] As an important part of the highway, the safety and smoothness of the high-speed tunnel are of great significance to ensuring the smoothness of road traffic and the safety of people’s lives and property.
[0003] Due to the closed structure, narrow and long space and poor ventilation conditions of high-speed tunnels, once a fire occurs, the smoke spreads rapidly and it is difficult to effectively control and extinguish. Therefore, the rapid identification of fire smoke in high-speed tunnels is of great significance to prevent and control the occurrence of high-speed tunnel fires.
[0004] At present, smoke detection in high-speed tunnel fires is done through smoke and flame alarm systems. Although this method has a certain effect, it is relatively dependent on sensor systems. It not only requires frequent maintenance or overhaul by staff, which is costly, but also is constrained by environmental factors, so its accuracy and reliability are difficult to guarantee.
[0005] In view of this, a highway tunnel fire smoke recognition algorithm is designed to solve the above problems. Summary of the invention
[0006] To solve the problems raised in the above background technology, the present invention provides a highway tunnel fire smoke recognition algorithm, which not only does not require frequent maintenance or overhaul by staff, thus reducing operation and maintenance costs, but also has strong environmental adaptability, can work stably under different lighting, weather and traffic conditions in the tunnel, and improves the accuracy and reliability of recognition.
[0007] To achieve the above object, the present invention provides the following technical solution: a highway tunnel fire smoke recognition algorithm, comprising the following steps:
[0008] S1: Install cameras at appropriate locations in highway tunnels;
[0009] S2: Get real-time video stream through the camera;
[0010] S3: extract images from real-time video streams frame by frame;
[0011] S4: preprocessing the extracted images;
[0012] S5: construct and train an improved YOLOv5 target detection model until convergence, input the preprocessed image into the converged improved YOLOv5 target detection model, and the improved YOLOv5 target detection model detects objects in the image in real time and outputs target detection results, wherein the target detection results are divided into two types, one is the presence of fire smoke, and the other is the absence of fire smoke;
[0013] S6: The pipeline algorithm generates a small video containing 16 frames from the output target image;
[0014] S7: preprocessing the generated small video containing 16 frames;
[0015] S8: Build and train a CNN-LSTM model until convergence, input the generated small video containing 16 frames into the converged CNN-LSTM model, and the CNN-LSTM model classifies the small video and outputs the classification results, where the classification results are divided into two types, one is fire smoke, and the other is not fire smoke;
[0016] S9: Compare the target detection results and classification results to identify whether there is fire smoke in the highway tunnel.
[0017] Furthermore, in step S4, image preprocessing includes resizing, tensor conversion and normalization, wherein resizing is to adjust the image pixels to 640×640, tensor conversion is to convert the resized image into a 3D tensor image including red, green and blue channels, and normalization is to normalize the converted 3D tensor image through Z-score.
[0018] Furthermore, in step S5, the Neck layer of the improved YOLOv5 target detection model is composed of FPN+PAN, wherein FPN sets four layers of feature pyramids, each layer of feature pyramids is set to a scale of 160*160, and the receptive field is a detection head of 4*4 pixels on a 640*640 size image, and a CBAM module is set in front of each detection head.
[0019] Furthermore, in step S6, the specific steps of generating a small video from the output target image by the pipeline algorithm include:
[0020] S61: sorting the output target images according to the timestamps to determine the playback order of the target images in the video;
[0021] S62: Arrange the target images in order to prepare for video synthesis;
[0022] S63: Use video editing software for video synthesis;
[0023] S64: Compare the similarities between the synthesized video frames. When the similarity between frames reaches or exceeds a preset specific threshold, it is regarded as a valid frame. The valid frames are retained and the invalid frames are removed. When the valid frames reach a preset specific number and the average similarity between frames reaches or exceeds a preset specific threshold, it is regarded as a valid video, i.e., a small video.
[0024] Furthermore, in step S7, the small video preprocessing includes resizing, wherein the resizing is to resize the small video to 150*150.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] The present invention first obtains the real-time video stream of the highway tunnel through a camera, then extracts the image of the real-time video stream frame by frame and preprocesses it, then performs target detection on the preprocessed image based on the improved YOLOv5 target detection model, outputs the target detection result, then generates a small video from the target image based on the pipeline algorithm and preprocesses it, then classifies the preprocessed small video based on the CNN-LSTM model, outputs the classification result, and then identifies the fire smoke in the highway tunnel based on the comparison of the target detection result and the classification result. Compared with the prior art, this method not only does not require frequent maintenance or overhaul by staff, thus reducing operation and maintenance costs, but also has strong environmental adaptability, can stably work under different lighting, weather and traffic conditions in the tunnel, and improves the accuracy and reliability of recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The figure is a flow chart of the highway tunnel fire smoke recognition algorithm of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] See also Figure 1 , the present invention provides the following technical solution: a highway tunnel fire smoke recognition algorithm, comprising the following steps:
[0030] S1: Install cameras at appropriate locations in highway tunnels;
[0031] S2: Get real-time video stream through the camera;
[0032] S3: extract images from real-time video streams frame by frame;
[0033] S4: preprocessing the extracted images;
[0034] Image preprocessing includes resizing, tensor conversion and normalization, where resizing is to adjust the image pixels to 640×640, tensor conversion is to convert the resized image into a 3D tensor image including red, green and blue channels, and normalization is to normalize the converted 3D tensor image through Z-score;
[0035] S5: construct and train an improved YOLOv5 target detection model until convergence, input the preprocessed image into the converged improved YOLOv5 target detection model, and the improved YOLOv5 target detection model detects objects in the image in real time and outputs target detection results, wherein the target detection results are divided into two types, one is the presence of fire smoke, and the other is the absence of fire smoke;
[0036] The Neck layer of the improved YOLOv5 target detection model is composed of FPN+PAN, where FPN sets four layers of feature pyramids, each layer of feature pyramids is set to a scale of 160*160, and the receptive field is a 4*4 pixel detection head on a 640*640 image. A CBAM module is set in front of each detection head.
[0037] S6: The pipeline algorithm generates a small video containing 16 frames from the output target image;
[0038] The specific steps of the pipeline algorithm to generate a small video from the output target image include:
[0039] S61: sorting the output target images according to the timestamps to determine the playback order of the target images in the video;
[0040] S62: Arrange the target images in order to prepare for video synthesis;
[0041] S63: Use video editing software for video synthesis;
[0042] S64: comparing the similarity between the synthesized video frames. When the similarity between the frames reaches or exceeds a preset specific threshold, they are regarded as valid frames, and the valid frames are retained, while the invalid frames are removed. When the valid frames reach a preset specific number and the average similarity between the frames reaches or exceeds a preset specific threshold, they are regarded as valid videos, i.e., small videos.
[0043] S7: preprocessing the generated small video containing 16 frames;
[0044] The small video preprocessing includes resizing, wherein the resizing is to resize the small video to 150*150;
[0045] S8: Build and train a CNN-LSTM model until convergence, input the generated small video containing 16 frames into the converged CNN-LSTM model, and the CNN-LSTM model classifies the small video and outputs the classification results, where the classification results are divided into two types, one is fire smoke, and the other is not fire smoke;
[0046] S9: Compare the target detection results and classification results to identify whether there is fire smoke in the highway tunnel.
[0047] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A highway tunnel fire smoke recognition algorithm, characterized in that: The following steps are involved: S1: Install cameras at appropriate locations in highway tunnels; S2: Get real-time video stream through the camera; S3: extract images from real-time video streams frame by frame; S4: preprocessing the extracted images; S5: construct and train an improved YOLOv5 target detection model until convergence, input the preprocessed image into the converged improved YOLOv5 target detection model, and the improved YOLOv5 target detection model detects objects in the image in real time and outputs target detection results, wherein the target detection results are divided into two types, one is the presence of fire smoke, and the other is the absence of fire smoke; S6: The pipeline algorithm generates a small video containing 16 frames from the output target image; S7: preprocessing the generated small video containing 16 frames; S8: Build and train a CNN-LSTM model until convergence, input the generated small video containing 16 frames into the converged CNN-LSTM model, and the CNN-LSTM model classifies the small video and outputs the classification results, where the classification results are divided into two types, one is fire smoke, and the other is not fire smoke; S9: Compare the target detection results and classification results to identify whether there is fire smoke in the highway tunnel.
2. The highway tunnel fire smoke recognition algorithm according to claim 1 is characterized by: In step S4, image preprocessing includes resizing, tensor conversion and normalization, wherein resizing is to adjust the image pixels to 640×640, tensor conversion is to convert the resized image into a 3D tensor image including red, green and blue channels, and normalization is to normalize the converted 3D tensor image through Z-score.
3. The highway tunnel fire smoke recognition algorithm according to claim 1 is characterized by: In the step S5, the Neck layer of the improved YOLOv5 target detection model is composed of FPN+PAN, wherein FPN sets four layers of feature pyramids, each layer of feature pyramids is set to a scale of 160*160, and the receptive field is a detection head of 4*4 pixels on a 640*640 size image, and a CBAM module is set in front of each detection head.
4. The highway tunnel fire smoke recognition algorithm according to claim 1 is characterized by: In step S6, the specific steps of generating a small video from the output target image by the pipeline algorithm include: S61: sorting the output target images according to the timestamps to determine the playback order of the target images in the video; S62: Arrange the target images in order to prepare for video synthesis; S63: Use video editing software for video synthesis; S64: Compare the similarities between the synthesized video frames. When the similarity between frames reaches or exceeds a preset specific threshold, it is regarded as a valid frame. The valid frames are retained and the invalid frames are removed. When the valid frames reach a preset specific number and the average similarity between frames reaches or exceeds a preset specific threshold, it is regarded as a valid video, i.e., a small video.
5. The highway tunnel fire smoke recognition algorithm according to claim 1 is characterized by: In step S7, the small video preprocessing includes resizing, wherein the resizing is to resize the small video to 150*150.
