Pest Detection on Oil-Palm Leaves Using the K-Nearest Neighbor Algorithm and Image Analysis

Authors

  • Ratu Mutiara Siregar Institut Teknologi Sawit Indonesia
  • Andi Prayogi Institut Teknologi Sawit Indonesia
  • Ritna Wahyuni Institut Teknologi Sawit Indonesia
  • Raden Aris Sugianto Institut Teknologi Sawit Indonesia

DOI:

https://doi.org/10.56473/cicost2025pp117-123

Keywords:

Image analysis; K-Nearest Neighbor (KNN); leaf pests; oil palm; texture features (GLCM).

Abstract

Oil palm is a strategic commodity whose productivity is often threatened by leaf‐feeding pests such as bagworms and nettle caterpillars, underscoring the need for rapid, objective early detection. This study develops an image-based pest detection system using the K-Nearest Neighbor (KNN) algorithm with Gray Level Co-occurrence Matrix (GLCM) texture features—energy, contrast, homogeneity, and correlation—extracted from images of healthy and infested leaves. The workflow comprises preprocessing (resizing, grayscale conversion, thresholding), GLCM feature extraction, normalization, and KNN classification with Euclidean distance and an empirically selected k. Performance is assessed on three classes (healthy, bagworm, nettle caterpillar) using a confusion matrix alongside precision, recall, and F1-score, with cross-validation to gauge generalization. The model reliably distinguishes classes, with classwise metrics ranging from 0.71 to 0.83 evaluation on new samples yields predictions consistent with ground truth. These findings indicate that the GLCM–KNN combination is an effective and affordable approach for early pest detection in oil-palm leaves, supporting timely, data-informed decisions in the field. Future improvements include enlarging and diversifying the dataset, parameter optimization and feature selection, comparative baselines with SVM/CNN, and integration into IoT and UAV monitoring pipelines for plantation-scale surveillance.

Downloads

Published

29-12-2025

How to Cite

Siregar, R. M., Andi Prayogi, Ritna Wahyuni, & Raden Aris Sugianto. (2025). Pest Detection on Oil-Palm Leaves Using the K-Nearest Neighbor Algorithm and Image Analysis. Cendana International Conference on Social and Technology, 2(1), 117–123. https://doi.org/10.56473/cicost2025pp117-123