## 3 Results and Discussion
### Selection of Optimal Wavelengths and Multispectral Model Development
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Contaminant**} & \multirow{2}{*}{**Selection**} & \multirow{2}{*}{**Number of** **Wavelengths**} & \multirow{2}{*}{**LVs**} & \multicolumn{2}{c}{**Calibration**} & \multicolumn{2}{c}{**Cross-Validation**} & \multicolumn{2}{c}{**Prediction**} \\ \cline{5-10}  & & & & \multicolumn{1}{c}{**R\({}_{\textbf{c}}\)2**} & \multicolumn{1}{c}{**RMSEC**} & \multicolumn{1}{c}{**R\({}_{\textbf{\alpha}}\)2**} & \multicolumn{1}{c}{**RMSECV**} & \multicolumn{1}{c}{**R\({}_{\textbf{\beta}}\)2**} & \multicolumn{1}{c}{**RMSEP**} \\  & & & & & **(\%)** & **R\({}_{\textbf{\alpha}}\)2** & **(\%)** & **R\({}_{\textbf{\beta}}\)2** & **(\%)** & **R\({}_{\textbf{\beta}}\)2** & **RMSEEP** \\ \hline \multirow{3}{*}{Peanut} & UVE & 16 & 12 & 0.991 & 0.312 & 0.989 & 0.340 & 0.988 & 0.348 \\  & SPA & 10 & 9 & 0.983 & 0.422 & 0.981 & 0.447 & 0.981 & 0.465 \\ \multirow{3}{*}{Walnut} & UVE & 14 & 6 & 0.998 & 0.147 & 0.998 & 0.157 & 0.997 & 0.170 \\  & SPA & 9 & 8 & 0.992 & 0.295 & 0.991 & 0.312 & 0.990 & 0.324 \\ \multirow{3}{*}{Peanut + walnut} & UVE & 17 & 10 & 0.988 & 0.345 & 0.987 & 0.360 & 0.987 & 0.373 \\  & SPA & 11 & 8 & 0.964 & 0.608 & 0.961 & 0.635 & 0.960 & 0.645 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Multispectral PLSR detection models for peanut-contaminated flour, walnut-contaminated flour and combination of them based on the corresponding selected wavelengths. RMSEC: root mean square error of calibration; RMSECV: root mean square error of cross-validation; RMSEP: root mean square error of prediction; SPA: successive projection algorithm; UVE: uninformative variable elimination. Figure 3: Performance of the best multispectral PLSR models for (**a**) peanut-contaminated flour; (**b**) walnut-contaminated flour; and (**c**) combination of both peanut-contaminated flour and walnut-contaminated flour applied on prediction sets based on the corresponding selected feature wavelengths (an enlarged view of the green circle part was shown in the green pane). for peanut-contaminated flour samples, the feature wavelengths selected by UVE and SPA were distributed similarly in the wavelengths regions such as 950-1050 nm, around 1200 nm, 1450-1600 nm, as well as 1350-1400 nm. As discussed in the Section 3.1, the former three regions presented the distinction between peanut and flour. For the region of 1350-1400 nm, there appeared to be an inflection point of the absorbance values between peanut and flour. While for Figure 4c,d, the distribution of wavelengths selected by UVE and SPA for walnut-contaminated samples seemed much more different from each other. The majority of the feature wavelengths selected by the UVE were among the region of 995-1150 nm, while wavelengths selected by SPA were among the whole wavelength range. The reason might be that SPA is based on criterion of the minimum of collinearity. As shown in Figure 4e,f, the distributions of wavelengths selected by UVE and SPA for combined samples of peanut and walnut contamination were also similar to each other; the distribution regions were in accordance with those discussed in peanut or walnut contamination cases, respectively. In general, UVE selected more feature wavelengths and had more accurate prediction models than SPA. SPA had the advantage in streamlining the wavelength variables, but also resulted in the decrease of the accuracy of the model. Figure 4: Distribution of feature wavelengths on average spectra curves of pure whole wheat flour as well as (**a,b**) peanut powder, (**c,d**) walnut powder, and combination of (**e,f**) both peanut and walnut powders samples (the wavelengths marked by the vertical green line were selected by UVE (**a,c,e**), while wavelengths marked by the vertical blue line were selected by SPA (**b,d,f**)). Furthermore, the number of feature wavelengths for peanut was greater than that for walnut, and the number for combined samples of peanut and walnut was the highest (shown in Table 3).