ISAR Publisher

International Scientific and Academic Research Publisher

Submit Manuscript

Optimized Weighted K-Nearest Neighbors Algorithm for Automated Classification of Banana Quality


Author: Mamidisetti Mohita Gangadhar, Manas Ranjan Senapati*
Associate Professor, Department of Computer Science and Technology, Veer Surendra Sai University of Technology, Odisha, India.
Published Date: 2025-12-10
Keywords: Automated grading; banana quality; classification; feature weighting; K-Nearest Neighbors; weighted KNN.
Abstract:
In this paper, the optimized weighted K-Nearest Neighbors (WKNN) algorithm was utilized for an efficient two-class automatic banana quality classification: good and bad. The seven-feature-based dataset was normalized, and then it was split into three parts: training, validation, and testing. Feature weights were incrementally adjusted based on errors over 70 training epochs evaluated on the validation set such that informative features were assigned more weight. When converged, the final KNN classifier with k=5 neighbors was tested on a separate test batch. The model achieved 98.10%, 97.98%, 98.23%, 97.97%, and 98.10% accuracy, precision, sensitivity, specificity, and F1-score for the good quality class, respectively. The error decreased from 0.260 to 0.191 in training, and the weights of size and weight dominated. Our results demonstrate that the proposed WKNN has the potential for day-to-day banana grading with high reliability and uniformity in the automated inspection systems.