Image-Based Classification of Robusta Coffee Roasting Degree Using LDA–KNN with Color and Shape Features
Abstract
The determination of robusta coffee roast levels is commonly conducted through visual assessment, which is inherently subjective and prone to inconsistency due to overlapping visual characteristics between adjacent roasting stages. On the other side, objective measurement equipment is often costly and not easily accessible. This study addresses this problem by proposing a digital image–based classification method for five robusta coffee roast levels (green, light, medium, medium-dark, and dark). Parameters included color feature extraction from RGB (Red, Green, Blue), HSV (Hue, Saturation, Value), and shape features including area, perimeter, and circularity are extracted from captured images. A hybrid Linear Discriminant Analysis (LDA) and K-Nearest Neighbor (KNN) classifier with Manhattan distance is employed to enhance class separability and improve classification accuracy. Model performance was evaluated using a confusion matrix (precision, accuracy, recall and F-1 score). Results showed that by integrating multiple visual features and employing a hybrid classification strategy, the proposed approach was able to improve the classification of Robusta coffee roasting levels. The evaluation using a 90:10 data split with an optimal k = 16 resulted in the highest accuracy of 83%.
Downloads
References
Abuhayi, B.M., & Mossa, A.A. (2023). Coffee disease classification using convolutional neural network based on feature concatenation. Informatics in Medicine Unlocked, 39, 101245. https://doi.org/10.1016/j.imu.2023.101245
Ahmad, U., & Nurrahman, M. I. (2024). Recognition of defect types of Arabica coffee beans using image processing. IOP Conference Series: Earth and Environmental Science, 1386, 012030. https://doi.org/10.1088/1755-1315/1386/1/012030
Ardiyansyah, D., & Oktafiani, N. (2024). Perbandingan metode pengukuran jarak pada K-Nearest Neighbour dalam klasifikasi data teks cardiovaskular. Jurnal Information System Management and Digital Business, 1(2), 116–122. https://doi.org/10.59407/jismdb.v1i2.260
Bahrumi, P., Ratna, & Fadhil, R. (2022). Levelisasi penyangraian kopi: Suatu kajian. Jurnal Ilmiah Mahasiswa Pertanian, 7(1), 522-525.
Baso, B., & Risald. (2023). Perbandingan distance space pada K-Nearest Neighbors dalam klasifikasi citra biji kopi timor berdasarkan ekstraksi fitur gray level co-occurrence matrix. Jurnal TEKINKOM, 6(2), 491-498.
Bedaso, M., Meshesha, M., & Diriba, C. (2023). Comparing performance of classification algorithms to use for grading coffee’s raw quality by using image processing techniques. AGBIR International Journal Agricultural and Biological Research, 39(2), 491-495.
Bustos-Vanegas, J.D., Corrêa, P.C., Martins, M.A., Baptestini, F.M., Campos, R.C., de Oliveira, G.H.H., & Nunes, E.H.M. (2018). Developing predictive models for determining physical properties of coffee beans during the roasting process. Industrial Crops and Products, 112, 839–845. https://doi.org/10.1016/j.indcrop.2017.12.015
Dermawan, M.F.H., Witarsyah, D., & Fakhruroja, H. (2023). Penerapan image processing untuk mengetahui tingkat kematangan kopi menggunakan algoritma K-Nearest Neighbor (KNN) pada perkebunan kopi malabar Bandung. E-Proceedings Engineering, 10(3), 3246–3252.
Desiani, A., Zayanti, D.A., Primartha, R., Efriliyanti, F., & Andriani, N.A.C. (2021). Variasi thresholding untuk segmentasi pembuluh darah citra retina. JEPIN (Jurnal Edukasi dan Penelitian Informatika), 7(2), 255–262. https://doi.org/10.26418/jp.v7i2.47205
Huang, L., Liu, M., Li, B., Chitrakar, B., & Duan, X. (2024). Terahertz spectroscopic identification of roast degree and variety of coffee beans. Foods, 13(3), 389. https://doi.org/10.3390/foods13030389
Jumarlis, M., Mirfan, M., & Manga, A.R. (2022). Classification of coffee bean defects using Gray-Level Co-Occurrence Matrix and K-Nearest Neighbor. ILKOM Jurnal Ilmiah, 14(1), 1–9. https://doi.org/10.33096/ilkom.v14i1.910.1-9
Lumagui, K.N., Manuel, L.J., Quilloy, E., & Yaptenco, K. (2020). Varietal classification of selected green coffee beans (Coffea arabica L. and Coffea canephora Pierre ex A. Froehner) using image processing software. Philippine Journal of Agricultural and Biosystems Engineering, 16(2), 29–44
Maghfirah, A., & Nasution, I.S. (2022). Application of colour, shape, and texture parameters for classifying the defect of Gayo Arabica green coffee bean using computer vision. IOP Conference Series: Earth and Environmental Science, 951, 012097. https://doi.org/10.1088/1755-1315/951/1/012097
Mujidah, M., & Agustin, S. (2024). Klasifikasi kualitas biji kopi robusta menggunakan metode K-Nearest. Jurnal Mahasiswa Teknik Informatika, 8(6), 11832–11838.
Novtahaning, D., Shah, H.A., & Kang, J.M. (2022). Deep learning ensemble-based automated and high-performing recognition of coffee leaf disease. Agriculture, 12(11), 1909. https://doi.org/10.3390/agriculture12111909
Prastyaningsih, Y., & Kusrini, W. (2021). Sistem temu kembali citra pada level roasting biji kopi menggunakan ekstraksi fitur warna. INOVTEK Polbeng - Seri Informatika, 6(2), 222. https://doi.org/10.35314/isi.v6i2.2086
Priyanto, D.A.M., Hintono, A., & Dwiloka, B. (2022). Perbedaan sifat fisikokimia dan organoleptik produk kopi rempah dari kopi arabika (Coffea arabica) dan kopi robusta (Coffea robusta). Jurnal Aplikasi Teknologi Pangan, 11(4). https://doi.org/10.17728/jatp.13827
Saputra, I.G.P.A., Rahayu, P.W., & Ardiada, I.M.D. (2024). Analisis tingkat kematangan sangraian biji kopi menggunakan ekstraksi fitur warna. J-INTECH (Journal of Information and Technology), 1(204), 203–208.
Setiawan, A. (2022). Perbandingan penggunaan jarak Manhattan, jarak Euclidean, dan jarak Minkowski dalam klasifikasi menggunakan metode KNN pada data iris. Jurnal Sains dan Edukasi Sains, 5(1), 28–37. https://doi.org/10.24246/juses.v5i1p28-37
United States Department of Agriculture [USDA]. (2024). Coffee: World markets and trade. USDA Foreign Agricultural Service.
Wibawa, M.F., Rahman, M.A., & Widodo, A.W. (2021). Penerapan ruang warna HSV dan ekstraksi fitur tekstur Local Binary Pattern untuk tingkat kematangan sangrai biji kopi. Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, 5(7), 2819–2825.
Yeager, S.E., Batali, M.E., Lim, L.X., Liang, J., Han, J., Thompson, A.N., Guinard, J.X., & Ristenpart, W.D. (2022). Roast level and brew temperature significantly affect the color of brewed coffee. Journal of Food Science, 87(4), 1837–1850. https://doi.org/10.1111/1750-3841.16089

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


