This study develops a pear variety classification system based on digital images using the K-Nearest Neighbor (KNN) algorithm. The data used included 195 images from three pear varieties, namely Century, Forel Afrika, and Singo, which were analyzed by utilizing various features such as color (RGB), texture (Local Binary Pattern), shape (area, circumference, length-width ratio), and size (bounding box dimensions). The preprocessing process removes the image's background to increase focus on the main object, thus allowing for more optimal feature extraction. The dataset is divided into 80% for training and 20% for model testing. The evaluation results show that the KNN model can achieve an accuracy of 85%, with an average precision value of 0.85, recall of 0.89, and F1-score of 0.85. These results prove that the KNN algorithm is effective in accurately classifying pear varieties, which can significantly contribute to applying digital image-based technology for automatic classification needs in the agricultural sector.
Copyrights © 2025