Document Type : Research Article
Author
Department of Biosystem Engineering, Gorgan University of Agricultural Sciences and Natural Resources, Gorgan, Iran
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
Subjects