Improved YOLOv5s-based lightweight detection method for tobacco leaves in complex environments - Liu, Yihao; Chen, Bojin; Fan, Hengzhi; Ma, Erdeng; Li, Delun; Wang, Xin; Chen, Du (International Journal of Agricultural and Biological Engineering, 2026)
Complex environments featuring variable lighting and backgrounds similar in color to the target objects present challenges for the rapid and accurate detection of tobacco leaves, which is critical for the development of automated tobacco leaf harvesting robots. This study introduces a depth filtering approach to filter out complex regions based on distance information, thereby simplifying the detection task, and proposes a lightweight detection method based on an enhanced YOLOv5s model. Initially, the YOLOv5s backbone network is substituted with a more lightweight MobileNetV2 to reduce the model size. Subsequently, sparse model training combined with the scaling factor distribution rules of batch normalization layers is utilized to identify and eliminate inconsequential neural network channels. Finally, fine-tuning and knowledge distillation techniques are employed to achieve a model accuracy close to the YOLOv5s baseline. Experimental results indicate that the depth filtering method can improve the model’s precision, recall, and mean Average Precision (mAP) by 11.2%, 29.6%, and 17.1%, respectively. The optimized lightweight model achieves a precision of 91.1%, a recall of 90.8%, and an mAP of 91.6%, with a memory footprint of only 1.4MB. It delivers a detection frame rate of 112 fps on desktop computers and 21 fps on mobile devices, which is approximately 3.5 and 4 times faster, respectively, compared to the baseline YOLOv5s tobacco leaf detection model. The precision, recall, and mAP experience a marginal decrease of 3.8, 1.6, and 2.8 percentage points, respectively, while the memory consumption is merely 10% of the pre-optimization amount. In summary, the proposed method enables the accurate detection of tobacco leaves against near-color backgrounds. Simultaneously, it achieves effective lightweighting of the model without compromising its performance, thereby providing technical support for deploying tobacco leaf detection on mobile platforms. Keywords: harvesting, object detection, YOLOv5s, tobacco leaves, complex environments DOI: 10.25165/j.ijabe.20251804.9034Citation: Liu Y H, Chen B J, Fan H Z, Ma E D, Li D L, Wang X, et al. Improved YOLOv5s-based lightweight detection method for tobacco leaves in complex environments. Int J Agric & Biol Eng, 2025; 18(4): 229–238.