Feature-Based Pistachio Classification: A 28-Dimensional Dataset with KNN

Authors

  • Steven Alexander Pasaribu Pasaribu Universitas Katolik Santo Thomas
  • Reza permana Olivera Simbolon Universitas Katolik Santo Thomas
  • Bonfilio Delatersia Nainggolan Universitas Katolik Santo Thomas

DOI:

https://doi.org/10.65853/jaden.v1i1.97

Keywords:

Pistachio classification, k-Nearest Neighbors, feature-based dataset, machine learning, morphological features

Abstract

Pistachio (Pistacia vera L.) is a high-value horticultural crop in which accurate variety classification is essential for quality assurance and trade. Conventional classification methods relying on visual inspection are subjective, labor-intensive, and inadequate for large-scale industrial deployment. This study evaluates the effectiveness of the k-Nearest Neighbors (KNN) algorithm for pistachio variety classification using a feature-based dataset comprising 2,148 samples and 28 morphological and color descriptors. Experimental results indicate that the optimized KNN configuration (k = 5, Euclidean distance metric, distance-based weighting) attained a test accuracy of 97% and a macro F1-score of 0.97, while both ROC-AUC and average precision values approached 0.99. The confusion matrix demonstrated only marginal misclassifications, confirming the high discriminative capability of the handcrafted features. These findings underscore that feature-based approaches remain competitive with, and in some contexts superior to, deep learning methods by providing interpretable, computationally efficient, and robust solutions. The proposed model offers practical potential for integration into industrial pistachio sorting systems and broader agricultural informatics applications, supporting scalable and cost-effective automation in crop quality assessment

Downloads

Download data is not yet available.

References

Çakmak, Muhammet. (2025). A New Lightweight Hybrid Model for Pistachio Classification Using Transformers and EfficientNet. http://dx.doi.org/10.1109/ACCESS.2025.3567774

Li, H. (2024). Classification of Pistachio Species based on Deep Learning Models. Science and Technology of Engineering, Chemistry and Environmental Protection, 1(1). https://doi.org/10.61173/y7tgwq87

Liakos, K. G., Busato, P., Moshou, D., Pearson, S., & Bochtis, D. (2018). Machine Learning in Agriculture: A Review. Sensors, 18(8), 2674. https://doi.org/10.3390/s18082674

Lisda, K., & Ariatmanto, D. (2023). Classification of Pistachio Nut Using Convolutional Neural Network. Inform: Jurnal Ilmiah Bidang Teknologi Informasi dan Komunikasi, 8(1). https://doi.org/10.25139/inform.v8i1.5685

Liu, X., Yang, L., Zhu, H., Zhang, L., An, Y., Wei, L., & Han, Z. (2024). The pistachio quality detection based on deep features plus unsupervised clustering. Journal of Food Process Engineering, 47(1). https://doi.org/10.1111/jfpe.14519

Mahdavi-Jafari, S., Salehinejad, H., & Talebi, S. (2008). A Pistachio Nuts Classification Technique: An ANN Based Signal Processing Scheme. 2008 International Conference on Computational Intelligence for Modelling Control & Automation, 447-451.

Omid, M., Soltani Firouz, M., Nouri-Ahmadabadi, H., & Mohtasebi, S. S. (2017). Classification of peeled pistachio kernels using computer vision and color features. Engineering in Agriculture, Environment and Food, 10(4), 259–265. https://doi.org/10.1016/J.EAEF.2017.04.002

Özkan, İ. A., Köklü, M., & Saraçoğlu, R. (2021). Classification of pistachio species using improved k-NN classifier. Progress in Nutrition, 23(2), e2021044. https://doi.org/10.23751/pn.v23i2.9686

Rahimzadeh, M., & Attar, A. (2020). Detecting and counting pistachios based on deep learning (Version 4) [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2005.03990

Rashid, M. K., Kılıç, A., & Kapucu, S. (2018). Classification of pistachio by using image processing and deep learning. Proceedings of the International Eurasian Conference on Science, Engineering and Technology (EurasianSciEnTech 2018), Ankara, Turkey.

Siahaan, A. P. U.., Iqbal, M., Dika, D., & Syahputri, M. . (2025). Classification Of Pistachio Varieties Using Machine Learning Algorithms. Jurnal Minfo Polgan, 14(1), 1452-1457. https://doi.org/10.33395/jmp.v14i1.15088

Singh, D., Taspinar, Y. S., Kursun, R., Cinar, I., Koklu, M., Ozkan, I. A., & Lee, H.-N. (2022). Classification and Analysis of Pistachio Species with Pre-Trained Deep Learning Models. Electronics, 11(7), 981. https://doi.org/10.3390/electronics11070981

Uzer, M. S. (2025). Deep Learning-Based Classification Consisting of Pre-Trained Models and Proposed Model Using K-Fold Cross-Validation for Pistachio Species. Applied Sciences, 15(8), 4516. https://doi.org/10.3390/app15084516

Williams, L., Shukla, P., Sheikh-Akbari, A., Mahroughi, S., & Mporas, I. (2025). Measuring the Level of Aflatoxin Infection in Pistachio Nuts by Applying Machine Learning Techniques to Hyperspectral Images. Sensors, 25(5), 1548. https://doi.org/10.3390/s25051548

Downloads

Published

2025-07-06

How to Cite

Pasaribu, S. A. P., Simbolon, R. permana O., & Nainggolan, B. D. (2025). Feature-Based Pistachio Classification: A 28-Dimensional Dataset with KNN. JADEN : Journal of Algorithmic Digital Engineering and Networks, 1(1), 1–6. https://doi.org/10.65853/jaden.v1i1.97