A lightweight and anti-interference flame detection method based on improved YOLOv4-tiny

By improving the YOLOv4-tiny network, using depth separable convolution and ECA channel attention mechanism, combined with the dual-stream structure and IOU post-processing algorithm, the problem of external interference and rapid detection in flame detection is solved, achieving high accuracy and efficiency. Flame detection.

CN114743151BActive Publication Date: 2024-10-29ZHONGBEI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210494875.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2024-10-29
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

There are problems with external interference, rapid detection and positioning in flame detection. Existing technologies have shortcomings in accuracy and speed when faced with complex environments and light interference. In particular, multi-scale feature extraction and anti-interference capabilities need to be improved.

Method used

Using the improved YOLOv4-tiny network, replacing ordinary convolutions with depth-separable convolutions, increasing the number of FPN network layers, and introducing the ECA channel attention mechanism, combined with the dual-stream structure and IOU post-processing algorithm, to improve feature extraction quality and anti-interference capabilities .

Benefits of technology

It achieves comprehensive improvements in accuracy, anti-interference and detection time, improves the accuracy and real-time performance of flame detection, reduces false detections and missed detections, and enhances the adaptability to complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114743151B_ABST
    Figure CN114743151B_ABST
Patent Text Reader

Abstract

As an important part of fire prevention and control, flame detection has high requirements for real-time, anti-interference and accuracy. The current flame target detection method lacks comprehensive research on these three indicators. To address this problem, the present invention proposes a lightweight and anti-interference flame detection method based on improved YOLOv4‑tiny. A flame detection model with a dual-stream structure is designed by utilizing the dynamic characteristics of flames changing over time. First, the backbone network of YOLOv4‑tiny is lightweight improved by using deep separable convolution; secondly, in the feature extraction stage, the learning ability of the network for shallow features is improved by further fusing multi-scale features, and the ECA channel attention module is introduced in FPN to further improve the accuracy; finally, the IOU (Intersection over Union) post-processing algorithm is used to effectively shield the interference of fire-like targets. In terms of data sets, a flame detection data set of its own is created. Experiments have shown that the method of the present invention achieves comprehensive improvements in accuracy, anti-interference and detection time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of flame detection, and specifically is a lightweight anti-interference flame detection method based on improved YOLOv4-tiny. Background Art

[0002] Fire has always been a major disaster that requires people's attention and vigilance. Due to its characteristics of diverse inducing factors, rapid spread, and high outbreak rate, it endangers human life and causes huge economic losses. Therefore, fire prevention and control has become an important topic of multidisciplinary research. Flame detection, as an important part of fire prevention and control, has always been highly valued by researchers. Traditional flame detection technologies based on sensors, such as temperature sensors, smoke sensors, and light sensors, all need to respond to parameters such as temperature, smoke particles, and light intensity during the flame combustion process through sensitive elements. At the same time, the physical signal is converted into an electrical signal, which is then transmitted to the fire alarm [1]. However, no matter what kind of parameter, it takes a certain amount of time to accumulate, during which the fire is out of control. In the face of a large space environment, sensor technology is even more powerless [2].

[0003] With the development of digital image technology and computer vision, vision-based fire detection technology has emerged. It can be roughly divided into two stages. Traditional vision-based methods rely on the design of manual features, such as extracting features such as flame color [3, 4] and texture [5]. In addition, the temporal movement of the center of mass of the flame over time can also be used as a basis for strengthening judgment [6]. However, in reality, fire types and scenes are complex, with many uncertain factors, and the generalization of features extracted by manual algorithms is not strong [7].

[0004] In recent years, with the development of deep learning, convolutional neural networks have become the mainstream of feature extraction. Flame detection based on deep learning can be divided into recognition methods based on image classification networks and positioning methods based on target detection networks. In the classification task, it is only necessary to identify whether there is a flame in the scene, which is often regarded as a binary classification problem. For example, MobileNet[8], DenseNet[9], Inception

[10] , VGG16 and Resnet50

[11] are used as basic networks to train flame datasets. These methods have achieved a good level in speed and accuracy. However, they cannot locate the exact position of the flame, which can be well solved by target detection methods. Target detection methods can be roughly divided into two-stage target detection methods and one-stage target detection methods. The representative two-stage method Faster-RCNN has achieved good results in the accuracy of flame detection

[12] , but it consumes a lot of time. Li[7] et al. compared the performance of flame detection on Faster-RCNN, R-FCN, SSD and YOLOv3 and found that YOLOv3 is a more suitable choice. In order to further improve the detection speed, researchers began to choose a lightweight route, and the more lightweight YOLO network [13, 14] was favored. The above methods are all based on the detection of a single image, and the detection process is relatively independent. In order to utilize the characteristics of flames changing over time, Xie et al.

[15] proposed a video flame detection method that combines the flickering characteristics of flames changing over time with the deep static features of a single image to achieve more accurate detection. This method does contribute to accuracy, but the extraction of flickering features from multiple sequence images relies on manual design, and there are still challenges in the face of complex scenes.

[0005] In flame detection, there is often interference caused by fire-like targets such as light, sun, and sunset glow. There are two main solutions to flame detection interference factors. One is the image preprocessing method, which balances the image brightness, contrast and other indicators to improve the accuracy of detection. The other is to use attention mechanisms, multi-scale feature fusion or other methods in convolutional neural networks to improve feature extraction quality.

[0006] In terms of image preprocessing, Huang et al.

[16] denoised and filtered the framed image sequence, extracted the static and dynamic features of the suspicious flame area, and then used the fusion features for classification based on the improved support vector machine. However, this method is too time-consuming. Sun et al.

[17] proposed a dual network to solve the interference of fire-like targets such as lights on flame detection. The image to be detected was first detected by YOLOv3 for fire-like targets, and then the fire-like targets were masked and sent to the Inceptionv4 network for classification and prediction. Although the accuracy was improved, the impact of the dual network on speed was obvious, and the accuracy depended on the accuracy of YOLOv3 for detecting fire-like targets. Wang et al.

