Open Access iconOpen Access

ARTICLE

KN-YOLOv8: A Lightweight Deep Learning Model for Real-Time Coffee Bean Defect Detection

Tesfaye Adisu Tarekegn1,*, Taye Girma Debelee1,2

1 Robotics Research Division, Ethiopian Artificial Intelligence Institute, Addis Ababa, P.O. Box 40782, Ethiopia
2 Department of Computer Engineering, Addis Ababa Science and Technology University, Addis Ababa, P.O. Box 120611, Ethiopia

* Corresponding Author: Tesfaye Adisu Tarekegn. Email: email

Journal on Artificial Intelligence 2025, 7, 585-613. https://doi.org/10.32604/jai.2025.067333

Abstract

The identification of defect types and their reduction values is the most crucial step in coffee grading. In Ethiopia, the current coffee defect investigation techniques rely on manual screening, which requires substantial human resources, time-consuming, and prone to errors. Recently, the deep learning driven object detection has shown promising results in coffee defect identification and grading tasks. In this study, we propose KN-YOLOv8, a modified You Only Look Once version-8 (YOLOv8) model optimized for real-time detection of coffee bean defects. This lightweight network incorporates effective feature fusion techniques to accurately detect and locate defects, even among overlapping beans. We have compiled a custom dataset of 562 images comprising thirteen distinct types of defects. The model achieved exceptional performance, with training dataset metrics of 97% recall, 100% precision, and 98% mean average precision(mAP). On the test dataset, it maintained outstanding results with 99% recall, 100% precision, and 98.9% mAP. The model outperforms existing approaches by achieving a 97.7% mAP for all classes at a 0.5 threshold, while maintaining an optimal precision-recall balance. The model outperforms new approaches by achieving a balance between precision and recall, achieving a mean average precision of 97.7% for all classes. This solution significantly reduces reliance on labor-intensive manual inspection while improving accuracy. Its lightweight design and high speed make it suitable for real-time industrial applications, transforming coffee quality inspection.

Keywords

KN-YOLOv8; coffee-bean; lightweight model; defect detection; optimization

Cite This Article

APA Style
Tarekegn, T.A., Debelee, T.G. (2025). KN-YOLOv8: A Lightweight Deep Learning Model for Real-Time Coffee Bean Defect Detection. Journal on Artificial Intelligence, 7(1), 585–613. https://doi.org/10.32604/jai.2025.067333
Vancouver Style
Tarekegn TA, Debelee TG. KN-YOLOv8: A Lightweight Deep Learning Model for Real-Time Coffee Bean Defect Detection. J Artif Intell. 2025;7(1):585–613. https://doi.org/10.32604/jai.2025.067333
IEEE Style
T. A. Tarekegn and T. G. Debelee, “KN-YOLOv8: A Lightweight Deep Learning Model for Real-Time Coffee Bean Defect Detection,” J. Artif. Intell., vol. 7, no. 1, pp. 585–613, 2025. https://doi.org/10.32604/jai.2025.067333



cc Copyright © 2025 The Author(s). Published by Tech Science Press.
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 131

    View

  • 29

    Download

  • 0

    Like

Share Link