Abstract:Real-time and high-precision detection of smoke and fire is of great significance for fire monitoring and rapid early warning. Addressing the challenge that the current detection methods have difficulty balancing accuracy and real-time performance, as well as the problem of high computational complexity, this paper proposes a refined YOLOv5s smoke and fire detection method. Firstly, the Neck structure was optimized. On the basis of the original FPN-PAN architecture, it adds an additional P6 feature detection layer targeting smaller scales. Then, it enhances the network’s multi-scale feature fusion capability and improve the recognition and localization accuracy for small objects. Secondly, a lightweight modification was applied to the C3 module within the backbone network. C3 modules were replaced with C3RepGhost modules based on structural re-parameterization, effectively reducing the computational load and accelerating the inference process. Furthermore, a large-scale smoke and fire dataset is conducted and it consists of approximately 18 000 images from diverse scenes (including urban streets, forests, and individual flames) for model training and validation. Experimental results demonstrate that the proposed method achieves a mean average precision (mAP) of 0.89 on the above dataset, with an improvement of approximately 29% compared to the original YOLOv5s model. The detection speed reaches 66 fps. The proposed method realizes high-accuracy and real-time smoke and fire detection. Compared to the latest YOLOv11s model, the computational complexity of the refined YOLOv5s method is reduced by 46%, making it more suitable for deployment on edge computing devices.