[18] proposed an RGB-HIS color model for extracting the flame area of ​​the image in the indoor environment. Compared with the general color extraction model, the flame saturation threshold was added for anti-interference. The image preprocessing method has played an anti-interference role to a certain extent, but in the face of complex environments, the preprocessing method is not generalizable and time-consuming.

[0007] In terms of feature extraction, Muhammad et al.

[19] proposed a feature map selection algorithm that can intelligently select fire-sensitive feature maps from the training process. These feature maps can be used for more accurate flame segmentation. At the same time, through further analysis, the basic characteristics of the fire can also be evaluated. High-quality feature information is helpful to a certain extent for anti-interference flame recognition. Shen et al.

[20] proposed a lightweight network model LFnet for smoke and fire detection. The model not only fuses multi-scale features, but also adds a channel attention mechanism to enhance the model's anti-interference ability under uncertain environmental factors.

[0008] [1]@ARTICLE{8022860,author={Yin, Zhijian and Wan, Boyang and Yuan, Feiniu and Xia, Xue and Shi, Jinting},journal={IEEE Access},title={A DeepNormalization and Convolutional Neural Network for Image Smoke Detection},year={2017},volume={5},number={},pages={18429-18438},doi={10.1109 / ACCESS.2017.2747399}}

[0009] [2]Jia Y,Chen W,Yang M,et al.Video Smoke Detection with DomainKnowledge and Transfer Learning from Deep Convolutional Neural Networks[J].Optik-International Journal for Light and Electron Optics,2021,240(8):166947.

[0010] [3]Bakri N S,Adnan R,Samad A M,et al.A methodology for fire detectionusing colour pixel classification[C] / / IEEE International Colloquium on SignalProcessing&Its Applications.IEEE,2018.@INPROCEEDINGS{8368692,author={Bakri,Nurul Shakira and Adnan,Ramli and Samad,Abd Manan and Ruslan,Fazlina Ahmat},booktitle={2018 IEEE 14th International Colloquium on Signal Processing ItsApplications(CSPA)},title={A methodology for fire detection using colourpixel classification},year={2018},volume={},number={},pages={94-98},doi={10.1109 / CSPA.2018.8368692}}

[0011] [4]Zhu X,Xu Y,Chen H,et al.Low false reject rate and false acceptrate multi-step fire detection method[J].Optik-International Journal forLight and Electron Optics,2013,124(24):6636-6641.

[0012] [5]K.Dimitropoulos,P.Barmpoutis and N.Grammalidis,"Spatio-TemporalFlame Modeling and Dynamic Texture Analysis for Automatic Video-Based FireDetection,"in IEEE Transactions on Circuits and Systems for Video Technology,vol.25,no.2,pp.339-351,Feb.2015,doi:10.1109 / TCSVT.2014.2339592.@ARTICLE{6857396,author={Dimitropoulos,Kosmas and Barmpoutis,Panagiotis andGrammalidis,Nikos},journal={IEEE Transactions on Circuits and Systems forVideo Technology},title={Spatio-Temporal Flame Modeling and Dynamic TextureAnalysis for Automatic Video-Based Fire Detection},year={2015},volume={25},number={2},pages={339-351},doi={10.1109 / TCSVT.2014.2339592}}

[0013] [6]Wang T,Bu L,Yang Z,et al.A New Fire Detection Method Using aMulti-Expert System Based on Color Dispersion,Similarity and Centroid Motionin Indoor Environment[J].自动化学报:英文版,2020,7(1):13.@ARTICLE{8741297,author={Wang,Teng and Bu,Leping and Yang,Zhikai and Yuan,Peng and Ouyang,Jineng},journal={IEEE / CAA Journal of AutomaticaSinica},title={A new firedetection method using a multi-expert system based on color dispersion,similarity and centroid motion in indoor environment},year={2020},volume={7},number={1},pages={263-275},doi={10.1109 / JAS.2019.1911546}}

[0014] [7]Li P,Zhao W.Image fire detection algorithms based on convolutionalneural networks[J].Case Studies in Thermal Engineering,2020,19:100625.

[0015] [8]Muhammad K,Khan S,Elhoseny M,et al.Efficient Fire Detection forUncertain Surveillance Environment[J].IEEE Transactions on IndustrialInformatics,2019:3113-3122.@ARTICLE{8635329,author={Muhammad,Khan and Khan,Salman and Elhoseny,Mohamed and Hassan Ahmed,Syed and Wook Baik,Sung},journal={IEEE Transactions on Industrial Informatics},title={Efficient FireDetection for Uncertain Surveillance Environment},year={2019},volume={15},number={5},pages={3113-3122},doi={10.1109 / TII.2019.2897594}}

[0016] [9]Li S,Yan Q,Liu P.An Efficient Fire Detection Method Based onMultiscale Feature Extraction,Implicit Deep Supervision and Channel AttentionMechanism[J].IEEE Transactions on Image Processing,2020,PP(99):1-1.@ARTICLE{9171455,author={Li,Songbin and Yan,Qiandong and Liu,Peng},journal={IEEETransactions on Image Processing},title={An Efficient Fire Detection MethodBased on Multiscale Feature Extraction,Implicit Deep Supervision and ChannelAttention Mechanism},year={2020},volume={29},number={},pages={8467-8475},doi={10.1109 / TIP.2020.3016431}}

[0017]

