Classification of Herbal Plants Based on Leaf Images Using Gray Level Co-Occurrence Matrix and K-Nearest Neighbor - Fahmi Nur Alimsyah Purba; Fathi Athallah Z; Alfin Alfarizi; Lailan Sofinah Harahap (Journal of Artificial Intelligence and Engineering Applications (JAIEA), 2026)
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.