Journal of Electrical Engineering and Computer (JEECOM)
Vol 7, No 2 (2025)

Improving Tomato Ripeness Classification Using Knowledge Distillation and Hyperparameter Optimization with Optuna

Sholihin, Iasya (Unknown)
Sunyoto, Andi (Unknown)



Article Info

Publish Date
15 Sep 2025

Abstract

Automatic 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.

Copyrights © 2025






Journal Info

Abbrev

jeecom

Publisher

Subject

Control & Systems Engineering Electrical & Electronics Engineering Energy

Description

Journal of Electrical Engineering and Computer (JEECOM) is published by Engineering Faculty of Nurul Jadid University, Probolinggo, East Java, Indonesia. This journal encompasses research articles, original research report, : 1) Power Systems, 2) Signal, System, and Electronics, 3) Communication ...