The identification of defect types and their reduction values are 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.