Deep Learning Framework for Coffee Quality Assessment via YOLOv8n Object Detection of Bean Defects

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Maintaining the visual quality of coffee beans is essential for preserving flavor integrity and meeting commercial grading requirements. Conventional inspection methods, which rely on manual evaluation, are subjective, labor-intensive, and inefficient for large-scale processing. This study introduces an automated deep learning framework for coffee bean quality assessment, employing the YOLOv8n object detection architecture to identify and quantify defective beans. A dataset of RGB images, each containing approximately fifty uniformly arranged green coffee beans, was used to train the model for detecting five key defect categories: Broken, Sour, Water_Faded, Immatured, and Black. The trained model achieved strong detection performance, with high accuracy, precision, recall, and mean average precision (mAP), confirming its reliability in both localization and classification. Overall quality grades were derived by calculating the proportion of defect-free beans per image and mapping results to commercial grading standards. To enhance interpretability, Gradient-weighted Class Activation Mapping (Grad-CAM) was applied, generating visual explanations that highlight the region’s most influential in model predictions. The proposed system offers a rapid, objective, and scalable alternative to manual inspection, demonstrating the potential of computer vision and deep learning to modernize quality control in the coffee industry.

Article activity feed