## 3 Results and Discussion
### Selection of Optimal Wavelengths and Multispectral Model Development  
UVE and SPA were applied on the preprocessed spectra of peanut and walnut contamination samples respectively to select the feature wavelengths from the full spectral range (213 wavelength variables). Furthermore, for the development of a general model for predicting peanut or walnut contamination, UVE and SPA were also applied on the spectra data of the combination of peanut-contaminated and walnut-contaminated flour samples. Multispectral PLSR models for predicting contaminants in flour were then developed using the corresponding feature wavelengths, and the main statistical parameters of the models are presented in Table 2. The number of optimal wavelengths selected by UVE was more than that by SPA, and the models based on UVE possessed better performance than those by SPA. This could be because SPA reduced the number of wavelength variables to a great extent in order to solve the collinearity problem, which leads to a decrease in the accuracy of the model. This was consistent with the conclusions of [PERSON], [PERSON], and [PERSON] [26], [PERSON] et al. [30] and [PERSON], [PERSON], and [PERSON] [31]. Multispectral PLSR models based on UVE showed good results to predict contaminants in three cases (as shown in Table 2). Accuracies of the best multispectral models to individually predict walnut or peanut contaminants were the same or even better than the models based on raw full spectra without being preprocessed. The general multispectral model for predicting a contaminant concentration value of both peanut-contaminated flour and walnut-contaminated flour performed worse than the models for peanut or walnut contaminant individually, but the performance was still promising with \(\text{R}_{\text{c}}{}^{2}\) of 0.988, RMSEC of 0.345%, \(\text{R}_{\text{cv}}{}^{2}\) of 0.987, RMSECV of 0.360%, \(\text{R}_{\text{p}}{}^{2}\) of 0.987, and RMSEP of 0.373%. The plot of measured versus predicted values of a prediction set for predicting peanut contamination, walnut contamination, and a combination of the two were presented in Figure 3. For the former two models, the contaminated samples with concentrations above 0.5% could be well predicted, while for the general model for both peanut and walnut, samples with concentrations above 1% could be predicted correctly as contaminated flour. These indicated that for the two individual models, the limit of detection was 0.5%, while for the general model, the limit of detection was 1%. [PERSON] et al. [33; 32; 33] studied the feasibility of the NIR HSI technique combined with principal component analysis (PCA), spectral band math, or independent component analysis (ICA) to detect peanut, hazelnut, and walnut particles (particle size of 1000-500 um) in wheat flour (particle size of 125-100 um and 212-160 um). The results of their studies indicated that the combined technique  
Figure 2: Performance of the best PLSR models for (**a**) peanut-contaminated flour and (**b**) walnut-contaminated flour applied on prediction sets based on full spectra (an enlarged view of the green circle part was shown in the green pane). can detect the spatial locations of peanut particles with contamination concentrations of 0.01% in the wheat flour. However, in their study, the particle sizes of the nuts were greater than that of the flour, and the situation of peanut and nut contaminants with smaller particle sizes similar to powdery food products has not been investigated. For some unintentional contamination situations, the results of the developed models in the study were not good enough; however, the models had practical application significance in the situations of nut powder as a food ingredient that was deliberately added in commercial wheat products without a clear statement. The distributions of selected wavelengths were plotted on the corresponding spectra profile of pure powders needed to be distinguished (as shown in Figure 4). As illustrated in Figure 4a,b