Automated defective green coffee bean image classification using deep learning for quality enhancement and market competitiveness
Hira Lal Gope , Ashutus Singha , Fahim Mahafuz Ruhad , Md Mahin Erpan Chowdhury , Chandra Kanta Dash , Md Masum Billah , Md Mehedi Hasan , Shohag Barman , Hidekazu Fukai
AIMS Agriculture and Food ›› 2025, Vol. 10 ›› Issue (4) : 962 -983.
Coffee is the most widely traded and popular beverage globally, and its flavor and quality depend significantly on the absence of defective beans. This study aimed to automate the identification and classification of impurities in green coffee beans, enabling more uniform roasting, as peaberries roast differently due to their unique shape. The automated system enhances efficiency and precision over manual checks, using 4367 green coffee bean images from Bangladesh, divided into six categories: black, sour, fade, broken, normal, and peaberry. The main contribution of this study is providing the first Bangladesh-origin dataset for coffee bean defect detection, paired with recent YOLOv10-N advances tailored to small, subtle defects. The study took an innovative step forward for Bangladesh’s coffee sector, which has traditionally relied on labor-intensive and error-prone manual sorting methods. This approach addresses key inefficiencies and enhances quality control, boosting global market competitiveness. This study shows that Bangladesh’s coffee industry can benefit from using YOLOv10-N to detect defects in green coffee beans, providing a cost-effective and accurate quality control system. We evaluated the following models: EfficientNet, ResNet-50, Faster R-CNN, and several versions of YOLO (v3-v10). Among them, YOLOv10-N was identified as the most successful model, with the highest precision of 0.992, recall of 0.984, F1-score of 0.987, and mean average precision (mAP) of 0.995; YOLOv8 had precision of 0.959 and recall of 0.944, and ResNet-50 had precision of 0.837 and recall of 0.853. The model’s accuracy and resilience can be further improved by creating a larger and more diverse dataset, which will enable it to better detect subtle differences in defects across batches of green coffee beans under varying environmental conditions.
Arabica / Robusta / normal / peaberry / defective / YOLO
| [1] |
|
| [2] |
García M, |
| [3] |
|
| [4] |
|
| [5] |
|
| [6] |
|
| [7] |
|
| [8] |
|
| [9] |
H Naito et al 2022 IOP Conf. Ser.: Earth Environ. Sci. 1024 012063. Discrimination Between Normal Coffee Beans and Peaberries Using Excitation-Emission Matrix Measured by A Hand-Held Optical System. DOI 10.1088/1755-1315/1024/1/012063. |
| [10] |
|
| [11] |
Peaberry seed (2020) available from: https://coffeebrat.com/peaberry-coffee/. |
| [12] |
Peaberry and regular coffee bean information is available (2020): https://ozonecoffee.co.uk/blogs/coffee-processing-explained/what-is-a-peaberry. |
| [13] |
|
| [14] |
Wintgens JN (Ed.) (2009) Coffee: Growing, processing, sustainable production: A guidebook for growers, processors, traders, and researchers. Wiley-VCH. |
| [15] |
|
| [16] |
|
| [17] |
Peña JM, Gutiérrez PA, |
| [18] |
|
| [19] |
|
| [20] |
|
| [21] |
|
| [22] |
|
| [23] |
|
| [24] |
|
| [25] |
Purwawangsa H, |
| [26] |
|
| [27] |
|
| [28] |
|
| [29] |
|
| [30] |
|
| [31] |
|
| [32] |
|
| [33] |
|
| [34] |
Gulzar Y, Ünal Z, Kızıldeniz T, |
| [35] |
|
| [36] |
Fukai H, Furukawa J, Pinto C, |
| [37] |
|
| [38] |
Types of green coffee bean information (2019) Available from: http://www.zecuppa.com/coffeeterms-bean-defects.htm. |
| [39] |
YOLOv10 model (2024) Available from: https://docs.ultralytics.com/models/yolov10/. |
| [40] |
|
| [41] |
A technical comparison (2025) Available from: https://docs.ultralytics.com/compare/yolov10-vs-yolov9/. |
| [42] |
|
| [43] |
|
| [44] |
|
| [45] |
|
| [46] |
|
/
| 〈 |
|
〉 |