# Detection of Defective Features in Cerasus Humilis Fruit Based on Hyperspectral Imaging Technology
## 3 Results and Discussion
### Image Information Detection  
#### 3.4.1 Principal Component Analysis  
Because the bands are not correlated with each other, the principal component band can produce more color and better-saturated color composite images [25]. The hyperspectral  
Figure 7: The discriminant result of the CARS-LS-SVM model.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{\
\begin{tabular}{c} **Modeling** \\ **Methods** \\ \end{tabular} } & \multirow{2}{*}{
\begin{tabular}{c} **Variable** \\ **Selection** \\ **Methods (No.)** \\ \end{tabular} } & \multicolumn{3}{c}{**Calibration Set**} & \multicolumn{3}{c}{**Prediction Set**} \\ \cline{3-7}  & & & **Number of** & **Classification** & **Number of** & **Classification** \\  & & & **Misjudgments** & **Accuracy (\%)** & **Misjudgments** & **Accuracy (\%)** \\ \hline \multirow{3}{*}{LS-SVM} & RC (11) & (2.47 \(\times\) 10\({}^{3}\), 1.19 \(\times\) 10\({}^{3}\)) & 54 & 82.86 & 16 & 84.76 \\  & SPA (17) & (4.64 \(\times\) 10\({}^{3}\), 1.98\(\times\)10\({}^{3}\)) & 45 & 85.71 & 11 & 89.52 \\ \cline{1-1}  & CARS (13) & (5.82 \(\times\) 10\({}^{3}\), 2.04 \(\times\) 10\({}^{3}\)) & 43 & 86.35 & 9 & 91.43 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Effects of discriminant models based on different characteristic wavelength methods.  
images of intact and defective _Cerasus humilis_ fruits corresponding to the 13 characteristic wavelengths selected by the CARS algorithm were analyzed for PCA. The results are shown in Table 4.  
As can be seen in Table 4, the cumulative contribution rate of the first six principal components (PC) images reached 99.96%. In this research, the first eight PC images of intact and defective _Cerasus humilis_ fruits based on characteristic wavelengths revealed the main characteristics of _Cerasus humilis_ fruits (all images are shown in Figure 8). These PC images are ranked according to the degree of decreasing variance, with the 1 st PC image having the largest proportion of variance and containing the most original information. It can be seen in Figure 8 that the first six PC images (PC-1 to PC-6) of four different defect types of _Cerasus humilis_ fruit contain the most original image information, while PC-7 and PC-8 images were primarily filled with noise.  
Through the rapid visual inspection of the first six PC images, we found that the primary defect features became more obvious in some of the converted PC images, proving that PCA could extract useful features. Take the cracked fruit as an example: in the PC-1 image, the gray value difference between the crack and the surrounding regions was small; this cannot provide more unique features than the original unconverted hyperspectral image. Images PC-2, PC-3, and PC-4 enhance useful crack features. In particular, the information in the cracked regions of the PC-3 image was remarkable, meaning the cracked regions could be clearly identified. The black information around the cracked regions of the PC-3 image was because the skin of the _Cerasus humilis_ fruit becomes darker and even rotten over a prolonged time. Thus, the PC-3 image was more suitable for crack region segmentation. In the PC image of the rust spot fruit sample, the rust spot regions in PC-6 are the most obvious, allowing it to be used for defect segmentation. Similarly, PC-5 could be used to identify insect damage defects.