Sinkron : Jurnal dan Penelitian Teknik Informatika
Vol. 10 No. 4 (2026): Research Articles October 2026

Random Forest Implementation for Indonesian Coffee Identification Based on Digital Image Feature Extraction

Widya Lelisa Army (Doctoral Program in Informatics, Universitas Ahmad Dahlan, Yogyakarta, Indonesia 55191)
Abdul Fadlil (Doctoral Program in Informatics, Universitas Ahmad Dahlan, Yogyakarta, Indonesia 55191)
Sunardi Sunardi (Doctoral Program in Informatics, Universitas Ahmad Dahlan, Yogyakarta, Indonesia 55191)



Article Info

Publish Date
05 Oct 2026

Abstract

Accurate identification of coffee types is a critical challenge in Indonesia's coffee industry, which relies heavily on subjective human visual inspection. This study implements the Random Forest ensemble learning algorithm to classify three commercially important coffee species  Arabica (Coffea arabica), Liberica (Coffea liberica), and Robusta (Coffea canephora) using digital image features. The dataset consists of 1,913 real coffee bean images from Roboflow Universe (Coffee Bean Type v1, CC BY 4.0), split into train (1,530), valid (287), and test (96). Feature extraction produces an 11-dimensional vector combining five Gray Level Co-occurrence Matrix (GLCM) texture features (Contrast, Energy, Homogeneity, Correlation, Dissimilarity) computed at four angles and six RGB color statistical features (mean and standard deviation per channel). The model is trained on 1,817 combined train-valid samples with optimal hyperparameters (n_estimators=200, max_depth=None, criterion=gini) selected via Grid Search with 5-fold stratified cross-validation. Evaluation on 96 held-out test samples yields accuracy 98.96%, macro precision 99.05%, macro recall 98.67%, macro F1-score 98.84%, and ROC-AUC 0.9996, with only one misclassification. Cross-validation confirms model stability at 98.07%±0.60%. Feature importance analysis identifies GLCM Energy (21.98%) and Homogeneity (14.57%) as the most discriminative features. The Robusta class achieves perfect classification (100% all metrics). Manual verification confirms that the reported metrics are consistent with the confusion matrix. These results demonstrate that Random Forest with GLCM and RGB color statistical features is effective for image-based coffee classification, achieving higher accuracy than several prior KNN and neural-network-based studies, although those studies differ in task, dataset, and class composition and are therefore not directly comparable.

Copyrights © 2026






Journal Info

Abbrev

sinkron

Publisher

Subject

Computer Science & IT

Description

Scope of SinkrOns Scientific Discussion 1. Machine Learning 2. Cryptography 3. Steganography 4. Digital Image Processing 5. Networking 6. Security 7. Algorithm and Programming 8. Computer Vision 9. Troubleshooting 10. Internet and E-Commerce 11. Artificial Intelligence 12. Data Mining 13. Artificial ...