with the collaboration of Iranian Society of Mechanical Engineers (ISME)

Document Type : Research Article

Author

Department of Biosystem Engineering, Gorgan University of Agricultural Sciences and Natural Resources, Gorgan, Iran

10.22067/jam.2025.92068.1339

Abstract

Introduction
The increasing demand for automation in agriculture, particularly for repetitive and labor-intensive tasks, has driven the development of robotic harvesting systems. Recent advances in computer vision, deep learning, and the availability of large image datasets have made it possible to create robust object detection models for agricultural applications. Traditional harvesting methods, such as bulk harvesting, often lead to fruit damage and loss owing to non-selective picking. Selective harvesting, particularly with the use of robotic systems, offers a promising alternative by combining the precision of human labor with the efficiency of automation. This study presents a deep learning-based model for detecting cucumber fruits on plants in a real greenhouse environment, which is an essential step towards developing autonomous harvesting robots that selectively pick ripe cucumbers.
Materials and Methods
A dedicated image dataset was curated in a commercial greenhouse, comprising 300 images of cucumber plants captured under various lighting conditions (morning, noon, and evening), to ensure robustness against real-world variability. Images were manually labeled to identify the cucumber fruits and their pedicels. To enhance the model training and prevent overfitting, data augmentation techniques were applied to the training set. Several architectures of the YOLO (You Only Look Once) object detection algorithm were evaluated, including the nano-scale versions YOLOv5n and YOLOv8n, and the small-scale YOLOv8s, in addition to the RT-DETR model.
The YOLOv8 algorithm is known as one of the state-of-the-art algorithms in computer vision because of its high speed, detection accuracy, and adaptability. The YOLOv8 architecture consists of three main parts: backbone, neck, and head, which are responsible for extracting image features, combining and enriching features, and predicting bounding boxes and object classes, respectively.
These models were trained, and their performances were compared based on the detection accuracy and inference time metrics. Training and evaluation were conducted using a suitable computational platform.
Results and Discussion
The performances of different YOLO models and RT-DETR were rigorously evaluated. The results demonstrated that the YOLOv8n model achieved the highest detection accuracy of 87.5%, surpassing the performances of the other tested models. Importantly, the YOLOv8n model also exhibited a favorable balance between the accuracy and inference time, making it suitable for real-time applications. The analysis considered the trade-off between the number of parameters and detection speed, highlighting the efficiency of YOLOv8n.
The YOLOv8n model demonstrated superior performance in terms of pedicel detection accuracy compared to YOLOv5n, achieving a fitness score of 91.08% (calculated as a weighted average of mAP@50 and mAP@50-95). While exhibiting strong performance in fruit and pedicel detection (Figure 6), the sensitivity of the model for pedicel detection (88.0%) was comparatively lower than that for fruit detection (96.1%). The highest F1 score (0.89) was observed at a confidence level of 39.5%, indicating the effectiveness of the model in balancing the precision and recall for pedicel detection. Overall, YOLOv8n outperformed the other tested models in identifying the class and location of the fruit pedicel. The superior performance of YOLOv8n can be attributed to its architectural advancements and optimized training processes.
Conclusion
This study successfully developed a deep learning-based model for accurate and efficient cucumber fruit detection in a greenhouse environment. The YOLOv8n model demonstrated superior performance compared with the other evaluated architectures, achieving a detection accuracy of 87.5% while maintaining a good processing speed. These findings suggest that the YOLOv8n model has significant potential for integration into autonomous vegetable harvesting robots, contributing to the automation of agricultural processes and increased efficiency in greenhouse operations. Future works should explore further optimization and testing under diverse environmental conditions.

Keywords

Main Subjects

