Classification of Pistachio Species Using Improved K-NN Classifier

Main Article Content

Ilker Ali Ozkan
Murat Koklu
Rıdvan Saraçoğlu


Classification, Image processing, k nearest neigbour classifier, Pistachio species


In order to keep the economic value of pistachio nuts which have an important place in the agricultural economy, the efficiency of post-harvest industrial processes is very important. To provide this efficiency, new methods and technologies are needed for the separation and classification of pistachios. Different pistachio species address different markets, which increases the need for the classification of pistachio species. In this study, it is aimed to develop a classification model different from traditional separation methods, based on image processing and artificial intelligence which are capable to provide the required classification. A computer vision system (CVS) has been developed to distinguish two different species of pistachios with different characteristics that address different market types. 2148 sample image for these two kinds of pistachios were taken with a high-resolution camera. The image processing techniques, segmentation and feature extraction were applied on the obtained images of the pistachio samples. A pistachio dataset that has sixteen attributes was created. An advanced classifier based on k-NN method, which is a simple and successful classifier, and principal component analysis was designed on the obtained dataset. In this study; a multi-level system including feature extraction, dimension reduction and dimension weighting stages has been proposed. Experimental results showed that the proposed approach achieved a classification success of 94.18%. The presented high-performance classification model provides an important need for the separation of pistachio species and increases the economic value of species.  In addition, the developed model is important in terms of its application to similar studies.

Abstract 2982 | PDF Downloads 2737


1. Ertürk YE. , Geçer MK., Gülsoy E, and Yalçın S. Production and Marketing of Pistachio, Journal of the Institute of Science and Technology of Igdir University 2011;5: 43-62.
2. Dreher ML. Pistachio nuts: composition and potential health benefits, Nutrition Reviews 2012, 70(4): 234–240.
3. Kay CD, Gebauer SK, West SG, Kris-Etherton PM. Pistachios Increase Serum Antioxidants and Lower Serum Oxidized-LDL in Hypercholesterolemic Adults, The Journal of Nutrition 2010, 140(6): 1093-1098
4. Tunalıoğlu R, and Taşkaya B. Antepfıstığı. Tarımsal Ekonomi Araştırma Enstitüsü Dergisi, 2003.
5. Cetin AE, Pearson TC, and Tewfik AH. Classification of closed and open shell pistachio nuts using principal component analysis of impact acoustics. In 2004 IEEE International Conference on Acoustics, Speech, and Signal Processing 2004; V-677.
6. Casasent DA, Sipe MA, Schatzki TF, Keagy PM, Lee LC. Neural net classification of X-ray pistachio nut data. LWT- Food Science and Technology 1998, 31(2): 122-128.
7. Omid M, Firouz MS, Nouri-Ahmadabadi H, Mohtasebi SS. Classification of peeled pistachio kernels using computer vision and color features, Engineering in Agriculture, Environment and Food 2017,10: 259-265.
8. Atay Ü. The investigation of classification systems used for pistahio and construction of an alternetive classification system, PhD Thesis Harran University, Sanliurfa, 2007.
9. Otsu N. A threshold selection method from gray-level histograms, IEEE Transactions on Systems, Man, and Cybernetics 1979, 9: 62-66.
10. Paliwal J, Visen NS, and Jayas DS, AE—Automation and Emerging Technologies: Evaluation of Neural Network Architectures for Cereal Grain Classification using Morphological Features, Journal of Agricultural Engineering Research 2001, 79: 361-370.
11. Liu ZY, Cheng F, Ying YB, and Rao XQ, Identification of rice seed varieties using neural network, Journal of Zhejiang University Science. B 2005, 6: 1095-1100.
12. Symons SJ, and Fulcher RG. Determination of wheat kernel morphological variation by digital image analysis: I. Variation in Eastern Canadian milling quality wheats, Journal of Cereal Science 1988, 8: 211-218.
13. Pazoki A, Farokhi F, and Pazoki Z. Classification of rice grain varieties using two Artificial Neural Networks (MLP and Neuro-Fuzzy), The Journal of Animal & Plant Sciences 2014, 24: 336-343.
14. Hossin M, Sulaiman MN, Mustapha A, and Mustapha N. A Novel Performance Metric for Building an Optimized Classifier, Journal of Computer Science 2011, 7(4):582-590.
15. Hossin M, and Sulaiman M. A review on evaluation metrics for data classification evaluations, International Journal of Data Mining & Knowledge Management Process 2015, 5: 1.
16. Sokolova M, and Lapalme G. A systematic analysis of performance measures for classification tasks, Information Processing & Management 2009, 45: 427-437.
17. James G, Witten D, Hastie T, and Tibshirani R. An Introduction To Statistical Learning, Springer, 2013.
18. Kuhn M, and Johnson K. Applied predictive modeling, Springer, 2013.
19. Chatterjee C, Roychowdhury VP, Chong EKP. On Relative Convergence Properties of Principal Component Analysis Algorithms, IEEE Transactions on Neural Networks 1998, 9(2): 319-329.
20. Mitchell TM. Machine learning, McGraw Hill, 1997.
21. Han J, Pei J, and Kamber M. Data mining: concepts and techniques, Elsevier, 2011.
22. Duda RO, Hart PE, and Stork DG. Pattern classification, John Wiley & Sons, 2012.
23. Coomans D, and Massart DL. Alternative k-nearest neighbour rules in supervised pattern recognition: Part 1. k-Nearest neighbour classification by using alternative voting rules, Analytica Chimica Acta 1982,136: 15-27.
24. Gärtner T, Lloyd JW, and Flach PA. Kernels and distances for structured data, Machine Learning 2004, 57: 205-232.
25. Mohamed TM. Pulsar selection using fuzzy kNN classifier, Future Computing and Informatics Journal 2018, 3: 1-6.
26. Dudani SA. The distance-weighted k-nearest-neighbor rule, IEEE Transactions on Systems, Man, and Cybernetics 1976, 325-327.
27. Srivastava A., Singh MP, and Kumar P. Supervised semantic analysis of product reviews using weighted k-NN classifier. 11th International Conference on Information Technology: New Generations 2014, 502–507.