Rice cultivation is a cornerstone of food security in agrarian countries like Indonesia, yet it remains highly vulnerable to pest infestations that can severely impact crop productivity. Manual identification of pests is time-consuming and error-prone, especially when pest species exhibit similar morphological characteristics. This study aims to implement and evaluate the performance of four classical machine learning algorithms Support Vector Machine (SVM), K-Nearest Neighbor (KNN), Random Forest (RF), and Logistic Regression (LR) for classifying rice pests based on image data. The dataset, derived from Kaggle’s “Rice Pest Detection Dataset,” includes 12 pest classes and underwent a series of preprocessing steps: grayscale conversion, image resizing to 128×128 pixels, feature extraction using Histogram of Oriented Gradients (HOG), label encoding, and class balancing via SMOTE. The experimental setup used 80% of the data for training and 20% for testing. Performance was evaluated using precision, recall, F1-score, and confusion matrices. Among the four models, SVM achieved the most consistent and robust performance, with F1-scores reaching up to 0.98 in several pest classes and an overall balanced classification across the dataset. Random Forest followed closely, particularly excelling in distinguishing classes such as Rice Water Weevil and Yellow Rice Borer, achieving F1-scores of 0.99 and 0.96 respectively. In contrast, KNN showed signs of overfitting, with extreme precision-recall imbalances, while LR was more stable but less accurate in separating visually similar classes like Rice Stem Fly and Thrips. Visual analysis of correct and incorrect predictions revealed that classes 7 (Rice Stem Fly) and 11 (Thrips) were consistently misclassified across all models, likely due to high visual similarity.
                        
                        
                        
                        
                            
                                Copyrights © 2025