Classification of Pistachio Nut Using Convolutional Neural Network

  • Lisda Lisda Informatics Engineering Department, Universitas Amikom Yogyakarta,
  • Kusrini Kusrini Informatics Engineering Department, Universitas Amikom Yogyakarta,
  • Dhani Ariatmanto Informatics Engineering Department, Universitas Amikom Yogyakarta,
Abstract views: 267 , PDF downloads: 339
Keywords: Pistachio, Classification, Convolutional Neural Network, Inception-V3, ResNet50


The application of innovative technologies in the agricultural industry has the potential to boost yield productivity and affect the well-being of farmers. Pistachio nuts are widely considered among the most precious things agriculture produces. The kirmizi and sirt are the two distinct varieties of pistachio nuts that are available. It is essential to categorize the different types of pistachio nuts to keep the product's quality and worth at a high level. This paper proposes a classified pistachio variety of kirmizi and siirt based on Convolutional Neural Network (CNN) models Inception V3 and ResNet50. The dataset used in this research is 2148 samples of pistachio images. The sample images are divided into 80% training data, 10% testing data, and 10% validation data. First, we pre-process and normalize by wrapping and cropping the images. The next, Inception-V3 and ResNet50 architectures, were trained and tested on the sample datasets. The experimental results show that the accuracy of both models is 96% and 86%, respectively. This can be concluded that the performance of the CNN model using Inception-V3 architecture outperforms ResNet50 architecture.




Author Biographies

Lisda Lisda, Informatics Engineering Department, Universitas Amikom Yogyakarta,



Kusrini Kusrini, Informatics Engineering Department, Universitas Amikom Yogyakarta,



Dhani Ariatmanto, Informatics Engineering Department, Universitas Amikom Yogyakarta,




F. R. Moeis, T. Dartanto, J. P. Moeis, and M. Ikhsan, "A longitudinal study of agriculture households in Indonesia: The effect of land and labor mobility on welfare and poverty dynamics," World Dev Perspect, vol. 20, Dec. 2020, doi: 10.1016/j.wdp.2020.100261.

F. N. Cahya, R. Pebrianto, and T. M. Adilah, "Klasifikasi Buah Segar dan Busuk Menggunakan Ekstraksi Fitur Hu-Moment , Haralick dan Histogram," IJCIT (Indonesian Journal on Computer and Information Technology), vol. 6, no. 1, pp. 57–62, 2021, doi:

G. Mandalari et al., "Pistachio nuts (Pistacia vera l.): Production, nutrients, bioactives and novel health effects," Plants, vol. 11, no. 1, Jan. 2022, doi: 10.3390/plants11010018.

C. Saglam and N. Cetin, "Prediction of Pistachio (Pistacia vera L.) Mass Based on Shape and Size Attributes by Using Machine Learning Algorithms," Food Anal Methods, vol. 15, no. 3, pp. 739–750, 2022, doi: 10.1007/s12161-021-02154-6.

S. K. Vidyarthi, R. Tiwari, S. K. Singh, and H. W. Xiao, "Prediction of size and mass of pistachio kernels using random Forest machine learning," J Food Process Eng, vol. 43, no. 9, Sep. 2020, doi: 10.1111/jfpe.13473.

G. Bonifazi, G. Capobianco, R. Gasbarrone, and S. Serranti, "Contaminant detection in pistachio nuts by different classification methods applied to short-wave infrared hyperspectral images," Food Control, vol. 130, Dec. 2021, doi: 10.1016/j.foodcont.2021.108202.

I. A. Özkan, M. Köklü, and R. Saraçoğlu, "Classification of pistachio species using improved k-NN classifier," Progress in Nutrition, vol. 23, no. 2, Feb. 2021, doi: 10.23751/pn.v23i2.9686.

D. Singh et al., "Classification and Analysis of Pistachio Species with Pre-Trained Deep Learning Models," Electronics (Switzerland), vol. 11, no. 7, Apr. 2022, doi: 10.3390/electronics11070981.

Farazi Mohammad, Abbas-Zadeh Mohammad Javad, and Moradi Hadi, "A machine vision based pistachio sorting using transferred mid-level image representation of Convolutional Neural Network," 2017.

