# A Flame Detection Algorithm Based on Improved YOLOv7  
[PERSON]  
1 College of Computer Science, Shaanxi Normal University, Xi'an 710119, China; [EMAIL_ADDRESS] (G.Y.); [EMAIL_ADDRESS] (J.G.); [EMAIL_ADDRESS] (S.Z.); [EMAIL_ADDRESS] (R.X.); [EMAIL_ADDRESS] (Z.X.) 1  
[PERSON]  
1 College of Computer Science, Shaanxi Normal University, Xi'an 710119, China; [EMAIL_ADDRESS] (G.Y.); [EMAIL_ADDRESS] (J.G.); [EMAIL_ADDRESS] (S.Z.); [EMAIL_ADDRESS] (R.X.); [EMAIL_ADDRESS] (Z.X.) 1  
[PERSON]  
2 School of International Studies, Shaarxi Normal University, Xi'an 710119, China; [EMAIL_ADDRESS] 2  
[PERSON]  
1 College of Computer Science, Shaanxi Normal University, Xi'an 710119, China; [EMAIL_ADDRESS] (G.Y.); [EMAIL_ADDRESS] (J.G.); [EMAIL_ADDRESS] (S.Z.); [EMAIL_ADDRESS] (R.X.); [EMAIL_ADDRESS] (Z.X.) 1  
[PERSON]  
1 College of Computer Science, Shaanxi Normal University, Xi'an 710119, China; [EMAIL_ADDRESS] (G.Y.); [EMAIL_ADDRESS] (J.G.); [EMAIL_ADDRESS] (S.Z.); [EMAIL_ADDRESS] (R.X.); [EMAIL_ADDRESS] (Z.X.) 1  
[PERSON]  
1 College of Computer Science, Shaanxi Normal University, Xi'an 710119, China; yanguibao@snnu.  
neural networks have strong learning ability, fault tolerance, and fast speed; thus, they are commonly used in image recognition and classification. Currently, the convolutional neural networks (CNNs) used for object detection mainly include region-convolutional neural networks (R-CNN) [4] and YOLO series [5; 6; 7; 8; 9]. Compared with other convolutional neural networks, the YOLO series can better extract global information from images and can be trained end-to-end, which assures them as a more suitable option for flame detection. In recent years, the YOLO series has been developed over many generations [10; 11; 12; 13; 14]. However, current methods have some issues, such as low detection accuracy and high false-negative rate for small target flames, which cannot meet the requirements of flame prevention. YOLOv7 [15] is the latest version of the YOLO series, and in [16], it is proved that the performance of YOLOv7 is obviously better than YOLOv5 and YOLOv6 in the aspect of target detection. In earlier works, YOLOv7 has been applied to safety helmet detection, urban vehicle detection, road damage detection, tree species identification, and vehicle-related distance estimation [16; 17; 18; 19; 20]. In this work, we propose a new flame detection algorithm based on YOLOv7, which is, to our knowledge, the first time that YOLOv7 has been applied in this field. In our algorithm, we replace a convolution of the MP-1 module with the SimAM structure, which is a parameter-free attention mechanism [21]. In this way, the missing detection problem can be improved. Furthermore, we replace a convolution of the ELAN-W module with a ConvNeXt-based CNeB module [22] to improve detection accuracy and the false detection problem in complex environments. Additionally, in order to further the robustness of the algorithm, we construct a self-built data set by combining several publicly available data sets for various application scenarios, and thus it contains sufficient data volume and various complex detection environments. The experimental results demonstrate that our algorithm is distinctly stronger than the original YOLOv7 and YOLOv5 in all performance metrics.  
This paper is structured as follows. In Section 2, we present the background and some related works, and in Section 3, we introduce the improvements of our proposed model based on YOLOv7. Then, we show our experiment design, including data set and performance metrics, in Section 4 and analyze the experiment results in Section 5. Finally, this paper is closed with a conclusion.