Scientific Reports (Nov 2024)

Comparative analysis of YOLO models for green coffee bean detection and defect classification

  • Hira Lal Gope,
  • Hidekazu Fukai,
  • Fahim Mahafuz Ruhad,
  • Shohag Barman

DOI
https://doi.org/10.1038/s41598-024-78598-7
Journal volume & issue
Vol. 14, no. 1
pp. 1 – 16

Abstract

Read online

Abstract The quality and uniformity of green coffee beans significantly influence the overall flavor and value of the product. In the coffee industry, automated flaws and bean-type identification offer numerous advantages. This study examines the effectiveness of multiple YOLO (You Only Look Once) models for identifying and classifying green coffee beans. Various YOLO variants, including YOLOv3, YOLOv4, YOLOv5, YOLOv7, YOLOv8, and custom models, are compared with a focus on computational efficiency, accuracy, and speed. Utilizing a dataset of 4,032 training and 506 testing images encompassing diverse bean types, defects, and lighting conditions, we assessed the performance. The bounding boxes generated by our models accurately encompass coffee beans, with the background typically uniform and set to black. Our analysis reveals the superior performance of the custom-YOLOv8n model, which we meticulously customized for green coffee bean detection. This model achieved high precision, recall, f1-score, and mAP, demonstrating its potential for real-world implementation in coffee bean quality control systems. The customization process involved fine-tuning the model to focus on significant features relevant to green coffee bean detection and employing specific labeling strategies. Customization allows you to fine-tune the model to focus on important features relevant to green coffee bean detection. This sensitivity ensures that the model can effectively distinguish between different bean types and detect even subtle defects. This paper clarifies our primary objective of evaluating YOLO models’ performance in identifying and categorizing green coffee beans, with potential implications for enhancing efficiency and consistency in the coffee industry. A succinct key sentence underscores the benefits of our research for readers seeking efficient YOLO model selection and implementation in agricultural systems.

Keywords