## 4 Result and Discussion
### PLS-DA Model Result  
PLS-DA was used to develop a model for the classification of almonds adulterated with apricot kernels. This method was applied because of its high potential for the classification of seeds based on previous reports. Additionally, it was employed because of its simplicity and high accuracy. The seeds were divided into calibration and validation sets [16; 39; 40]. A high accuracy was obtained using the method and is thus recommended for classification. PLS-DA has been used with different  
Figure 4: The plots present (**a**) mean data obtained before treatment and (**b**) the SNV preprocessing mean data plot in the range of 950–1622 nm. purposes for the classification of seeds, for example, Raman hyperspectral imaging has been used for the classification of watermelon seeds infected with _Acidovorax citrulli_[41], which presented a high accuracy. In another study, hyperspectral imaging was used for the classification of Arabic and Robust green coffee based on PLS-DA [42]. All of the studies mentioned above reported a good performance for the PLS-DA model. Moreover, the model's performance for the classification of kernels exhibits varying inaccuracies that depend on the preprocessing method with a comparison of the lowest root mean square error of cross validation (RMECV) captured by the PLS-DA based on each preprocessing technique. Therefore, the desirable preprocessing techniques used based on the optimum latent variable (LV) number corresponded to the minimum RMSECV. The number of LVs was investigated with the RMSE of the model using the 10-fold cross-validation method. In Figure 5, exhibiting a knee point, the first minimal of the error rate was found at seven latent variables, which can be considered as the optimal number of LVs. The exploratory PLS-DA was performed with a total of 448 samples, which were divided into two groups: The calibration set (n = 310) and the validation set (n = 138). The discriminating ability of PLS-DA combined with raw preprocessing was near-perfectly accurate (97%) for adulterated almonds. Therefore, the accuracies obtained by calibration and prediction within raw preprocessing indicate the method's suitability for discriminating between almond and apricot kernels. The resultant classification model based on each technique obtained based on each preprocessing method is summarized in Table 1.  
Based on the results displayed in Table 1, it can be seen that all high-potential preprocessing methods have similar degrees of accuracy. The obtained PLS-DA plots based on the raw preprocessing presented in Figure 6 provide a clear classification of these two seeds. According to the previously discussed strategy, the classification model developed pixel-based data on the spectral features of each pixel. Figure 7 shows the pixel-based classification of seeds as almonds or apricot kernels, based on the number of pixels in the binary images of the PLS-DA model, which calculated the pixels of the image based on the optimal detection rate of each seed using the reflectance intensity of the seeds. Generally, a 50% detection rate was considered for the classification of both groups, similar to the 0.5 threshold value used for the classification of seeds. The accuracy increases significantly when an optimum detection-rate method is used along with kernel-based image classification [18]. Figure 7 presents the 98% pixel-based classification of seeds for four tested images of both varieties of seeds. There may be some inaccuracy due to applying the total number of images from each group. Figure 5: The optimal number of latent variables (LVs) for the full spectral data.