Automated coffee roast level classification using machine learning and deep learning models - Rivas, René Ernesto García; Bertarini, Pedro Luiz Lima; Fernandes, Henrique (Wiley, 2025)
The coffee roasting process is a critical factor in determining the final quality of the beverage, influencing its flavour, aroma, and acidity. Traditionally, roast‐level classification has relied on manual inspection, which is time‐consuming, subjective, and prone to inconsistencies. However, advancements in machine learning (ML) and computer vision, particularly convolutional neural networks (CNNs), have shown great promise in automating and improving the accuracy of this process. This study evaluates multiple ML models for coffee roast level classification, including a CNN with Xception as a feature extractor, alongside AdaBoost, random forest (RF), and support vector machine (SVM). The models were trained and tested on a public dataset of 1,600 high‐quality images, balanced across four roast levels: green, light, medium, and dark, to ensure robust performance. Experimental results demonstrate that all models achieved 100 % accuracy and F‐1 scores, confirming their effectiveness in accurately distinguishing roast levels. Furthermore, the proposed approach was compared with previous studies, showing strong performance in roast classification. Image augmentation techniques were applied to improve generalizability in real‐world applications. This research presents a reliable, scalable, and fully automated solution for roast‐level classification, significantly contributing to quality control in the coffee industry. Practical Applications This research offers a reliable and automated way to classify coffee bean roast levels using image analysis and ML. It can help coffee producers and roasters improve quality control by providing faster, more consistent, and objective assessments of roast levels, ultimately ensuring a better product for consumers.
Keywords: 30 Agricultural, Veterinary and Food Sciences; 32 Biomedical and Clinical Sciences; 3006 Food Sciences; 3210 Nutrition and Dietetics; Machine Learning and Artificial Intelligence; Networking and Information Technology R&D (NITRD); Bioengineering; Food Science; Coffee; Deep Learning; Machine Learning; Neural Networks, Computer; Quality Control; Coffea; Support Vector Machine; Food Handling; Seeds; Cooking