[10] A.Bari,T.Saini and A.Kumar,"Fire Detection Using Deep TransferLearning on Surveillance Videos,"2021 Third International Conference onIntelligent Communication Technologies and Virtual Mobile Networks(ICICV),2021,pp.1061-1067,doi:10.1109 / ICICV50876.2021.9388485.@INPROCEEDINGS{9388485,author={Bari,Abdul and Saini,Tapas and Kumar,Anoop},booktitle={2021 ThirdInternational Conference on Intelligent Communication Technologies andVirtual Mobile Networks(ICICV)},title={Fire Detection Using Deep TransferLearning on Surveillance Videos},year={2021},volume={},number={},pages={1061-1067},doi={10.1109 / ICICV50876.2021.9388485}}

[0018]

[11] Sharma J,Granmo O C,Goodwin M,et al.Deep Convolutional NeuralNetworks for Fire Detection in Images[J].2017.

[0019]

[12] BarmpoutisP,Dimitropoulos K,Kaza K,et al."Fire Detection fromImages using Faster R-CNN and Multidimensional Texture Analysis"[C] / / ICASSP2019-2019 IEEE International Conference on Acoustics,Speech and SignalProcessing(ICASSP).IEEE,2019.@INPROCEEDINGS{8682647,author={Barmpoutis,Panagiotis and Dimitropoulos,Kosmas and Kaza,Kyriaki and Grammalidis,Nikos},booktitle={ICASSP 2019-2019 IEEE International Conference on Acoustics,Speech and Signal Processing(ICASSP)},title={Fire Detection from ImagesUsing Faster R-CNN and Multidimensional Texture Analysis},year={2019},volume={},number={},pages={8301-8305},

[0020] doi={10.1109 / ICASSP.2019.8682647}}

[0021]

[13] Wang S,Chen T,Lv X,et al.Forest Fire Detection Based onLightweight Yolo.@INPROCEEDINGS{9601362,author={Wang,Shengying and Chen,Taoand Lv,Xinyu and Zhao,Jing and Zou,Xiaoyan and Zhao,Xiaoye and Xiao,Mingxiaand Wei,Haicheng},booktitle={2021 33rd Chinese Control and DecisionConference(CCDC)},title={Forest Fire Detection Based on Lightweight Yolo},year={2021},volume={},number={},pages={1560-1565},doi={10.1109 / CCDC52312.2021.9601362}}

[0022]

[14] Kang L W,Wang I S,Chou K L,et al.Image-Based Real-Time FireDetection using Deep Learning with Data Augmentation for Vision-BasedSurveillance Applications[C] / / 2019 16th IEEE International Conference onAdvanced Video and Signal Based Surveillance(AVSS).IEEE,2019.@INPROCEEDINGS{8909899,author={Kang,Li-Wei and Wang,I-Shan and Chou,Ke-Lin and Chen,Shih-Yu and Chang,Chuan-Yu},booktitle={2019 16th IEEE International Conference onAdvanced Video and Signal Based Surveillance(AVSS)},title={Image-Based Real-Time Fire Detection using Deep Learning with Data Augmentation for Vision-Based Surveillance Applications},year={2019},volume={},number={},pages={1-4},doi={10.1109 / AVSS.2019.8909899}}

[0023]

[15] Xie Y,Zhu J,Cao Y,et al.Efficient Video Fire Detection ExploitingMotion-Flicker-Based Dynamic Features and Deep Static Features[J].IEEEAccess,2020,8:81904-81917.@ARTICLE{9081979,author={Xie,Yakun and Zhu,Jun andCao,Yungang and Zhang,Yunhao and Feng,Dejun and Zhang,Yuchun and Chen,Min},journal={IEEE Access},title={Efficient Video Fire Detection ExploitingMotion-Flicker-Based Dynamic Features and Deep Static Features},year={2020},volume={8},number={},pages={81904-81917},doi={10.1109 / ACCESS.2020.2991338}}

[0024]

[16] X Huang,Du L.Fire Detection and Recognition Optimization Based onVirtual Reality Video Image[J].IEEE Access,2020,8:77951-77961.@ARTICLE{9078090,author={Huang,Xinchu and Du,Lin},journal={IEEE Access},title={Fire Detection and Recognition Optimization Based on Virtual Reality VideoImage},year={2020},volume={8},number={},pages={77951-77961},doi={10.1109 / ACCESS.2020.2990224}}

[0025]

[17] Sun K,Zhao Q,Wang X.Using knowledge inference to suppress thelamp disturbance for fire detection[J].Journal of Safety Science andResilience,2021,2(3):124-130.

[0026]

[18] Wang T,Bu L,Yang Z,et al.A New Fire Detection Method Using aMulti-Expert System Based on Color Dispersion,Similarity and Centroid Motionin Indoor Environment[J].IEEE / CAA Journal of AutomaticaSinica.2020,7(1):263-275.@ARTICLE{8741297,author={Wang,Teng and Bu,Leping and Yang,Zhikai andYuan,Peng and Ouyang,Jineng},journal={IEEE / CAA Journal of AutomaticaSinica},title={A new fire detection method using a multi-expert system based oncolor dispersion,similarity and centroid motion in indoor environment},year={2020},volume={7},number={1},pages={263-275},doi={10.1109 / JAS.2019.1911546}}

[0027]

[19] Muhammad K,Ahmad J,Lv Z,et al.Efficient Deep CNN-Based FireDetection and Localization in Video Surveillance Applications[J].IEEETransactions on Image Processing,2018,29:8467-8475.@ARTICLE{8385121,author={Muhammad,Khan and Ahmad,Jamil and Lv,Zhihan and Bellavista,Paolo and Yang,Poand Baik,Sung Wook},journal={IEEE Transactions on Systems,Man,andCybernetics:Systems},title={Efficient Deep CNN-Based Fire Detection andLocalization in Video Surveillance Applications},year={2019},volume={49},number={7},pages={1419-1434},doi={10.1109 / TSMC.2018.2830099}}

[0028]