©2025 The author(s). This is an open access article distributed under Creative Commons Attribution 4.0 International License (CC BY 4.0).

  1. Alaaudeen, K. M., Selvarajan, S., Manoharan, H., & Jhaveri, R. H. (2024). Intelligent robotics harvesting system process for fruits grasping prediction. Scientific Reports14(1), 2820. https://doi.org/10.1038/s41598-024-52743-8
  2. Bac, C. W., Van Henten, E. J., Hemming, J., & Edan, Y. (2014). Harvesting robots for high‐value crops: State‐of‐the‐art review and challenges ahead. Journal of Field Robotics, 31(6), 888-911. https://doi.org/10.1002/rob.21525
  3. Bharad, N. B., & Khanpara, B. M. (2024). Agricultural fruit harvesting robot: An overview of digital agriculture. Plant Archives, 24, 154-160. https://doi.org/10.51470/PLANTARCHIVES.2024.v24.SP-GABELS.023
  4. Bochkovskiy, A., Wang, C.-Y., & Liao, H.-Y. M. (2020). Yolov4: Optimal speed and accuracy of object detection. ArXiv Preprint ArXiv:2004.10934. https://doi.org/10.48550/arXiv.2004.10934
  5. Droukas, L., Doulgeri, Z., Tsakiridis, N. L., Triantafyllou, D., Kleitsiotis, I., Mariolis, I., ..., & Bochtis, D. (2023). A survey of robotic harvesting systems and enabling technologies. Journal of Intelligent & Robotic Systems, 107(2), 21. https://doi.org/10.1007/s10846-022-01793-z
  6. FAO. (2023). Food and Agriculture Organization, 2021 Food and Agriculture Data. [Online]. https://www.fao.org/faostat/en/#data/QCL/visualize
  7. Fatehi, F., Bagherpour, H., & Amiri Parian, J. (2025). Investigating the Potential of the Innovative YOLOv8s Model for Detecting Bloomed Damask Roses in Open Fields. Journal of Agricultural Machinery, (in Press). https://doi.org/10.22067/jam.2024.88066.1249
  8. Fernandez, R., Montes, H., Surdilovic, J., Surdilovic, D., Gonzalez-De-Santos, P., & Armada, M. (2018). Automatic detection of field-grown cucumbers for robotic harvesting. IEEE Access, 6, 35512-35527. https://doi.org/10.1109/ACCESS.2018.2851376
  9. Jin, T., & Han, X. (2024). Robotic arms in precision agriculture: A comprehensive review of the technologies, applications, challenges, and future prospects. Computers and Electronics in Agriculture221, 108938. https://doi.org/10.1016/j.compag.2024.108938
  10. Hussain, M. (2024). Sustainable machine vision for industry 4.0: a comprehensive review of convolutional neural networks and hardware accelerators in computer vision. AI, 5(3), 1324-1356. https://doi.org/10.3390/ai5030064
  11. Jocher, G., Chaurasia, A., & Qiu, J. (2023). YOLO by Ultralytics. https://ultralytics.com/yolo
  12. Kootstra, G., Wang, X., Blok, P. M., Hemming, J., & Van Henten, E. (2021). Selective harvesting robotics: current research, trends, and future directions. Current Robotics Reports2, 95-104. https://doi.org/10.1007/s43154-020-00034-1
  13. Kuznetsova, A., Maleva, T., & Soloviev, V. (2020). Using YOLOv3 algorithm with pre-and post-processing for apple detection in fruit-harvesting robot. Agronomy, 10(7), 1016. https://doi.org/10.3390/agronomy10071016
  14. Liu, G., Nouaze, J. C., Touko Mbouembe, P. L., & Kim, J. H. (2020). YOLO-tomato: A robust algorithm for tomato detection based on YOLOv3. Sensors, 20(7), 2145. https://doi.org/10.3390/s20072145
  15. Mahani, S. F. N., & Karami, A. (2023). Maize tassel detection and counting using deep learning techniques. Journal of Agricultural Machinery, 13(2), 175-194. https://doi.org/10.22067/jam.2022.72477.1062
  16. Mallick, P. K. (2022). Evaluating potential importance of cucumber (Cucumis sativus-Cucurbitaceae): a brief review. International Journal of Applied Sciences and Biotechnology, 10(1), 12-15. https://doi.org/10.3126/ijasbt.v10i1.41466
  17. Mehta, S. S., MacKunis, W., & Burks, T. F. (2016). Robust visual servo control in the presence of fruit motion for robotic citrus harvesting. Computers and Electronics in Agriculture, 123, 362-375. https://doi.org/10.1016/j.compag.2016.02.019
  18. Moseley, K. R., House, L., & Roka, F. M. (2012). Adoption of mechanical harvesting for sweet orange trees in Florida: addressing grower concerns on long-term impacts. International Food and Agribusiness Management Review, 15(1030-2016–82762), 83-98. https://doi.org/10.22004/ag.econ.127108
  19. Park, Y., Seol, J., Pak, J., Jo, Y., Kim, C., & Son, H. I. (2023). Human-centered approach for an efficient cucumber harvesting robot system: Harvest ordering, visual servoing, and end-effector. Computers and Electronics in Agriculture, 212, 108116. https://doi.org/10.1016/j.compag.2023.108116
  20. Salim, N. O., & Mohammed, A. K. (2024). Comparative Analysis of Classical Machine Learning and Deep Learning Methods for Fruit Image Recognition and Classification. Traitement du Signal41(3). https://doi.org/10.18280/ts.410322
  21. Shewfelt, R. L., & Prussia, S. E. (2022). Challenges in handling fresh fruits and vegetables. In Postharvest Handling (pp. 167–186). Elsevier. https://doi.org/10.1016/B978-0-12-822845-6.00007-0
  22. Sola-Guirado, R. R., Castro-Garcia, S., Blanco-Roldán, G. L., Gil-Ribes, J. A., & González-Sánchez, E. J. (2020). Performance evaluation of lateral canopy shakers with catch frame for continuous harvesting of oranges for juice industry. International Journal of Agricultural and Biological Engineering, 13(3), 88-93. https://doi.org/10.25165/j.ijabe.20201303.4998
  23. Tajane, K., Khutale, P., Kore, A., Khairmode, A., & Girawale, S. (2024). Object Detection: A comprehensive study of famous Deep Learning approaches with case study of Helmet Detection dataset. In 2024 2nd International Conference on Advancements and Key Challenges in Green Energy and Computing (AKGEC)(pp. 1-5). IEEE. https://doi.org/10.1109/AKGEC60574.2024.10507194
  24. Wu, D., Lv, S., Jiang, M., & Song, H. (2020). 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, 178, 105742. https://doi.org/10.1016/j.compag.2020.105742
  25. Xiao, F., Wang, H., Li, Y., Cao, Y., Lv, X., & Xu, G. (2023). Object detection and recognition techniques based on digital image processing and traditional machine learning for fruit and vegetable harvesting robots: An overview and review. Agronomy13(3), 639. https://doi.org/10.3390/agronomy13030639
  26. Yue, X., Qi, K., Na, X., Zhang, Y., Liu, Y., & Liu, C. (2023). Improved YOLOv8-Seg Network for Instance Segmentation of Healthy and Diseased Tomato Plants in the Growth Stage. Agriculture, 13(8), 1643. https://doi.org/10.3390/agriculture13081643
  27. Zhang, Z., Igathinathane, C., Li, J., Cen, H., Lu, Y., & Flores, P. (2020). Technology progress in mechanical harvest of fresh market apples. Computers and Electronics in Agriculture, 175, 105606. https://doi.org/10.1016/j.compag.2020.105606
  28. Zhou, H., Wang, X., Au, W., Kang, H., & Chen, C. (2022). Intelligent robots for fruit harvesting: Recent developments and future challenges. Precision Agriculture, 23(5), 1856-1907. https://doi.org/10.1007/s11119-021-09836-5
CAPTCHA Image