Improving Tomato Ripeness Classification Using Knowledge Distillation and Hyperparameter Optimization with Optuna
Authors (s)
(1) * Iasya Sholihin  

        Indonesia
(2)  Andi Sunyoto   (Universitas Amikom Jogyakarta)  
        Indonesia
(*) Corresponding Author
AbstractAutomatic classification of tomato ripeness plays a crucial role in ensuring post-harvest quality and efficiency in the horticultural industry.
This study proposes a combined strategy of Knowledge Distillation (KD) and hyperparameter optimization using Optuna to improve the accuracy of the ResNet50 student model by leveraging the performance of a MobileNetV2 teacher model.We used a publicly available Kaggle dataset containing 8,540 images, categorized into four ripeness levels (green, red, ripe, and rotten), comprising 7,157 training images and 1,383 validation images.Each image was resized to 224×224 pixels; light augmentation techniques (random rotation, brightness–contrast adjustment, flipping, and Gaussian blur) were applied only to the training set to prevent overfitting while maintaining consistency during evaluation.The MobileNetV2 teacher model was initially fine-tuned on the last 20 layers using manual hyperparameters (freeze_until = 20, dropout = 0.6), achieving an accuracy of 85.8%.Subsequent tuning via Optuna identified the optimal configuration (freeze_until = 91, dropout_rate = 0.5055), which improved the teacher’s performance to 89.6%.The resulting teacher model was then used to distill knowledge into the ResNet50 student: under manual settings, the student’s accuracy improved from 55.24% to 73.25%; when the student model was also optimized using Optuna, its accuracy surged to 85.54% nearly matching the teacher.Further evaluation using a confusion matrix and ROC curves revealed an increase in per-class AUC to the range of 0.91–0.99 in the KD + Optuna student model, confirming that this method effectively closes the performance gap between student and teacher.These findings demonstrate that combining KD with Optuna-based hyperparameter optimization is an effective approach for producing a lightweight, fast, and highly accurate tomato ripeness classification model ready for deployment in field applications to support post-harvest decision-making. |
Keywords
Tomato Ripeness Classification; Knowledge Distillation; Optuna; Hyperparameter Tuning ResNet50; MobileNetV2
Full Text: PDF
Refbacks
- There are currently no refbacks.
Copyright (c) 2025 Iasya Sholihin

This work is licensed under a Creative Commons Attribution License (CC BY-SA 4.0)
Journal of Electrical Engineering and Computer (JEECOM)
Published by LP3M Nurul Jadid University, Indonesia, Probolinggo, East Java, Indonesia.