Res. Agr. Eng., 2025, 71(2):80-87 | DOI: 10.17221/31/2024-RAE
Spoilage detection of tomatoes using a convolutional neural networkOriginal Paper
- 1 Department of Food Engineering and Technology, Tezpur University, Assam, India
With the increasing productivity in agriculture, it has become extremely essential to look for an advanced technique that will help to minimise losses. Recently, deep learning has outperformed the task of recognition and classification of fruits and vegetables automatically from images, finding applicability in this study. This work, thus, attempts to develop an automatic spoilage detection CNN model for tomatoes. In this work, a deep learning-based CNN model is trained and validated on a self-prepared dataset for classifying tomatoes as edible and spoilt is proposed. The dataset consisted of 810 images, out of which 572 images were considered for training and 238 images for validation. The model is also trained iteratively with varying epoch and batch sizes to evaluate the model in giving the highest classification accuracy. The highest accuracy of 99.70% was achieved at epoch 20 and batch size 32. Further evaluating the performance of the developed model using a confusion matrix, a precision, recall and accuracy of 100%, 87% and 95%, respectively, was obtained for the spoilage detection of tomatoes. Also, on establishing Pearson’s correlation between the predictive model and the sensory evaluation results, a Pearson correlation of 0.895 was obtained, showing that there is strong linear correlation between them.
Keywords: tomato samples; training datasets; classification models; models accuracy; images validation
Received: March 25, 2024; Accepted: March 4, 2025; Prepublished online: May 30, 2025; Published: June 18, 2025 Show citation
Supplementary files:
Download file | 31-2024-rae_ESM.pdf File size: 332.11 kB |
References
- Alzubaidi L., Zhang J., Humaidi A.J., Al-Dujaili A., Duan Y., Al-Shamma O., Santamaría J., Fadhel M.A., Al-Amidie M., Farhan L. (2021): Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. Journal of Big Data, 8: 1-74.
Go to original source...
Go to PubMed...
- Batu A. (2004): Determination of acceptable firmness and colour values of tomatoes. Journal of Food Engineering, 61: 471-475.
Go to original source...
- Bergstra J., Bardenet R., Bengio Y., Kégl B. (2011): Algorithms for hyper-parameter optimization. In: 25th Annual Conference on Neural Information Processing Systems, Neural Information Processing Systems Foundation, Granada, Dec 12-15, 2011: 2546-2554.
- Chaturvedi A., Sharma S., Janghel R.R. (2023): Detection of external defects in tomatoes using deep learning. Journal of Ambient Intelligence and Humanized Computing, 14: 2709-2721.
Go to original source...
- Constantino L.V., Rossetto L.M., Benassi M.T., Oliveira C., Zeffa D. M., Koltun A., Resende J.T.V., Gonçalves L.S.A. (2021): Physico-biochemical characterization of mini-tomatoes and internal preference mapping based on consumer acceptance. Scientia Horticulturae, 282: 1-7.
Go to original source...
- Da Costa A.Z., Figueroa H.E., Fracarolli J.A. (2020): Computer vision based detection of external defects on tomatoes using deep learning. Biosystems Engineering, 190: 131-144.
Go to original source...
- Ghosh A. (2009): Identification of microorganisms responsible for spoilage of tomato (Lycopersicon esculentum) fruit. Journal of Phytology, 1: 414-416.
- Goyal K., Kumar P., Verma K. (2024): Tomato ripeness and shelf-life prediction system using machine learning. Journal of Food Measurement and Characterization, 18: 2715-2730.
Go to original source...
- Hu W., Huang Y., Wei L., Zhang F., Li H. (2015): Deep convolutional neural networks for hyperspectral image classification. Journal of Sensors, 2015: 1-12.
Go to original source...
- Ireri D., Belal E., Okinda C., Makange N., Ji C. (2019): A computer vision system for defect discrimination and grading in tomatoes using machine learning and image processing. Artificial Intelligence in Agriculture, 2: 28-37.
Go to original source...
- Itakura K., Saito Y., Suzuki T., Kondo N., Hosoi F. (2019): Classification of soymilk and tofu with diffuse reflection light using a deep learning technique. AgriEngineering, 1: 235-245.
Go to original source...
- Kaur H., Sawhney B.K., Jawandha S.K. (2018): Evaluation of plum fruit maturity by image processing techniques. Journal of Food Science and Technology, 55: 3008-3015.
Go to original source...
Go to PubMed...
- Khalid S., Hassan S.A., Javaid H., Zahid M., Naeem M., Bhat Z.F., Abdi G., Aadil R.M. (2024): Factors responsible for spoilage, drawbacks of conventional packaging, and advanced packaging systems for tomatoes. Journal of Agriculture and Food Research, 15: 1-11.
Go to original source...
- Letsoin S.M.A., Herák D. (2024): The effect of parameter adjustment in sago palm classification-based convolutional neural network (CNN) model. Research in Agricultural Engineering, 70: 123-133.
Go to original source...
- Monselise S.P. (2018): Handbook of Fruit Set and Development. CRC Press, USA.
- Patel K.K., Kar A., Khan M.A. (2020): Development and an application of computer vision system for non destructive physical characterization of mangoes. Agricultural Research, 9: 109-124.
Go to original source...
- Ranatunga C.L., Jayaweera H.H., Ariyaratne T.R. (2008): Evaluation of finger-feel firmness as a subjective measurement of tomato quality degradation in the retail market. Topical Agricultural Research, 20: 134-142.
- Semary N.A., Tharwat A., Elhariri E., Hassanien A.E. (2015): Fruit-based tomato grading system using features fusion and support vector machine. In: Intelligent Systems', Springer, Cham, 2015: 401-410.
Go to original source...
- Taner A., Öztekin Y.B., Duran H. (2021): Performance analysis of deep learning CNN models for variety classification in hazelnut. Sustainability, 13: 6527.
Go to original source...
- Tu S., Xue Y., Zheng C., Qi Y., Wan H., Mao L. (2018): Detection of passion fruits and maturity classification using Red-Green-Blue Depth images. Biosystems Engineering, 175: 156-167.
Go to original source...
- Wan P., Toudeshki A., Tan H., Ehsani R. (2018): A methodology for fresh tomato maturity detection using computer vision. Computers and Electronics in Agriculture, 146: 43-50.
Go to original source...
- Zhou L., Zhang C., Liu F., Qiu Z., He Y. (2019): Application of deep learning in food: a review. Comprehensive Reviews in Food Science and Food Safety, 18: 1793-1811.
Go to original source...
Go to PubMed...
This is an open access article distributed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International (CC BY NC 4.0), which permits non-comercial use, distribution, and reproduction in any medium, provided the original publication is properly cited. No use, distribution or reproduction is permitted which does not comply with these terms.