# Improving Moving Insect Detection with Difference of Features Maps in YOLO Architecture
## 4 Conclusions  
This work introduces the motion module, a lightweight component designed to enhance the detection performance of YOLOv8 models by integrating motion information directly at the feature map level. The module operates on feature maps of two consecutive frames, allowing the network to exploit temporal differences and extract motion cues that are not available in static images. This design choice provides dynamic context that helps the network distinguish small insects from the background, specially under real-world conditions where appearance-based cues alone may be insufficient. Additionally, operating  
Figure 14: Detection results on synthetic pests dataset using YOLOv8n enhanced with the proposed motion module. Figure 15: Detection results on synthetic pests dataset using YOLOv8s enhanced with the proposed motion module. at a feature map level helps reduce the impact of lighting variations, compared to methods that rely on frame differencing, such as [29]. Experimental results demonstrate that the motion module can significantly boost performance across the evaluation metrics. Specifically, mAP50 increases by up to 5.11% for YOLOv8n and 2.34% for YOLOv8n; Recall improves by up to 7.83% and 5.38% respectively; Precision sees gains of up to 1.34% and 2.49%; and F1 Score increases by up to 4.33% for YOLOv8n and 2.91% for YOLOv8n. These improvements are achieved when the motion module is inserted between blocks \(B_{2}\) and \(B_{5}\) for YOLOv8n, and between blocks \(B_{2}\) and \(B_{4}\) for YOLOv8s in the network backbone, resulting in a modest increase in computational cost-at most 1.67 GFLOPs for YOLOv8n and 3.96 GFLOPs for YOLOv8s. The results indicate that the motion module is particularly beneficial for lightweight models, such as YOLOv8n, where the integration of motion cues can effectively compensate for limited representational capacity. Moreover, quantitative evaluations under simulated lighting variations (via HSV modifications) reveal that our approach, specifically for YOLOv8n, maintains robust performance with only a minor degradation under challenging illumination conditions. This robustness makes the module practical and reliable for real-world applications, where lighting can vary due to factors such as shadows, cloud cover, and other environmental factors. Additionally, a synthetic dataset of common pests known to affect raspberry plants was introduced. Results obtained on this synthetic dataset show that the proposed motion module is not limited to honeybee detection but can generalize effectively to other insect classes. The inclusion of the motion module consistently improved key detection metrics such as F1 Score and mAP50 for both YOLOv8n and YOLOv8s variants, compared to its corresponding baseline models. Specifically, for YOLOv8n, recall increases by 4.66%, F1 Score improves by 2.66% and mAP50 increases by 3.49%. Regarding YOLOv8s, precision is improved by 1.16%, recall by 1.98%, F1 Score rises by 1.72 percentage points and mAP50 by 3.28 points. This highlights the potential of the proposed approach to enhance object detection performance in tasks involving insects in motion. Future work will explore whether the motion module is object-agnostic, that is, whether it can generalize across detection tasks and architectures without retraining the motion module, offering consistent performance improvements regardless of the type of object being detected. Similarly, we intend to experiment with other feature maps and preprocessing techniques, such as temporal gradients and optical flow. Conceptualization, N.A.-D. and C.V.; methodology, J.G.-A. and J.H.-B. ; software, J.G.-A. and A.G.-C.; validation, J.H.-B.,resources, N.A.-D.; data curation, A.G.-C. and C.V.; writing--original draft preparation, A.G.-C.; visualization, A.G.-C.; project administration, C.L.-F. All authors have read and agreed to the published version of the manuscript. This research received no external funding. Not applicable  
The data are available upon request from the corresponding authors.