Integrating ResNet-50 and Vision Transformer Architectures for Robust and Efficient Tomato Fruit Ripeness Classification
DOI:
https://doi.org/10.63313/AERpc.2013Keywords:
Deep Learning, Tomato Classification, ResNet-50, Vision Transformer, Computer Vision, Smart Agriculture, Crop Quality Control, Automated SortingAbstract
This article introduces a new hybrid deep learning framework that combines ResNet-50 and Vision Transformer (ViT) models to classify tomato fruits by ripeness and quality. The hybrid model takes advantage of the ResNet-50's capability to extract features in local spatial regions. Additionally, it combines ResNet-50 with ViT's ability to establish a global contextual relationship between elements with self-attention. The framework overcomes the limitations of utilizing a single model. The framework was trained and evaluated, using a balanced and diverse dataset. It consists of four tomato classes, ripe, unripe, unevenly ripened, and damaged, collected under controlled conditions in the field. The experiments conducted aggressively in the study demonstrated a high classification accuracy of 98% with a hybrid framework compared to individual ResNet-50 and ViT models. The results in addition to the general performance were validated further using precision, recall, the area under the curve (AUC) and the F1-score. The study also included a computational efficiency test to look for accuracy versus multiple time and spatial resource costs. The research successfully addresses the challenges with dataset diversity, computational costs, and real-time feature deployments through the conceptualization of strategies (data augmentation, transfer learning) to improve generalization. The hybrid framework is expected to provide similar design principles and measures for use with other agricultural products. It can help in real-time sorting applications in variable real-world scenarios in agricultural operations. The research provides a pathway for developing smarter, scalable, and sustainable solutions in food quality and safety systems within precision agriculture. Future work will incorporate deployment and optimize the framework for edge devices in a real-world variable farm environment.
References
[1] FAO, "FAOSTAT," Food and Agriculture Organizatition of the United Nations, 2022. [Online]. Available: https://www.fao.org/faostat/en/#data/QCL/visualize. [Accessed September 2024].
[2] G. Aladekoyi, O. A. Ajala and O. A. Shakpo, "The Effect of Moringa Seeds Oil and Shea Butter Oil Waxing On the Post-Harvest Life of Tomato Fruit (Solanum lycopersicum)," European Journal of Food Science and Technology, vol. 11, no. 1, pp. 36-49, 2023.
[3] A. Kabas and I. Celik, "Effect of newly developed interspecific hybrid rootstocks on miner-al nutrient composition and fruit quality in tomato (Solanum lycopersicum L.)," Acta Ali-mentaria, vol. 50, no. 3, p. 383–392, 2021.
[4] Z. Lang, Y. Wang, K. Tang, D. Tang, T. Datsenka, J. Cheng, Y. Zhang , A. Handa and J. Zhu, "Critical roles of DNA demethylation in the activation of ripening-induced genes and inhi-bition of ripening-repressed genes in tomato fruit," Proceedings of the National Academy of Sciences, vol. 114, no. 22, p. E4511–E451, 2017.
[5] L. Coman, "african american workers picking tomatoes from a conveyer belt sorting them by size," Shutterstock, January 2024. [Online]. Available: https://www.shutterstock.com/image-photo/african-american-workers-picking-tomatoes-conveyer-2412134441. [Accessed September 2024].
[6] V. Jaya, M. Sai, P. Rishitha and U. Prabu, "A Comprehensive Study on Fruit Classification and Grading Techniques," 2022 3rd International Conference on Electronics and Sustainable Communication Systems (ICESC), pp. 970-978, 2022.
[7] S. Kaur, A. Girdhar and J. Gill, Computer vision-based tomato grading and sorting, Springer, Singapore, 2018.
[8] Y. Chen, N. Zhang, A. Wang, Z. Liu and J. Yue, "Automatic classification of tomato leaf dis-eases based on MtConvNeXt model," 2024 8th International Conference on Electrical, Me-chanical and Computer Engineering (ICEMCE), pp. 2021-2025, 2024.
[9] P. Das, J. K. P. S. Yadav and A. K. Yadav, "An Automated Tomato Maturity Grading System Using Transfer Learning Based AlexNet," In Ingénierie des Systèmes d Inf., vol. 26, no. 2, pp. 191-200, 2021.
[10] C. Janiesch, P. Zschech and K. Heinrich, "Machine learning and deep learning," Electron Markets, no. 31, p. 685–695, 2021.
[11] M. O. Pallavi and A. Raj, "Tomato Disease Prediction Model using Machine Learning Algo-rithms and Image Processing Techniques," 2024 6th International Conference on Compu-tational Intelligence and Networks (CINE), pp. 1-6, 2024.
[12] A. Hemalatha and J. Vijayakumar, "Automatic Tomato Leaf Diseases Classification and Recognition using Transfer Learning Model with Image Processing Techniques," 2021 Smart Technologies, Communication and Robotics (STCR), pp. 1-5, 2021.
[13] K. He, X. Zhang, S. Ren and J. Sun, "Deep Residual Learning for Image Recognition," IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, 2016.
[14] P. Shukla and M. Kumar, "Explicating ResNet for Facial Expression Recognition," Interna-tional Journal of Computing, Intelligent and Communication Technology, vol. 11, no. 3, pp. 2319-748X, 2022.
[15] M. Sahaai, G. Jothilakshmi and D. Ravikumar, "ResNet-50 based deep neural network using transfer learning for brain tumor classification," AIP Conference Proceedings, vol. 2463, no. 1, p. 020014, 2022.
[16] S. Kumar, S. Pal, V. Singh and P. Jaiswal, "Performance evaluation of ResNet model for clas-sification of tomato plant disease," Epidemiologic Methods, vol. 12, no. 1, p. 20210044, 2023.
[17] S. Alshammari, "TLDViT: A Vision Transformer Model for Tomato Leaf Disease Classifica-tion," International Journal of Advanced Computer Science and Applications (IJACSA), vol. 15, no. 12, pp. 841-848, 2024.
[18] E. Baek, "Attention Score-Based Multi-Vision Transformer Technique for Plant Disease Classification," Sensors (Basel, Switzerland)., vol. 25, no. 1, p. 270, 2025.
[19] Y. Xu, H. Wei, M. Lin, Y. Deng, K. Sheng, M. Zhang, F. Tang, W. Dong, F. Huang and C. Xu, "Transformers in computational visual media: A survey," Computational Visual Media, vol. 8, no. 1, pp. 33-62, 2022.
[20] A. Warohma, H. Hindersah and D. Lestari, "Speaker Recognition Using MobileNetV3 for Voice-Based Robot Navigation," 2024 11th International Conference on Advanced Infor-matics: Concept, Theory and Application (ICAICTA), pp. 1 - 6, 2024.
[21] H. Mputu, A. Abdel-Mawgood, A. Shimada and M. Sayed, "Tomato Quality Classification Based on Transfer Learning Feature Extraction and Machine Learning Algorithm Classifi-ers," IEEE Access, vol. 12, pp. 8283-8295, 2024.
[22] M. Jagatheeswari and Y. Rao, "A Hybrid Approach based on Metaheuristics and Machine Learning for Tomato Plant Leaf Disease Classification," 2022 IEEE 4th International Con-ference on Cybernetics, Cognition and Machine Learning Applications (ICCCMLA), pp. 1-6, 2022.
[23] A. Boukhris, J. Antari, H. Asri and A. Sadiq, "Detection and Identification of Tomato Disease Based on Deep Learning and Machine Learning algorithms," 2023 IEEE Af-ro-Mediterranean Conference on Artificial Intelligence (AMCAI), pp. 1-6, 2023.
[24] L. Quach, K. Quoc, A. Quynh, H. Ngoc and N. Thai-Nghe, "Tomato Health Monitoring System: Tomato Classification, Detection, and Counting System Based on YOLOv8 Model With Ex-plainable MobileNet Models Using Grad-CAM++," IEEE Access, vol. 12, pp. 9719-9737, 2024.
[25] G. Ezhilarasan, S. Ranganathan, L. Mani and S. Kadry, "An intelligent deep residual learning framework for tomato plant leaf disease classification," International Journal of Electrical and Computer Engineering (IJECE), vol. 14, no. 3, pp. 3168-3178, 2024.
[26] R. Kasera, S. Nath, B. Das, A. Kumar and T. Acharjee, "IoT Enabled Smart Agriculture System for Detection and Classification of Tomato and Brinjal Plant Leaves Disease," Scalable Comput. Pract. Exp., vol. 26, pp. 96-113, 2025.
[27] M. Mahajan, D. Upadhyay, M. Aeri, V. Kukreja and R. Sharma, "Smart Agriculture: Leverag-ing CNN-RF Fusion for Enhanced Tomato Disease Classification," 2024 3rd International Conference for Innovation in Technology (INOCON), pp. 1-5, 2024.
[28] A. Ali and A. Abdulazeez, "Transfer Learning in Machine Learning: A Review of Methods and Applications," Indonesian Journal of Computer Science, vol. 13, no. 3, pp. 4227-4259, 2024.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 by author(s) and Erytis Publishing Limited.

This work is licensed under a Creative Commons Attribution 4.0 International License.