Brilliance: Research of Artificial Intelligence
Vol. 6 No. 2 (2026): Brilliance: Research of Artificial Intelligence, Article Research May 2026

YOLOv8-Based Multi-Class Detection of Coffee Bean Defects and Contaminants for Automated Quality Grading

Sayid Muhammad Jundullah (Malikussaleh University)
Hafizh Al Kautsar Aidilof (Malikussaleh University)
Fadlisyah (Malikussaleh University)



Article Info

Publish Date
29 Jun 2026

Abstract

The quality of coffee beans is a crucial factor in determining export value and compliance with international standards set by the International Coffee Organization (ICO) and Standar Nasional Indonesia (SNI). Traditional manual sorting methods are time-consuming, labor-intensive, and prone to human subjectivity and inconsistency. This study aims to develop an automated coffee bean quality grading system using the YOLOv8s object detection model to accurately identify 20 classes of physical defects and contaminants from static images and automatically calculate the quality grade. A dataset consisting of 2,000 annotated images of Arabica and Robusta coffee beans was collected and divided into training (70%), validation (20%), and testing (10%) sets. The YOLOv8s model was trained using transfer learning with pre-trained weights and data augmentation techniques, then integrated into a web-based application using FastAPI for defect detection and automated defect scoring based on ICO and SNI 01-2907-2008 standards. Experimental results showed that the proposed model achieved a mean Average Precision (mAP@0.5) of 0.75, precision of 0.76, and recall of 0.75. The model performed excellently on distinct classes such as normal beans, large husk fragments, stones, and twigs, while facing challenges in differentiating visually similar defects like variants of black beans and sour beans. This study demonstrates the effectiveness of YOLOv8s for multi-class coffee bean defect detection and provides a practical, scalable, and objective solution for coffee quality assessment, significantly reducing reliance on manual inspection while improving consistency and efficiency in the grading process.

Copyrights © 2026






Journal Info

Abbrev

brilliance

Publisher

Subject

Decision Sciences, Operations Research & Management Mathematics Other

Description

Brilliance: Research of Artificial Intelligence is The Scientific Journal. Brilliance is published twice in one year, namely in February, May and November. Brilliance aims to promote research in the field of Informatics Engineering which focuses on publishing quality papers about the latest ...