*2.7. Modeling Algorithm*

The least square support vector machine (LS-SVM) is an improved SVM algorithm proposed by Suykens [29]. Its operation speed can be significantly improved by solving a set of linear equations instead of the complex quadratic programming problem of the SVM. In this work, the radial basis function (RBF) was used as the kernel function, and the combination of the regression error weight, γ, and the kernel function parameter, σ2, were optimized via grid search based on the cross-validation model. The quality parameters of the LS-SVM models were evaluated by using the RMSEC, RC, RMSEV, and RV values. The results show that the model performs better when RMSEC and RMSEV are small and RC and RV are large.

#### **3. Results**

#### *3.1. Statistics and Analysis of the Sensory and Physicochemical Values*

The statistic values of a\*, the firmness, and the SSC of Korla fragrant pears are shown in Table 2. The value of a\* lies in the −7.108–3.254 range. When a\* is positive the color of the tested area is red, whereas when a\* is negative is green. The firmness lies in the 10.4 × 105– 14.1 × <sup>10</sup><sup>5</sup> Pa range. This value is larger than that measured in other studies [30,31] probably because, in this work, the skin of the pears was not removed. This method was preferred since it meets the most common eating habits of the customers, who generally eat the pears with the skin to increase their uptake of vitamin C. The SSC lies in the 10.0–13.4 ◦Brix range. Such range is narrower that the one defined by Yu X J et al. and Li J B et al. probably due to the differences in planting locations. On the other hand, the value ranges in the calibration set include those in the other set: Both sets, in fact, are representative since the mean values and dispersion degree of the two sets are similar.


**Table 2.** Statistics of the quality parameters in the calibration and validation sets.

The a\* color space method recommended by the International Commission on illumination (CIE) used "\*" in the expression of three parameters.

#### *3.2. Spectrum Data Processing*

#### 3.2.1. Spectral Curves

The spectral curves with the largest distance in most wavelengths are shown in Figure 3. The measured values of a\*, of the firmness, and of the SSC of sample 1 and sample 2 are 3.194, 13.9 × <sup>10</sup><sup>5</sup> Pa, and 12.0 ◦Brix and −6.934, 10.4 × <sup>10</sup><sup>5</sup> Pa, and 10.1 ◦Brix, respectively. Three reflection valleys can be observed near 1140 nm, 1440 nm, and 1640 nm, whereas two reflection peaks are located at 960 nm and 1270 nm. A water absorption band exists near 960 nm [32]. The reflection valleys near 1140 nm and 1640 nm may correspond to the first and second overtones of the C-H group, respectively [33]. The strong reflection valley at 1440 nm can be assigned to the first overtone of the O-H and N-H bonds [34]. The reflection peaks near 1270 nm may be related to the second overtones of the O-H and C-H bonds, respectively [35].

**Figure 3.** Reflective spectral curves.

3.2.2. PLSR Models for the Quality Parameters and Optimization of the Principal Components Based on the Full Spectral Analysis

The PLSR models for the a\* value, the firmness, and the SSC of Korla fragrant pears were obtained by analyzing the spectral data after different spectral pre-processing processes. The spectra after pretreatment with MSC-SG are shown in Figure 4. The selection process of the numbers of principal components is shown in Figure 5. The principal components to determine the a\* value, the firmness, and the SSC are 10, 8, and 9, respectively. The prediction results are listed in Table 3. The results show that the PLSR models with MSC-SG pretreatment exhibit the highest evaluating ability. The RC and RMSEC values obtained for a\* measure 0.907 and 0.448, respectively, in the case of the calibration set, whereas RV and RMSEV measure 0.894 and 0.402 when the validation set is used. The RC and RMSEC values of the firmness are 0.914 and 0.352 × <sup>10</sup><sup>5</sup> Pa, respectively, for the calibration set and the RV and RMSEV values of 0.903 and 0.317 × 105 Pa, respectively,

are obtained from the validation set. The RC and RMSEC of the SSC measure 0.925 and 0.314 ◦Brix, respectively, when the calibration set is considered, whereas RV and RMSEV measure 0.912 and 0.301 ◦Brix, respectively, in the case of the validation set.

**Figure 4.** Spectra after the MSC-SG preprocessing.

**Figure 5.** *Cont*.

**Figure 5.** Selection process of principal components based on MSC-SG. (**a**) Selecting process to estimate the a\* value. (**b**). Selecting process to estimate the firmness. (**c**) Selecting process to estimate the SSC.

