Skip to main content
Log in

Detection of external defects in tomatoes using deep learning

  • Original Research
  • Published:
Journal of Ambient Intelligence and Humanized Computing Aims and scope Submit manuscript

Abstract

Computer vision helps a computer to understand, classify and label images. Digital cameras can capture images and videos and then be analyzed with deep learning models for accurate identification and classification. Similarly, deep learning can be used for separating defective or unusable items for quality control. This paper presents a method to separate tomatoes that have some form of external defect from ones that do not. External defects may include bruises, aberrations, cuts, and rotten spots. The dataset selected to train our convolutional neural networks (CNN) contains 43,843 images, which is highly biased toward the healthy class. Ever since AlexNet won the ILSVRC 2012, CNN has been used extensively in Deep Learning models. For our paper, five Deep Learning models based on CNN were trained, namely VGG19, ResNet50, DenseNet201, EfficientNetB4, and Inceptionv3. The highest accuracy achieved was 97.97% by EfficientNetB4 while having an average precision of 97.00% and an average recall of 93.00%. These results achieved in our paper on the selected dataset are the highest to date anyone has achieved. This paper compares the different models based on the results, architecture, and effectiveness of the selected datasets.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18

Similar content being viewed by others

Data availability

The dataset used for our project was used in da Costa et al. (2020) and is openly available online and can be accessed through the URL: ArthurZC23 (2018).