[20] Shen C, Hu J, Wang C, et al. LFNet: Lightweight fire smoke detection for uncertain surveillance environment [C] / / 2020 6th International Conference on Big Data and Information Analytics (BigDIA), Shenzhen, China, 2020: 11-17. @INPROCEEDINGS{9384527, author={Shen, Ce and Hu, Jinxing and Wang, Chuansheng andLi, Donghao}, booktitle={20206th International Conference on Big Data and Information Analytics (BigDIA)}, title={LFNet: Lightweight fire smoke detection for uncertain surveillance environment}, year={2020}, volume={}, number={}, pages={11-17}, doi={10.1109 / BigDIA51454.2020.00011}}. Summary of the invention

[0029] In view of the problems of external interference, rapid detection, positioning, etc. in flame detection, the present invention proposes a lightweight and anti-interference flame detection method based on improved YOLOv4-tiny. Firstly, YOLOv4-tiny

[21] is lightweighted and improved, and the depthwise separable convolution

[22] is used to replace the convolution of the backbone network. At the same time, the number of network layers of the FPN network is increased and the Efficient Channel Attention mechanism

[23] is introduced to improve the quality of feature extraction. Finally, in order to improve the anti-interference ability of flame detection, a flame detection model with a dual-stream structure is adopted.

[0030] The present invention is implemented by adopting the following technical solution: a lightweight anti-interference flame detection method based on improved YOLOv4-tiny, comprising the following steps:

[0031] S1: First, the YOLOv4-tiny network structure is improved: the deep separable convolution is used to replace the ordinary convolution of the YOLOv4-tiny backbone network, which greatly reduces the number of model parameters; then, the multi-scale features of the feature extraction network are fused to form a three / four detection head network (YOLOv4tiny-L3 / L4), which can adapt to the detection of flame targets of various scales and effectively avoid false detection and missed detection caused by the spread of flames; finally, the ECA channel attention mechanism is introduced in the feature fusion network FPN to effectively improve the accuracy of flame detection;

[0032] S2: Establish a robust flame detection dataset;

[0033] S3: Train the improved YOLOv4-tiny network using a self-built flame detection dataset to obtain a lightweight flame detection network;

[0034] S4: Obtain real-time flame detection video from the camera;

[0035] S5: Process the video frame by frame to form an image sequence;

[0036] S6: sequentially obtain adjacent frame image pairs, and use the trained lightweight flame detection network to perform flame detection on each image, and extract the flame prediction frame;

[0037] S7: If no flame prediction frame is detected, return to step S6 and continue to extract the next set of adjacent frame image pairs in sequence for detection.

[0038] The above-mentioned lightweight anti-interference flame detection method based on improved YOLOv4-tiny, the adjacent frame image pairs detected by the lightweight flame detection network are then processed by the IOU post-processing algorithm. The specific process is:

[0039] S8: If a flame prediction frame is detected in the adjacent frame image pair after the lightweight flame detection network is detected, the flame prediction frames in the image pair to be detected are traversed simultaneously from top to bottom and from left to right, and the sizes of the flame prediction frames IOU at the same position are compared;

[0040] S9: If the IOU of the flame prediction frame at the same position in the adjacent frame image pair is greater than or equal to the set threshold, it is determined that the static target is mistakenly detected as a flame, so the flame prediction frame at the position of the adjacent frame image pair is deleted at the same time;

[0041] S10: If the IOU of the flame prediction frame at the same position of the adjacent frame image is less than the set threshold, it is considered that the dynamic flame is detected in the adjacent frame image pair, and the flame prediction frame is retained;

[0042] S11: After the flame prediction frames at the same position in the current adjacent frame image pair are traversed and the IOU comparison is completed, the flame detection frame of the current image pair is output;

[0043] S12: Return to step S6 to continue to perform flame detection on the next set of adjacent frame image pairs through the lightweight flame detection network, and extract the flame prediction frame according to the IOU.

[0044] The above-mentioned lightweight anti-interference flame detection method based on improved YOLOv4-tiny introduces fire-like target images and real flame images into the self-built flame detection data set to form an interference set image.

[0045] The present invention firstly uses deep separable convolution to improve the backbone network of YOLOv4-tiny to make lightweight improvements; secondly, in the feature extraction stage, the network's learning ability for shallow features is improved by further fusing multi-scale features, and the ECA channel attention module is introduced in FPN to further improve the accuracy; finally, the IOU (Intersection over Union) post-processing algorithm is used to effectively shield the interference of fire-like targets. In terms of data sets, a flame detection data set of its own is created. Experiments have shown that the method of the present invention has achieved comprehensive improvements in accuracy, anti-interference and detection time. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is the flow chart of flame detection with dual flow structure.

[0047] Figure 2 is the ECA channel attention module diagram, where X is the input feature map. is the feature map output after weighting, H, W, C are the height, width and channel dimension of the feature map, GAP (Global Average Pooling) is the global average pooling operation, K is the convolution kernel size of the one-dimensional convolution, in order to avoid manual tuning, K is adaptively adjusted by formula 1, σ is the sigmoid activation function, k = ψ (C) = |log 2 (C) / 2+1 / 2| odd (1) where |x| odd is the odd number closest to x.

[0048] Figure 3 This is the improved YOLOv4-tiny network structure diagram (ConvDW is a depth-separable convolution operation, and BN is a batch normalization operation).

[0049] Figure 4 This is an example of data enhancement effect.

[0050] Figure 5Schematic diagram of the interference set image production process.

[0051] Figure 6 The test results of the normal set and the interference set are shown in Figure 2.

[0052] Figure 7 Schematic diagram of mAP and F1 results of IOU threshold experiment.

[0053] Figure 8 Comparison chart of detection results using IOU post-processing and not using it. DETAILED DESCRIPTION

