CERESResearch Repository

Automated coffee roast level classification using machine learning and deep learning models

Loading...
Thumbnail Image

Date published

Free to read from

2025-10-02

Supervisor/s

Industry supervisor/s

Journal Title

Journal ISSN

Volume Title

Publisher

Department

Course name

ISSN

0022-1147

Format

Citation

Rivas REG, Bertarini PLL, Fernandes H. (2025) Automated coffee roast level classification using machine learning and deep learning models. Journal of Food Science, Volume 90, Issue 9, September 2025, Article number e70532

Abstract

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.

Description

Software description

Software language

Git repository

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

DOI

Rights

Attribution 4.0 International

Funder/s

This study was financed in part by the Coordenação de Aperfeiçoamentode Pessoal de Nível Superior—Brazil (CAPES), 00x0ma614.

Grant number

Relationships

Resources