Klasifikasi Tingkat Kematangan Roasting Biji Kopi Berbasis Ekstraksi Fitur Warna HSV Menggunakan Metode Naïve Bayes
Abstract
Manual determination of coffee bean roasting levels through visual inspection has limitations, particularly in terms of subjectivity and human error. To address this, the present study develops an automatic classification system based on digital images to identify the roasting maturity level of coffee beans. The system uses six-dimensional HSV (Hue, Saturation, Value) color features — specifically the mean and standard deviation of each channel classified using the Naive Bayes Classifier (NBC) algorithm. Primary data (145 images) were collected only for the medium and dark classes, as these are the most common roasting levels in the local industry and were underrepresented in the secondary dataset from Kaggle (1,600 images), covering four classes: green, light, medium, and dark. A pixel normalization step was applied prior to HSV conversion to mitigate sensor bias between the primary (smartphone) and secondary (Kaggle) data sources. The images underwent size normalization to 224×224 pixels, then split into training data (75%) and test data (25%). Performance evaluation was carried out using a confusion matrix and metrics such as accuracy, precision, recall, and F1-score. The classification results show that the model achieves an accuracy of 83.48% (compared to 79.82% using only mean features), with the best performance in the light class (F1-score: 0.97) and medium class (F1-score: 0.90). The dark class had the lowest performance (recall: 0.61) due to spectral similarity with adjacent classes. These findings establish a lightweight baseline (inference time: 2.3 ms/image, model size: <1 KB) suitable for embedded and IoT implementations in small-scale coffee processing industries.
Downloads
References
Badan Pusat Statistik, “statistik-kopi-indonesia-2021,” 2021, Accessed: Jul. 13, 2025. [Online]. Available: https://www.bps.go.id
M. Ezar et al., “Ekstraksi Fitur Warna Dengan Histogram HSV Untuk Klasifikasi Motif Songket Palembang,” J. Tek. Inform. dan Sist. Inf., vol. 11, no. 2, pp. 386–396, 2024, [Online]. Available: http://jurnal.mdp.ac.id
I. V. C. Motta, N. Vuillerme, H. H. Pham, and F. A. P. de Figueiredo, “Machine learning techniques for coffee classification: a comprehensive review of scientific research,” Artif. Intell. Rev., vol. 58, no. 1, 2025, doi: 10.1007/s10462-024-11004-w.
D. N. T. Setiawan and E. I. Sela, “Klasifikasi Tingkat Kematangan Buah Pepaya Menggunakan Metode Jaringan Syaraf Tiruan Berdasarkan Warna Kulit Buah,” J. Nas. Komputasi dan Teknol. Inf., vol. 7, no. 5, pp. 1441–1456, 2024, doi: 10.32672/jnkti.v7i5.8127.
H. A. R. M. A. R. B. Rabbani, “Perbandingan Ruang Warna RGB dan HSV dalam Klasifikasi Kematangan Biji Kopi,” J. Pengemb. Teknol. Inf. dan Ilmu Komput., vol. 5, no. 6, pp. 2243–2248, 2021, [Online]. Available: http://j-ptiik.ub.ac.id
I. M. Pakaya, R. Radi, and B. Purwantana, “Classification of Roasting Level of Coffee Beans Using Convolutional Neural Network with MobileNet Architecture for Android Implementation,” J. Tek. Pertan. Lampung (Journal Agric. Eng., vol. 13, no. 3, p. 924, 2024, doi: 10.23960/jtep-l.v13i3.924-932.
R. A. Suharman and H. Hartono, “Klasifikasi Kematangan Manggis Berdasarkan Fitur Warna dan Tekstur Menggunakan Algoritma Naive Bayes,” PYTHAGORAS J. Pendidik. Mat., vol. 17, no. 2, pp. 377–388, 2022, doi: 10.21831/pythagoras.v17i2.53625.
A. Wiratama and F. Samopa, “Jurnal Iptek,” J. IPTEK, vol. 22, no. 1, pp. 1–12, 2020, doi: 10.31284/j.iptek.2023.v27i1.36.
I. K. N. Putra and G. A. M. S. Suari, “Naïve Bayes Classifier untuk Klasifikasi Cacat Biji Kopi Berdasarkan Warna dan Tekstur,” InComTech J. Telekomun. dan Komput., vol. 13, no. 2, p. 125, 2023, doi: 10.22441/incomtech.v13i2.17307.
N. E. R. Pah, S. A. S. Mola, and A. Y. Mauko, “Ekstrasi Ciri Warna Hsv Dan Ciri Bentuk Moment Invariant Untuk Klasifikasi Buah Apel Merah,” J. Komput. dan Inform., vol. 9, no. 2, pp. 142–153, 2021, doi: 10.35508/jicon.v9i2.5043.
I. Gusti et al., “SINTECH Journal | 1 Implementasi Metode Convolutional Neural Network Pada Pengenalan Aksara Bali Berbasis Game Edukasi”, [Online]. Available: https://doi.org/10.31598
M. Irsyad, I. Fata, and D. Avianto, “Jurnal Indonesia : Manajemen Informatika dan Komunikasi Penerapan Metode Naive Bayes pada Sistem Klasifikasi Kualitas Biji Kopi Robusta Abstrak Jurnal Indonesia : Manajemen Informatika dan Komunikasi,” J. Indones. Manaj. Inform. dan Komun., vol. 5, no. 1, pp. 512–524, 2024, doi: https://doi.org/10.35870/jimik.v5i1.515.
D. Giuliani, “Metaheuristic Algorithms Applied to Color Image Segmentation on HSV Space,” J. Imaging, vol. 8, no. 1, 2022, doi: 10.3390/jimaging8010006.
D. Kris, T. Ritonga, U. Ahmad, and S. S. Mardjan, “Image - Based Classification of Robusta Coffee Roasting Degree Using LDA – KNN with Color and Shape Features,” vol. 15, no. 2, pp. 710–719, 2026.
N. E. R. Pah, S. A. S. Mola, dan A. Y. Mauko, “Ekstraksi Ciri Warna HSV dan Ciri Bentuk Moment Invariant untuk Klasifikasi Buah Apel Merah,” Jurnal Komputer dan Informatika, vol. 9, no. 2, pp. 142–153, 2021, doi: 10.35508/jicon.v9i2.4498.
N. P. Batubara, D. Widiyanto, dan N. Chamidah, “Klasifikasi Rempah Rimpang Berdasarkan Ciri Warna RGB dan Tekstur GLCM Menggunakan Algoritma Naive Bayes,” Informatik: Jurnal Ilmu Komputer, vol. 16, no. 3, p. 156, 2020, doi: 10.33373/informatik.v16i3.2638.
Irma, M. Muchtar, R. Adawiyah, dan Sarimuddin, “Klasifikasi Tingkat Kematangan Cabai Merah Keriting Menggunakan SVM Multiclass Berdasarkan Ekstraksi Fitur Warna,” Jurnal Informatika dan Teknik Elektro Terapan, vol. 12, no. 3, pp. 1747–1755, 2024, doi: 10.23960/jitet.v12i3.4102.
M. A. Fata dan D. Avianto, “Penerapan Metode Naive Bayes pada Sistem Klasifikasi Kualitas Biji Kopi Robusta,” Jurnal Indonesia: Manajemen Informatika dan Komunikasi, vol. 5, no. 1, pp. 512–524, 2024, doi: 10.35870/jimik.v5i1.384.
Alfiantama et al., “Klasifikasi Tingkat Roasting Biji Kopi dengan Metode CNN,” Prosiding Seminar Nasional Informatika dan Sistem Informasi, vol. 3, pp. 285–290, 2024. [Online]. Available: https://ejurnal.seminar-id.com/index.php/senafti/article/view/1274
R. E. G. Rivas, P. L. L. Bertarini, dan H. Fernandes, “Automated Coffee Roast Level Classification Using Machine Learning and Deep Learning Models,” Journal of Food Science, vol. 90, no. 9, p. e70532, 2025, doi: 10.1111/1750-3841.70532.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Klasifikasi Tingkat Kematangan Roasting Biji Kopi Berbasis Ekstraksi Fitur Warna HSV Menggunakan Metode Naïve Bayes
Pages: 118-127
Copyright (c) 2026 Gusti Ayu Devani Zelvia, I Made Gede Sunarya, I Gde Made Hanura, Ida Bagus Gede Putra Kenaka

This work is licensed under a Creative Commons Attribution 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 Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment 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 acknowledgment 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 (Refer to The Effect of Open Access).






