[0054] The core idea of ​​the present invention is that the adjacent frames of the video simultaneously enter the flame detection model of the dual-stream structure, which can effectively utilize the context feature information. The two images that have been detected are then processed by the IOU post-processing module to discard the unqualified prediction frames, thereby achieving the purpose of anti-interference. The detection network adopts the improved YOLOv4-tiny, which makes the network lighter and faster. The flowchart of the dual-stream structure flame detection method of the present invention is as follows: Figure 1 As shown, the detection method includes the following steps:

[0055] S1: First follow Figure 3 Improve the YOLOv4-tiny network structure;

[0056] Firstly, the ordinary convolution of the YOLOv4-tiny backbone network is replaced by the deep separable convolution, which greatly reduces the number of model parameters. Then, the multi-scale features of the feature extraction network are fused to form a three / four detection head network (YOLOv4tiny-L3 / L4), which can adapt to the detection of flame targets of various scales and effectively avoid false detection and missed detection caused by the spread of flames. Finally, the ECA channel attention mechanism is introduced in the feature fusion network FPN to effectively improve the accuracy of flame detection.

[0057] S2: Establish a robust flame detection dataset;

[0058] S3: Train the lightweight detection network YOLOv4tiny-L3 / L4 through the self-built data set to obtain a lightweight flame detection network;

[0059] S4: Obtain real-time flame detection video from the camera;

[0060] S5: Process the video frame by frame to form an image sequence;

[0061] S6: sequentially obtain adjacent frame image pairs, and use the trained lightweight flame detection network to perform flame detection on each image, and extract the flame prediction frame;

[0062] S7: If no flame prediction frame is detected, return to step S6 and continue to extract the next set of adjacent frame images in sequence for detection;

[0063] S8: If a flame prediction frame is detected, the flame prediction frames in the image pair to be detected are traversed simultaneously from top to bottom and from left to right, and the IOU (intersection over union) of the flame prediction frames at the same position is compared.

[0064] S9: If the IOU (intersection-over-union) of the flame prediction frame at the same position in the adjacent frame image pair is greater than or equal to the set threshold, it is determined that a static target (such as the sun, light, etc.) is mistakenly detected as a flame, so the flame prediction frame at the position of the adjacent frame image pair is deleted at the same time;

[0065] S10: If the IOU (intersection over union) of the flame prediction frame at the same position of the adjacent frame image pair is less than the set threshold, it is considered that a dynamic flame is detected in the adjacent frame image pair, and the flame prediction frame is retained;

[0066] S11: After the flame prediction frames at the same position in the image to be detected are traversed and the IOU comparison is completed, the flame detection frame of the current image pair is output;

[0067] S12: Return to step S6 to continue to perform flame detection on adjacent frame image pairs through the lightweight flame detection network, and extract the flame prediction frame according to the IOU (intersection over union).

[0068] Improvements based on YOLOv4-tiny

[0069] In order to meet the real-time requirements, lightweight target detection networks have gradually developed. YOLOv4-tiny is one of the products in recent years. YOLOv4-tiny is a compressed version of YOLOv4, with only about 6 million parameters, nearly one-tenth of YOLOv4. This is why YOLOv4-tiny has attracted much attention in embedded systems. Its backbone network is CSPDarknet53-tiny, which contains 15 convolutional layers. In order to alleviate the problem of network model degradation, residual blocks Resblock

[24] are added. In order to obtain more semantic information, the YOLOv4-tiny method uses a feature pyramid network to extract features of different scales and fuse them. The present invention further lightweights YOLOv4-tiny and replaces the ordinary convolution in the original backbone network CSPDarknet53-tiny with a depth-separable convolution. It creatively divides the convolution process into two parts: channel-by-channel convolution (Depthwise Convolution) and point-by-point convolution (Pointwise Convolution), which greatly reduces the number of parameters, making the number of parameters only 11% of ordinary convolution, saving computational costs. At the same time, it is also noted that the generation of flames is caused by early flames, and small targets are the main targets in the early stages of flames. For fire prevention and control, real-time performance is crucial, which requires the detection network to have a strong sensitivity to small targets so that the generation of flames can be detected in the early stages. Since the shallow features contain more position information in the convolution process, in order to enhance the sensitivity of the original YOLOv4-tiny (input is 416×416×3) to small targets, two layers of shallow features (52×52, 104×104) are added to the original two layers of feature pyramid (13×13, 26×26) for detection head prediction. At the same time, in order to enhance the quality of feature extraction, the ECA channel attention module is introduced. It improves the SE (Squeeze-and-Excitation) module

[25] and proposes a local cross-channel interaction strategy without dimensionality reduction and a method for adaptively selecting the size of the one-dimensional convolution kernel. The size of the one-dimensional convolution kernel can be obtained through learning, which significantly improves the quality of feature extraction with very few parameters. The module diagram is shown in the figure below. Figure 2 As shown, the improved YOLOv4-tiny module is shown in Figure 3 shown.

[0070] IOU post-processing algorithm

[0071] Because there are often fire-like targets in real life, this is a major interference factor for flame target detection, greatly increasing the false alarm rate and the false detection rate. If you rely solely on the setting of the confidence threshold, although the correct detection rate is increased to a certain extent, the missed detection rate will also increase. This is especially true for lightweight target detection networks that cut down on the backbone network. The image detection method that relies on a single frame obtains limited information and cannot utilize the dynamic changes of the flame over time. Blindly increasing the number of detection frames will make the real-time performance insufficiently guaranteed. Therefore, based on the detection results of adjacent frames, the present invention proposes an IOU post-processing algorithm that can improve the correct detection rate of flame target detection.

[0072] For static interference items, there will be no obvious changes in shape in a short period of time, while for flames, there are often some dynamic changes. Therefore, for the images of the previous and next two frames, the false detection frame generated by the static fire target will hardly have obvious changes in size and position coordinates due to the same detection network and network weight. On the contrary, for real flame targets, due to their dynamic characteristics such as jumping and flickering, there will be position deviations and even morphological differences in the previous and next two frames. At this time, even in the case of the same detection network and the same network weights, the prediction box is often accompanied by different degrees of position deviation and size. The present invention utilizes this point to improve the positive detection rate of flame target detection.

