Automatic Fruit and Vegetable Detection and Disease Identification System

DOI : 10.17577/IJERTCONV8IS15017

Download Full-Text PDF Cite this Publication

Text Only Version

Automatic Fruit and Vegetable Detection and Disease Identification System

R Chandramma

Ramya C

Computer Science and Engineering

Computer Science and Engineering

Vivekananda Institute of Technology

Vivekananda Institute of Technology

Bangalore-560070, India

Bangalore-560060, India

S Vinitha

Computer Science and Engineering Vivekananda Institute of Technology Bangalore-560070, India

Shivani P R

Computer Science and Engineering Vivekananda Institute of Technology Bangalore-560070, India

Vidya M S

Computer Science and Engineering Vivekananda Institute of Technology Bangalore-560070, India

Abstract Nowadays in agriculture industry exporting the fruits to other countries in bulk quantities is a difficult task. In this field farmers need manual inspection. Our system helps the farmers to pack their fruits as soon as possible by detecting the fruits and vegetable and identifying the disease this helps the farmers to save their time and they can delivery fruits and vegetable as soon as possible. We use CNN algorithm for fruits and vegetable detection and disease identification. Using neural network the image is segmented which is followed by extraction of some features from the segmented image finally fruits and vegetable image is identified and labeled.

Keywords agribusiness science, CNN algorithm

  1. INTRODUCTION (Heading 1)

    This system developed based on automatic vision technology. Efficient fruit and vegetable detection is crucial in present trend. In the field of agriculture manual inspection is difficult task to detect and identify the fruit image using this technology we are increasing an agriculture and fruit industry. There are many types of fruits and vegetable in world and species can be around 3 to 4 lacks. India is the second largest country in production of fruits and vegetable. This approach for identifying fruits and vegetable based on naked eye observation by expert which is time consuming in bulk quantities. We should identify the disease in fruits and vegetable as soon as possible if we check in final stage we should remove the defected fruits or else it will spread to other fruits and vegetable. Here automatic fruit identification of defected fruits and vegetable. The aim of our system is to identify the fruit image and it will be labeled if the fruit is defected it will sent as input for disease identification. Then the image processing are done to get required features of fruits and vegetable. Our proposed system helps the customers to buy good fruits and vegetables. The objective of our work to help the buyers to buy good fruits and vegetable without dying

    their time. Neural network technique is used for image classification and identification of fruits and vegetable.In this system Convolutional Neural Network is used.


    Suchet et al., proposed accurate fruit detection system based on Faster R-CNN.Data augumentation technique was used for consequential performance improvements and a roofing approach was used. [1]

    Nikhitha et al., proposed a system which was based on convolutional neural network for classification and grading of fruits based on infection percentage. [2]

    Seema et al., proposed a system which is based on fruit detection and grading system. The technique used is image processing. ANN is used for feature extraction from the image which is captured and quality of fruit can be evaluated using KNN. [3]

    Rohan et al., developed a system which automatically categorize the fruits based on image captured. The proposed system uses CNN. [4]

    Gayathri et al., described that manual including of fruits is lot

    of time consuming and requires more effort. The purpose of this system is to minimize the number of human interactions, speedup documentation process and improve the usability of the GUI compared to present system. Make use RGB color model which does not produce much correct result. [5] Zania et al., proposed a system which was suitable only for smooth surfaced fruits like grapes and apple which lacks definition and contrasting features and the color of the fruit matches with background. [6]

    Ghobad et al., proposed a system which was based on segmentation of image and it is one of the image processing application. [7]

    Santi et al., has provided automatic method which was very useful in large farm with many fruits for packaging purpose. This method was mainly based on four features like color, texture, shape and appearance. The SVM classifier is used for identification of the type of fruit and detection of disease. [8] Hung et al., proposed fruit identification system which is based on color, shape and size. It increases accuracy of the system by combining these features. This system identifies fruit based on feature values obtained by using nearest neighbors classification. Methodology used is RGB color model and KNN classifier technique. [9]

    J Moonrinta et al., has delivered method for classification of fruits accurately. Methodology used is Segmentation technique, SVM and Feature Extraction Technique. [10]

    C. S. Nandhi et al., Methodology used in this system is Segmentation Technique, Support Vector Machine (SVM) and Feature Extraction. Here preprocessing is done to separate the fruit in the foreground from the background. After the model is completely been trained it can be used to detect the fruit based on the validation set [11]

    H. Ayasso et al., has proposed Digital Image Processing Technique is used for fruit freshness detection. They have also included the study and analysis of various algorithms and feature extraction techniques which are used in the captured digital images. The quality of fruit is identified based on the parameters like size, color and weight. All these algorithms are implemented using RASPBERRY PI development board which will become an independent. [12]

    Sukhpreet Kaur et al., has proposed an automatic fruit quality detection system which is used for sorting, grading and defect of the fruit. This helps to increase the accuracy, processing speed and efficiency and reduce time. The image processing is done based on the features of fruits such as color and size [13] Dakshayini Patil et al. here K-means clustering method is used and for identification of fruit diseases purpose Artificial Neural Network (ANN) and GLCM used. . Here there are two databases, one for training and another for testing purpose. [14]

    Chinnaraj Velappan et al., Methodology utilized in this system is machine vision system which includes the Vision box hardware and Digital Image Processing for fruit detection. [15]

    Roberts et al., K-Denotes clustering is utilized for segmentation of images, and features extracted from the segmented images are relegated into a single class using a Multi-class Support Vector Machine. [16]

    Rupam Thakur et al., The main goal is to identify the fruit diseases using Artificial Neural Network concept. Which automatically detect of fruit diseases automatically based on symptoms of diseases as they are seen on the growing fruits.The sundry types fruits determines the quality, quantity and stability. [17]

    Vimala Devi et al., the sundry techniques utilized in automatic inspection of fruits. There the predication is based on color, shape and size. Machine vision methods provide automatic inspection and analysis predicated on images. [18] Neeraj et al. ,has provided a system that utilizes SVM for the relgation of defected and non-defected Indian mangoes. K- Mean clustering and FCM algorithm are used for disease detection. [19]

    Horea Mures et al. ,Neural Network is used to train and detect fruits. During this project we were able to explore part of the deep learning algorithms and compare strengths and impotencies. [20]


    In this model Raspberry Pi 3 Model B is used which is the earliest model of the third-generation Raspberry Pi with 1GB RAM and a Micro SD port is available for extending memory and loading the operating system and storing data. Raspberry Pi has 40-pin extended GPIO(General Purpose Input Output) pins for connecting the peripheral devices like monitor, keyboard, mouse, etc. Raspberry Pi also has CSI( Camera Serial Interface) camera port for connecting a Raspberry Pi camera through which is used to capture the images and that is runned by using a Programming Language called Python. This is one of the main component of the project. OpenCV (Open Source Computer Vision) is a image processing library. It is mainly used to do all operations related to images. It is mainly based on image processing. The Raspberry Pi camera module can be used to take high definition photographs. The camera consists of a circuit board, which connects the Raspberry Pis Camera Serial Interface(CSI) bus connector through a flexible cable. The figure 1 shows the architecture of fruit detection and disease identification system where the fruit name is labeled and then whether the identified fruit is defected or not. The figure 2 shows the architecture of vegetable detection and disease identification system where the vegetable name is labeled and then displays whether it is defected or of good quality. The model is based on the principle of image processing. The image to be detected is captured using Raspberry Pi camera attached to Raspberry Pi after image is identified it is labeled with the fruit or vegetable name and then it is displayed where it is defected or not.

    Fig.1. Fruit detection and disease identification Architecture

    The different modules in this project are:

    • Collecting the Dataset.

    • Building the CNN

    • Data Augmentation

    1. Collecting the Dataset

      In order to train our machine, we need a huge amount of data so that our model can learn from them by identifying out certain relations and common features related to the objects. This will help in training as well as testing our classifier. The dataset is created by downloading the images. A challenging data set of 3 fruits categories, with 2403 images in total are introduced. There are 2 vegetable categories with 1000 images.

    2. Building The CNN

      Fig. 2. Architecture of CNN Algorithm

      The system is trained by our image dataset. When the fruit image is captured by the camera the system identifies the fruit using on Convolutional Neural Network (CNN) algorithm. CNN is composed of two major components:

      1. Feature extraction: At this point, the network will perform a number of convolutions and pooling operations during which the features are detected. If you had a picture of a watermelon. This is the component where the network would agonize its stripes and shape.

      2. Classification: Here, the completely associated layers will accommodate as a classifier on best of these extricated highlights. The likelihood will be doled out for the protest on the picture being what the calculation presages. The fruit or vegetable image is captured and identified utilizing CNN algorithm. In the next step, the captured and identified image is processed for disease detection. If the fruit or vegetable is defected then it is disease is identified and labelled as deplorable quality else it is labelled as good quality Steps in CNN Algorithm

        INPUT: In this phase the input is taken in the form of image using Raspberry Pi camera. The image is then sent to the

        Raspberry Pi

        Fig. 3. Captured apple fruit

        TRAINING: In this step the features are extracted from the input image which is further converted into pixel values. Convolution is utilized for conversion of image into pixel values which preserves the relationship by learning image features utilizing diminutive squares of the input.

        Fig. 4. Feature Extraction

        POOLING LAYER: In pooling layer the size of the image is reduced into a more minute size. Pooling is done after p assing through activation layer. This is done by 4 steps Choosing window size Choosing a stride By examining window across filtered images Picking up the maximum value.

        STACKING UP THE LAYERS: In this we convert 7*7 matrix into 4*4 matrix after passing through first three layers such as convolution, ReLU and pooling. FULLY CONNECTED LAYER:

        In this layer we are completed with training the network and the prediction and working of classifier can be done.

        Fig. 5. Fruit identification output

    3. Data Augmentation

    Data augmentation may be a procedure that empowers clients to extend the differences of information accessible for training models, without really collecting beginning information. Distinctive information enlargement strategies are editing, cushioning, and horizontal flipping are commonly utilized to prepare sizably voluminous neural systems. Data augmentation is a way we can abbreviate over fitting on models, where we increment the quantity of training data utilizing information only in our training data. The field of data augmentation is not incipient, and in fact, sundry data augmentation techniques have been applied to categorical quandaries. The below figure shows the augmented data of the banana fruit in the same way the data is augmented for the remaining fruits like orange,apple and vegetables broccoli and carrot.

    Fig. 6. Banana fruit data augmentation


    The purpose of the proposed system is to automate the fruit or vegetable detection and to automatically identify the disease of the identified fruit or vegetable. In this system the input fruit image captured by the raspberry pi camera is labeled and a message is sent to the utilizer. If the fruit or vegetable is defected then along with the message of the fruit name the image of the defected fruit or vegetable is mailed.

    Fig. 7. Defected banana image sent to mail