**Table 3.** Modeling results to estimate the quality parameters for Korla pears.


The a\* color space method recommended by the International Commission on illumination (CIE) used "\*" in the expression of three parameters.

3.2.3. Visualization of the Iterative Process and Selection of the Important Wavelengths

In an iterative process, wavelengths can be classified into different groups according to their P and Dmean values. Figure 6 shows the distribution of the P and D-means values for each wavelength obtained in the second iteration. The strongly informative wavelengths, weakly informative wavelengths, uninformative wavelengths, and interfering wavelengths are 7, 57, 37, and 14 to estimate the a\* value, 15, 37, 47, and 7 to define the firmness, and 8, 59, 34, and 13 to calculate the SSC, respectively.

**Figure 6.** Distribution of wavelengths for different parameters obtained in the second iteration. (**a**) Wavelengths to estimate the a\* value. (**b**) Wavelengths to estimate the firmness. (**c**) Wavelengths to estimate the SSC.

The number of wavelengths selected for a\*, the firmness, and the SSC in different iterations are shown in Figure 7. Their number in the first three rounds initially decreases rapidly and then slows down. Both the irrelevant wavelengths and the interference wavelengths are completely removed after the 6th iteration. The important wavelengths, which were missed during the process, were selected after reverse elimination. To estimate the a\* value, the firmness, and the SSC, 8, 11, and 16 important wavelengths are necessary. Selected wavelengths for each parameter are shown in Table 4. The number of important wavelengths of different quality parameters accounts for 3.9%, 5.4%, 7.9% of the valid wavelengths, respectively.

**Figure 7.** Number of retained wavelengths in each IRIV iteration.

**Table 4.** Important wavelengths for different parameters.


The a\* color space method recommended by the International Commission on illumination (CIE) used "\*" in the expression of three parameters.

#### 3.2.4. Evaluation of the Quality Parameters Based on the LS-SVM Model

In this study, several evaluation models were established based on the LS-SVM and the PLSR methods for a set of selected wavelengths. The optimal combinations of the regression error weight, <sup>γ</sup>, and the kernel function parameter, <sup>σ</sup>2, are (8.67 × <sup>10</sup>4, 1.21 × <sup>10</sup>3), (1.45 × <sup>10</sup>4, 2.93 × 104), and (2.37 × <sup>10</sup>5, 3.80 × <sup>10</sup>3) for the a\* value, the firmness, and the SSC, respectively. Figure 8a–c shows the results on the 3 quality parameters obtained via the IRIV-LS-SVM model. The RC and RV values measure 0.932 and 0.927, respectively, in the case of the a\* value; They are 0.954 and 0.948 for the firmness, and 0.955 and 0.953 for the SSC. The RMSEC and RMSEV value measure 0.426 and 0.475, respectively, for the a\* value, 0.310 × <sup>10</sup><sup>5</sup> Pa and 0.345 × 105 Pa for the firmness, and 0.319 ◦Brix and 0.346 ◦Brix for the SSC.

The principal components used in the PLSR models to estimate a\*, the firmness, and the SSC are 8, 8, and 9, respectively. Figure 8d–f shows the results obtained by using the IRIV-PLSR model. The RC and RV values of a\* measure 0.921 and 0.915, respectively, in the case of the firmness, these values are 0.940 and 0.933, respectively, whereas for the SSC, the measure 0.951 and 0.942. The RMSEC and the RMSEV of the a\* are 0.447 and 0.406, in the case of the firmness they measure 0.330 × <sup>10</sup><sup>5</sup> Pa and 0.395 × <sup>10</sup><sup>5</sup> Pa, whereas for the SSC 0.346 ◦Brix and 0.340 ◦Brix, respectively.

These results show that the IRIV-LS-SVM model provides more accurate results than the IRIV-PLSR one.

**Figure 8.** *Cont*.

**Figure 8.** Scatter plots of the calibration set (\*) and prediction set (o) for each quality parameter. (**a**) Scatter plots of the LS-SVM mold of the a\* value. (**b**) Scatter plots of the LS-SVM mold of the firmness. (**c**) Scatter plots of the LS-SVM mold of the SSC. (**d**) Scatter plots of the PLSR mold of the a\* value. (**e**) Scatter plots of the PLSR mold of the firmness. (**f**) Scatter plots of the PLSR mold of the SSC.

### **4. Discussion**