[0073] Experimental setup and results analysis

[0074] Dataset

[0075] The dataset of the present invention is mainly obtained from three-party channels, one part is obtained from network resources, one part is a self-built gunpowder combustion video dataset, and the rest are flame images obtained in references [9] and

[26] . The obtained video dataset is framed to form a mixed dataset of video frame images and flame images. The images are subjected to data enhancement operations, including rotation, flipping, color enhancement, random color, contrast enhancement, brightness enhancement and Mosaic data enhancement. The enhanced dataset contains a total of 11,037 images. The Mosaic data enhancement method is to first perform simple data enhancement on four images, such as rotation, color gamut change, scaling, etc., and then crop and splice them to form a four-grid image. In this way, the background of the detected object is greatly enriched, and the data of the four images will be calculated simultaneously during the Batch Normalization calculation, thereby improving the training efficiency. Examples of data enhancement are as follows: Figure 4 shown.

[0076] In life, flames are often accompanied by fire-like targets, but the current flame dataset lacks images in which flames and fire-like targets coexist. Therefore, in order to verify the anti-interference ability of the method of the present invention, an interference set of images was produced. Figure 4 The Mosaic data enhancement method in the paper is used, but no basic data enhancement is performed. Only the fire-like target images and the real flame images are spliced. Some of the fire-like target images are from the literature [9], and the real flame target images are from the video frame images after the flame video dataset obtained by the present invention is framed, thereby forming 1000 interference set images. The process of making interference set images is as follows: Figure 5 shown.

[0077] Parameter settings

[0078] The present invention divides the dataset images into training set, test set and validation set, with a total of 11037 images. Among them, 8939 images are used as training set, 994 images are used as validation set, and the last 1104 images are used as test set. For target detection algorithms with anchor boxes, it is necessary to pre-set the size ratio of the anchor boxes. The present invention adopts a lightweight target detection algorithm based on improved YOLOv4-tiny to divide the image into grids of 13×13, 26×26, 52×52, and 104×104 sizes. According to the dataset of the present invention and the real target box after data annotation, the K-means algorithm

[21] is used to perform a clustering calculation of the aspect ratio of the annotated real target box to obtain 12 sizes of prior box sizes. The prior box obtained after K-means clustering is more consistent with the real size of the flame, which can accelerate the convergence speed of the model and also improve the accuracy.

[0079] During the training process, the conventional stochastic gradient descent method is likely to fall into a local optimal solution, which slows down the training speed and results in unsatisfactory training results. The present invention uses the cosine annealing algorithm to decay the learning rate, which can effectively solve this problem. The cosine annealing algorithm suddenly increases the learning rate through warm restart to jump out of the local optimal solution

[27] . After using the cosine annealing algorithm, the learning rate is updated as shown in formula (2): new lr =eta min +(initial lr -eta min )(1+cos(epoch·π / T max )) / twenty two), Among them new lr is the new learning rate, eta min is the minimum learning rate, initial lr is the initial learning rate, Tmax Indicates 1 / 2 of the period.

[0080] The present invention max =5,eta min =0.00005, the weight decay regularization term is 0.0005, the learning rate is 0.001, the number of iterations epoch = 500, and the weight with the lowest loss is selected as the final prediction weight.

[0081] Evaluation indicators

[0082] The evaluation indicators used in the present invention are accuracy (Precision, P), average accuracy (AveragePrecision, AP), multi-category AP average (mean AP, mAP), recall (Recall, R), a comprehensive evaluation indicator based on accuracy and recall (F1-score, F1), and the model complexity evaluation criteria are parameter size (MByte, MB) and floating-point operations per second (Floating-Point Operations per Second, FLOPs). The calculation formula is as follows:

[0083] P=TP / (TP+FP) (3)

[0084] R=TP / (TP+FN) (4)

[0085] F1=2PR / (P+R) (5)

[0086] AP=S pr (6)

[0087]

[0088] Among them, TP is the number of correctly predicted positive samples; FP is the number of incorrectly predicted positive samples; FN is the number of incorrectly predicted negative samples; S pr is the area under the Precision-Recall curve at different confidence levels; is the average value of multi-category AP.

[0089] Experimental Results

[0090] The experimental comparison methods include YOLOv4-tiny, a lightweight version of YOLOv4, EfficientDet

[28] , a target detection method formed by using Efficientnet as the backbone network, Mobilenet replacing the original backbone network of SSD to form the Mobilenet-SSD method, and the three-layer detection head method YOLOv4-tiny-L3 (13×13, 26×26, 52×52) and the four-layer detection head method YOLOv4-tiny-L4 (13×13, 26×26, 52×52, 104×104) formed by improving YOLOv4-tiny in the present invention.

[0091] Model complexity comparison experiment

[0092] The parameter amount and computation amount of various methods are shown in Table 1. The improved YOLOv4-tiny uses depthwise separable convolution instead of ordinary 3×3 convolution in the backbone network, which greatly reduces the parameter amount and computation amount. Although the computation amount is not as much as MobileNet-SSD, the improved method of the present invention is superior to the other methods in terms of parameter amount.

[0093] Table 1. Parameters and computational complexity of various methods

[0094]

[0095] Ablation and comparative experiments

[0096] In order to verify the effectiveness of the improved method, an ablation experiment was conducted on the improved method, and the performance was tested on a test set containing 1104 images. It should be noted that the IOU post-processing algorithm was not added at this time. The performance of various methods on the 1104 test set is shown in Table 2. YOLOv4-tiny-L3 (no-ECA) is a method that uses deep separable convolution and FPN to add a 52×52 effective feature layer on the basis of the original YOLOv4-tiny. Similarly, YOLOv4-tiny-L4 (no-ECA) is a method that adds a 104×104 feature layer to FPN on the basis of YOLOv4-tiny-L3 (no-ECA). YOLOv4-tiny-L3 (ECA) and YOLO v4-tiny-L4 (ECA) are methods that add the above two methods to the ECA channel attention module respectively. YOLO v4-tiny(ECA) is just a method of adding the original YOLOv4-tiny to the ECA channel attention module.

