Abstract
This paper proposes a real-time lightweight fire flame detection algorithm based on improved YOLOv8n to promptly assess fire situations and minimize losses. The algorithm is integrated into an automated water cannon system to aid firefighting efforts. The optimization focuses on the YOLOv8n backbone, where the Bottleneck in the C2f module is replaced with FasterNet Block and EMA attention is proposed. This enhances the network's ability to capture fire features in various scenarios, improving accuracy in recognizing flames. Additionally, a lightweight Slim-Neck structure reduces computational complexity and parameters, suitable for embedded deployment. The Wise-Shape-FocalerIoU loss function further accelerates convergence. Experiments show the improved algorithm increased the precision rate by 1.2%, the mAP50 reached 99.2%, and the recall rate increased by 3.4%. Meanwhile, the amount of parameters is reduced by 19% and the GFLOPs are reduced by 1.8. This algorithm achieves lightweight processing while maintaining accuracy, providing strong technical support for fire safety.