Classification of Herbal Plants Based on Leaf Images Using Gray Level Co-Occurrence Matrix and K-Nearest Neighbor

Authors

  • Fahmi Nur Alimsyah Purba Fahmi Universitas Islam Negeri Sumatera Utara
  • Fathi Athallah Z Fathi Universitas Islam Negeri Sumatera Utara
  • Alfin Alfarizi Alfarizi Universitas Islam Negeri Sumatera Utara
  • Lailan Sofinah Harahap4 Lailan Universitas Islam Negeri Sumatera Utara

DOI:

https://doi.org/10.59934/jaiea.v5i3.2291

Keywords:

GLCM, Classification, KNN, Leaf Image, Herbal

Abstract

Herbal plants have long been used as traditional medicine. However, many people struggle to tell different herbal leaves apart because they look quite similar. This study tries to build a system that can recognize two types of herbal leaves, Moringa and Katuk, simply from their photos. We used GLCM to extract texture features from the leaves, then classified them using KNN. The dataset came from Kaggle, with 480 leaf images in total. Before processing, we cropped the images, resized them to 256x256 pixels, and converted them to grayscale. GLCM features were taken from four angles (0°, 45°, 90°, 135°) and then averaged. This gave us four texture values: contrast, correlation, energy, and homogeneity. We tested KNN with k values from 1 to 15 and five different distance metrics. The best result we got was 94% accuracy, using Manhattan distance with k=1. This system could help everyday people identify medicinal plants more easily without needing lab tests.

Downloads

Download data is not yet available.

References

A. D. Ningtyasa, E. B. Nababan, and S. Efendi, "Performance analysis of local binary pattern and K-Nearest Neighbor on image classification of fingers leaves," International Journal of Nonlinear Analysis and Applications, 2022.

B. I. Nugroho, M. W. Khusni, P. S. Ananda, and G. Gunawan, "Comparison of naïve bayes and KNN for herbal leaf classification," Jurnal Mandiri IT, vol. 13, no. 1, pp. 18-27, 2024. doi: 10.35335/mandiri.v13i1.297.

J. Mulyadi and N. D. M. Veronika, "Klasifikasi penyakit pada daun sirih menggunakan K-Nearest Neighbor (KNN) berdasarkan ekstraksi fitur Gray Level Co-occurrence Matrix (GLCM)," Jurnal Ampere, vol. 10, pp. 1-14, 2025.

A. Z. Alfarizi and E. I. Sela, "Klasifikasi rimpang menggunakan metode K-Nearest Neighbor dan ekstraksi ciri Gray Level Co-occurrence Matrix," Jurnal Ilmiah Komputer, vol. 14, no. 1, 2024. doi: 10.37859/jf.v14i1.6832.

A. Raghukumar, G. Narayanan, and S. G. Remadevi, "Optimized supervised ML for medicinal plant detection - An FPGA implementation," International Journal of Electronics and Telecommunications, vol. 70, no. 3, pp. 537-544, 2024. doi: 10.24425/ijet.2024.149576.

K. Ranathunga and A. Ramanan, "Simple and compound leaf taxonomy embedded machine learning approach for Ayurveda plants recognition," in Proc. 4th Int. Conf. Advanced Research in Computing (ICARC), 2024, pp. 109-114.

"Klasifikasi citra digital daun herbal menggunakan metode Naïve Bayes dan K-Nearest Neighbor dengan ekstraksi fitur GLCM," Jurnal RESTI, 2023.

"Development of smart decision support system for detecting cotton leaf diseases caused by Erysiphe betae and Spodoptera frugiperda," in Proc. IEEE Conf., 2025.

"Coffee plant disease classification using K-Nearest Neighbor," in Proc. IEEE Conf., Bandung, Indonesia, 2022, pp. 1-5.

A. Arifin, J. Hendyli, and D. E. Herwindiati, "Klasifikasi tanaman obat herbal menggunakan metode Support Vector Machine," Computatio: J. Comput. Sci. Inf. Syst., vol. 5, no. 1, p. 25, 2021. doi: 10.24912/computatio.v1i1.12811.

Downloads

Published

2026-06-02

How to Cite

Fahmi, F. N. A. P., Fathi, F. A. Z., Alfarizi, A. A., & Lailan, L. S. H. (2026). Classification of Herbal Plants Based on Leaf Images Using Gray Level Co-Occurrence Matrix and K-Nearest Neighbor. Journal of Artificial Intelligence and Engineering Applications (JAIEA), 5(3), 3864–3868. https://doi.org/10.59934/jaiea.v5i3.2291

Issue

Section

Articles