Abstract
Classification of various types of fruits and identification of the grading of fruit is a burdensome challenge due to the mass production of fruit products. In order to distinguish and evaluate the quality of fruits more precisely, this paper presents a system that discriminates among four types of fruits and analyzes the rank of the fruit-based on its quality. Firstly, the algorithm extracts the red, green, and blue values of the images and then the background of images was detached by the split-and-merge algorithm. Next, the multiple features (30 features) namely color, statistical, textural, and geometrical features are extracted. To differentiate between the fruit type, only geometrical features (12 features), other features are used in the quality evaluation of fruit. Furthermore, four different classifiers k-nearest neighbor (k-NN), support vector machine (SVM), sparse representative classifier (SRC), and artificial neural network (ANN) are used to classify the quality. The classifier has been contemplated with four different databases of fruits: one having 4359 color images of apples; out of which 2342, are with various defects, second having 918 color images of avocado out of which 491 are of with various defects, third having 3805 color images of banana out of which 2224 are with various defects, and fourth having 3050 color images of oranges out of which 1590 are with various defects. The system performance has been validated using the k-fold cross-validation technique by considering different values of k. The maximum accuracy achieved for fruit detection is 80.00% (k-NN), 85.51% (SRC), 91.03% (ANN), and 98.48% (SVM) for k = 10.The classification among Rank1, Rank2, and defected maximum accuracy is 77.24% (k-NN), 82.75% (SRC), 88.27% (ANN), and 95.72% (SVM) achieved by the system. SVM has seen to be more effective in quality evaluation and results obtained are encouraging and comparable with the state of art techniques.
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig1_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig2_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig3_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig4_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig5_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig6_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig7_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs12161-019-01690-6/MediaObjects/12161_2019_1690_Fig8_HTML.png)
Similar content being viewed by others
References
Al-Osaimi FR, Bennamoun M, Mian A (2011) Illumination normalization of facial images by reversing the process of image formation. Mach Vis Appl 22(6):899–911
Anonymous (2004) Commission regulation (ec) no 85/2004 of 15 January 2004 on marketing standards for apples. Off. J. Eur. Union L 13, 3–18.
Ashok V, Vinod DS (2014) Automatic quality evaluation of fruits using probabilistic neural network approach. International Conference on Contemporary Computing and Informatics (IC3I):308–331
Banot S, Mahajan PM (2016) A fruit detecting and grading system based on image processing-review. Int J Innov Res Electr Electron Instrum Control Eng:47–52
Bhargava A, Bansal A (2018) Fruits and vegetables quality evaluation using computer vision: a review. J King Saud Univ Comput Inf Sci. https://doi.org/10.1016/j.jksuci.2018.06.002
Blasco J, Aleixos N, Molto E (2003) A machine vision system for automatic quality grading of fruit. Biosyst Eng 85(4):415–423
Blasco J, Aleixos N, Gomez-Sanchis J, Molto E (2009) Recognition and classification of external skin damage in citrus fruits using multispectral data and morphological features. Biosyst Eng 103(2):137–145
Brosnan T, Sun DW (2004) Improving quality inspection of food products by computer vision-a review. J Food Eng 61:3–16
Butz P, Hofmann C, Tauscher B (2005) Recent developments in non-invasive techniques for fresh fruit and vegetable internal quality analysis. J Food Sci 70(9):131–141
Chang CC, Lin CJ (2001) Libsvm: a library for support vector machines, via http://www.csie.ntu.edu.tw/cjlin/libsvm
Clement J, Novas N, Gazquez J, Manzano-Agugliaro F (2012) High speed intelligent classifier of tomatoes by colour, size and weight. Span J Agric Res 10(2):314–325
Deepa P, Geethalakshmi SN (2012) A comparative analysis of watershed and color based segmentation for fruit grading. Int J Soft Comput Eng 2(3):11–15
Dorj UO, Lee M, Yum S (2017) An yield estimation in citrus orchards via fruit detection and counting using image processing. Comput Electron Agric 140:103–112
Dubey SR, Jalal AS (2015) Apple disease classification using color, texture and shape features from images. Springer-Verlag, London
ElMasry G, Cubero S, Molto E, Blasco J (2012a) In-line sorting of irregular potatoes by using automated computer-based machine vision system. J Food Eng 112(1–2):60–68
Elmasry G, Kamruzzaman M, Sun DW, Allen P (2012b) Principles and applications of hyperspectral imaging in quality evaluation of agro-food products: a review. Crit Rev Food Sci Nutr 52(11):999–1023
Hashim N, Adebayo SE, Abdan K, Hanafi M (2018) Comparative study of transform based image texture analysis for the evaluation of banana quality using an optical backscattering system. Postharvest Biol Technol 135:38–50
Jain AK, Duin RPW, Mao J (2000) Statistical pattern recognition: a review. IEEE Trans Pattern Anal Mach Intel 22(1):4–37
Jhawar J (2016) Orange sorting by applying pattern recognition on color image. Int Conference on Information Security & Privacy 691-697
Kalluri SR. Apple, orange, banana Images are retrieved January 15, 2018 from https://www.kaggle.com/sriramr/fruits-fresh-and-rotten-for-classification
Kalsom O, Yahaya M, MatJafri MZ, Aziz AA, Omar AF (2014) Non-destructive quality evaluation of fruit by color based on RGB LEDs system. International conference on electronics design, pp 230–233
Kang L, Fazhi H, Haiping Y, Xiao C (2017) A correlative classifiers approach based on particle filter and sample set for tracking occluded target. Appl Math A J Chin Univ 32(3):294–312
Kavdir I, Guyer DE (2008) Evaluation of different pattern recognition techniques for apple sorting. Biosyst Eng 99:211–219
Khan MA, Lali MIU, Sharif M, Javed K, Aurangzeb K, Haider SI, Altamrah AS, Akram AT (2019) An optimized method for segmentation and classification of apple diseases based on strong correlation and genetic algorithm based feature selection. IEEE Access 7:46261–46277
Lee TS (1996) Image representation using 2D Gabor wavelets (PDF). IEEE Trans Pattern Anal Mach Intell 18(10):959–971. https://doi.org/10.1109/34.541406
Li K, He F, Yu H, Chen X (2018) A parallel and robust object tracking approach synthesizing adaptive Bayesian learning and improved incremental subspace learning. Front Comput Sci 13:1116–1135. https://doi.org/10.1007/s11704-018-6442-4
Liming X, Yanchao Z (2010) Automated strawberry grading system based on image processing. Comput Electron Agric 71:32–39
Lou S, Jiang X, Scott PJ (2012) Algorithms for morphological profile filters and their comparison. Precis Eng 36(3):414–423
Lv X, He F, Yan X, Wu Y, Cheng Y (2019) Integrating selective undo of feature-based modeling operations for real-time collaborative CAD systems. Futur Gener Comput Syst. https://doi.org/10.1016/j.future.2019.05.021
Malmer T. Image segmentation using GrabCut, 5 1-7 (2010)
Mehra T, Kumar V, Gupta P (2016) Maturity and disease detection in tomato using computer vision, IEEE International Conference on parallel, distributed and grid computing pp 399–403
Mery D, Filbert D (2002) Classification of potential defects in automated inspection of aluminium casting using statistical pattern recognition. In: Proc. 8th European Conference on Non-Destructive Testing (ECNDT 2002); 17–21 Jun 2002; Barcelona. Madrid, Spain: [AEND] Asociación Española de Ensayos No Destructivos, Alcobendas. 14
Moallem P, Serajoddin A, Pourghassem H (2017) Computer vision-based apple grading for golden delicious apples based on surface features. Inf Process Agric 33-40
Mustafa NBA, Arumugam K, Ahmed SK, Sharrif ZAM (2011) Classification of fruits using probabilistic neural networks-improvement using color Features IEEE International Conference on TENCON, pp 264–269
Naik S, Patel B (2014) CIELab based color feature extraction for maturity level grading of Mango (MangiferaIndica L.). Nat J Syst Inf Technol (0974-3308) 7(1)
Naik S, Patel B (2017) Thermal imaging with fuzzy classifier for maturity and size based non-destructive mango (MangiferaIndica L.) grading, International Conference on Emerging Trends & Innovation in ICT, 15-20
Oltean M. Avocado retrieved January 15, 2018 from https://www.kaggle.com/moltean/fruits
Ou X, Pan W, Xiao P (2014) Vivo skin capacitive imaging analysis by using grey level co-occurrence matrix (GLCM). Int J Pharm 460(2):28–32
Pal T, Jaiswal V, Chauhan RS (2016) DRPPP: a machine learning based tool for prediction of disease resistance proteins in plants. Comput Biol Med 78:42–48
Pan Y, Liu L, Yang L, Wang Y (2016) Texture feature extracting method based on local relative phase binary pattern. 5th International Conference on Computer Science and Network Technology, pp 749–753
Pan Y, He F, Yu H (2019) A novel enhanced collaborative autoencoder with knowledge distillation for top-N recommender systems. Neuro Comput 332:137–148
Payne AB, Walsh KB, Subedi PP, Jarvis D (2013) Estimation of mango crop yield using image analysis - segmentation method. Comput Electron Agric 91:57–64
Pereira LFSSB Jr, Valous NA, Barbin DF (2018) Predicting the ripening of papaya fruit with digital imaging and random forests. Comput Electron Agric 145:76–82
Prabha DS, Kumar JS (2013) Assessment of banana fruit maturity by image processing technique, J Food Sci Technology, March; 52(3), 1316-1327
Quinlan JR (1993) C4.5: programs for machine learning. Morgan Kaufmann, San Francisco
Raheja JL, Kumar S, Chaudhary A (2013) Fabric defect detection based on GLCM and Gabor filter: a comparison. Opt Int J Light Electron Opt 124(23):6469–6474
Razak TRB, Othman MB, Bakar MNBA, Ahmad KAB, Mansor AB (2012) Mango grading by using fuzzy image analysis in international conference on agricultural, Environment and Biological Sciences, 18-22
Razmjooy N, Mousavi BS, Soleymani F (2012) A real-time mathematical computer method for potato inspection using machine vision. Comput Math Appl 63(1):268–279
Rong D, Rao X, Ying Y (2017) Computer vision detection of surface defect on oranges by means of a sliding comparison window local segmentation algorithm. Comput Electron Agric 59:–68
Sahu D, Potdar RM (2017) Defect identification and maturity detection of mango fruits using image analysis. Am J Artif Intell:5–14
Seng WC, Mirisaee SH (2009) A new method for fruits recognition system. In: International conference on electrical engineering and informatics, pp 130–134
Singh S, Singh NP (2019) Machine learning based classification of good and rotten apple. Recent trends in Communication, Computing and Electronics, pp 377–386
Udemy (2017) Machine learning A-ZTM: hands-on python & R In Data Science
Unay D, Gosselin B, Keenan D, Leemans V, Destain M, Debeir O (2011) Automatic grading of bi-colored apples by multispectral machine vision. Comput Electron Agric 75:204–212
Wen X, Fang J, Diao M, Zhang C (2012) Artificial neural network modeling of dissolved oxygen in the Heihe River, Northwestern China. Environ Monit Assess 185(5):4361–4371
Wright J, Yang AY, Ganesh A, Sastry SS, Yi M (2009) Robust face recognition via sparse representation. IEEE Trans Pattern Anal Mach Intell 31:210–227
Wu D, Sun D-W (2013) Colour measurements by computer vision for food quality control–a review. Trends Food Sci Technol 29:5–20
Wu Y, He F, Zhang D, Li X (2018) Service-oriented feature-based data exchange for cloud-based design and manufacturing. IEEE Trans Serv Comput 11(2):341–353
Xiaobo Z, Jiewen Z, Yanxiao L, Jiyong S, Xiaoping Y (2008) Apples shape grading by Fourier expansion and genetic program algorithm. Natural computation Fourth International Conference, 4, 85–90
Yu W, Liu T, Valdez R, Gwinn M, Khoury MJ (2010) Application of support vector machine modeling for prediction of common diseases: the case of diabetes and prediabetes. Med Inform Decis Making 10:1–7
Zhang YJ (2001) Image segmentation. Science Press, Beijing
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of Interest
Anuja Bhargava declares that she has no conflict of interest. Atul Bansal declares that he has no conflict of interest.
Ethical Approval
This article does not contain any studies with human participants or animals performed by any of the authors.
Informed Consent
Not applicable.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Bhargava, A., Bansal, A. Automatic Detection and Grading of Multiple Fruits by Machine Learning. Food Anal. Methods 13, 751–761 (2020). https://doi.org/10.1007/s12161-019-01690-6
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12161-019-01690-6