Introduction To address the problems of low detection accuracy, severe background interference, and poor real-time performance existing in current object detection models in complex agricultural monitoring scenarios, we proposed Focal-HAIN (F-HAIN), a lightweight object detection model tailored for embedded platforms. Methods Built on the YOLOv5 architecture with design insights from RT-DETR, the proposed model incorporates two key structural enhancements to improve multi-scale feature representation and localization precision. Firstly, focus modulation was integrated into the neck network, and the F-SPPELAN module was designed to achieve adaptive and precise modulation of the feature channel based on the focus loss-guided attention mechanism. This effectively suppresses background noise and enhances the model’s response to small targets. Secondly, the HAIN module was constructed. By introducing a deep interlacing fusion strategy, feature interaction operations within the scale are embedded into the cross-scale feature aggregation path, thereby enhancing the correlation among multi-scale features and improving positioning accuracy. This study conducted comprehensive experiments on the IP102 dataset and deployed the model on a Raspberry Pi 4B embedded device for real-time performance verification. Results The experimental results show that the mAP50 of F-HAIN can reach 90.1%. Under the same experimental conditions, compared with models such as RT-DETR, YOLOv5, YOLOv8, YOLOv10, and YOLOv11, the performance of F-HAIN on mAP50 increased by 5.5%, 6.8%, 4.9%, 5.4%, and 3.0%, respectively. Meanwhile, F-HAIN maintains a high-speed inference of 161 FPS on a high-performance workstation and was successfully deployed in an IoT-based collaborative system where a Raspberry Pi 4B serves as the edge acquisition terminal. Discussion These findings demonstrate that F-HAIN effectively balances high detection accuracy with computational efficiency, providing a robust and deployable solution for real-time agricultural monitoring on resource-constrained edge devices.
Liu et al. (Wed,) studied this question.