## 1 Introduction
Although this method realizes real-time target detection, it suffers from slow speed and large errors in the coordinates of the prediction box for the early stage of fire detection. In this regard, [PERSON] et al. [25] improved YOLOv3 using the EfficientNet method, which facilitates the feature learning of the model and optimizes the detection process for small targets. However, this method ignores the problem of incomplete detection of occluded targets. [PERSON] and [PERSON] [26] fused two independent weakly supervised models, YOLOv5 and EfficientDet, to achieve algorithmic improvement, improving the accuracy and detection speed. But the required huge computation costs lead to the lack of practicality. [PERSON] et al. [27] improved the Tiny-YOLO-V3 model and combined the dense connection to obtain a lightweight YOLO fire detection model with high accuracy, but there is an obvious gap between its real-time performance and the actual industrial requirements. Therefore, conventional deep learning methods for flame detection still suffer from low accuracy, slow speed, and large parameters. Compared to YOLOv5, the most significant improvement of YOLOv7 [28] is the use of the extended efficient layer aggregation network (E-ELAN) as the feature extraction unit, and the addition of auxiliary headers for deep supervision in model training. As the latest YOLOv8 [29] model, the Decoupled-Head is further used to improve the head, while the sample allocation strategy of the model uses the Task-Aligned Assigner from Task-Aligned One-Stage Object Detection (TOOD). They have been successfully applied to many practical image recognition scenarios such as tea bud detection in complex backgrounds [30], smart city fire protection [31], etc. However, during the design of these two models, they do not explicitly consider the recognition speed and complexity of the model, which decreases the compatibility for diverse devices since high configuration parameters are required. In fact, detection accuracy, speed, and model weight metrics have equal status in flame recognition applications, and all three metrics need to be effectively balanced to design appropriate target detection models. More specifically, the core factor that makes it difficult to effectively control fire hazards is the rapid and unpredictable spread of flames, which indicates that the detection model for flame recognition needs to improve its speed as soon as possible on the basis of guaranteeing the detection accuracy so that it can give timely fire warnings. In addition, the complexity metrics of the model directly determine whether the model can be applied to practical flame recognition equipment, but the classical YOLOv7 and YOLOv8 models improve the accuracy of the model somewhat from the angle of sacrificing the complexity and speed. As we know, compared to the classical YOLOv7 and YOLOv8, the detection accuracy of the YOLOv5 is slightly inferior, but it has a certain advantage in detection speed and complexity. More significantly, YOLOv7 and YOLOv8 do not require anchor boxes in the construction mechanism resulting in their inability to be used directly for image centre region localization, which has obvious contradictions in flame detection since the flame-centre region need to be located for effectively fire control. Therefore, this paper utilizes YOLOv5 as the base model to design a detection model that balances these three metrics, instead of YOLOv7 or YOLOv8. A YOLO fire detection algorithm (AEGG-FD) based on an attention-enhanced ghost bottleneck stack, mixed convolutional pyramids, and flame-centre detection is proposed in this paper, which improves the inference speed and accuracy of the YOLOv5 fire detection while ensuring the model is lightweight. The main contributions of our work are listed below: (1) The stacking strategy is used to cascade the Ghost modules and optimize the backbone network structure by combining with the attention mechanism, which enhances the robustness of the network and further achieves a lightweight model volume.