3.3.1. Principal Component Analysis

The original reflectance spectral data matrix was reduced to a system of coordinate axes, where samples were located according to principal component analysis (PCA) scores instead of intensities in the wavelength space [35]. Therefore, samples with similar spectral properties tend to project to the same location in principal component space. A clear differentiation according to capsaicinoid content and moisture content is indicated in the PCA score plots shown in Figure 3, which are expressed in two dimensions and three dimensions by the principal component factors based on the hyperspectral spectra. In the score plot, GC is shown in blue, ST in green, KC in yellow, and JU in orange; the higher the moisture content, the darker the color. PC−1, PC−2, and PC−3 contributed 95%, 3%, and 1% of the hyperspectral image data of red pepper powder obtained in the VIS-NIR region, respectively (Figure 3A,B). As indicated by the dotted circle, it is clearly classified according to the production area of red pepper powder, which may mean that it is classified according to the degree of spiciness or ASTA color; therefore, additional interpretation is needed through the loading plot result. In addition, the distribution of darker markers closer to the upper left corner of the score plot indicates that PCA analysis using hyperspectral data in the VIS−NIR region can visually show the difference in the moisture content of red pepper powder.

PCA results of the SWIR region showed that the first principal component (PC1) and the second principal component (PC2) accounted for 91% and 6% of the spectral variance, respectively. Because the first two principal components can explain 97% of the data, this data reveals the high feasibility of discrimination among red pepper powders. In the two-dimensional plot, it was sequentially distributed according to the moisture content, which can be the basis for the hyperspectral spectrum to represent the relative moisture content distribution of red pepper powder. In the three-dimensional plot, separate grouping was performed according to the sample and moisture content. Therefore, PCA analysis using hyperspectral data in the SWIR region can be a method that can effectively show the difference in the distribution of moisture content and other quality characteristics of red pepper powder. This plot only demonstrates the qualitative differences between the examined samples without referring to their quantitative attributes [35].

(**A**) PCA score plot in the VIS−NIR

**Figure 3.** PCA score plot of hyperspectral spectra in the VIS−NIR (**A**) and SWIR band (**B**).

#### 3.3.2. Loading Plot

The first two PCs accounted for 97% or more of the spectral variation in the tested samples; therefore, these five PCs can be used as alternatives to the variables for the classification of red pepper powder (Figure 4). In this study, to identify the key wavelengths that are highly correlated with each PC for VIS−NIR and SWIR systems, the PC loadings were plotted against their spectral ranges, and all characteristic wavelengths were marked. PC loading can be used to identify wavelengths highly correlated with each PC [36]. In addition, the PCA results of the spectral data of all tested red pepper powder spectra

loadings are the regression coefficients for each wavelength in each principal component, indicating which wavelength has a dominant effect on identification.

**Figure 4.** Loading plot of PC1 and PC2 derived from PCA of hyperspectral spectra in VIS–NIR (**A**) and SWIR band (**B**).

As a result of observing the PCA loading plot of VIS-NIR data (Figure 4A), PC1 explained 95% of the total variance in the samples. Key wavelengths (675–760 nm) were shown from this component, and key peaks were observed in the 580–610 nm, 675 nm, and 870–970 nm bands from PC2. Among the key wavelengths (580–610, 675–760, 870–975 nm) shown by PCA loadings, a peak observed in the red region (675 nm) might also be related to the presence of carotenoids [37]. The high absorbance observed at 625–740 nm is associated with red absorbing pigments, mainly chlorophyll absorption [38,39]. Absorption at 750 and 974 nm is due to water absorption bands related to O–H stretching second overtones [40,41]. Owing to the obvious difference in ASTA color value and moisture content between the samples in Table 1, VIS–NIR spectroscopic images can be used to compare the moisture content and color of red pepper powder.

As a result of observing the PCA loading plot of the SWIR data, PC–1 showed a prominent peak only at 1460 nm, and PC-2 showed peaks at 1020–1130 nm and 1430–1520 nm (Figure 4B). Capsaicin and dihydrocapsaicin are alkaloids with molecular formulas of C18H27NO3 and C18H29NO3, respectively, and the capsaicin molecule can be divided into three regions: aromatic rings, amide bonds, and hydrophobic side chains [42]. The chemical bonds that are read include O–H str. 1st overtone was detected in the wavelength range of 1395–1452 nm and this chemical bond in the form of the C–H stretch 1st overtone is due to the presence of aromatic and alkene functional groups, which are also known to be constituents of capsaicin [34]. The 2nd overtone occurred because of the presence of a

hydroxyl group (-OH) derived from several sources of antioxidants in red chili, such as capsanthin and capsaicin.

Therefore, it is foreseen that wavelengths at water absorption bands and capsaicinoid absorption bands are important for discrimination of pungency level and moisture content within each red pepper powder.

#### 3.3.3. Prediction of Quality Attribute in Red Pepper Powder

