An Explainable Deep Learning Framework for Agtron-Based Coffee Roast Classification Using Grad-CAM

Authors

DOI:

https://doi.org/10.58190/icisna.2025.139

Keywords:

Coffee Roast Classification, Deep Learning, DenseNet201, Grad-CAM, Quality Control

Abstract

Precise control of the roasting process is a critical determinant of coffee quality, as it governs the chemical transformations that define aroma and flavor profiles. However, traditional quality assessment methods typically rely on subjective manual inspection or expensive colorimetric devices, which are often prone to inconsistency or limited by high operational costs. To address these challenges, this study proposes a robust, automated computer vision framework for fine-grained coffee roast classification based on the Agtron color scale. We utilized a dataset comprising five distinct roast levels (Green, Light, Medium, Dark, and Overbaking) to evaluate the performance of state-of-the-art Convolutional Neural Network architectures, including VGG16, ResNet50, DenseNet201, MobileNetV2, InceptionV3 and Xception. To ensure statistical reliability, all models were trained and tested using a 5-fold cross-validation strategy. Experimental results demonstrated that DenseNet201 achieved superior performance, recording a classification accuracy of 99.84% and an F1-score of 0.9984, outperforming other architectures in both stability and precision. Furthermore, to validate the model's reliability, we employed Gradient-weighted Class Activation Mapping, which visually confirmed that the network focuses on discriminative bean features, such as surface texture and oil expression, rather than background artifacts. These findings indicate that deep learning-based visual inspection can serve as a highly accurate, non-destructive, and cost-effective solution for real-time quality control in the coffee industry.

Author Biography

Murat KOKLU, Department of Computer Engineering, Technology Faculty, Selcuk University, Konya, Türkiye

Murat KOKLU was born in Konya, TURKEY in 1979. He received B.Sc. degrees in Computer System Teaching in 2002 and Computer Engineering in 2019 from the Selcuk University. He received M.Sc. and Ph.D degrees from Selcuk University, Departments of Electronics and Computer Sciences, and Computer Engineering, in 2005 and 2014 respectively. He has been working as an Assistant Professor in the Department of Computer Engineering at Selcuk University. His current research interests include image processing, data mining and artificial intelligence.

Downloads

Published

2025-12-14

How to Cite

ARAS, H. H., ERYESIL, Y., & KOKLU, M. (2025). An Explainable Deep Learning Framework for Agtron-Based Coffee Roast Classification Using Grad-CAM. Proceedings of International Conference on Intelligent Systems and New Applications, 3, 51–57. https://doi.org/10.58190/icisna.2025.139