Assessing the quality of apples is essential to ensure they are suitable for consumption; however, manual identification remains slow and subjective. This study aims to develop an image segmentation model for apples to detect decayed areas, utilizing a U-Net architecture based on MobileNetV2. The dataset, sourced from Kaggle, consists of 5,031 images (2,088 fresh apples and 2,943 decayed apples). Binary mask annotations were generated automatically through color thresholding in the HSV color space, combined with morphological operations. The dataset was partitioned into 80% for training (4,024 images) and 20% for validation/testing (1,007 images). The model was configured using a MobileNetV2 encoder (pre-trained on ImageNet), the Adam optimizer (with a learning rate of 10⁻⁴), and a loss function combining Binary Crossentropy and Dice Loss. Test results demonstrate excellent segmentation performance, achieving an accuracy of 98.80%, a Dice Coefficient of 0.9428, and an Intersection over Union (IoU) of 0.8977 at the 45th epoch. In conclusion, the MobileNetV2-based U-Net model proves to be effective and accurate for the automated differentiation between decayed and fresh areas. The primary limitations of this study include the reliance on HSV color-based estimation for binary mask generation and the fact that testing was confined to an experimental cloud environment
Copyrights © 2026