Citrus fruit detection based on an improved YOLOv5 under natural orchard conditions

Authors

  • Yu Tang 1. Academy of Interdisciplinary Studies, Guangdong Polytechnic Normal University, Guangzhou 510665, China
  • Wenxuan Huang 1. Academy of Interdisciplinary Studies, Guangdong Polytechnic Normal University, Guangzhou 510665, China
  • Zhiping Tan 1. Academy of Interdisciplinary Studies, Guangdong Polytechnic Normal University, Guangzhou 510665, China
  • Weilin Chen 2. School of Mechatronics Engineering and Automation, Foshan University, Foshan 528000, Guangdong, China
  • Sheng Wei 3. Engineering Research Center for Intelligent Robotics, Jihua Laboratory, Foshan 528200, Guangdong, China
  • Jiajun Zhuang 4. Academy of Contemporary Agriculture Engineering Innovations, Zhongkai University of Agriculture and Engineering, Guangzhou 510225, China
  • Chaojun Hou 4. Academy of Contemporary Agriculture Engineering Innovations, Zhongkai University of Agriculture and Engineering, Guangzhou 510225, China
  • Jinchang Ren 1. Academy of Interdisciplinary Studies, Guangdong Polytechnic Normal University, Guangzhou 510665, China 5. National Subsea Center, Robert Gordon University, Aberdeen, AB21 0BH, U.K

DOI:

https://doi.org/10.25165/ijabe.v18i3.8935

Keywords:

occluded citrus fruits detection, improved YOLOv5, coordinate attention mechanism, object detection

Abstract

Accurate detection of citrus can be easily affected by adjacent branches and overlapped fruits in natural orchard conditions, where some specific information of citrus might be lost due to the resultant complex occlusion. Traditional deep learning models might result in lower detection accuracy and detection speed when facing occluded targets. To solve this problem, an improved deep learning algorithm based on YOLOv5, named IYOLOv5, was proposed for accurate detection of citrus fruits. An innovative Res-CSPDarknet network was firstly employed to both enhance feature extraction performance and minimize feature loss within the backbone network, which aims to reduce the miss detection rate. Subsequently, the BiFPN module was adopted as the new neck net to enhance the function for extracting deep semantic features. A coordinate attention mechanism module was then introduced into the network’s detection layer. The performance of the proposed model was evaluated on a home-made citrus dataset containing 2000 optical images. The results show that the proposed IYOLOv5 achieved the highest mean average precision (93.5%) and F1-score (95.6%), compared to the traditional deep learning models including Faster R-CNN, CenterNet, YOLOv3, YOLOv5, and YOLOv7. In particular, the proposed IYOLOv5 obtained a decrease of missed detection rate (at least 13.1%) on the specific task of detecting heavily occluded citrus, compared to other models. Therefore, the proposed method could be potentially used as part of the vision system of a picking robot to identify the citrus fruits accurately. Keywords: occluded citrus fruits detection, improved YOLOv5, coordinate attention mechanism, object detection DOI: 10.25165/j.ijabe.20251803.8935 Citation: Tang Y, Huang W X, Tan Z P, Chen W L, Wei S, Zhuang J J, et al. Citrus fruit detection based on an improved YOLOv5 under natural orchard conditions. Int J Agric & Biol Eng, 2025; 18(3): 176–185.

References

Liu Y, Ma X Y, Shu L, Hancke G P, Abu-Mahfouz A M. From industry 4.0 to agriculture 4. 0: Current status, enabling technologies, and research challenges. IEEE Transactions on Industrial Informatics, 2020; 17(6): 4322-4334.

Onishi Y, Yoshida T, Kurita H, Fukao T, Arihara H, Iwai A. An automated fruit harvesting robot by using deep learning. Robomech Journal, 2019; 6: 13.

Tang Y, Dananjayan S, Hou C J, Guo Q W, Luo S M, He Y. A survey on the 5G network and its impact on agriculture: Challenges and opportunities. Computers and Electronics in Agriculture, 2021; 180: 105895.

Wan S H, Goudos S. Faster R-CNN for multi-class fruit detection using a robotic vision system. Computer Networks, 2020; 168: 107036.

Li Z B, Li Y, Yang Y B, Guo R H, Yang J Q, Yue J, et al. A high-precision detection method of hydroponic lettuce seedlings status based on improved Faster RCNN. Computers and Electronics in Agriculture, 2021; 182: 106054.

He Z L, Xiong J T, Chen S M, Li Z X, Chen S F, Zhong Z, et al. A method of green citrus detection based on a deep bounding box regression forest. Biosystems Engineering, 2020; 193: 206-215.

Tu S Q, Pang J, Liu H F, Zhuang N, Chen Y, Zheng C, et al. Passion fruit detection and counting based on multiple scale faster R-CNN using RGB-D images. Precision Agriculture, 2020; 21: 1072-1091.

Tian Y N, Yang G D, Wang Z, Wang H, Li E, Liang Z Z. Apple detection during different growth stages in orchards using the improved YOLO-V3 model. Computers and Electronics in Agriculture, 2019; 157: 417-426.

