# A Lightweight Fire Detection Algorithm Based on the Improved YOLOv8 Model
## 3 Experiment and Discussion
### Comparison Experiment  
To validate the lightweight effectiveness of the GhostNet backbone, comparative experiments were conducted using mainstream lightweight networks, FasterNet, and HGNetv2. The results are presented in Table 3.  
As shown in the table, introducing FasterNet as the backbone network significantly reduces the number of parameters and FLOPs. However, this reduction in model size comes at the cost of less effective feature extraction compared to the baseline model, resulting in a 0.5 percentage point decrease in the [EMAIL_ADDRESS]. Using HGNetv2 (Hierarchical Geometry Network version 2) as the backbone network also reduces the parameters and FLOPs compared to the baseline model, but the improvements in lightweight performance are not as pronounced as those achieved with GhostNet. Incorporating GhostNet as the backbone network markedly reduces both the number of parameters and the computational complexity while incurring only a minimal loss in accuracy, thereby demonstrating superior lightweight performance. To further validate the effectiveness of the MLCA attention mechanism in fire detection, we conducted comparative experiments with other mainstream attention mechanisms on our custom fire dataset. The results are shown in Table 4.  
As shown in Table 4, the YOLOv8n-MLCA model achieves the highest improvement in mean average precision (mAP) compared to the baseline model. Introducing the SEAttention (Squeeze-and-Excitation Attention, SEAttention) module into the baseline model improves the [EMAIL_ADDRESS] to 81.9%, but the recall rate decreases by 0.6%. The SEAttention module uses global average pooling to capture global features, but this reduces the model's ability to capture detailed features. The CBAM (Convolutional Block Attention Module, CBAM) module includes a dual attention mechanism that computes both channel and spatial attention, resulting in a more complex processing flow. The SimAM (Simple Attention Module, SimAM) module simplifies the attention mechanism by combining linear transformation and dot product operations, avoiding the use of the softmax operation typically employed to compute attention weights. However, this simplification can lead to improper key weight allocation when handling small artifacts. MLCA, on the other hand, employs a multi-level feature fusion mechanism, allowing for the more effective integration of features at different scales. Compared to single-level attention mechanisms, MLCA can more comprehensively capture and utilize feature information. The comparison results indicate that the MLCA module performs best in terms of improving detection accuracy and recall rate, meeting the requirements for practical applications. To further validate the performance of the GCM-YOLO model in fire detection, comparative analyses were conducted using different versions of the YOLO model on the custom dataset. The results are shown in Table 5. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Network** & **YOLOv8n (Baseline)** & **YOLOv8n-SEAttention** & **YOLOv8n-CBAM** & **YOLOv8n-SimAM** & **YOLOv8n-MLCA** \\ \hline [EMAIL_ADDRESS]/\% & 81.7 & 81.9 & 81.8 & 81.6 & 82.0 \\ Recall/\% & 75.8 & 75.2 & 75.3 & 76.0 & 76.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of comparison experiment with different attention mechanisms. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Network** & **[EMAIL_ADDRESS]/\%** & **Recall/\%** & **Parameters** & **FLOPS/G** & **Model Size/MB** \\ \hline YOLOv8n (Baseline) & 81.7 & 75.8 & 3,006,038 & 8.1 & 6.3 \\ YOLOv8n-FasterNet [18] & 81.2 & 76.1 & 2,300,838 & 6.3 & 4.9 \\ YOLOv8n-HGNetv2 [19] & 81.8 & 76.3 & 2,351,290 & 6.9 & 5.0 \\ YOLOv8n-GhostNet & 81.6 & 75.8 & 1,714,466 & 5.0 & 3.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Results of comparison experiment with different lightweight backbone networks.