Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Application of decision trees and fuzzy inference system for quality classification and modeling of black and green tea based on visual features

  • 10 Accesses


A fuzzified decision tree (DT)-based computer vision system was developed in this study for classification of common Iranian teas. Images of different tea categories, including five green tea and five black tea classes were captured using a CCD camera. In total, 83 image-based information (including 18 colour, 13 texture, and 52 wavelet-based features) were extracted from the images and introduced into DT classifier to distinguish between different tea categories. Reduced Error Pruning (REP) and J48 DTs were applied as classifier and the overall accuracy of both evaluated DTs was equal to 94.79% for differentiating all tea categories. However, these DTs had almost complex structures which made them unsuitable for developing a Mamdani fuzzy system, based on their structure. So, in order to simplify the structures of the DTs to be more suitable for developing fuzzy sets, the DTs were examined for categorizing black and green teas separately. The overall accuracy of J48 DT was 92.917% and 95.000% for classification of black and green teas, respectively and for REP tree the accuracy was equal to 90.83% and 97.08%, respectively. The REP tree structure was used to set the membership functions and rules of the fuzzy system because of the simpler structure of REP tree, even though J48 and REP trees had almost equal performances. It was concluded that the DT-based fuzzy logic system can be used effectively to classify different quality categories of tea, based on image extracted features.

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

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11


  1. 1.

    G. Sen, B. Bera, Mini review Black tea as a part of daily diet: a boon for healthy living. Int. J. Tea Sci. 9, 51–59 (2013)

  2. 2.

    Q. Chen et al., Classification of different varieties of Oolong tea using novel artificial sensing tools and data fusion. LWT Food Sci. Technol. 60(2), 781–787 (2015)

  3. 3.

    S. Henning et al., Effect of green and black tea extracts on intestinal microbiota and body composition in mice fed a high fat/high sucrose/western diet. FASEB J. 29, 924–927 (2015)

  4. 4.

    J.V. Higdon, B. Frei, Tea Catechins and Polyphenols: Health Effects, Metabolism, and Antioxidant Functions (Taylor & Francis, Routledge, 2003)

  5. 5.

    FAOstat, Accessed (2018–3–9). 2018.

  6. 6.

    J. Liu et al., Quantitative analysis of acrylamide in tea by liquid chromatography coupled with electrospray ionization tandem mass spectrometry. Food Chem. 108(2), 760–767 (2008)

  7. 7.

    Q. Chen et al., Feasibility study on identification of green, black and Oolong teas using near-infrared reflectance spectroscopy based on support vector machine (SVM). Spectrochim. Acta A 66(3), 568–574 (2007)

  8. 8.

    J. Ning et al., Classification of five Chinese tea categories with different fermentation degrees using visible and near-infrared hyperspectral imaging. Int. J. Food Prop. 20(sup2), 1515–1522 (2017)

  9. 9.

    R.B. Roy et al., Artificial flavor perception of black tea using fusion of electronic nose and tongue response: a Bayesian statistical approach. J. Food Eng. 142, 87–93 (2014)

  10. 10.

    Q. Ouyang et al., Intelligent evaluation of color sensory quality of black tea by visible-near infrared spectroscopy technology: A comparison of spectra and color data information. Spectrochim. Acta A 180, 91–96 (2017)

  11. 11.

    P.L. Fernández-Cáceres et al., Differentiation of tea (Camellia sinensis) varieties and their geographical origin according to their metal content. J. Agric. Food Chem. 49(10), 4775–4779 (2001)

  12. 12.

    P.H.G.D. Diniz et al., Simplified tea classification based on a reduced chemical composition profile via successive projections algorithm linear discriminant analysis (SPA-LDA). J. Food Compos. Anal. 39, 103–110 (2015)

  13. 13.

    A. Alcazar et al., Differentiation of green, white, black, Oolong, and Pu-erh teas according to their free amino acids content. J. Agric. Food Chem. 55(15), 5960–5965 (2007)

  14. 14.

    P.H.G.D. Diniz et al., Using UV–Vis spectroscopy for simultaneous geographical and varietal classification of tea infusions simulating a home-made tea cup. Food Chem. 192, 374–379 (2016)

  15. 15.

    M. Palit et al., Classification of black tea taste and correlation with tea taster's mark using voltammetric electronic tongue. IEEE Trans. Instrum. Meas. 59(8), 2230–2239 (2010)

  16. 16.

    R. Bhattacharyya et al., Classification of black tea liquor using cyclic voltammetry. J. Food Eng. 109(1), 120–126 (2012)

  17. 17.

    M.B. Banerjee et al. Cross-perception fusion model of electronic nose and electronic tongue for black tea classification. International Conference on Computational Intelligence, Communications, and Business Analytics (Springer, 2017)

  18. 18.

    T. Yi et al., Comparison of ten major constituents in seven types of processed tea using HPLC-DAD-MS followed by principal component and hierarchical cluster analysis. LWT Food Sci Technol. 62(1), 194–201 (2015)

  19. 19.

    P. Šilarová, L. Česlová, M. Meloun, Fast gradient HPLC/MS separation of phenolics in green tea to monitor their degradation. Food Chem. 237, 471–480 (2017)

  20. 20.

    A. Banakar et al., Combined application of decision tree and fuzzy logic techniques for intelligent grading of dried figs. J Food Process Eng 40(3), e12456 (2017)

  21. 21.

    X. Yu et al., Raisin quality classification using least squares support vector machine (LSSVM) based on combined color and texture features. Food Bioprocess. Technol. 5(5), 1552–1563 (2012)

  22. 22.

    I.R. Donis-González et al., Assessment of chestnut (Castanea spp.) slice quality using color images. J. Food Eng. 115(3), 407–414 (2013)

  23. 23.

    N.K. Jain, S. Khanna, K.R. Jain. Development of a classification system for quality evaluation of Oryza sativa L. (Rice) using computer vision. 2014 Fourth International Conference on Communication Systems and Network Technologies (CSNT), 2014

  24. 24.

    M.S. Iraji, Comparison between soft computing methods for tomato quality grading using machine vision. J. Food. Meas. Charact. 13(1), 1–15 (2019)

  25. 25.

    J. Mahadevappa et al., Development of an inline measurement technique to assess the quality of wheat dough during the sheeting process. J. Cereal Sci. 64, 183–188 (2015)

  26. 26.

    E.M. de Oliveira et al., A computer vision system for coffee beans classification based on computational intelligence techniques. J. Food Eng. 171, 22–27 (2016)

  27. 27.

    N.M. Baneh, H. Navid, J. Kafashan, Mechatronic components in apple sorting machines with computer vision. J. Food. Meas. Charact. 12(2), 1135–1155 (2018)

  28. 28.

    M. Omid et al., Classification of peeled pistachio kernels using computer vision and color features. Eng. Agric. Environ. Food 10(4), 259–265 (2017)

  29. 29.

    V.R. Phate, R. Malmathanraj, P. Palanisamy, Classification and weighing of sweet lime (Citrus limetta) for packaging using computer vision system. J. Food Meas. Charact. 13(2), 1451–1468 (2019)

  30. 30.

    J. Ma et al., Applications of computer vision for assessing quality of agri-food products: a review of recent research advances. Crit. Rev. Food Sci. Nutr. 56(1), 113–127 (2016)

  31. 31.

    P. Vithu, J. Moses, Machine vision system for food grain quality evaluation: a review. Trends Food Sci. Technol. 56, 13–20 (2016)

  32. 32.

    Y. Ye, Study on quality evaluation of Dafo Longjing tea based on near infrared spectroscopy. Spectrosc. Spectral. Anal. 32(11), 2971–2975 (2012)

  33. 33.

    A. Laddi et al., Discrimination analysis of Indian tea varieties based upon color under optimum illumination. J. Food. Meas. Charact. 7(2), 60–65 (2013)

  34. 34.

    A. Laddi et al., Classification of tea grains based upon image texture feature analysis under different illumination conditions. J. Food Eng. 115(2), 226–231 (2013)

  35. 35.

    C.-W. Dong et al., Sensory quality evaluation for appearance of needle-shaped green tea based on computer vision and nonlinear tools. J. Zhejiang Univ. Sci B 18(6), 544–548 (2017)

  36. 36.

    S. Borah, E. Hines, M. Bhuyan, Wavelet transform based image texture analysis for size estimation applied to the sorting of tea granules. J. Food Eng. 79(2), 629–639 (2007)

  37. 37.

    X. Zhou, et al. Tea category classification based on feed-forward neural network and two-dimensional wavelet entropy. in International Conference on High Performance Computing and Applications (Springer, 2015)

  38. 38.

    A. Bakhshipour et al., Evaluation of data mining strategies for classification of black tea based on image-based features. Food Anal. Methods 11, 1041–1050 (2017)

  39. 39.

    C. Isaza et al., Image analysis and data mining techniques for classification of morphological and color features for seeds of the wild castor oil plant (Ricinus communis L.). Multimed. Tools Appl. 77(2), 2593–2610 (2018)

  40. 40.

    H. Zareiforoush et al., Qualitative classification of milled rice grains using computer vision and metaheuristic techniques. J. Food Sci. Technol. 53(1), 118–131 (2016)

  41. 41.

    A. Saettler, E. Laber, F.D. Pereira, Decision tree classification with bounded number of errors. Inf. Process. Lett. 127, 27–31 (2017)

  42. 42.

    C.V. Maheshwari, N.K. Jain, S. Khanna, Computer Vision Based Classification of Indian Gujarat-17 Rice Using Geometrical Features and Cart (Springer, Berlin, 2015), pp. 205–216

  43. 43.

    C.-H. Shi et al., Identifying metabolite and protein biomarkers in unstable angina in-patients by feature selection based data mining method. Chem. Res. Chin. Univ. 27(1), 87–93 (2011)

  44. 44.

    A.G. Karegowda, Enhanced categorization of wheat seeds by integrating ensemble methods with decision tree identified significant features. Int. J. Data. Min. Emerg. Technol. 4(1), 10–15 (2014)

  45. 45.

    L.A. Zadeh, Fuzzy sets. Inf. Control 8(3), 338–353 (1965)

  46. 46.

    H. Zareiforoush et al., Design, development and performance evaluation of an automatic control system for rice whitening machine based on computer vision and fuzzy logic. Comput. Electron. Agric. 124, 14–22 (2016)

  47. 47.

    M. Othman et al., Fuzzy ripening mango index using RGB colour sensor model. Res. World 5(2), 1 (2014)

  48. 48.

    N. Alavi, Quality determination of Mozafati dates using Mamdani fuzzy inference system. J. Saudi Soc. Agric. Sci. 12(2), 137–142 (2013)

  49. 49.

    N. Goel, P. Sehgal, Fuzzy classification of pre-harvest tomatoes for ripeness estimation–An approach based on automatic rule learning using decision tree. Appl. Soft Comput. 36, 45–56 (2015)

  50. 50.

    ISIRI, https://standard.isiri.gov.ir. 2018.

  51. 51.

    S.J. Sangwine, R.E. Horne, The Colour Image Processing Handbook (Springer, New York, 2012)

  52. 52.

    R.C. Gonzalez, R.E. Woods, Digital image processing (Prentice Hall, Upper Saddle River, 2012)

  53. 53.

    M. Hall-Beyer, GLCM texture: a tutorial. National Council on Geographic Information and Analysis Remote Sensing Core Curriculum, 2000.

  54. 54.

    A. Jafari, A. Bakhshipour, Inspection of quince slice dehydration stages based on extractable image features. Czech J Food Sci 32(5), 456–463 (2014)

  55. 55.

    A. Haar, Zur theorie der orthogonalen funktionensysteme. Math. Ann. 69(3), 331–371 (1910)

  56. 56.

    G.S. Raghlate, S.S. Salankar, Comparison of second order statistical analysis and wavelet transform method for texture image classification. 2015 International Conference on Computational Intelligence and Communication Networks (CICN), 2015

  57. 57.

    A. Bakhshipour et al., Weed segmentation using texture features extracted from wavelet sub-images. Biosyst. Eng. 157, 1–12 (2017)

  58. 58.

    W.N.H.W. Mohamed, M.N.M. Salleh, A.H. Omar, A comparative study of reduced error pruning method in decision tree algorithms. 2012 IEEE International Conference on Control System, Computing and Engineering (ICCSCE), 2012

  59. 59.

    S.J. Narayanan, R.B. Bhatt, I. Paramasivam, An improved second order training algorithm for improving the accuracy of fuzzy decision trees. Int. J. Fuzzy Syst. Appl. 5(4), 96–120 (2016)

  60. 60.

    J.R. Quinlan, C4.5: programs for machine learning (Elsevier, Amsterdam, 2014)

  61. 61.

    A.R. Alharbi, M.A. Thornton, Demographic group classification of smart device users. 2015 IEEE 14th International Conference on Machine Learning and Applications (ICMLA), 2015

  62. 62.

    I.H. Witten et al., Data Mining: Practical Machine Learning Tools and Techniques (Morgan Kaufmann, Burlington, 2016)

  63. 63.

    M. Soltani, M. Omid, Detection of poultry egg freshness by dielectric spectroscopy and machine learning techniques. LWT Food Sci. Technol. 62(2), 1034–1042 (2015)

  64. 64.

    S. Khoje, S. Bodhe, Comparative performance evaluation of fast discrete curvelet transform and colour texture moments as texture features for fruit skin damage detection. J. Food Sci. Technol. 52(11), 6914–6926 (2015)

  65. 65.

    K. Mollazade, M. Omid, A. Arefi, Comparing data mining classifiers for grading raisins based on visual features. Comput. Electron. Agric. 84, 124–131 (2012)

  66. 66.

    A. Ben-David, Comparison of classification accuracy using Cohen’s Weighted Kappa. J. Food Process. Eng. 34(2), 825–832 (2008)

  67. 67.

    N. Teimouri et al., A novel artificial neural networks assisted segmentation algorithm for discriminating almond nut and shell from background and shadow. Comput. Electron. Agric. 105, 34–43 (2014)

  68. 68.

    C. Riccioli, D. Pérez-Marín, A. Garrido-Varo, Identifying animal species in NIR hyperspectral images of processed animal proteins (PAPs): comparison of multivariate techniques. Chemom. Intell. Lab. Syst. 172, 139–149 (2018)

  69. 69.

    N. Aggarwal, R. Agrawal, First and second order statistics features for classification of magnetic resonance brain images. J. Signal Inf. Process. 3(02), 146 (2012)

  70. 70.

    H. Pu et al., Using wavelet textural features of visible and near infrared hyperspectral image to differentiate between fresh and frozen–thawed pork. Food Bioprocess. Technol. 7(11), 3088–3099 (2014)

  71. 71.

    F.R. Ajdadi et al., Application of machine vision for classification of soil aggregate size. Soil Tillage Res. 162, 8–17 (2016)

  72. 72.

    A. Rahimi et al., Classification of jujube fruits using different data mining methods. Researcher 6(5), 52–61 (2014)

  73. 73.

    P. Mishra et al., Near-infrared hyperspectral imaging for non-destructive classification of commercial tea products. J Food Eng 238, 70–77 (2018)

  74. 74.

    X. Li et al., Using wavelet transform and multi-class least square support vector machine in multi-spectral imaging classification of Chinese famous tea. Expert Syst. Appl. 38(9), 11149–11159 (2011)

  75. 75.

    A. Modak, et al., Towards artificial flavor perception of black tea: An approach using fusion of electronic nose and electronic tongue responses with fuzzy ART classification technique. Proceedings of the 2nd International Conference on Perception and Machine Intelligence. ACM, 2015

  76. 76.

    Y.-F. Li et al., A comparative analysis of chemical compositions in Camellia sinensis var. puanensis Kurihara, a novel Chinese tea, by HPLC and UFLC-Q-TOF-MS/MS. Food Chem 216, 282–288 (2017)

Download references


The authors would like to thank the University of Guilan for providing the facilities and financial support for this research.

Author information

Correspondence to Hemad Zareiforoush.

Additional information

Publisher's Note

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

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Bakhshipour, A., Zareiforoush, H. & Bagheri, I. Application of decision trees and fuzzy inference system for quality classification and modeling of black and green tea based on visual features. Food Measure (2020). https://doi.org/10.1007/s11694-020-00390-8

Download citation


  • Classification
  • Computer vision
  • Decision tree
  • Fuzzy logic
  • Tea