## 4 Result and Discussion
### Visualization Mapping of Adulterated Almonds  
The beta coefficient plotted in Figure 8 displays a valley of information used to identify the wavelengths carrying the vital information about the chemical composition features of kernels. The beta coefficient evaluates the relationship between the spectrum as dependent and independent variables of seeds.  
The peaks carrying the beta coefficient showed some specific bands of energy absorption between the almonds and apricot seeds. The absorption bands between 1165-1238 and 1692-1740 nm are associated with lipids. These include the C-H (-CH) second overtone stretching band (1200-1214 nm) [43]. The absorption bands between 1408-1462 and 1902-1959 nm are associated with the H-OH second overtone of water [44]. The absorption bands at 1432, 1457, 1505, and 1513 nm correspond to proteins [45]. These bands correlate with the major constituents of raw almonds: Lipids (50%), carbohydrates (\(\sim\)22%), and proteins (\(\sim\)21%) [38]. The spectrum in both kernels is dominated by water absorption bands with overtone bands of the OH-bonds at 970 nm, 1190 nm, and 1450 nm [46].  
The developed model's results are based on the averaged spectral data of each individual sample of hyperspectral image, in which the beta coefficient was obtained based on the above analysis and the full wavelength was used and applied to each pixel of the imaged seeds to visualize the chemical composition map of adulterated kernels. Before the development of spatial distribution mapped images, the background was eliminated from the samples using a simple threshold method. Further composition visualization mapped using the beta coefficient obtained from the PLS-DA model used raw pre-processing techniques to gain the total information from the samples in Figure 9. These images not only provided the spatial distribution of adulterations on the surface of samples, but were also useful for identifying the specific adulteration mixed with almond samples. The color scale from blue to red presents the differences in the chemical compositions of both kernels arranged in two rows of seven, in which the first row presents the almonds with a bluer color due to their high chemical content compared to the apricot kernels. Therefore, the almond kernels, due to absorbing more light because of their chemical composition and higher lipid content, absorbed the exposed light more than apricot kernels. According to the color bar, which presents the intensity of reflected light from the surface of seeds, the almonds appear bluer compared to the apricot kernels, which reflected more light than almonds.  
Figure 8: The obtained beta coefficient based on the raw preprocessing.  
The hyperspectral imaging technique has been widely used for various purposes in seed inspection, such as in the detection of seed diseases, seed viability measurement, foreign material detection, chemical composition analysis, etc. Recent studies on the purity assessment of maize seed varieties [47], detection of bacterially contaminated watermelon seeds [48], and internally damaged almond nuts [49] can be considered as successful applications of the hyperspectral imaging technique. Although the aforementioned studies have produced significant contributions for seed inspection, the results have rarely been used in the field. In this study, the developed hyperspectral imaging algorithm was used for the real-time discrimination of adulterated almond seeds with an online seed sorting system, in order to investigate its feasibility for further industrial application.