作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2023, Vol. 49 ›› Issue (8): 291-301, 309. doi: 10.19678/j.issn.1000-3428.0065025

• 开发研究与工程应用 • 上一篇    下一篇

基于改进YOLOv5的火焰检测方法

陈露萌1, 曹彦彦1,*, 黄民1, 谢鑫钢2   

  1. 1. 北京信息科技大学 机电工程学院, 北京 100192
    2. 中国矿业大学 机电与信息工程学院, 北京 100083
  • 收稿日期:2022-06-20 出版日期:2023-08-15 发布日期:2023-08-15
  • 通讯作者: 曹彦彦
  • 作者简介:

    陈露萌(1994—),女,硕士研究生,主研方向为计算机视觉、深度学习、机器人技术

    黄民,教授、博士

    谢鑫钢,博士研究生

  • 基金资助:
    北京市教育委员会科学研究计划项目(KM202211232021)

Flame Detection Method Based on Improved YOLOv5

Lumeng CHEN1, Yanyan CAO1,*, Min HUANG1, Xingang XIE2   

  1. 1. School of Mechanical and Electrical Engineering, Beijing Information Science and Technology University, Beijing 100192, China
    2. School of Mechanical Electronic and Information Engineering, China University of Mining and Technology, Beijing 100083, China
  • Received:2022-06-20 Online:2023-08-15 Published:2023-08-15
  • Contact: Yanyan CAO

摘要:

现有基于图像的火焰检测方法难以兼顾实时性和准确性,且缺乏对小火焰目标精准识别的能力,无法有效应对小火点灭火等应用场景。YOLOv5算法与传统主流算法相比在检测的实时性上有很大优势,为提升火焰检测精度,提出一种基于改进YOLOv5的火焰实时检测方法。针对YOLOv5模型进行改进:在特征提取部分嵌入协同注意力机制模块,在不损失特征信息的情况下减少特征冗余,以帮助模型更精确地定位火焰特征;在特征融合部分增加一个专门针对小火焰目标的检测层,并添加对应的特征提取及特征融合模块,以帮助模型有效获取感受野小于8×8像素的火焰特征;在损失函数的计算部分使用α-CIoU作为新的边界框损失函数,以提升模型的收敛速度和对小数据集的鲁棒性。此外,通过模型预训练和迁移学习的方法对火焰检测模型各层结构的权重参数进行初始化,防止梯度消失,提升训练效果。实验结果表明,改进后的火焰检测模型检测精度为96.6%,较YOLOv5原始模型提升7.4个百分点,并且检测速度达到68帧/s,模型大小仅15.4 MB,在大幅提升精度的基础上能够同时满足消防灭火机器人对火焰检测实时性和轻量化的要求。

关键词: 火焰检测, 注意力机制, 特征融合, YOLOv5算法, 边界损失函数

Abstract:

The existing image-based flame detection approach finds it challenging to balance real-time and precision, and it is incapable of accurately identifying small flame targets, making it ineffective for application situations such as small fire extinguishing. In terms of real-time detection, the YOLOv5 algorithm provides significant benefits over conventional techniques. A real-time flame detection method based on improved YOLOv5 is proposed to increase flame detection accuracy. First, to help the model locate the flame features more accurately, a coordinate attention mechanism module is embedded in the feature extraction portion of the YOLOv5 model.This module can reduce feature redundancy without sacrificing the feature information. Second, to help the model successfully obtain flame features with a receptive field smaller than 8×8 pixels, a detection layer specifically designed for small flame targets is added to the feature fusion portion of the algorithm along with the corresponding feature extraction and feature fusion modules. Finally, to increase the model's speed of convergence and robustness to small datasets, α-CIoU is employed as a new bounding box loss function in the computation phase of the loss function.Additionally, model pretraining and transfer learning techniques are used to initialize the weight parameters of each layer structure of the flame detection model to prevent the gradient from dissipating and enhance the training effect. According to the experimental findings, the proposed flame detection model shows an accuracy rate of 96.6%, which is 7.4 percentage points higher than that of the YOLOv5 original model.Additionally, the detection speed of this model is 68 frame/s, and its size is only 15.4 MB. On the basic of significantly improving accuracy, it can also meet the requirements of firefighting robots for real-time and lightweight flame detection.

Key words: flame detection, attention mechanism, feature fusion, YOLOv5 algorithm, boundary loss function