The prediction results of capsaicinoid, free sugar, and ASTA color by PLS modeling in VIS-NIR and SWIR are shown in Figures 5 and 6. The average Rp <sup>2</sup> of Model A in VIS-NIR for capsaicinoid was 0.98, and the average R<sup>2</sup> value decreased to approximately 0.92 in B7-10, B7-11 and B7-12 models, respectively: A decrease in Rp <sup>2</sup> of approximately 5.9% occurred. The SWIR Rp <sup>2</sup> values of the B7-10, B7-11, and B7-12 prediction models for the capsaicinoid were 0.85–0.87, a decrease of approximately 8.7% from the average Rp <sup>2</sup> value of A7–A12. Referring to Figure 4A, the loading peaks at 590 nm and 670 nm, which can explain the red color, were about 0.04 higher than those at 750 nm and 970 nm related to moisture. On the other hands, there is a peak that stands out more than other bands at 1450 nm where the vibration of OH bond in water molecules is revealed in Figure 4B. Therefore, the SWIR spectra were more sensitive to the moisture content of the sample compared to VIS-NIR spectra, which hindered the prediction of capsaicinoid content by difference of water contents.

The modeling results for free sugars are as follows. In Figure 5, the prediction Model A with uniform moisture content had an Rp <sup>2</sup> value of 0.96 or more. However, Rp <sup>2</sup> decreased in the order of B7-8 (0.94), B7-9 (0.90), B7-10 (0.90), B7-11 (0.85), and B7-12 (0.80) models. In Figure 6, it can be observed that the average Rp <sup>2</sup> of Model A is 0.951, whereas that of Model B is 0.839, a decrease of about 12%. As shown in Figure 5, the fact that the Rp <sup>2</sup> value did not decrease sequentially can be interpreted as a slight error according to the resolution of the SWIR system itself and the number of measurement bands. As a result, it means that the adjustment of the water content of the sample has a significant effect on the accuracy of the PLS model in predicting the free sugar content in both the VIS-NIR and SWIR regions.

The training, and prediction model of the ASTA color value in VIS-NIR maintained an Rc 2, Rcv2 and Rp <sup>2</sup> of 0.97 or more regardless of the moisture content distribution. In the SWIR region, it was observed that the R<sup>2</sup> values of the B7-11 and B7-12 models slightly decreased below 0.95 in the ASTA prediction model, but the prediction accuracy was still high. Although capsanthin, zeaxanthin, cryptoxanthin, and betacarotene are responsible for the red color in red pepper powders [43], the use of VIS-NIR region, which was based on the external color values of red peppers was better for developing the prediction model of ASTA color value than the use of SWIR region, which was based on the chemical structure of red peppers by water molecules (OH bond). Therefore, the hyperspectral imaging system is more useful and convenient for estimating ASTA values because there is less need to adjust the moisture content of the sample.

**Figure 5.** *Cont*.

(**B**) Prediction accuracy of free sugar of red pepper powders using VIS-NIR 0.8

**Figure 5.** Prediction accuracy of capsaicinoid (**A**), free sugar (**B**) and ASTA color (**C**) of red pepper powders using VIS-NIR wavelength range in accordance with moisture content. RMSEC, root mean square error of calibration; RMSECV, root mean square error of cross-validation.

(**A**) Prediction accuracy of capsaicinoid of red pepper powders using SWIR

(**B**) Prediction accuracy of free sugar of red pepper powders using SWIR

**Figure 6.** *Cont*.

(**C**) Prediction accuracy of ASTA color of red pepper powders using SWIR

**Figure 6.** Prediction accuracy of capsaicinoid (**A**), free sugar (**B**) and ASTA color (**C**) of red pepper powders using SWIR wavelength range in accordance with moisture content. RMSEC, root mean square error of calibration; RMSECV, root mean square error of cross-validation.

#### **4. Conclusions**

The present study predicted the capsaicinoid and free sugar content through hyperspectral imaging and PLS analysis of red pepper powder with different moisture contents and different pungency levels. There is an explicit tendency for the RMSE value to increase as the difference in moisture content of the modeling sample increases for all predicted quality attributes. Finally, a difference of more than 2% in MC had a negative effect on prediction accuracy for capsaicinoid and free sugar. Therefore, this study demonstrated that it is essential to adjust the moisture content difference of red pepper powder samples to be used for modeling within 2% using a hyperspectral imaging system. It is expected that this will be used as a basis for the development of automated systems for the rapid grading of pungency levels and sweetness.

**Author Contributions:** Conceptualization, J.-Y.C. and J.H.L.; methodology, J.-S.C.; validation, K.J.P. and J.H.C.; Formal analysis, J.-Y.C.; data curation, J.-S.C.; writing—original draft preparation, J.-Y.C. and J.-S.C.; writing—review and editing, K.J.P., J.H.C. and J.H.L.; visualization, J.-Y.C.; supervision, J.H.L.; project administration, J.H.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by Korea Institute of Planning and Evaluation for Technology in Food, Agriculture, Forestry (IPET) through (High Value-added Food Technology Development Program), funded by Ministry of Agriculture, Food and Rural Affairs (MAFRA) (321049-05).

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no potential conflict of interest.

#### **References**

