Abstract
In this study, an algorithm based on combined image processing and machine learning techniques including artificial neural networks (ANN) and support vector machine (SVM) were implemented for grading peeled pistachio kernels (PPK) into five classes: green, yellowish green, yellow, mixed color and unwanted materials. Initially, the B-component of the images in L*a*b* color space and Otsu thresholding were used for segmentation of the images. Altogether, 72 chromatic and four shape features were extracted from the samples. After carrying out sensitivity analysis, the input vector was reduced to 26. Principal component analysis (PCA) was applied to further compress the size of the input vector to 7. The best ANN classifier had a 7-8-5 structure with correct classification rate (CCR) of 99.4%. The best kernel function for SVM algorithm was radial basis with CCR, C, sigma and the number of support vectors of 99.88, 10, 3.5 and 266, respectively.