Improved YOLOv5s-based lightweight detection method for tobacco leaves in complex environments

Authors

  • Yihao Liu College of Engineering, China Agricultural University, Beijing 100083, China
  • Bojin Chen College of Engineering, China Agricultural University, Beijing 100083, China
  • Hengzhi Fan College of Engineering, China Agricultural University, Beijing 100083, China
  • Erdeng Ma Yunnan Academy of Tobacco Agricultural Sciences, Kunming 650021, China
  • Delun Li Guizhou Academy of Tobacco Science, Guiyang 550081, China
  • Xin Wang College of Engineering, China Agricultural University, Beijing 100083, China
  • Du Chen State Key Laboratory of Intelligent Agricultural Power Equipment, Beijing 100083, China

DOI:

https://doi.org/10.25165/ijabe.v18i4.9034

Keywords:

harvesting, object detection, YOLOv5s, tobacco leaves, complex environments

Abstract

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.9034 Citation: 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.

References

Tang Z X, Chen L L, Chen Z B, Fu Y L, Sun X L, Wang B B, et al. Climatic factors determine the yield and quality of Honghe flue-cured tobacco. Scientific Reports, 2020; 10: 19868.

Shen X P, Zhang Y H, Tang Y M, Qin Y F, Liu N, Yi Z L. A study on the impact of digital tobacco logistics on tobacco supply chain performance: Taking the tobacco industry in Guangxi as an example. Industrial Management & Data Systems, 2022; 122(6): 1416–1452.

Martins-da-Silva A S, Torales J, Becker R F V, Moura H F, Waisman Campos M, Fidalgo T M, et al. Tobacco growing and tobacco use. International Review of Psychiatry, 2022; 34(1): 51–58.

Xiang L G, Wang H C, Wang F, Cai L T, Li W H, Hsiang T, et al. Analysis of phyllosphere microorganisms and potential pathogens of tobacco leaves. Frontiers in Microbiology, 2022; 13: 843389.

Xiao B G, Zhu J, Lu X P, Bai Y F, Li Y P. Analysis on genetic contribution of agronomic traits to total sugar in flue-cured tobacco (Nicotiana tabacum L. ). Field Crops Research, 2007; 102(2): 98–103.

Thakur A, Venu S, Gurusamy M. An extensive review on agricultural robots with a focus on their perception systems. Computers and Electronics in Agriculture, 2023; 212: 108146.

Liu L, Ouyang W L, Wang X G, Fieguth P, Chen J, Liu X W, et al. Deep learning for generic object detection: A survey. International Journal of Computer Vision, 2020; 128: 261–318.

Zaidi S S A, Ansari M S, Aslam A, Kanwal N, Asghar M, Lee B. A survey of modern deep learning based object detection models. Digital Signal Processing, 2022; 126: 103514.

Tang Y C, Qiu J J, Zhang Y Q, Wu D X, Cao Y H, Zhao K X, et al. Optimization strategies of fruit detection to overcome the challenge of unstructured background in field orchard environment: A review. Precision Agriculture, 2023; 24: 1183–1219.

Wu D H, Lv S C, Jiang M, Song H B. Using channel pruning-based YOLO v4 deep learning algorithm for the real-time and accurate detection of apple flowers in natural environments. Computers and Electronics in Agriculture, 2020; 178: 105742.

Li Y T, He L Y, Jia J M, Chen J N, Lyu J, Wu C Y. High-efficiency tea shoot detection method via a compressed deep learning model. Int J Agric & Biol Eng, 2022; 15(3): 159–166.

Zhao S L, Zhang S, Lu J M, Wang H, Feng Y, Shi C, et al. A lightweight dead fish detection method based on deformable convolution and YOLOV4. Computers and Electronics in Agriculture, 2022; 198: 107098.

Cao S, Zhao D, Liu X Y, Sun Y P. Real-time robust detector for underwater live crabs based on deep learning. Computers and Electronics in Agriculture, 2020; 172: 105339.

Tang Y C, Chen M Y, Wang C L, Luo L F, Li J H, Lian G P, et al. Recognition and localization methods for vision-based fruit picking robots: A review. Frontiers in Plant Science, 2020; 11: 510.

Xu Z B, Huang X P, Huang Y, Sun H B, Wan F X. A real-time zanthoxylum target detection method for an intelligent picking robot under a complex background, based on an improved YOLOv5s architecture. Sensors, 2022; 22(2): 682.

Zhang W Z, Wang Y F, Shen G C, Li C L, Li M, Guo Y C. Tobacco leaf segmentation based on improved MASK RCNN algorithm and SAM model. IEEE Access, 2023; 11: 103102–103114.

Li G C, Zhen H J, Hao T M, Jiao F Y, Wang D J, Ni K P. Tobacco leaf and tobacco stem identification location detection method based on YOLOV3 network. In: 2021 IEEE International Conference on Artificial Intelligence and Computer Applications (ICAICA), Dalian, China: IEEE, 2021; 29–31. doi: 10.1109/ICAICA52286.2021.9497964

Harjoko A, Prahara A, Supardi T W, Candradewi I, Pulungan R, Hartati S. Image processing approach for grading tobacco leaf based on color and quality. International Journal on Smart Sensing and Intelligent Systems, 2019; 12(1): 1–10.

