Journal of Artificial Intelligence and Engineering Applications (JAIEA)
Vol. 5 No. 3 (2026): June 2026

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

Fahmi Nur Alimsyah Purba (Universitas Islam Negeri Sumatera Utara)
Fathi Athallah Z (Universitas Islam Negeri Sumatera Utara)
Alfin Alfarizi (Universitas Islam Negeri Sumatera Utara)
Lailan Sofinah Harahap (Universitas Islam Negeri Sumatera Utara)



Article Info

Publish Date
15 Jun 2026

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.

Copyrights © 2026






Journal Info

Abbrev

JAIEA

Publisher

Subject

Automotive Engineering Computer Science & IT Control & Systems Engineering

Description

The Journal of Artificial Intelligence and Engineering Applications (JAIEA) is a peer-reviewed journal. The JAIEA welcomes papers on broad aspects of Artificial Intelligence and Engineering which is an always hot topic to study, but not limited to, cognition and AI applications, engineering ...