Open Access
ARTICLE
KN-YOLOv8: A Lightweight Deep Learning Model for Real-Time Coffee Bean Defect Detection
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:
Journal on Artificial Intelligence 2025, 7, 585-613. https://doi.org/10.32604/jai.2025.067333
Received 30 April 2025; Accepted 03 November 2025; Issue published 01 December 2025
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
Cite This Article
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.


Submit a Paper
Propose a Special lssue
View Full Text
Download PDF
Downloads
Citation Tools