Comparison of Tree Method, Support Vector Machine, Naïve Bayes, and Logistic Regression on Coffee Bean Image

  • Rahmat Robi Waliyansyah Universitas PGRI Semarang, Indonesia
  • Umar Hafidz Asy'ari Hasbullah Universitas PGRI Semarang, Indonesia
Keywords: digital image processing, coffee beans, classification


Coffee is one of the many favorite drinks of Indonesians. In Indonesia there are 2 types of coffee, namely Arabica & Robusta. The classification of coffee beans is usually done in a traditional way & depends on the human senses. However, the human senses are often inconsistent, because it depends on the mental or physical condition in question at that time, and only qualitative measures can be determined. In this study, to classify coffee beans is done by digital image processing. The parameters used are texture analysis using the Gray Level Coocurrence Matrix (GLCM) method with 4 features, namely Energy, Correlation, Homogeneity & Contrast. For feature extraction using a classification algorithm, namely Naïve Bayes, Tree, Support Vector Machine (SVM) and Logistic Regression. The evaluation of the coffee bean classification model uses the following parameters: AUC, F1, CA, precision & recall. The dataset used is 29 images of Arabica coffee beans and 29 images of Robusta beans. To test the accuracy of the model using Cross Validation. The results obtained will be evaluated using the confusion Matrix. Based on the results of testing and evaluation of the model, it is obtained that the SVM method is the best with the value of AUC = 1, CA = 0.983, F1 = 0.983, Precision = 0.983 and Recall = 0.983.


Download data is not yet available.

Author Biography

Rahmat Robi Waliyansyah, Universitas PGRI Semarang, Indonesia

Fakultas Teknik dan Informatika


TR Nanda, Zulhelmi, and M. Syaryadhi, "Designing Coffee Color Sorting Systems Based on Digital Image Techniques Based on the Atmega 328p Microcontroller," KITEKTRO, vol. 3, no. 2, pp. 76–83, 2018.

BD Argo and M. Andreane, "Parameter Identification of Robusta Coffee Beans and Powder Using Machine Vision and Artificial Neural Network (ANN) Methods," J. Technical Engineering. Trop. and Biosist., vol. 5, no. 2, pp. 150–162, 2017.

DW Soedibyo, U. Ahmad, KB Seminar, and IDM Subrata, "Design of Intelligent Image-Based Sorting System for Rice Coffee," J. Technical Engineering., vol. 24, no. 02, pp. 67–74, 2010.

M. Yulia, R. Iriani, D. Suhandy, S. Waluyo, and C. Sugianti, "Study on the Use of Uv-Vis Spectroscopy and Chemometrics to Quickly Identify The Falsification of Arabica and Robusta Coffees," J. Tech. Pertan. Lampung, vol. 6, no. 1, pp. 43–52, 2017.

PS Maria and M. Rivai, "Classification of Coffee Bean Quality Using Image Processing and Fuzzy Logic," in National Seminar: Initiating the Rise of Local Commodities in Agriculture and Maritime Affairs, Faculty of Agriculture, Trunojoyo University, Madura, 2013, pp. 773–780.

N. Ulum, IGLPE Prismana, and RAJ Firdaus, "Identification of Coffee Bean Types Using Digital Images with City Block Distance Classification Method," INOVATE, vol. 03, no. 01, pp. 30–37, 2018.

SA Mutallib, J. Nugroho, and N. Bintoro, "Identifying the Aroma of Blending of Arabica and Robusta Coffee with Electronic Nose Using a Pattern Recognition System," in Proceedings of the PERTETA National Seminar, 2012, pp. 154–163.

TH Nasution and U. Andayani, "Recognition of Roasted Coffee Bean Levels using Image Processing and Neural Networks," in Annual Applied Science and Engineering Conference, 2017, vol. 1, pp. 1–8.

AD Mengistu, SG Mengistu, and DM Alemayehu, "Image analysis for the Ethiopian Coffee Plant Diseases Identification of Abrham," Int. J. Biometrics Bioinforma., vol. 10, no. 1, pp. 1–11, 2016.

AD Mengistu, "The Effects of Segmentation Techniques in Digital Image Based Identification of Ethiopian Coffee Variety," TELKOMNIKA, vol. 16, no. 2, pp. 713-717, 2018.

UT de CP Souto et al., "Screening for Coffee Adulteration Using Digital Images and SPA-LDA," Food Anal. Methods, vol. 8, no. 6, pp. 1515-1521, 2015.

JDB Vanegas et al., "Developing predictive models for determining the physical properties of coffee beans during the roasting process," Ind. Crops Prod., Vol. 112, pp. 839–845, 2018.

UT de CP Souto et al., "Identification of adulteration in ground roasted coffees using UV-Vis spectroscopy and SPA-LDA," LWT - Food Sci. Technol., Vol. 63, no. 2, pp. 1037–1041, 2015.

B. Chu, K. Yu, Y. Zhao, and Y. He, "Development of Noninvasive Classification Methods for Different Roasting Degrees of Coffee Beans Using Hyperspectral Imaging," sensors, vol. 18, no. 4, pp. 1–15, 2018.

Y. Pu, DB Apple, and B. Lingga, "Rockburst prediction in kimberlite using decision tree with incomplete data," J. Sustain. Min, vol. 17, no. 3, pp. 158–165, 2018.

A. Subasi, A. Ahmed, and E. Alickovic, "The effect of flash stimulation for migraine detection using decision tree classifiers," in Procedia Computer Science, 2018, vol. 140, pp. 223–229.

T. Shaikhina, D. Lowe, S. Daga, D. Briggs, R. Higgins, and N. Khovanova, "Decision trees and random forest models for outcome prediction in antibody incompatible kidney transplantation," Biomed. Signal Process. Control, vol. 52, pp. 456–462, 2019.

S. Maitra, S. Madan, R. Kandwal, and P. Mahajan, "Mining authentic student feedback for faculty using Naïve Bayes classifier," in Procedia Computer Science, 2018, vol. 132, pp. 1171–1183.

S. Padmavathi and E. Ramanujam, "Naïve Bayes Classifier for ECG abnormalities using Multivariate Maximal Time Series Motives," Procedia Comput. Sci, vol. 47, no. C, pp. 222–228, 2015.

D. Seo, E. Kang, Y. mi Kim, SY Kim, IS Oh, and MG Kim, "SVM-based waist circumference estimation using Kinect," Comput Biomed Methods Programs., vol. 191, pp. 1-6, 2020.

A. Nasirahmadi et al., "Automatic scoring of lateral and sternal lying postures in grouped pigs using image processing and Support Vector Machines," Comput. Electron. Agric., Vol. 156, December 2018, pp. 475–481, 2019.

IKP Suniantara, IGEW Putra, and G. Suwardika, "Improved Classification Accuracy with the Aggregating Bootstrap Method in Ordinal Logistic Regression," INTENSIVE J. Ilm. Researcher. and Application of Technology. Sis. Inf., vol. 3, no. 1, p. 32, 2019.

A. Salim and MR Alfian, "Optimizing Logistic Regression in the Classification Process Using Genetic Algorithms," J. Tech. Inf. and Applied., vol. 6, no. 2, pp. 50–55, 2019.

How to Cite
Waliyansyah, R. R., & Umar Hafidz Asy’ari Hasbullah. (2021). Comparison of Tree Method, Support Vector Machine, Naïve Bayes, and Logistic Regression on Coffee Bean Image. EMITTER International Journal of Engineering Technology, 9(1), 126-136.