Wu Y J, Yang Y, Wnag X F, Cui J, Li X Y. Fig fruit recognition method based on YOLO v4 deep learning. In: 2021 18th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON), Chiang Mai, Thailand: IEEE, 2021; pp.303-306. doi: 10.1109/ECTI-CON51831.2021.9454904.

Suo R, Gao F F, Zhou Z X, Fu L S, Song Z Z, Dhupia J, et al. Improved multi-classes kiwifruit detection in orchard to avoid collisions during robotic picking. Computers and Electronics in Agriculture, 2021; 182: 106052.

Liang C X, Xiong J T, Zheng Z H, Zhong Z, Li Z H, Chen S M, et al. A visual detection method for nighttime litchi fruits and fruiting stems. Computers and Electronics in Agriculture, 2020; 169: 105192.

Xia Y, Nguyen M, Yan W Q. A real-time kiwifruit detection based on improved YOLOv7. In: Yan W Q, Nguyen M, Stommel M, editors. Image and Vision Computing. Cham: Springer. 2022; pp.48-61.

Wu D L, Jiang S, Zhao E L, Liu Y L, Zhu H C, Wang W W, et al. Detection of Camellia oleifera fruit in complex scenes by using YOLOv7 and data augmentation. Applied Sciences, 2022; 12(22): 11318.

Chen S M, Xiong J T, Jiao J M, Xie Z M, Huo Z W, Hu W X. Citrus fruits maturity detection in natural environments based on convolutional neural networks and visual saliency map. Precision Agriculture, 2022; 23: 1515-1531.

Wang Z P, Jin L Y, Wang S, Xu H R. Apple stem/calyx real-time recognition using YOLO-v5 algorithm for fruit automatic loading system. Postharvest Biology and Technology, 2022; 185: 111808.

Wang N, Qian T T, Yang J, Li L Y, Zhang Y Y, Zheng X G, et al. An enhanced YOLOv5 model for greenhouse cucumber fruit recognition based on color space features. Agriculture, 2022; 12(10): 1556.

Zhang T, Wu F Y, Wang M, Chen Z Y, Li L Y, Zou X J. Grape-bunch identification and location of picking points on occluded fruit axis based on YOLOv5-GAP. Horticulturae, 2023; 9(4): 498.

Gao F F, Fu L S, Zhang X, Majeed Y, Li R, Karkee M, et al. Multi-class fruit-on-plant detection for apple in SNAP system using Faster R-CNN. Computers and Electronics in Agriculture, 2020; 176: 105634.

Li Z S, Xie W Q, Zhang L Z, Lu S, Xie L, Su H Y, et al. Toward efficient safety helmet detection based on YoloV5 with hierarchical positive sample selection and box density filtering. IEEE transactions on instrumentation and measurement, 2022; 71: 1-14.

Chen W B, Liu M C, Zhao C J, Li X X, Wang Y Q. MTD-YOLO: Multi-task deep convolutional neural network for cherry tomato fruit bunch maturity detection. Computers and Electronics in Agriculture, 2024; 216: 108533.

Nan Y L, Zhang H C, Zeng Y, Zheng J Q, Ge Y F. Intelligent detection of Multi-Class pitaya fruits in target picking row based on WGB-YOLO network. Computers and Electronics in Agriculture, 2023; 208: 107780.

Hou Q B, Zhou D Q, Feng J S. Coordinate attention for efficient mobile network design. In: 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA: IEEE. 2021; pp.13713-13722.

Hu J, Shen L, Albanie S, Sun G, Wu E H. Squeeze-and-excitation networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019; 42(8): 2011-2023.

Woo S, Park J, Lee J-Y, Kweon I S. Cbam: Convolutional block attention module. In: Ferrari V, Hebert M, Sminchisescu C, Weiss Y. editors. Computer Vision - ECCV 2018. Springer. 2018; doi: 10.1007/978-3-030-01234-2_1.

Redmon J, Farhadi A. Yolov3: An incremental improvement. arxiv preprint arxiv: 1804.02767, 2018; In press. doi: 10.48550/arXiv.1804.02767

Wang C Y, Bochkovskiy A, Liao H Y. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In: 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada: IEEE, 2023; pp.7464-7475.

Zhou X, Wang D, Krähenbühl P. Objects as points. arxiv preprint arxiv: 1904.07850. 2019; In press.

Ren S Q, He K M, Girshick R, Sun J. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017; 39(6): 1137-1149.

Downloads

Published

2025-06-30

How to Cite

Tang, Y., Huang, W., Tan, Z., Chen, W., Wei, S., Zhuang, J., … Ren, J. (2025). Citrus fruit detection based on an improved YOLOv5 under natural orchard conditions. International Journal of Agricultural and Biological Engineering, 18(3), 176–185. https://doi.org/10.25165/ijabe.v18i3.8935

Issue

Section

Information Technology, Sensors and Control Systems