Visual Segmentation and Classification of Coffee Beans After Roasting
DOI:
https://doi.org/10.30871/jaic.v9i4.9758Keywords:
Coffee Bean, Roasting Level, Image Segmentation, Image Classification, Deep LearningAbstract
This research aims to develop an image-based system for segmenting and classifying coffee beans after roasting using deep learning. A U-Net architecture was applied to isolate coffee beans from the background with high spatial accuracy, achieving a mean Intersection over Union (IoU) of 0.8833 and Dice Coefficient of 0.9375. The segmented images were then classified into six roasting levels green, light, light to medium, medium, medium to dark, and dark using a modified ResNet-50 model, which reached an overall classification accuracy of 86%. The system demonstrates strong performance for clear categories but shows overlapping predictions for visually similar classes such as “medium” and its neighboring levels, indicating that boundaries between roasting stages can be ambiguous. This study provides an objective and automated alternative for roast quality inspection, reducing reliance on subjective human assessment. However, to meet industrial standards, further improvements are needed, such as integrating additional image features or ensemble models to increase discrimination power. This two-stage system serves as a promising foundation for future developments in automated coffee quality control.
Downloads
References
[1] A. Taslim, S. Sudin, M. Dzikrullah Suratin Identifikasi Mutu Roasting Biji Kopi Menggunakan Fitur Warna Dan Backpropagation, and M. Dzikrullah Suratin, “Identifikasi Mutu Roasting Biji Kopi Menggunakan Fitur Warna Dan Backpropagation Identification Of Roasting Quality Coffee Beans Using Color And Backpropagation Features,” 2023.
[2] Purnomo Haykal Mohammed, Raharjo Jangkung, and Magdelena Rita, “Deteksi Kualitas Biji Kopi Melalui Pengolahan Citra Digital Dengan Metode Adaptive Region Growing Dan Klasifikasi Decision Tree (Coffee Bean Quality Detection Through Digital Image Processing With Adaptive Region Growing Method And Decision Tree Classification),” 2021.
[3] D. Aditya Nugraha and A. Sartika Wiguna, “Seleksi Fitur Warna Citra Digital Biji Kopi Menggunakan Metode Principal Component Analysis Digital Image Selection of Coffee Seed Using Component Analysis Method,” 2020.
[4] J. Khatib Sulaiman, N. Amelia, M. Garonga, J. Rusman, and I. Artikel Abstrak, “Penerapan Metode K-Nearest Neighbor (Knn) Untuk Klasifikasi Kematangan Buah Kopi,” Indonesian Journal of Computer Science Attribution, vol. 12, no. 2, 2023.
[5] Firmansyah Tegar, Kurniawan Rudi, and Hidayat Toyib Asep, “Klasfikasi Tingkat Kematangan Roasting Biji Kopi Berbasis Deep Learning dengan Arsitektur MobileNet,” 2025, doi: 10.47065/josh.v6i2.6811.
[6] R. Janandi and T. W. Cenggoro, An Implementation of Convolutional Neural Network for Coffee Beans Quality Classification in a Mobile Information System. 2020. doi: 10.1109/ICIMTech50083.2020.9211257.
[7] A. Ridhovan et al., “Penerapan Metode Residual Network (RESNET) Dalam Klasifikasi Penyakit Pada Daun Gandum,” 2022.
[8] M. A. Djohar et al., “Liver Segmentation Using Convolutional Neural Network Method with U-Net Architecture,” Journal of Informatics And Telecommunication Engineering, vol. 6, no. 1, pp. 221–234, Jul. 2022, doi: 10.31289/jite.v6i1.6751.
[9] A. Di Benedetto, M. Fiani, and L. M. Gujski, “U-Net-Based CNN Architecture for Road Crack Segmentation,” Infrastructures (Basel), vol. 8, no. 5, May 2023, doi: 10.3390/infrastructures8050090.
[10] A. I. Mohammed and A. AK. Tahir, “A New Optimizer for Image Classification using Wide ResNet (WRN),” Academic Journal of Nawroz University, vol. 9, no. 4, p. 1, Sep. 2020, doi: 10.25007/ajnu.v9n4a858.
[11] A. Kaur, Y. Singh, N. Neeru, L. Kaur, and A. Singh, “A Survey on Deep Learning Approaches to Medical Images and a Systematic Look up into Real-Time Object Detection,” Jun. 01, 2022, Springer Science and Business Media B.V. doi: 10.1007/s11831-021-09649-9.
[12] J. Jumadi and D. Sartika, “Pengolahan Citra Digital Untuk Identifikasi Objek Menggunakan Metode Hierarchical Agglomerative Clustering,” 2021.
[13] Y. Prastyaningsih, W. Kusrini, P. Negeri Tanah Laut, J. A. Yani KM, D. Panggung KecPelaihari KabTanah Laut, and K. Selatan, “Sistem Temu Kembali Citra Pada Level Roasting Biji Kopi Menggunakan Ekstraksi Fitur Warna,” vol. 6, no. 2, 2021.
[14] Y. Hafifah, K. Muchtar, A. Ahmadiar, and S. Esabella, “Perbandingan Kinerja Deep Learning Dalam Pendeteksian Kerusakan Biji Kopi,” JURIKOM (Jurnal Riset Komputer), vol. 9, no. 6, p. 1928, Dec. 2022, doi: 10.30865/jurikom.v9i6.5151.
[15] B. T. W. Putra, R. Amirudin, and B. Marhaenanto, “The Evaluation of Deep Learning Using Convolutional Neural Network (CNN) Approach for Identifying Arabica and Robusta Coffee Plants,” Journal of Biosystems Engineering, vol. 47, no. 2, pp. 118–129, 2022, doi: 10.1007/s42853-022-00136-y.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Firdaus Alamanda, Rudy Susanto, Wiji Lestari

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).