[0097] From the analysis in Table 2, it can be seen that after adding the effective feature layer, the three-layer effective feature layer method (YOLOv4-tiny-L3 (no-ECA)) has improved mAP and Precision, and slightly decreased F1 and Recall. After adding the fourth effective feature layer (YOLOv4-tiny-L4 (no-ECA)), all data have improved. For the ECA channel attention module, YOLOv4-tiny-L4 (no-ECA) has a small improvement in indicators after adding the ECA channel attention module, while YOLOv4-tiny-L3 (no-ECA) has both increases and decreases. In addition, the first two rows of the table compare EfficientDet and Mobilenet-SSD on the same 1104 images. Through the above analysis, the effectiveness of adding feature layers (13×13 and 104×104) and ECA channel attention modules to FPN is obtained. In addition, the use of depthwise separable convolution makes the model more lightweight. This means that, based on the original YOLOv4-tiny parameter volume of about 18%, higher performance is achieved in flame target detection.

[0098] Table 2 Performance of each method on the 1104 test set

[0099]

[0100] Interference set experiment

[0101] In real life, there are often interferences from fire-like targets. In order to verify the interference of fire-like targets on flame detection, we first use 1000 normal flame video frame images (normal set) for testing, with a total of 500 pairs of adjacent flame image sequences; and then use the same 1000 flame video frame images to add fire-like target images (interference set) for testing, with a total of 500 pairs of adjacent flame image sequences. The production process of the interference set images is as follows: Figure 5 As shown. Figure 6 It can be seen that after adding interference terms, the mAP and F1 values ​​of the five methods are significantly reduced, and flame detection is significantly interfered.

[0102] IOU threshold experiment

[0103] In order to improve the anti-interference ability of the method, the IOU post-processing algorithm is adopted. The IOU threshold is used as the key value to determine whether it is a real flame. The experimental method is used to finally determine the IOU threshold. By observing the mAP value and F1 value under different IOU thresholds, it is concluded that when the IOU threshold is set to 1, the IOU post-processing algorithm does not work. Figure 7It can be seen that when the IOU threshold is set to 0.99, the mAP values ​​and F1 values ​​of the three methods are optimal, and are better than those without the IOU post-processing algorithm. Figure 8 The three methods (YOLOv4-tiny (ECA), YOLOv4-tiny-L3 (ECA), and YOLOv4-tiny-L4 (ECA)) were tested with and without IOU post-processing algorithms, where the upper right corner image in each figure is a real flame image. Figure 8 It is known that the three methods are all interfered by fire-like targets to varying degrees. Among them, YOLOv4-tiny has poor detection of small targets. However, after the IOU post-processing algorithm, the anti-interference ability of the three methods is significantly improved and the false detection is significantly reduced.

[0104] Detection time comparison experiment

[0105] In order to verify the real-time performance of the flame detection method, the detection time of five methods was compared. They were run on a laptop (CPU-i5-8250U) M1 environment and Google Cloud Server Colab (GPU-Tesla K80) M2 respectively. The interference set image was detected and the average detection time was calculated. The experimental data is shown in Table 3. From the data, it can be seen that the detection speed of MobileNet-SSD is the fastest in the CPU environment, while the improved YOLOv4-tiny-L3 (IOU) method and YOLOv4-tiny-L4 (IOU) method in the GPU environment are better than other methods. Although the post-processing process of IOU reduces the problem of false detection of flame targets to a certain extent, it also increases the time consumption in its processing process. Similarly, the time consumption of the IOU post-processing process was detected separately, and the detection was performed in the interference set. The average detection time of 500 pairs of adjacent frame images was calculated, and it was found that the time consumption was only 0.23ms.

[0106] Table 3 Detection time performance of each method on the interference set

[0107]

[0108] in conclusion

[0109] The present invention proposes a flame detection model with a dual-stream structure for flame detection of adjacent frame images. At the same time, the detection network YOLOv4-tiny is improved, the backbone network is lightweighted by using deep separable convolution, an effective feature layer is added to FPN, and an ECA module is introduced. The improved YOLOv4-tiny achieves improved detection performance on the basis of about 18% of the original parameter amount. The mAP and F1 of the YOLOv4-tiny-L3 method and the YOLOv4-tiny-L4 method on the flame data set of the present invention reach 87.73%, 90.69% and 81%, 85%, respectively. In addition, in order to prevent static fire-like targets from affecting the detection results, an IOU post-processing algorithm is proposed. For the predicted adjacent frame images, if the IOU values ​​of their corresponding prediction boxes exceed a certain range, they are considered to be false positives. The IOU threshold of the present invention is obtained by experiment to be 0.99. The IOU post-processing algorithm is tested on an interference set, and the method of the present invention makes a certain contribution to anti-interference. Real-time performance is very important for flame detection. The present invention compares the detection time of various methods and verifies that the present invention has excellent performance and the IOU post-processing process is only 0.23ms. The analysis proves that the present invention has made a certain degree of balance improvement in terms of lightweight, accuracy and real-time performance.

[0110]

[21] @article{bochkovskiy2020yolov4, title={Yolov4: Optimal speed and accuracy of object detection}, author={Bochkovskiy, Alexey and Wang, Chien-Yaoand Liao, Hong-Yuan Mark}, journal={arXiv preprint arXiv:2004.10934}, year={2020}

[0111] }

[0112]