An image processing predicated solution is proposed and evaluated for the detection and relegation of fruit quality. The proposed system is composed of mainly three steps. In the first step the data is accumulated. In the second step, features are extracted and the machine is trained. In the third step, the trained machine will identify the fruit image and label it. In the fourth step it will identify the disease associated with the identified fruit. It would withal advance Indian agriculturists to do keenly intellective cultivating, which profits to require time to time decisions, which withal protect time and shorten misfortune of natural product due to quality. The driving objective of our work is to upgrade the esteem of fruit quality discovery.


The satisfaction and euphoria that accompany the successful completion of any task would be incomplete without the mention of people who made it possible because Success is the abstract of hard work and perseverance, but steadfast of is encouraging guidance. So, I acknowledge all those whose guidance and encouragement served as a beacon light and crowned our efforts with success. Im grateful to our beloved guide Prof. R Chandramma, Associate Professor, Dept of Computer Science and Engineering for her valuable guidance and support express our deep felt gratitude to beloved HOD Dr. Vidya A, Professor and Head, Dept. of Computer Science.


  1. Suchet Bargoti and James Underwood Deep Fruit Detection in Orchards 2017 IEEE International Conference on Robotics and Automation (ICRA)Singapore, May 29 June

  2. the Third International Conference on Electronics Communication and Aerospace Technology [ICECA 2019].

  3. Ms. Seema Banot1, Dr. P.M. Mahajan2 A Fruit Detecting and GradingSystemBasedonImageProcessing-Review


  4. Rohan Sriram1, Amar Tejas M2, Prof. J. Girija3 Mango Classification using Convolutional Neural Networks International Research Journal of Engineering and Technology (IRJET) Volume: 05 Issue: 11 Nov 2018.

  5. Gayathri A 2Aparna Menon 3Amitha Jiju 4Divya V Chandran Fruit Detection and Sorting based on Machine Learning Global Research and Development Journal for Engineering National Conference on Emerging Research Trend in Electrical and Electronics Engineering (ERTE19) May 2019.

  6. Zania S Pothen1 and Stephen Nuske2 Texture-based Fruit Detection via Images using the Smooth Patterns on the Fruit 2016 IEEE International Conference on Robotics and Automation (ICRA) Stockholm, Sweden, May 16-21, 2016.

  7. Ghobad Moradi, Mousa Shamsi, Mohammad H. Sedaghi, Mohammad

    R. Alsharif Fruit defect detection from color images using ACM and MFCM algorithms 2011 International Conference on

    Electronic Devices, Systems and Applications(lCEDSA).

  8. Santi Kumari Behera, Amiya Kumar Rath, Prabira Kumar Sethy Automatic Fruits Identification and Disease Analysis using Machine Learning Techniques International Journal of Innovative Technology and Exploring Engineering (IJITEE).

  9. W.K. Jung and N.I Cho, Relevance Feedback in Content-Based Image Retrieval System by Selective Region Growing in the Feature Space. Signal Processing: Image Communication.

  10. J. Moonrinta, S. Chaivivatrakul, M. N. Dailey and M. Ekpanyapong, Fruit detection, tracking, and 3D reconstruction for crop mapping and yield estimation, IEEE, 11th International Conference on Control Automation Robotics Vision.

  11. C. S. Nandi, B. Tudu, and C. Koley, A machine vision-based maturity prediction system for sorting of harvested mangoes, IEEE

    Trans. Instrum. Meas.

  12. Jednipat Moonrinta, Supawadee Chaivivatrakul, Matthew N. Dailey, Mongkol Ekpanyapong Fruit Detection, Tracking, and 3D Reconstruction for Crop Mapping and Yield Estimation.

  13. Sukhpreet Kaur, Akshay Girdhar and Jasmeen Gill, Computer VisionBased Tomato Grading and Sorting. J. Gill RIMT IET, Mandi Gobindgarh, India © Springer Nature Singapore Pte Ltd. 2018 M. L. Kolhe et al. (eds.), Advances in Data and Information Sciences, Lecture Notes in Networks and Systems.

  14. Dakshayini Patil Fruit Disease Detection using Image Processing Techniques International Journal for Research in Engineering Application Management (IJREAM).

  15. Chinnaraj Velappan1, K. Subbulakshmi*2 International Journal of Advanced Research in Electrical, Electronics and Instrumentation Engineering.

  16. Roberts, M. J., Schimmelpfennig, D., Ashley, E., Livingston, M., Ash, M., in Communication, Computing and Electronics Technology [ACCET-2016] held at M. E.

  17. Rupam Thakur, 2Priyanka Mehta Automatic detection of fruit diseases: A Review 2017 IJEDR Volume 5, Issue 3 ISSN: 2321-9939.

  18. Y.B. Ravi Kumar, C.K. Narayanappa, Dayananda P,Weighted full binary treesliced binary pattern: An RGB-D image descriptor,Heliyon, Volume 6, Issue 2020,e03751.


  20. Neeraj Kumari, DAshutosh Kr. Bhatt, Rakesh Kr. Dwivedi, Rajendra Belwal Performance Analysis of Support Vector Machine in Defective and Non Defective Mangoes Classification International Journal of Engineering and Advanced Technology.

  21. Horea MURESAN1, Mihai OLTEAN2 Fruit recognition from images using deep learning.

Leave a Reply