# Variety Identification of Chinese Walnuts Using Hyperspectral Imaging Combined with Chemometrics
## 3 Results and Discussion
### Classification Visualization of Chinese Walnut Varieties  
The advantage of HSI to acquire both spatial and spectral information makes it possible to show the classification results of Chinese walnuts using intuitive classification maps. In our study, the simplified CARS-PLS-DA model was transferred to predict the varieties of each pixel. Compared to original hyperspectral images, the visual classification map could be eventually formed. The original false-color images of Ningguo and Lin'an walnuts are shown in Figure 5a,b. It could be seen that most of the walnuts differed little in texture or morphology characteristics. It was difficult to discriminate different varieties by naked eye. As shown in Figure 5c,d, the corresponding predicted varieties were marked using different colors (red for Ningguo walnuts, green for Lin'an walnuts, and black for background). The misclassified and well-classified pixels were clearly displayed in the classification maps. Most of the pixels within one sample were accurately classified, however, a distribution structured in band misclassification could be seen especially for Lin'an variety. The main reason was that samples shook slightly as the conveyor belt slipped, and noise was brought into the line-scanning images. Further application will focus on holding the walnuts with a belt with sockets in images collection procedure to obtain more accurate results. Anyway, the sample-level varieties were successfully identified with 100% accuracy, and more than 75% of the pixels were correctly identified. The visualization results indicated that HSI together with the optimal CARS-PLS-DA model also had great potential in visualizing the Chinese walnut varieties. This methodology was expected to be applied in modern nut industry as a powerful tool for large-scale qualitative detection of walnuts.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{2}{c}{**Calibration Set**} & \multicolumn{2}{c}{**Cross-Validation Set**} & \multicolumn{2}{c}{**Prediction Set**} \\ \cline{2-7}  & **Ningguo** & **Lin’an** & **Ningguo** & **Lin’an** & **Ningguo** & **Lin’an** \\ \hline Ningguo & 146 & 4 & 143 & 7 & 44 & 6 \\ Lin’an & 7 & 143 & 6 & 144 & 3 & 47 \\ Sensitivity & 97.28\% & 95.42\% & 95.36\% & 95.97\% & 88.68\% & 93.62\% \\ Specificity & 95.42\% & 97.28\% & 95.97\% & 95.36\% & 93.62\% & 88.68\% \\ \hline \hline \end{tabular}
\end{table}
Table 4: Confusion matrix in the three sets predicted using the optimal simplified model.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Models**} & \multirow{2}{*}{**Number**} & \multirow{2}{*}{**LVs**} & \multicolumn{4}{c}{**Corrected Classification Rate (\%)**} \\ \cline{3-5}  & & & **Calibration Set** & **Cross-Validation Set** & **Prediction Set** \\ \hline PC-PLS-DA & 3 & 2 & 68.67 & 65.00 & 66.00 \\ CARS-PLS-DA & 15 & 11 & 96.33 & 95.67 & 91.00 \\ SPA-PLS-DA & 10 & 7 & 91.33 & 92.00 & 89.00 \\ \hline \hline \end{tabular}
\begin{tabular}{c} PC: principal component; PLS-DA: partial least squares-discriminant analysis; CARS: competitive adaptive reweighted sampling; SPA: successful projects algorithm; LVs: latent variables. \\ \end{tabular}
\end{table}
Table 3: The optimal PLS-DA modeling results developed by selected wavelengths based on different methods.  
The overall results indicated that HSI could become a good way for identifying Chinese walnut varieties. Coincidentally, a recent work [44] related to this subject also confirmed that walnut varieties can be evaluated by HSI technique. However, no attempts of HSI-based classification visualization have been conducted previously. Our study shows the potential of HSI for visualizing the variety categorization of Chinese walnuts. It provides a good example for widespread application of this technique on different kinds of nuts. The nut industry will benefit from this visual and rapid method to categorize nut according to their variety, and direct the nut of different varieties to appropriate end-uses.