# Multi-Target Detection Algorithm for Fusion Images Based on an Attention Mechanism
## 5 Experiments Results
### Comparison of Detection Results  
In order to verify that the three optimization strategies of adding a small-target detection layer, adding a GAM attention mechanism and improving the loss function can bring performance gains to the model, this section compares the detection effects of the improved network and the unimproved network. The experimental results are shown in Table 5.  
Table 5 presents six experiments. The first uses the original YOLOv8 model as a baseline. In the second experiment, the default CIoU loss is replaced with WIoU, leading to slightly decreased precision but improved recall, F1-score, and both mAP and mAP50-95. Experiment 3 adds the GAM attention module while retaining WIoU; this results in a marginal increase in recall and F1-score, but a slight drop in precision and mAP metrics.  
Figure 19: The network’s indicator changes on the validation set.  
Figure 18: Loss change curve.  
Experiment 4 replaces attention with a small-target detection layer, significantly boosting precision, recall, and mAP, indicating the layer's effectiveness in enhancing small-object detection. Experiment 5 combines all three components, WIoU, GAM attention, and the small-target detection layer, achieving the highest values in mAP, mAP50-95, recall, and F1-score, despite a modest trade-off in precision. The sixth experiment trains the original YOLOv5 model as a reference point, which underperforms compared to all YOLOv8 variants, particularly in recall and mAP50-95.  
Although each component may only provide limited improvement when used alone, the full combination in Experiment 5 achieves the best overall performance, particularly in terms of mAP50-95, which is a more comprehensive indicator of localization accuracy across different IoU thresholds. This demonstrates that the proposed components, GAM attention, WIoU loss, and the small-object detection layer, are complementary and synergistic when integrated.  
To visually illustrate the improvements, nine representative image groups from the test set were selected. For each group, the top image shows detection results from  
As shown in the figure, the comparison includes a total of nine image groups, arranged in three rows with three groups per row and numbered from Group 1 to Group 9.  
In Groups 1-6, the number of detectable targets is relatively small. In most cases, both the original and improved detection models successfully identify the key targets. However, in Groups 1, 2, and 4, the original model fails to detect targets located near the image edges and performs poorly on partially visible objects. Although the improved model enhances detection performance in these scenarios, it misses the motorcycle target in Group 2. Groups 7-9 contain a larger number of targets, many of which are occluded, small in size, and occupy only a small portion of the image. While both models detect most targets, some remain undetected. Nevertheless, the improved model consistently identifies more targets than the original.  
Overall, the enhanced detection algorithm exhibits superior performance compared to the original model.