Implementation of Deep Learning for Coffee Bean Type Identification Using Convolutional Neural Network Method
DOI:
https://doi.org/10.22303/csrid-.17.3.2025.387-398Keywords:
Deep Learning, Convolutional Neural Network, Xception, Coffee Bean Identification, FlaskAbstract
Indonesia is one of the largest coffee producers in the world, with various types of coffee beans such as Arabica, Robusta, and Liberica. Each type of coffee bean has unique characteristics that influence the taste, aroma, and overall quality of the coffee. However, many people are still unable to visually distinguish between these types of beans. This research aims to develop a Deep Learning-based system using the Convolutional Neural Network (CNN) method with the Xception architecture to identify coffee bean types from images. The dataset was obtained from direct image collection and online sources, then processed through preprocessing and data augmentation stages. The model training process was conducted using transfer learning techniques to improve classification performance. The resulting model is capable of classifying coffee bean images into three main categories with an accuracy 81.63%. The system is implemented as a web interface using Flask, allowing users to upload images of coffee beans and obtain classification results via a website. This study demonstrates that the CNN method with Xception architecture is effective for visual recognition of coffee bean types and can be a solution to help the general public in identifying different coffee bean varieties. This study aims to develop a deep learning–based system using the Convolutional Neural Network (CNN) method with the Xception architecture to identify coffee bean types from images. A total of 600 images of Arabica, Robusta, and Liberica beans were collected from primary and online sources, and then divided into training (80%), validation (10%), and testing (10%) sets. The dataset was processed through image preprocessing and augmentation techniques such as rotation, flipping, zooming, and brightness adjustment to improve model generalization. The training was performed using a transfer learning approach, followed by fine-tuning several deeper layers to enhance feature extraction. Evaluation was conducted using a confusion matrix and F1-score to validate class-wise performance. The model achieved an accuracy of 81.63% using the testing dataset. In practical implementation through a Flask-based website, the system achieved above 90% accuracy for several input angles, indicating strong recognition ability under controlled image conditions. This work demonstrates that the CNN Xception model is effective for visual identification of coffee bean types and can be applied as a practical solution to assist the general public, farmers, and coffee industry practitioners. Future enhancement may include expanding bean classes, optimizing architecture, and real-world testing.
References
LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444.
Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet Classification with Deep Convolutional Neural Networks. Advances in Neural Information Processing Systems, 25, 1097–1105.
Pudji rahardjo. 2012. Kopi. Penebar swadaya grup.
Chollet, F. (2017). Xception: Deep Learning with Depthwise Separable Convolutions. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 1251–1258.
Grinberg, M. (2018). Flask Web Development: Developing Web Applications with Python. O'Reilly Media, Inc.
Sugiyono. (2016). Metode Penelitian Pendidikan: Pendekatan Kuantitatif, Kualitatif, dan R&D. Alfabeta.
Borg, W. R., & Gall, M. D. (1983). Educational Research: An Introduction (4th ed.). Longman.
Shorten, C., & Khoshgoftaar, T. M. (2019). A survey on image data augmentation for deep learning. Journal of Big Data, 6(1), 60.
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
Han, J., Kamber, M., & Pei, J. (2011). Data Mining: Concepts and Techniques (3rd ed.). Morgan Kaufmann.
Tan, C., Sun, F., Kong, T., Zhang, W., Yang, C., & Liu, C. (2019). A survey on deep transfer learning. In International Conference on Artificial Neural Networks (pp. 270–279). Springer.
Brownlee, J. (2020). How to Split Data into Train, Test, and Validation Sets with Python. Machine Learning Mastery.
Szegedy, C., Ioffe, S., Vanhoucke, V., & Alemi, A. (2017). Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning. In AAAI (Vol. 4, No. 1, p. 12).
Howard, J., & Gugger, S. (2017). Fastai: A layered API for deep learning. Information, 11(2), 108.
Kandel, I., & Castelli, M. (2020). Transfer Learning with Convolutional Neural Networks for Diabetic Retinopathy Image Classification: A Review. Applied Sciences, 10(6), 2021.
Han, K., Wang, Y., Chen, H., Chen, X., Guo, J., Liu, Z., ... & Xu, C. (2021). A survey on vision transformer. arXiv preprint arXiv:2012.12556.









