Development of Color Segmentation and Texture Analysis Algorithms for Early Detection of Green Vegetable Deterioration in Retail Environments - Dinul Akhiyar; Iskandar Fitri; Gunadi Widi Nurcahyo (Bright Publisher, 2026)
Vegetable deterioration in retail environments is often accelerated by improper storage conditions, leading to quality degradation, economic losses, and reduced consumer trust. Early detection of deterioration is therefore essential to enable timely preventive actions before visible spoilage becomes severe. This study proposes an integrated image-based framework for early detection of spinach leaf deterioration by combining K-Means++ for robust color segmentation, Gray Level Co-occurrence Matrix (GLCM) for texture feature extraction, and Convolutional Neural Network (CNN) for classification. K-Means++ improves segmentation stability through optimized centroid initialization, GLCM captures subtle texture variations associated with early spoilage, and CNN enables accurate classification by learning complex visual patterns from segmented images. The dataset consists of 642 spinach leaf images captured under controlled lighting for initial calibration and under varying lighting conditions to simulate real-world retail environments. Experimental results show that the standard K-Means algorithm achieved an average classification accuracy of 77%, while the proposed K-Means++ segmentation improved accuracy to 81.86%. Furthermore, CNN-based validation achieved the highest classification accuracy of 94.82%, demonstrating strong generalization capability. The novelty of this work lies in the optimized integration of K-Means++ segmentation under lighting variability, selective GLCM feature utilization validated through ablation analysis, and end-to-end CNN-based validation with real-time deployment feasibility. The proposed framework offers a practical, scalable, and non-destructive solution for automated freshness monitoring in retail environments and can be extended to other leafy vegetables.