Grading of Specialty-Grade Coffea arabica Beans Using Digital Imaging and Machine Learning

Abstract The specialty coffee industry relies heavily on manual grading to maintain the ultimate cupping quality of the specialty coffee. This is a subjective and costly process, as this grading is performed by skilled labor. Therefore, this study aims to evaluate the potential of computer vision and machine learning approaches to classify green coffee beans into specialty and defective categories. In this regard, two traditional machine learning models, including random forest (RF) and support vector classifier (SVC), and three deep learning models, including a custom lightweight Convolutional Neural Network (CNN), MobileNetV2, and MobileNetV3, were evaluated on this task. Model performances were assessed using accuracy, precision, recall, F1-score, learning curves, Grad-CAM visualization, and precision-recall analysis. According to the results, the traditional machine-learning models achieved classification accuracies of 98% with RF and 95% with SVC. Similarly, the deep-learning models achieved accuracy values of 99.6% with the lightweight custom CNN, 99.6% with MobileNetV2, and 98.7% with MobileNetV3. Moreover, inference time was tested on a Raspberry Pi 5 to assess the feasibility of real-time deployment capabilities of the models on low-cost edge devices. The results demonstrated ultra-fast inference time of 0.155 ms with SVC compared to RF (1.226 ms). Similarly, average inference time for deep learning models demonstrated 94.811 ms for CNN with custom architecture, 125.144 ms with MobileNetV2, and 115.86 ms with MobileNetV3. Furthermore, this inference time was reduced significantly after the conversion of the models to a TFLite model. Based on overall evaluations of the models, the lightweight CNN with a custom architecture outperformed, maintaining consistent inference time and strong feature interpretability with generalized performance.

Authors

Institutions

Publication Details

Journal
Food Analytical Methods
Published
2026-01-01
DOI
https://doi.org/10.1007/s12161-025-02961-1
Citations
1
Primary Topic
Coffee research and impacts
Type
article
Field-Weighted Citation Impact
32.57
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Grading of Specialty-Grade Coffea arabica Beans Using Digital Imaging and Machine Learning

Azlan Zahid, Mazhar Sher, Maitiniyazi Maimaitijiang, Chamika Kuruppuarachchi et al.
1 citations
Food Analytical Methods
Coffee research and impacts
32.57
article

Grading of Specialty-Grade Coffea arabica Beans Using Digital Imaging and Machine Learning

Azlan Zahid, Mazhar Sher, Maitiniyazi Maimaitijiang, Chamika Kuruppuarachchi, Muhammad Roman, K. S. P. Amaratunga
article en
1 citations

Abstract

Abstract The specialty coffee industry relies heavily on manual grading to maintain the ultimate cupping quality of the specialty coffee. This is a subjective and costly process, as this grading is performed by skilled labor. Therefore, this study aims to evaluate the potential of computer vision and machine learning approaches to classify green coffee beans into specialty and defective categories. In this regard, two traditional machine learning models, including random forest (RF) and support vector classifier (SVC), and three deep learning models, including a custom lightweight Convolutional Neural Network (CNN), MobileNetV2, and MobileNetV3, were evaluated on this task. Model performances were assessed using accuracy, precision, recall, F1-score, learning curves, Grad-CAM visualization, and precision-recall analysis. According to the results, the traditional machine-learning models achieved classification accuracies of 98% with RF and 95% with SVC. Similarly, the deep-learning models achieved accuracy values of 99.6% with the lightweight custom CNN, 99.6% with MobileNetV2, and 98.7% with MobileNetV3. Moreover, inference time was tested on a Raspberry Pi 5 to assess the feasibility of real-time deployment capabilities of the models on low-cost edge devices. The results demonstrated ultra-fast inference time of 0.155 ms with SVC compared to RF (1.226 ms). Similarly, average inference time for deep learning models demonstrated 94.811 ms for CNN with custom architecture, 125.144 ms with MobileNetV2, and 115.86 ms with MobileNetV3. Furthermore, this inference time was reduced significantly after the conversion of the models to a TFLite model. Based on overall evaluations of the models, the lightweight CNN with a custom architecture outperformed, maintaining consistent inference time and strong feature interpretability with generalized performance.

Food Analytical MethodsVol. 19(1)
University of Peradeniya (LK), Texas A&M University System (US), South Dakota State University (US)
Decent work and economic growth
Openalex Percentile: Top 2%
Coffee research and impacts
32.57
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.