References

  • Akiyama Y, Mikami T, Mikuni N (2020) Deep learning-based approach for the diagnosis of moyamoya disease. J Stroke Cerebrovasc Dis 29(12):105322

    Article  Google Scholar 

  • Albawi S, Mohammed TA, Al-Zawi S (2017) Understanding of a convolutional neural network. In: 2017 international conference on engineering and technology (ICET). IEEE, pp 1–6

  • ArthurZC23 (2018) https://github.com/ArthurZC23/Deep-learning-classifier-for-external-defects-in-tomatoes

  • Asuntha A, Srinivasan A (2020) Deep learning for lung cancer detection and classification. Multimed Tools Appl 79(11):7731–7762

    Article  Google Scholar 

  • Azizi A, Gilandeh YA, Mesri-Gundoshmian T, Saleh-Bigdeli AA, Moghaddam HA (2020) Classification of soil aggregates: a novel approach based on deep learning. Soil Tillage Res 199:104586

    Article  Google Scholar 

  • Bansal M, Kumar M, Sachdeva M, Mittal A (2021) Transfer learning for image classification using vgg19: Caltech-101 image data set. J Ambient Intell Humaniz Comput 1–12

  • Brownlee Jason (2019) Deep learning for computer vision: image classification, object detection, and face recognition in python. Machine Learning Mastery

  • Cao J, Zhang Z, Tao F, Zhang L, Luo Y, Zhang J, Han J, Xie J (2021) Integrating multi-source data for rice yield prediction across china using machine learning and deep learning approaches. Agric For Meteorol 297:108275

    Article  Google Scholar 

  • Chandrasegaran K, Tran N-T, Cheung N-M (2021) A closer look at fourier spectrum discrepancies for cnn-generated images detection. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp 7200–7209

  • Chen Y-F, Yang F-S, Su E, Ho C-C (2019) Automatic defect detection system based on deep convolutional neural networks. In: 2019 international conference on engineering, science, and industrial applications (ICESI). IEEE, pp 1–4

  • da Costa AZ, Figueroa HEH, Fracarolli JA (2020) Computer vision based detection of external defects on tomatoes using deep learning. Biosyst Eng 190:131–144

    Article  Google Scholar 

  • Dargan S, Kumar M, Ayyagari MR, Kumar G (2020) A survey of deep learning and its applications: a new paradigm to machine learning. Arch Comput Methods Eng 27(4):1071–1092

    Article  MathSciNet  Google Scholar 

  • Deepak S, Ameer PM (2021) Automated categorization of brain tumor from MRI using CNN features and SVM. J Ambient Intell Humaniz Comput 12(8):8357–8369

    Article  Google Scholar 

  • Escobar CA, Morales-Menendez R (2018) Machine learning techniques for quality control in high conformance manufacturing environment. Adv Mech Eng 10(2):1687814018755519

    Article  Google Scholar 

  • Esgario JGM, Krohling RA, Ventura JA (2020) Deep learning for classification and severity estimation of coffee leaf biotic stress. Comput Electron Agric 169:105162

    Article  Google Scholar 

  • FAO (2021) Faostat. http://www.fao.org/faostat/en/#search/tomato

  • Garg S, Saxena A, Gupta R (2022) Yoga pose classification: a CNN and mediapipe inspired deep learning approach for real-world application. J Ambient Intell Humaniz Comput 1–12

  • Goodfellow I, Bengio Y, Courville A (2016) Deep learning. MIT Press, Cambridge

    MATH  Google Scholar 

  • Habimana O, Li Y, Li R, Xiwu G, Ge Yu (2020) Sentiment analysis using deep learning approaches: an overview. Sci China Inf Sci 63(1):1–36

    Article  Google Scholar 

  • He K, Zhang X, Ren S, Sun J (2016) Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 770–778

  • Hochreiter S (1998) The vanishing gradient problem during learning recurrent neural nets and problem solutions. Int J Uncertain Fuzziness Knowl Based Syst 6(02):107–116

    Article  MATH  Google Scholar 

  • Hossin M, Nasir Sulaiman M (2015) A review on evaluation metrics for data classification evaluations. Int J Data Min Knowl Manag Process 5(2):1

    Article  Google Scholar 

  • Hu Y, Huber A, Anumula J, Liu S-C (2018) Overcoming the vanishing gradient problem in plain recurrent networks. arXiv preprint arXiv:1801.06105

  • Huang G, Liu Z, Van Der Maaten L, Weinberger KQ (2017) Densely connected convolutional networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 4700–4708

  • Jianping J, Zheng H, Xiaohang X, Guo Z, Zheng Z, Lin M (2022) Classification of jujube defects in small data sets based on transfer learning. Neural Comput Appl 34(5):3385–3398

    Article  Google Scholar 

  • Jiuxiang G, Wang Z, Kuen J, Ma L, Shahroudy A, Shuai B, Liu T, Wang X, Wang G, Cai J et al (2018) Recent advances in convolutional neural networks. Pattern Recognit 77:354–377

    Article  Google Scholar 

  • Katumba A, Bomera M, Mwikirize C, Namulondo G, Ajero MG, Ramathani I, Nakayima O, Nakabonge G, Okello D, Serugunda J (2020) A deep learning-based detector for brown spot disease in passion fruit plant leaves. arXiv preprint arXiv:2007.14103

  • Kłosowski Piotr (2018) Deep learning for natural language processing and language modelling. In: 2018 signal processing: algorithms, architectures, arrangements, and applications (SPA). IEEE, pp 223–228

  • Krizhevsky A, Sutskever I, Hinton GE (2012) Imagenet classification with deep convolutional neural networks. Adv Neural Inf Process Syst 25

  • Lavin A, Gray S (2016) Fast algorithms for convolutional neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 4013–4021

  • Li X, He M, Li H, Shen H (2021) A combined loss-based multiscale fully convolutional network for high-resolution remote sensing image change detection. IEEE Geosci Remote Sens Lett 19:1–5

    Google Scholar 

  • Lu Z, Pu H, Wang F, Hu Z, Wang L (2017) The expressive power of neural networks: a view from the width. Adv Neural Inf Process Syst 30

  • Masita KL, Hasan AN, Shongwe T (2020) Deep learning in object detection: a review. In: 2020 international conference on artificial intelligence, big data, computing and data communication systems (icABCD). IEEE, pp 1–11

  • Mehl PM, Chen Y-R, Kim MS, Chan DE (2004) Development of hyperspectral imaging technique for the detection of apple surface defects and contaminations. J Food Eng 61(1):67–81

    Article  Google Scholar 

  • Mohanty SP, Hughes DP, Salathé M (2016) Using deep learning for image-based plant disease detection. Front Plant Sci 7:1419

    Article  Google Scholar 

  • Moses K, Miglani A, Kankar PK et al (2022) Deep CNN-based damage classification of milled rice grains using a high-magnification image dataset. Comput Electron Agric 195:106811

    Article  Google Scholar 

  • Muneeb M, Feng SF, Henschel A (2022) Deep learning pipeline for image classification on mobile phones. arXiv preprint arXiv:2206.00105

  • Nwankpa C, Ijomah W, Gachagan A, Marshall S (2018) Activation functions: comparison of trends in practice and research for deep learning. arXiv preprint arXiv:1811.03378

  • Paul A, Pramanik R, Malakar S, Sarkar R (2022) An ensemble of deep transfer learning models for handwritten music symbol recognition. Neural Comput Appl 34(13):10409–10427

    Article  Google Scholar 

  • Raghu M, Poole B, Kleinberg J, Ganguli S, Sohl-Dickstein J (2017) On the expressive power of deep neural networks. In: International conference on machine learning, PMLR. pp 2847–2854

  • Scherer D, Müller A, Behnke S (2010) Evaluation of pooling operations in convolutional architectures for object recognition. In: International conference on artificial neural networks. Springer, pp 92–101

  • Sejnowski TJ (2020) The unreasonable effectiveness of deep learning in artificial intelligence. Proc Natl Acad Sci 117(48):30033–30038

    Article  MATH  Google Scholar 

  • Simonyan K, Zisserman A (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556

  • Singh R, Athisayamani S et al (2020) Banana leaf diseased image classification using novel heap auto encoder (hae) deep learning. Multimed Tools Appl 79(41):30601–30613

    Google Scholar 

  • Steinkraus D, Buck I, Simard PY (2005) Using gpus for machine learning algorithms. In: Eighth international conference on document analysis and recognition (ICDAR’05). IEEE, pp 1115–1120

  • Szegedy C, Vanhoucke V, Ioffe S, Shlens J, Wojna Z (2016) Rethinking the inception architecture for computer vision. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp 2818–2826

  • Tan M, Le Q (2019) Efficientnet: rethinking model scaling for convolutional neural networks. In: International conference on machine learning, PMLR. pp 6105–6114

  • Turkoglu Muammer, Hanbay Davut, Sengur Abdulkadir (2019) Multi-model lstm-based convolutional neural networks for detection of apple diseases and pests. Journal of Ambient Intelligence and Humanized Computing 1–11

  • Umer M, Ashraf I, Ullah S, Mehmood A, Choi GS (2022) Covinet: a convolutional neural network approach for predicting COVID-19 from chest X-ray images. J Ambient Intell Humaniz Comput 13(1):535–547

    Article  Google Scholar 

  • WHO (2020) Food safety. https://www.who.int/news-room/fact-sheets/detail/food-safety

  • Wu D, Wang Y, Xia S-T, Bailey J, Ma X (2020) Skip connections matter: on the transferability of adversarial examples generated with resnets. arXiv preprint arXiv:2002.05990

  • Yamashita R, Nishio M, Do RKG, Togashi K (2018) Convolutional neural networks: an overview and application in radiology. Insights Imaging 9(4):611–629

    Article  Google Scholar 

  • Yang J, Li S, Wang Z, Dong H, Wang J, Tang S (2020) Using deep learning to detect defects in manufacturing: a comprehensive survey and current challenges. Materials 13(24):5755

    Article  Google Scholar 

  • Zhao Z-Q, Zheng P, Shou-tao X, Xindong W (2019) Object detection with deep learning: a review. IEEE Trans Neural Netw Learn Syst 30(11):3212–3232

    Article  Google Scholar 

Download references

Funding

No funding was received to assist with the preparation of this manuscript.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sanjeev Sharma.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chaturvedi, A., Sharma, S. & Janghel, R.R. Detection of external defects in tomatoes using deep learning. J Ambient Intell Human Comput 14, 2709–2721 (2023). https://doi.org/10.1007/s12652-023-04514-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12652-023-04514-y

Keywords

Navigation