The quality of fresh fruits and vegetables plays a crucial role in consumer health. Manual assessment of product freshness is often ineffective because it is subjective and time-consuming. This study implements a Convolutional Neural Network (CNN) architecture and transfer learning using VGG16 and ResNet50 to classify the condition of fruits (apples and bananas) as fresh or rotten. The model design adapts previous research by modifying the input image size, restricting the target labels to four classes (freshapples, freshbanana, rottenapples, and rottenbanana), and removing the Dropout layer. The dataset, obtained from Kaggle, includes two fruit types (apples and bananas) and two conditions (fresh and rotten). The experimental results show that VGG16 achieved the highest accuracy at 93.9%, outperforming both ResNet50 and the custom CNN model. The custom CNN exhibited notably lower performance, indicating its limited ability to extract deep hierarchical features compared to pretrained architectures. These findings highlight the effectiveness of CNN-based transfer learning for supporting automated classification of fresh agricultural products.
Copyrights © 2026