A Roasted Coffee Bean Identification Using ResNet50 Model
DOI:
https://doi.org/10.30871/jaic.v9i6.11460Keywords:
Coffee Bean, Coffee roasting, Convolutional Neural Network, Deep learning, Image identificationAbstract
Identification of coffee types after roasting is a major challenge because visual changes make the appearance of coffee beans diverse. Subjective assessment methods are time-consuming, so digital image processing and CNN techniques show potential to solve complex classification problems. This study develops a ResNet50-based CNN model to identify four types of coffee beans (Robusta, Arabica, Excelsa, and Liberica) after roasting and analyzes the effectiveness of pre-processing and augmentation techniques in improving classification performance. The research employed quantitative methodology with three phases: data collection, pre-processing with augmentation, and CNN implementation. The dataset consisted of 2,000 coffee bean images, with 500 images for each class: Arabica, Excelsa, Liberica, and Robusta, ensuring balanced representation across all coffee varieties from a local Indonesian coffee supplier, using smartphone. Preprocessing included normalization and resizing, while augmentation comprised various image transformation techniques. Model performance was evaluated using performance metrics. Results showed an overall accuracy of 94.50%, with Liberica demonstrating exceptional performance (100% precision, 98% recall). Robusta achieved 97% precision and 98% recall, while Arabica showed 86.5% precision with 96% recall. Excelsa achieved 95.6% precision and 86% recall. The model successfully classified 378 out of 400 test samples, with Excelsa representing the primary classification challenge due to visual similarity with other varieties post-roasting. Analysis of misclassifications revealed improved distinction between coffee varieties, with the model demonstrating strong generalization capabilities across all classes. The ResNet50 model successfully identified coffee beans with good accuracy but experienced difficulty distinguishing varieties with similar visual characteristics. Future work should explore improved methods and larger datasets for accuracy.
Downloads
References
[1] A. Zikra and others, “Analisis Potensi Komoditas Kopi Kabupaten/Kota di Indonesia Tahun 2015: Metode Fuzzy C-Medoid Clustering,” J. Agric. Socio-Econ., 2022, doi: 10.33474/jase.v3i1.
[2] A. Pradhana and others, “Fostering Coffee-Minds by Developing Customer Perspective from Simple Public Cupping: Study Case in Bumi Kopi, Malang,” in BIO Web of Conferences, EDP Sciences, Mar. 2025. doi: 10.1051/bioconf/202516507002.
[3] N. Happyana, Y. M. Syah, and E. H. Hakim, “Discrimination of Metabolite Profiles of Gayo Roasted Arabica and Robusta Coffees,” Molekul, vol. 17, no. 1, pp. 98–106, Mar. 2022, doi: 10.20884/1.jm.2022.17.1.5603.
[4] I. Santoso, S. A. Mustaniroh, and A. Choirun, “Methods for quality coffee roasting degree evaluation: A literature review on risk perspective,” in IOP Conference Series: Earth and Environmental Science, IOP Publishing Ltd, Dec. 2021. doi: 10.1088/1755-1315/924/1/012058.
[5] B. R. Santoso, C. A. Sari, and E. H. Rachmawanto, “Coffee Beans Classification Using Convolutional Neural Networks Based On Extraction Value Analysis In Grayscale Color Space.” 2025. [Online]. Available: http://jurnal.polibatam.ac.id/index.php/JAIC
[6] A. E. Ilesanmi and T. O. Ilesanmi, “Methods for image denoising using convolutional neural network: a review,” Complex Intell. Syst., vol. 7, no. 5, pp. 2179–2198, Oct. 2021, doi: 10.1007/s40747-021-00428-4.
[7] E. T. Cortés-Macías, C. F. López, P. Gentile, J. Girón-Hernández, and A. F. López, “Impact of post-harvest treatments on physicochemical and sensory characteristics of coffee beans in Huila, Colombia,” Postharvest Biol. Technol., vol. 187, May 2022, doi: 10.1016/j.postharvbio.2022.111852.
[8] Syafriandi, A. Lubis, R. Fadhil, and O. Paramida, “Characteristics of roasting arabica and robusta coffee beans with rotary cylinder tube roast machine with electric heat source,” in IOP Conference Series: Earth and Environmental Science, Institute of Physics, 2022. doi: 10.1088/1755-1315/1116/1/012032.
[9] I. A. F. Anto, J. W. Wibowo, T. I. Salim, and A. Munandar, “Implementation of Image Processing and CNN for Roasted-Coffee Level Classification,” Indones. J. Electr. Eng. Inform., vol. 12, no. 4, pp. 1005–1018, Dec. 2024, doi: 10.52549/ijeei.v12i4.5531.
[10] D. H. Suryana and W. K. Raharja, “Applying Artificial Intelligence to Classify the Maturity Level of Coffee Beans During Roasting,” 2023, doi: 10.52088/ijesty.v1i4.461.
[11] C. Janiesch, P. Zschech, and K. Heinrich, “Machine learning and deep learning,” 2021, doi: 10.1007/s12525-021-00475-2.
[12] A. Korkmaz, T. Talan, S. Koşunalp, and T. Iliev, “Comparison of deep learning models in automatic classification of coffee bean species,” PeerJ Comput. Sci., vol. 11, 2025, doi: 10.7717/peerj-cs.2759.
[13] M. D. A. Putra, T. S. Winanto, R. Hendrowati, A. Primajaya, and F. D. Adhinata, “A Comparative Analysis of Transfer Learning Architecture Performance on Convolutional Neural Network Models with Diverse Datasets,” Komputika J. Sist. Komput., vol. 12, no. 1, pp. 1–11, May 2023, doi: 10.34010/komputika.v12i1.8626.
[14] E. Firdissa, A. Mohammed, G. Berecha, and W. Garedew, “Coffee Drying and Processing Method Influence Quality of Arabica Coffee Varieties (Coffee arabica L.) at Gomma I and Limmu Kossa, Southwest Ethiopia,” J. Food Qual., pp. 1–8, Jan. 2022, doi: 10.1155/2022/9184374.
[15] M. Nazari and others, “Explainable AI to improve acceptance of convolutional neural networks for automatic classification of dopamine transporter SPECT in the diagnosis of clinically uncertain parkinsonian syndromes,” Eur. J. Nucl. Med. Mol. Imaging, vol. 49, no. 4, pp. 1176–1186, Mar. 2022, doi: 10.1007/s00259-021-05569-9.
[16] A. C. Ramdhana and N. Pratiwi, “Perbandingan Kinerja Model Convolutional Neural Network pada Klasifikasi Kanker Kulit,” Edumatic J. Pendidik. Inform., vol. 7, no. 2, pp. 197–206, Dec. 2023, doi: 10.29408/edumatic.v7i2.19823.
[17] R. A. Mas’ud and J. Zeniarja, “Optimasi Convolutional Neural Networks untuk Deteksi Kanker Payudara menggunakan Arsitektur DenseNet,” Edumatic J. Pendidik. Inform., vol. 8, no. 1, pp. 310–318, Jun. 2024, doi: 10.29408/edumatic.v8i1.25883.
[18] V. Singh and others, “A Hybrid Deep Learning Model for Enhanced Structural Damage Detection: Integrating ResNet50, GoogLeNet, and Attention Mechanisms,” Sensors, vol. 24, no. 22, Nov. 2024, doi: 10.3390/s24227249.
[19] C. Wang and others, “Meta Distant Transfer Learning for Pre-trained Language Models.” Nov. 2021. doi: 10.18653/v1/2021.emnlp-main.768.
[20] M. Xu, S. Yoon, A. Fuentes, and D. S. Park, “A Comprehensive Survey of Image Augmentation Techniques for Deep Learning,” Pattern Recognit., vol. 137, May 2023, doi: 10.1016/j.patcog.2023.109347.
[21] A. K. Ulandari, F. Bimantoro, and I. G. P. S. Wijaya, “Real Time Student Emotion Detection using Yolov5,” Edumatic J. Pendidik. Inform., vol. 8, no. 1, pp. 222–231, Jun. 2024, doi: 10.29408/edumatic.v8i1.25726.
[22] S. Arwatchananukul, D. Xu, P. Charoenkwan, S. A. Moon, and R. Saengrayap, “Implementing a deep learning model for defect classification in Thai Arabica green coffee beans,” Smart Agric. Technol., vol. 9, Dec. 2024, doi: 10.1016/j.atech.2024.100680.
[23] E. Hassan, “Enhancing coffee bean classification: a comparative analysis of pre-trained deep learning models,” Jun. 2024, doi: 10.1007/s00521-024-09623-z.
[24] Y. Nie and others, “An improved CNN model in image classification application on water turbidity,” Sci. Rep., vol. 15, no. 1, Dec. 2025, doi: 10.1038/s41598-025-93521-4.
[25] M. M. Taresh, N. Zhu, T. A. A. Ali, M. Alghaili, A. S. Hameed, and M. L. Mutar, “KL-MOB: automated COVID-19 recognition using a novel approach based on image enhancement and a modified MobileNet CNN,” PeerJ Comput. Sci., vol. 7, pp. 1–23, 2021, doi: 10.7717/PEERJ-CS.694.
[26] W. Juslan and A. H. Muhammad, “Evaluasi Kinerja Metode Peningkatan Kontras (CLAHE & HE) pada Klasifikasi Ras Kucing menggunakan VGG16,” Edumatic J. Pendidik. Inform., vol. 9, no. 1, pp. 246–255, 2025, doi: 10.29408/edumatic.v9i1.29578.
[27] A. Gupta, P. Pawade, and R. Balakrishnan, “Deep Residual Network and Transfer Learning-based Person Re-Identification,” Intell. Syst. Appl., vol. 16, Nov. 2022, doi: 10.1016/j.iswa.2022.200137.
[28] S. R. Sannasi Chakravarthy, N. Bharanidharan, C. Vinothini, V. Vinoth Kumar, T. R. Mahesh, and S. Guluwadi, “Adaptive Mish activation and ranger optimizer-based SEA-ResNet50 model with explainable AI for multiclass classification of COVID-19 chest X-ray images,” BMC Med. Imaging, vol. 24, no. 1, p. 206, Aug. 2024, doi: 10.1186/s12880-024-01394-2.
[29] I. Salehin and D. K. Kang, “A Review on Dropout Regularization Approaches for Deep Neural Networks within the Scholarly Domain,” Jul. 2023, doi: 10.3390/electronics12143106.
[30] S. Sathyanarayanan, “Confusion Matrix-Based Performance Evaluation Metrics,” Afr. J. Biomed. Res., pp. 4023–4031, Nov. 2024, doi: 10.53555/AJBR.v27i4S.4345.
[31] O. Rainio, J. Teuho, and R. Klén, “Evaluation metrics and statistical tests for machine learning,” Sci. Rep., vol. 14, no. 1, Dec. 2024, doi: 10.1038/s41598-024-56706-x.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Aryasatya Muhammad Aqsel, Eko Hari Rachmawanto

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).