This work demonstrates that hyperspectral imaging can be used to quantitatively analyze the a\* value, the firmness, and the SSC of Korla fragrant pears. Both the PLSR and the LS-SVM models were implemented in combination with the IRIV algorithm to select the important wavelengths. The optimal (γ and σ2) combinations found in this study are (8.67 × 104, 1.21 × 103), (1.45 × 104, 2.93 × 104), and (2.37 × <sup>10</sup>5, 3.80 × <sup>10</sup>3) for the a\* value, the firmness, and the SSC, respectively. In the LS-SVM model, the combination of the RC and RMSEC values for a\*, the firmness, and the SSC measures (0.892, 0.726), (0.914, 0.410), and (0.925, 0.319), respectively. These combinations are (0.883, 0.775), (0.908, 0.548), and (0.916, 0.346), respectively, when the validation set is considered. These results show that the IRIV-LS-SVM model can efficiently evaluate the main important parameters of Korla fragrant pears, which can be used for the quantitative evaluation and grading of fruit.

### **5. Conclusions**

Compared with traditional detection methods, multiple parameter detection based on hyperspectral imaging technology has the technical advantages of being nondestructive, real-time and accurate.

There were two ways to reduce the spectral influences caused by different optical path lengths of ROI of Korla fragrant pear. Firstly, there were four halogen light sources at the same vertical plane in the irreflexive hyperspectral imaging system. The center of the four lights was in the center of the moving stage. Secondly, some spectral preprocessing algorithms were used in order to reduce the effects. The combination of MSC and SG exhibited the highest evaluating ability.

Most previous studies predicted only one or two parameters of fruits by non-destructive technologies. Three quality parameters related to the maturity and grading were predicted at the same time in this paper. Both the PLSR and the LS-SVM models were implemented in combination with the IRIV algorithm to select the important wavelengths. Both the irrelevant wavelengths and the interference wavelengths are completely removed after the 6th iteration. 8, 11, and 16 important wavelengths are selected to estimate the a\* value, the firmness, and the SSC. The optimal (γ and σ2) combinations found in this study are (8.67 × 104, 1.21 × 103), (1.45 × 104, 2.93 × 104), and (2.37 × 105, 3.80 × 103) for the a\* value, the firmness, and the SSC, respectively. In the LS-SVM model, the combination of the RC and RMSEC values for a\*, the firmness, and the SSC measures (0.892, 0.726), (0.914, 0.410), and (0.925, 0.319), respectively. These combinations are (0.883, 0.775), (0.908, 0.548), and (0.916, 0.346), respectively, when the validation set is considered. These results show that the IRIV-LS-SVM model can efficiently evaluate the main important parameters of Korla fragrant pears, which can be used for a quantitative evaluation and grading of the fruit. At the same time, this study also has a certain guiding significance for the qualitative detection of other fruits.

There are some research demands in the future. Firstly, a large number of experiments are needed to extend this method to more fruit detection fields through the adjustment of key parameters and the development of supporting equipment. Secondly, the number of Korla fragrant pears can be increased, so as to guarantee the grading quality and realize the industrial upgrading. Thirdly, this research mainly used spectral data to quantitatively predict the quality parameters of Korla fragrant pear although hyperspectral imaging technology has the characteristics of atlas integration. The image processing technology can be introduced to identify the kind of defects, defect level, maturities, et al. of Korla fragrant pear according to more organoleptic attributes.

**Author Contributions:** Resources, F.C.; data curation, R.S.; writing—original draft preparation, T.W.; writing—review and editing, Y.L.; visualization, C.H.; supervision, J.C.; project administration, Y.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by the National Natural Science Foundation of China, grant number 31960498, the Open Project Program of the Key Laboratory of Colleges & Universities under the Department of Education of Xinjiang Uygur Autonomous Region, grant number TDNG20200102, and the Science and Technology Planning Project of 1st Division of Xinjiang Production and Construction Corps, grant number 2019XX02.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The data presented in this study are available on request from the corresponding author. The data are not publicly available due to the request of funding scientific research projects.

**Acknowledgments:** This work was supported in part by the National Natural Science Foundation of China (Project No. 31960498), the Open Project Program of the Key Laboratory of Colleges & Universities under the Department of Education of Xinjiang Uygur Autonomous Region (No. TDNG20150101 and No. TDNG20200102), the Science and Technology Planning Project of 1st Division of Xinjiang Production and Construction Corps (No. 2019XX02). The authors are grateful to anonymous reviewers for their comments.

**Conflicts of Interest:** The authors declare that they have no known competing financial interest or personal relationship that could have appeared to influence the work reported in this paper.

#### **References**