[22] Howard AG, Zhu M, Chen B, et al.MobileNets: Efficient ConvolutionalNeural Networks for Mobile Vision Applications[J].

[0113] 2017.@article{howard2017mobilenets,title={Mobilenets:Efficientconvolutional neural networks for mobile vision applications},author={Howard,Andrew G and Zhu,Menglong and Chen,Bo and Kalenichenko,Dmitry andWang,Weijun and Weyand,Tobias and Andreetto,Marco and Adam,Hartwig},

[0114] journal={arXiv preprint arXiv:1704.04861},

[0115] year={2017}

[0116] }

[0117]

[23] Wang Q,Wu B,Zhu P,et al.ECA-Net:Efficient Channel Attention forDeep Convolutional Neural Networks[C] / / 2020IEEE / CVF Conference on ComputerVision and Pattern Recognition(CVPR).Seattle,WA,USA,2020:11531-11539.@INPROCEEDINGS{9156697,author={Wang,Qilong and Wu,Banggu and Zhu,Pengfei andLi,Peihua and Zuo,Wangmeng and Hu,Qinghua},booktitle={2020IEEE / CVFConference on Computer Vision and Pattern Recognition(CVPR)},title={ECA-Net:Efficient Channel Attention for Deep Convolutional Neural Networks},year={2020},volume={},number={},pages={11531-11539},doi={10.1109 / CVPR42600.2020.01155}}

[0118]

[24] He K,Zhang X,Ren S,et al.Deep Residual Learning for ImageRecognition[J].IEEE,2016.@inproceedings{he2016deep,

[0119] title={Deep residual learning for image recognition},

[0120] author={He,Kaiming and Zhang,Xiangyu and Ren,Shaoqing and Sun,Jian},booktitle={Proceedings of the IEEE conference on computer vision and patternrecognition},

[0121] pages = {770--778},

[0122] year = {2016}

[0123] }

[0124]

[25] Jie H, Li S, Gang S, et al.Squeeze-and-Excitation Networks[J].IEEETransactions on Pattern Analysis and Machine Intelligence, 2017, PP(99).@inproceedings{hu2018squeeze,title={Squeeze-and-excitation networks},

[0125] author={Hu, Jie and Shen, Li and Sun, Gang}, booktitle={Proceedings of the IEEEconference on computer vision and pattern recognition}, pages={7132--7141}, year={2018}

[0126] }

[0127]

[26] Li Xinjian, Zhang Dasheng, Sun Lilei, et al. Lightweight flame detection method based on CNN in complex scenes[J]. Pattern Recognition and Artificial Intelligence, 2021, 34(5): 415-422.

[0128] LI Xinjian, ZHANG Dasheng, SUN Lilei, XU Yong. CNN-Based Lightweight Flame Detection Method in Complex Scenes., 2021, 34(5): 415-422.

[0129]

[27] @article{loshchilov2016sgdr,

[0130] title={Sgdr:Stochastic gradient descent with warm restarts},

[0131] author={Loshchilov,Ilya and Hutter,Frank},

[0132] journal={arXiv preprint arXiv:1608.03983},

[0133] year={2016}

[0134] }

[0135]

[28] @inproceedings{tan2020efficientdet,

[0136] title={Efficientdet:Scalable and efficient object detection},

[0137] author={Tan,Mingxing and Pang,Ruoming and Le,Quoc V},booktitle={Proceedings of the IEEE / CVF conference on computer vision andpatternrecognition},

[0138] pages={10781--10790},

[0139] year={2020}

[0140] }。

Claims

1. A lightweight anti-interference flame detection method based on improved YOLOv4-tiny, characterized in that: The following steps are involved: S1: First, the YOLOv4-tiny network structure is improved: the convolution of the YOLOv4-tiny backbone network is replaced by deep separable convolution; then, the multi-scale features of the feature extraction network are fused to form a three- or four-head network; finally, the ECA channel attention mechanism is introduced into the feature fusion network FPN; S2: Establish a robust flame detection dataset; S3: Train the improved YOLOv4-tiny network using a self-built flame detection dataset to obtain a lightweight flame detection network; S4: Obtain real-time flame detection video from the camera; S5: Process the video frame by frame to form an image sequence; S6: sequentially obtain adjacent frame image pairs, and use the trained lightweight flame detection network to perform flame detection on each image, and extract the flame prediction frame; S7: If no flame prediction frame is detected, return to step S6 and continue to extract the next set of adjacent frame images in sequence for detection; The adjacent frame image pairs detected by the lightweight flame detection network are then processed by the IOU post-processing algorithm. The specific process is as follows: S8: If a flame prediction frame is detected in the adjacent frame image pair after the lightweight flame detection network is detected, the flame prediction frames in the image pair are traversed simultaneously from top to bottom and from left to right, and the sizes of the flame prediction frames IOU at the same position are compared; S9: If the IOU of the flame prediction frame at the same position in the adjacent frame image pair is greater than or equal to the set threshold, it is determined that the static target is mistakenly detected as a flame, so the flame prediction frame at the position of the adjacent frame image pair is deleted at the same time; S10: If the IOU of the flame prediction frame at the same position of the adjacent frame image is less than the set threshold, it is considered that the dynamic flame is detected in the adjacent frame image pair, and the flame prediction frame is retained; S11: After the flame prediction frame in the current adjacent frame image pair is traversed and the IOU comparison is completed, the flame detection frame of the current image pair is output; S12: Return to step S6 to continue to perform flame detection on the next set of adjacent frame image pairs through the lightweight flame detection network, and extract the flame prediction frame according to the IOU.

2. A lightweight anti-interference flame detection method based on improved YOLOv4-tiny according to claim 1, characterized in that: Fire-like target images are introduced into the self-built flame detection dataset and spliced ​​with real flame images to form interference set images.

Citation Information

Patent Citations

  • Method for manufacturing carbon nanotube film

    US9156697B2