Apple Freshness Classification Based on Images Using Wavelet and K-Nearest Neighbors Techniques

Apple Freshness, Classification, Wavelet, Images, k-Nearest Neighbors

Authors

December 30, 2025
December 30, 2025

Downloads

An essential component of fruit marketing and the agriculture sector is determining the freshness of fresh apples. Additionally, the majority Hindu population of Bali uses apples for religious rituals, therefore determining the apples' freshness aids in their selection of high-quality apples. In this study, we provide a k-Nearest Neighbors strategy for apple classification. Using a dataset of apple photos, this study attempts to identify the freshness of apples. Pre-processing and classification of images are among the methods employed. After processing fruit photos to improve contrast, wavelets are used to extract key features. The k-Nearest Neighbors classification algorithm uses these features as input. It is expected that the findings of this study will demonstrate the accuracy of the classification results produced by the k-Nearest Neighbors (k-NN) algorithm. The application is developed using the Python programming language, which is capable of processing image datasets to classify fresh fruit images. This application can be used as a tool to assist in selecting high-quality apples. When the k-NN method was used to evaluate the freshness classification of apples, it performed better at test size training parameter 0.2, with an accuracy value of 0.96 and a precision value of 0.93 for fresh apples and 1 for rotten apples.