## 3 Results and Discussion
### Comparison of Preprocessed Methods and Full Spectra Modeling  
The performances of different PLSR models that were developed based on raw and the five preprocessed spectra for predicting peanut or walnut contaminants in flour are summarized in Table 1. Compared to the raw spectra, the preprocessing methods offered a significant improvement in the model performance for peanut contamination, which indicated that the preprocessing methods were effective to attenuate the scatter effect and random noise. As shown in Table 1, the PLSR model with a combined preprocessed method of SNV + 1 st Der performed the best. Regarding the model of walnut contamination, although not all of the preprocessing methods improved the performance of the PLSR models, the combination method of SNV + 1 st Der performed the best. Moreover, performance of PLSR models for walnut powder was better than the model for peanut powder, which was in accordance with the more distinct difference between walnut and flour than that between peanut and flour, as indicated in Section 3.1 and Figure 1.  
The plot of measured versus predicted values of the prediction set for peanut and walnut contamination were shown in Figure 2a,b, respectively. Normally, contaminants with larger concentration gradients are relatively easy to be predicted; thus, the minimum limit of detection is the critical point of the problem. As shown in Figure 2a for peanut contamination, all of the samples with a concentration equal and greater than 1% were predicted to be above 0, while for samples  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Contaminant**} & \multirow{2}{*}{
\begin{tabular}{c} **Preprocessing** \\ **Method** \\ \end{tabular} } & \multirow{2}{*}{**LVs**} & \multicolumn{2}{c}{**Calibration**} & \multicolumn{2}{c}{**Cross-Validation**} & \multicolumn{2}{c}{**Prediction**} \\ \cline{3-10}  & & & \multicolumn{1}{c}{**R\({}^{\text{2}}\)**} & \multicolumn{1}{c}{**RMSEC**} & \multicolumn{1}{c}{**R\({}_{\text{cv}}\)**} & \multicolumn{1}{c}{**RMSECV**} & \multicolumn{1}{c}{**R\({}_{\text{p}}\)**} & \multicolumn{1}{c}{**RMSEP**} \\  & & & & & & & & & \\ \hline \multirow{6}{*}{Peanut} & None & 11 & 0.989 & 0.342 & 0.986 & 0.386 & 0.985 & 0.398 \\  & SNV & 12 & 0.996 & 0.208 & 0.992 & 0.282 & 0.992 & 0.287 \\  & 1 st Der & 10 & 0.994 & 0.259 & 0.991 & 0.298 & 0.991 & 0.307 \\  & Det & 13 & 0.995 & 0.225 & 0.992 & 0.293 & 0.993 & 0.267 \\  & SNV + 1 st Der & 12 & 0.997 & 0.183 & 0.994 & 0.253 & 0.993 & 0.272 \\  & SNV + Det & 12 & 0.996 & 0.195 & 0.992 & 0.285 & 0.994 & 0.251 \\ \hline \multirow{6}{*}{Walnut} & None & 8 & 0.998 & 0.145 & 0.998 & 0.159 & 0.997 & 0.180 \\  & SNV & 6 & 0.998 & 0.142 & 0.998 & 0.153 & 0.997 & 0.168 \\ \cline{1-1}  & 1 st Der & 8 & 0.998 & 0.159 & 0.997 & 0.175 & 0.998 & 0.161 \\ \cline{1-1}  & Det & 9 & 0.998 & 0.154 & 0.997 & 0.184 & 0.996 & 0.198 \\ \cline{1-1}  & SNV + 1 st Der & 8 & 0.999 & 0.125 & 0.998 & 0.144 & 0.998 & 0.153 \\ \cline{1-1}  & SNV + Det & 10 & 0.999 & 0.119 & 0.998 & 0.145 & 0.998 & 0.153 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Partial least squares regression (PLSR) models for the detection of peanut-contaminated flour and walnut-contaminated flour based on full spectra. SNV: standard normal variate; 1 st Der: Savitzky–Golay first derivative; Det: de-trending.  
Figure 1: Average absorbance spectra of pure whole wheat flour, peanut powder, and walnut powder.  
with a concentration of 0.5%, except for one sample, all of the other samples' predicted values were above 0. These indicated that the lowest detection limit of peanut contamination in flour was close to 0.5%, although variation did exist. The results for walnut were better, and all of the samples with concentrations equal to and greater than 0.5% could be well predicted, and as shown in Figure 2b, the lowest detection limit of walnut contamination in flour reached 0.5%.