An Improved Deep Neural Network System for Strawberry Ripeness Detection and Classification
摘要
Accurate identification of fruit ripeness is crucial for ensuring product quality, optimizing harvest timing, and minimizing postharvest losses in modern agriculture. Among various fruit crops, strawberries present a particular challenge due to their high morphological variability, delicate structure, and short shelf life, making automated, high-precision inspection essential for modern agricultural systems. To address these challenges, this study proposes an improved whale optimization algorithm (IWOA)-based strawberry detection and ripeness inspection (S-Det) system that integrates optimization-driven feature extraction with deep learning-based classification. The proposed framework combines an IWOA-optimized autoencoder for compact and discriminative feature representation with an IWOA-optimized deep neural network (DNN) for precise multi-class classification of strawberry ripeness stages. Two key improvements are introduced into the traditional whale optimization algorithm (WOA): population diversity monitoring using cosine similarity and an improved spiral position updating mechanism, which together enhance convergence speed and prevent premature stagnation in complex agricultural datasets. Comprehensive experiments were conducted on the StrawTex dataset, consisting of 6000 strawberry texture samples across five ripeness categories. The proposed IWOA-DNN achieved a classification accuracy of 98.23%, precision of 98.25%, recall of 98.26%, and an F1-score of 0.9824, outperforming classical models such as k-nearest neighbors (KNN, 92.17%) and support vector machine (SVM, 92.06%), as well as advanced methods like particle swarm optimization–DNN (PSO-DNN, 97.62%), WOA-DNN (97.72%), and pre-trained architectures including ResNet50 (97.73%). These findings confirm the superior learning ability, convergence stability, and generalization capability of the IWOA-based system, supporting its potential deployment in real-world agricultural automation. Overall, the results demonstrate that the proposed S‑Det framework provides an effective, intelligent, and highly reliable solution for strawberry ripeness detection, offering strong potential for real-time implementation in smart sorting lines and robotic harvesting systems. Furthermore, the proposed approach shows promise for broader applications across various precision agriculture tasks.