YOLOV8-POWERED COMPUTER VISION FOR COFFEE CHERRY RIPENESS, DEFECT, AND MORPHOLOGICAL ASSESSMENTMEXICO’S POTENTIAL
DOI:
https://doi.org/10.47163/agrociencia.v60i3.3485Keywords:
ViT-CNN feature extraction, smart sorting systems, Sustainable agriculture, computer vision, deep learningAbstract
The present investigation describes an advanced multi-task deep learning framework for automated inspection of coffee cherry quality using YOLOv8 with color-based segmentation and Vision Transformer-Convolutional Neural Network (ViT-CNN) feature extraction. The model performs ripeness stage classification, defect detection, and size and shape analysis. For ripeness detection, YOLOv8 was enhanced with a color segmentation module, achieving class-wise accuracies of 90–95 % for unripe, partially ripe, and fully ripe cherries, with moderate performance (85 %) for overripe samples. ViT-CNN feature maps improved segmentation clarity and bounding-box localization, particularly in high-density clusters. Defect detection was carried out across five categories (healthy, blackened, moldy, wrinkled, and insect-damaged), achieving F1-score values between 0.88 and 0.96 and mean average precision at 50 % intersection over union (mAP@50) values above 0.97 for key defect classes after 150 training epochs. Quantitative evaluation of morphological characteristics for size and shape assessment further demonstrated model robustness, with insect-damaged cherries reaching a contour accuracy of 0.98 and an Intersection over Union (IoU) of 0.96. Comparative analysis with YOLOv5 and Faster Region-Based Convolutional Neural Network (Faster R-CNN) showed superior performance of the proposed architecture across all metrics, including precision, recall, F1-score, and mAP. By incorporating contextual embeddings and attention mechanisms, the framework enables accurate, real-time sorting for smart agricultural systems.
Additional Files
Published
Issue
Section
License
Agrociencia is published every 45 days, in an English format, and it is edited by the Colegio de Postgraduados. Mexico-Texcoco highway Km. 36.5, Montecillo, Texcoco, Estado de México, CP 56264, Telephone (52) 5959284427. www.colpos.mx. Editor-in-Chief: Dr. Fernando Carlos Gómez Merino. Rights Reserved for Exclusive Use: 04-2021-031913431800-203, e-ISSN: 2521-9766, granted by the National Institute for Author Right.