M. Omid, M. S. Firouz, H. Nouri-Ahmadabadi, and S. S. Mohtasebi, "Classification of peeled pistachio kernels using computer vision and color features," Engineering in Agriculture, Environment and Food, vol. 10, no. 4, pp. 259–265, Oct. 2017, doi: 10.1016/j.eaef.2017.04.002.

"Pistachio Image Dataset".

E. G. Winarto, Rahmayati, and A. Lawi, “Implementasi Arsitektur Inception Resnet-V2 untuk Klasifikasi Kualitas Biji Kakao,” Konferensi Nasional Ilmu Komputer (KONIK) 2021 , 2021.

A. Krizhevsky, I. Sutskever, and G. E. Hinton, "ImageNet classification with deep convolutional neural networks," Commun ACM, vol. 60, no. 6, pp. 84–90, Jun. 2017, doi: 10.1145/3065386.

E. Dandıl and R. Polattimur, "Dog behavior recognition and tracking based on faster R-CNN," Journal of the Faculty of Engineering and Architecture of Gazi University, vol. 35, no. 2, pp. 819–834, 2020, doi: 10.17341/gazimmfd.541677.

H. Chen et al., "A deep learning CNN architecture applied in smart near-infrared analysis of water pollution for agricultural irrigation resources," Agric Water Manag, vol. 240, Oct. 2020, doi: 10.1016/j.agwat.2020.106303.

D. M. S. Arsa and A. A. N. H. Susila, "VGG16 in Batik Classification based on Random Forest," 2019.

B. Bayar and M. C. Stamm, "A deep learning approach to universal image manipulation detection using a new convolutional layer," in IH and MMSec 2016 - Proceedings of the 2016 ACM Information Hiding and Multimedia Security Workshop, 2016, pp. 5–10. doi: 10.1145/2909827.2930786.

X. Glorot, A. Bordes, and Y. Bengio, "Deep Sparse Rectifier Neural Networks," 2011.

N. Akhtar and U. Ragavendran, "Interpretation of intelligence in CNN-pooling processes: a methodological survey," Neural Computing and Applications, vol. 32, no. 3. Springer, pp. 879–898, Feb. 01, 2020. doi: 10.1007/s00521-019-04296-5.

G. Habib and S. Qureshi, "Optimization and acceleration of convolutional neural networks: A survey," Journal of King Saud University - Computer and Information Sciences, vol. 34, no. 7. King Saud bin Abdulaziz University, pp. 4244–4268, Jul. 01, 2022. doi: 10.1016/j.jksuci.2020.10.004.

N. Dong, L. Zhao, C. H. Wu, and J. F. Chang, "Inception v3 based cervical cell classification combined with artificially extracted features," Appl Soft Comput, vol. 93, p. 106311, Aug. 2020, doi: 10.1016/j.asoc.2020.106311.

M. Nour, Z. Cömert, and K. Polat, "A Novel Medical Diagnosis model for COVID-19 infection detection based on Deep Features and Bayesian Optimization," Appl Soft Comput, vol. 97, Dec. 2020, doi: 10.1016/j.asoc.2020.106580.

N. D. Miranda, L. Novamizanti, and S. Rizal, “CONVOLUTIONAL NEURAL NETWORK PADA KLASIFIKASI SIDIK JARI MENGGUNAKAN RESNET-50,” Jurnal Teknik Informatika (Jutif), vol. 1, no. 2, pp. 61–68, Dec. 2020, doi: 10.20884/1.jutif.2020.1.2.18.

X. Ou et al., "Moving Object Detection Method via ResNet-18 with Encoder-Decoder Structure in Complex Scenes," IEEE Access, vol. 7, pp. 108152–108160, 2019, doi: 10.1109/ACCESS.2019.2931922.

S. Yeshwanth Chaganti Test Engineer, T. GNRSN Prudhvith, N. Kumar, and K. Rao Pandi, "Image Classification using SVM and CNN," in 2020 International Conference on Computer Science, Engineering and Applications (ICCSEA), 2020.

How to Cite
Lisda, L., Kusrini, K., & Ariatmanto, D. (2023). Classification of Pistachio Nut Using Convolutional Neural Network. Inform : Jurnal Ilmiah Bidang Teknologi Informasi Dan Komunikasi, 8(1), 71-77.