# Hyperspectral Imaging for the Detection of Bitter Almonds in Sweet Almond Batches
## 3 Results and Discussion
### Identification of Bitter Almonds in Adulterated Sweet Almond Batches
The detailed study of the bitter almond identification success for each of the groups M\({}_{5\%}\), M\({}_{10\%}\), M\({}_{15\%}\) and M\({}_{20\%}\) ranged between 61-85%. In the case of the mixtures, M\({}_{5\%}\), 70.6% (12/17) of the samples were correctly classified. Three of the five misclassified samples were prepared with _Belona_ cultivar almonds; this coincides with the results reported in previous NIR works by [PERSON] et al. [8] and [PERSON] et al. [9], who found greater  
Figure 3: Pixel-by-pixel validation for the identification of bitter almonds in the mixtures. difficulty in identifying as non-compliant products those mixtures prepared using _Belona_, possibly due to the shape of these kernels. In other mixture, it was detected that it had been prepared with a sweet sample from the _Vairon_ cultivar whose amygdala content was 0.13 mg/g, higher than the range of this parameter for the remaining samples of this cultivar (0.03-0.09 mg/g); then, it could be considered that this sample was underrepresented in the training set. Finally, in the case of the other misclassified M5% sample, it had been prepared using a bitter sample with a low amygdala content (0.07 mg/g). With regard to the mixtures, M10%, 85% (17/20) of these samples were correctly classified. The samples wrongly classified corresponded to mixtures prepared with samples belonging to _Belona_ (n = 1) and _Laureanne_ (N = 2) cultivars. Furthermore, one of these samples had been prepared with the previously mentioned bitter sample, whose amygdala content was low. Related to the mixtures M15%, the 80% (16/20) of the samples were correctly classified, corresponding again to three of the four samples wrongly classified to mixtures prepared using _Belona_ and _Laureanne_. Finally, in the case of the M20%, the percentage of correctly classified samples was lower, about 61% (11/18). As in the previous cases, the seven misclassified samples included mixtures that included sweet samples from the _Belona_ (N = 2) and _Laureanne_ (N = 2) cultivars, which would confirm the greater complexity for the identification of bitter samples in batches of sweet almonds of these cultivars. Another of the misclassified samples had been prepared using as sweet samples almonds of _Guara_ cultivar, which is considered a slightly bitter cultivar according to its genotype [26]. These results obtained are of great interest to the almond processing industry as they enable to identify the presence of each individual bitter almond mixed with sweet almonds, so it would not be necessary to eliminate the total processed batch. It is also important to note that as individual validation of each pixel in the image is being carried out, the percentage of correctly classified samples is not influenced by the proportion of bitter almonds included in the mixture, but there are other key factors, such as the characteristics associated with each cultivar and the representativeness of each cultivar within the training set. In this sense, due to the great heterogeneity that almond samples present, the model would require periodic readjustments with samples from new seasons, different cultivars, or other changes in environmental conditions that affect the almonds' characteristics. Once the viability of the pixel-by-pixel validation was demonstrated, it was tested the object-wise segmentation approach [_Data not shown_] in order to simulate the procedure required for the implementation of this system in the processing lines. For this purpose, the kernels were separated by applying different masks, and each individual kernel was identified as sweet or bitter depending on the class of most of its pixels. Although the results obtained allowed the identification of bitter almonds, more studies and the refining of the methodology is required for the improvement of this approach before its recommendation and adoption.