Zhu H Y, Cen H Y, Zhang C, He Y. Early detection and classification of tobacco leaves inoculated with tobacco mosaic virus based on hyperspectral imaging technique. In: 2016 ASABE Annual International Meeting, Michigan: American Society of Agricultural and Biological Engineers, 2016; 162460422. doi: 10.13031/aim.20162460422

Lin H, Tse R, Tang S K, Qiang Z P, Ou J L, Pau G. Tobacco plant disease dataset. In: Fourteenth International Conference on Digital Image Processing (ICDIP 2022). Wuhan, China: SPIE, 2022. doi: 10.1117/ 12.2644288

Zhu H Y, Chu B Q, Zhang C, Liu F, Jiang L J, He Y. Hyperspectral imaging for presymptomatic detection of tobacco disease with successive projections algorithm and machine-learning classifiers. Scientific Reports, 2017; 7(1): 4125.

Tufail M, Iqbal J, Tiwana M I, Alam M S, Khan Z A, Khan M T. Identification of tobacco crop based on machine learning for a precision agricultural sprayer. IEEE access, 2021; 9: 23814–23825.

Wang T, Zhang K M, Zhang W, Wang R Q, Wan S M, Rao Y, et al. Tea picking point detection and location based on Mask-RCNN. Information Processing in Agriculture, 2023; 10(2): 267–275.

Cardellicchio A, Solimani F, Dimauro G, Petrozza A, Summerer S, Cellini F, et al. Detection of tomato plant phenotyping traits using YOLOv5-based single stage detectors. Computers and Electronics in Agriculture, 2023; 207: 107757.

Ma J, Lu A, Chen C, Ma X D, Ma Q C. YOLOv5-lotus an efficient object detection method for lotus seedpod in a natural environment. Computers and Electronics in Agriculture, 2023; 206: 107635.

Wang F, Sun Z X, Chen Y, Zheng H, Jiang J. Xiaomila green pepper target detection method under complex environment based on improved YOLOv5s. Agronomy, 2022; 12(6): 1477.

Qiu S J, Li Y, Zhao H M, Li X B, Yuan X Y. Foxtail millet ear detection method based on attention mechanism and improved YOLOv5. Sensors, 2022; 22(21): 8206.

Ho M J, Lin Y C, Hsu H C, Sun T Y. An Efficient recognition method for watermelon using faster R-CNN with post-processing. In: 2019 8th International Conference on Innovation, Communication and Engineering (ICICE), Zhengzhou, China: IEEE, 2019; pp.86–89. doi: 10.1109/ ICICE49024.2019.9117374

Li X, Pan J D, Xie F P, Zeng J P, Li Q, Huang X J, et al. Fast and accurate green pepper detection in complex backgrounds via an improved Yolov4tiny model. Computers and Electronics in Agriculture, 2021; 191: 106503.

Liu W Y, Ren G F, Yu R S, Guo S, Zhu J, Zhang L K, et al. Imageadaptive YOLO for object detection in adverse weather conditions. Proceedings of the AAAI Conference on Artificial Intelligence. 2022; 36(2): 1792–1800. doi: 10.1609/aaai.v36i2.20072

Jiang F C, Zhang H Y, Feng C W, Chen Z. A closed-loop detection algorithm for indoor simultaneous localization and mapping based on you only look once v3. Traitement du Signal, 2022; 39(1): 109–117.

Rahim U F, Mineno H. Data augmentation method for strawberry flower detection in non-structured environment using convolutional object detection networks. Journal of Agricultural and Crop Research, 2020; 8(11): 260–271.

Liu Q L, Ye H X, Wang S M, Xu Z. YOLOv8-CB: Dense pedestrian detection algorithm based on in-vehicle camera. Electronics, 2024; 13(1): 236.

Du H W, Zhu W Z, Peng K, Li W F. Improved high speed flame detection method based on YOLOv7. Open Journal of Applied Sciences, 2022; 12: 2004–2018.

Sandler M, Howard A, Zhu M, Zhmoginov A, Chen L C. Mobilenetv2: Inverted residuals and linear bottlenecks. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA: IEEE, 2018; pp.4510–4520. doi: 10.1109/CVPR.2018.00474

Liu Z, Li J G, Shen Z Q, Huang G, Yan S M, Zhang C S, et al. Learning efficient convolutional networks through network slimming. In: 2017 IEEE International Conference on Computer Vision (ICCV), Venice, Italy: IEEE, 2017; pp.2755–2763. doi: 10.1109/ICCV.2017.298

Gou J P, Yu B S, Maybank S J, Tao D C. Knowledge distillation: A survey. International Journal of Computer Vision, 2021; 129: 1789–1819.

Downloads

Published

2025-08-21

How to Cite

Liu, Y., Chen, B., Fan, H., Ma, E., Li, D., Wang, X., & Chen, D. (2025). Improved YOLOv5s-based lightweight detection method for tobacco leaves in complex environments. International Journal of Agricultural and Biological Engineering, 18(4), 229–238. https://doi.org/10.25165/ijabe.v18i4.9034

Issue

Section

Information Technology, Sensors and Control Systems