Prediction and visualization map for physicochemical indices of kiwifruits by hyperspectral imaging

Soluble solid content (SSC), firmness, and color (L*, a*, and b*) are important physicochemical indices for assessing the quality and maturity of kiwifruits. Therefore, this research aimed to realize the nondestructive detection and visualization map for the physicochemical indices of kiwifruits at different maturity stages by hyperspectral imaging coupled with the chemometrics. To further improve the detection accuracy and working efficiency of the models, competitive adaptive reweighted sampling (CARS) and successive projection algorithm were employed to choose feature wavelengths for predicting the physicochemical indices of kiwifruits. Multiple linear regression (MLR) was designed to develop simplified detection models based on feature wavelengths for determining the physicochemical indices of kiwifruits. The results showed that 32, 18, 26, 29, and 32 feature wavelengths were extracted from 256 full wavelengths to predict the SSC, firmness, L*, a*, and b*, respectively, with the CARS algorithm. Not only was the working efficiency of the CARS-MLR model improved, but the prediction accuracy of the CARS-MLR model for determining the physicochemical indices was also at its relative best. The residual predictive deviations of the CARS-MLR model for determining the SSC, firmness, L*, a*, and b* were 3.09, 2.90, 2.32, 2.74, and 2.91, respectively, which were all above 2.3. Compared with the model based on the full spectra, the CARS-MLR model could be used to predict the physicochemical indices of kiwifruits. Finally, the visualization map for the physicochemical indices of kiwifruits at different maturity stages was generated by calculating the spectral response of each pixel on the kiwifruit samples with the CARS-MLR model. This made the detection for the physicochemical indices of kiwifruits more intuitive. This study demonstrates that hyperspectral imaging coupled with the chemometrics is promising for the nondestructive detection and visualization map for the physicochemical indices of kiwifruits, and also provides a novel theoretical basis for the nondestructive detection of kiwifruit quality.


Introduction
As one of the post-ripening fruits, kiwifruit is usually picked unripe during actual harvesting to prolong its storage time.If picked too early, kiwifruits will retain their flesh firmness, thereby affecting the taste.Harvesting too late will lead to over-ripeness, making it difficult to store kiwifruits (1).Soluble solid content (SSC), firmness, and color (L*, a*, and b*) are essential parameters for assessing kiwifruit quality and ripeness.Therefore, nondestructive detection of the SSC, firmness, and color of kiwifruits at different maturity stages can be useful for determining the appropriate harvesting time and post-harvest quality grading.
Although traditional methods for measuring the physicochemical indices of fruits are characterized by relatively high accuracy, they have their fair share of disadvantages.For example, they may destroy the detected objects, the detection is inefficient and time-consuming, and large-scale detection is difficult to realize (2,3).Nondestructive detection methods based on hyperspectral imaging have been widely used in the field of fruit quality detection (4)(5)(6)(7)(8)(9), which are fast and non-contaminating compared with traditional detection methods.The hyperspectral imaging technique can not only quickly and nondestructively capture the spectral information of the object of interest but also obtain its image information (10).By integrating spectral and image information, this technique can rapidly and nondestructively detect the internal and external quality of fruits.Compared with near-infrared spectroscopy, hyperspectral imaging can obtain the spectral information of the entire object of interest, which helps construct a more stable prediction model (11).In addition, the image information obtained by hyperspectral imaging can be used to visualize the distribution of the physicochemical indices of fruits, making the detection of these indices more intuitive.However, hyperspectral images are characterized as high dimensionality data, which will influence the detection efficiency.Fan et al. (12) employed hyperspectral imaging technology to quantitatively predict SSC and firmness in Korla pears.Partial least square regression (PLSR) models based on variables extracted from the combination of competitive adaptive reweighted sampling (CARS) and successive projection algorithm (SPA) demonstrated outstanding prediction performance.The correlation coefficients and root mean square errors of the prediction set (RMSEP) were 0.88 and 0.49 for SSC, and 0.87 and 0.72 for firmness.Xie et al. (13) proposed a method of using hyperspectral imaging to quantitatively predict the color (L*, a*, and b*) and firmness of bananas.The constructed partial least squares prediction model performed relatively well.The coefficient of determination in the prediction set was 0.80 for L*, 0.97 for a*, 0.77 for b*, and 0.76 for firmness.Su et al. (14) combined hyperspectral imaging and deep learning to quantitatively predict strawberry SSC and identify strawberry ripeness.Wang et al. (15) investigated the feasibility of evaluating the apple quality and ripeness using hyperspectral imaging; the results showed that the constructed model could achieve nondestructive detection and spatial distribution of apple quality and ripeness.No study has been reported on quantitative prediction and distribution visualization of multiple physicochemical indices of kiwifruits using hyperspectral imaging.
Therefore, this study constructed a model for predicting the physicochemical indices of kiwifruits at different maturity stages based on hyperspectral imaging and chemometrics.To improve the detection accuracy and efficiency of the prediction model, we used CARS and SPA algorithms to select feature wavelengths for the physicochemical indices of kiwifruits, to construct a simplified prediction model.The distributions map of the physicochemical indices of kiwifruits at different maturity stages were visualized using the pseudo-color technique, making the detection of such indices more intuitive.This study provides a reference for the accurate prediction of the physicochemical indices of kiwifruits in actual production.

Kiwifruit samples
The "Guichang" kiwifruit samples used in this study were obtained from the commercial orchard in Xiuwen County, Guizhou Province, China.To improve the detection range of the physicochemical indices of kiwifruits, we randomly picked samples from kiwifruit trees at different locations in four batches from September to October 2019.Samples were picked at different maturity stages (unripe stage: picked on September 17, with the SSC ranging from 4.63 to 5.73 °Brix; semi-ripe stage: picked on September 28, with the SSC ranging from 5.90 to 7.30 °Brix; ripe stage: picked on October 7, with the SSC ranging from 6.50 to 9.20 °Brix; over-ripe stage: picked on October 19, with the SSC ranging from 9.20 to 12.20 °Brix).Fifty samples free of defects and damages were selected from each batch, totalling 200 samples.Before the experiment, the dust on the surface of the samples was wiped off with soft paper.The samples were sequentially numbered to obtain the hyperspectral images and measure the physicochemical indices.
Figure 1 shows the configuration diagram of the hyperspectral imaging system, of which the wavelength ranges from 390 nm to 1,030 nm.The spatial resolution of hyperspectral images is 0.2 mm/ pixels.The parameters of the instrument are detailed in the reference (16).

Hyperspectral images acquisition and correction
We placed the numbered kiwifruit samples on an electric transportation plate and scanned them one by one to obtain their original hyperspectral images.Due to the uneven intensity distribution of the light source in the dark box and certain differences in sample shapes, there were noise signals in the acquired original hyperspectral images.After acquiring the hyperspectral images of all the samples, we acquired black-and-white calibrated images with the same system parameters, and performed reflectance correction for the original hyperspectral images of all the samples as follows (formula 1): where R ref is the calibrated image, R original is the original image, and R white and R black are the white and black calibrated images, respectively.

Measurement of physicochemical indices
After acquiring the hyperspectral images of all the samples, we measured the color values (L*, a*, and b*) of kiwifruits at the equatorial positions using a spectrophotometer.The aperture plate diameter of the spectrophotometer was 10 mm.After the spectrophotometer was calibrated, we placed the samples in the observer of the spectrophotometer, and then gently closed the color sample holder to determine the color values.
The reference firmness of the samples was determined using a sclerometer.The probe diameter of the sclerometer was 7.9 mm, and the depth at which the probe was pressed into the kiwifruit flesh was roughly 10 mm.The skin of the samples near the equator was peeled before the measurement.The probe was aligned with the flesh of the fruit and then pressed slowly and uniformly to the mark.Each sample was tested thrice.The average of the tested values was used as the reference firmness of the samples.
The reference SSC of the kiwifruit samples was determined by a refractometer with a range of 0.0-85 °Brix and an accuracy of ±0.2 °Brix.Juice was extracted from the samples and then centrifuged at 3000 r/min for 5 min before the determination.The sample juice was smeared on a mirror, followed by multiple consecutive measurements until the last three measurements were the same.Afterwards, this measurement was taken as the reference SSC of the samples.

Modeling and assessment
A PLSR detection model was constructed to predict the physicochemical indices of kiwifruits based on the full-band data and the reference values of the indices.CARS (17) and SPA (18) were used to select feature wavelengths.SPA adopts an easy projection procedure in a vector space to select subsets of wavelengths with minimum colinearity.CARS employs the absolute values of regression coefficients of PLSR model as a parameter for evaluating the importance of every wavelength.Based on the selected characteristic spectra and the reference values, we then constructed a simplified multiple linear regression (MLR) model to predict the physicochemical indices of kiwifruits.The linear regression equation between the independent variable X (X 1 , X 2 , X 3 ,.., X m ) and the dependent variable Y (each physicochemical index) is given as follows (formula 2): Assuming that the observations are {(Y i , X i1 ,.., X im ), i = 1, 2,.., n}, the MLR prediction model is as follows (formula 3): where β i denotes the coefficient of the ith independent variable, and ε i denotes the error term.
The coefficient of determination (R 2 C ) and its root mean square error (RMSEC) for the calibration set, the coefficient of determination (R 2 P ) and its root mean square error (RMSEP) for the prediction set, and the residual prediction deviation (RPD) were used as the key indicators to determine the prediction model performance (formulas 4-8).The prediction model is more effective if R 2 C and R 2 P are closer to 1, RMSEC and RMSEP are closer to 0, and the RPD value is larger.For the model, 1.4 ≤ RPD < 1.8 indicates a poor prediction effect; 1.8 ≤ RPD < 2.0 indicates a good prediction effect; RPD ≥ 2.0 indicates an excellent prediction effect (19).

R y i y i y i y i
(5) Configuration diagram of hyperspectral imaging system.
Meng et al.
where n C and n P are the numbers of samples in the calibration and prediction set, respectively; y act and y mean are the reference and mean values of the physicochemical indices, respectively; y cal and y pre are the predicted values of the physicochemical indices in the calibration and prediction set, respectively; SD is the standard deviation of the reference values of the physicochemical indices in the prediction set.

Statistics of the physicochemical indices
Figure 2 shows the statistical results for the physicochemical indices of kiwifruits at different maturity stages.It can be seen that the mean SSC of kiwifruits at different maturity stages increased with their gradual maturity, while the mean firmness of kiwifruits at different maturity stages showed the opposite trend of change.The color values of kiwifruits at different maturity stages changed relatively little, among which a* and b* followed the same trend.
Before a model for predicting the physicochemical indices of kiwifruits is constructed, all the samples need to be divided into calibration and prediction sets based on the acquired reflectance spectral data and measured physicochemical values.Whether the ranges of physicochemical values in the calibration set are larger than those in the prediction set is usually taken as the basis for evaluating the advantages and disadvantages of dividing the sample sets.The joint x-y distance method based on spectral data and physicochemical values (SPXY) (20) was used to divide 200 kiwifruit samples into 140 calibration sets and 60 prediction sets.The statistics of the sample sets divided using the SPXY algorithm are presented in Table 1.It can be seen that the value ranges of all physicochemical indices in the calibration set were wider than those in the prediction set.

Spectral preprocessing
Due to the influence of the particle size and surface scattering of the samples (21,22), some noise is included in the acquired original spectra.To improve the prediction accuracy and stability of the detection model, this study used standard normal variation (SNV) to eliminate the noise in the original spectra (16).Figure 3 presents the original spectra of all the samples and the relative reflectance spectra after SNV preprocessing.The selected region of interest (ROI) is the entire sample.As can be seen in Figure 3, the waveforms of all spectral curves exhibited the same trend, with a more pronounced absorption peak near the 675 nm wavelength.This is possibly caused by chlorophyll absorption.Another absorption peak occurred near 980 nm, which may be related to the absorption of water in kiwifruits.
Comparing Figure 3, we can observe that the relative reflectance spectra after SNV preprocessing were smoother than the original spectra, indicating that SNV preprocessing can eliminate part of the noise in the original spectra.

Feature wavelength extraction
Two techniques, SPA and CARS, were used to extract feature wavelengths to improve the computational efficiency of the model.By comparing these two techniques, we selected the better feature wavelength extraction method for the prediction of the physicochemical indices of kiwifruits.

Extraction of feature wavelengths by SPA
When the SPA method was used to select feature wavelengths, the number of effective feature wavelengths was usually determined based on the lowest root mean squared error (RMSE) of the model.Firstly, the RMSE value decreased with the increase in the number of effective wavelengths.Then, when the number of effective wavelengths in the model increased to a certain value, the decreasing tendency of the RMSE value was no longer evident.In this study, the RMSE values no longer decreased when the number of effective wavelengths was greater than 10, 8, 13, 9, and 14 for the prediction of SSC, firmness, L*, a*, and b*, respectively.Therefore, we extracted 10, 8, 13, 9, and 14 wavelengths as the feature wavelengths for predicting SSC, firmness, L*, a*, and b*.The proportion of the feature wavelengths by SPA in the total of 256 wavelengths is 3.91, 3.13, 5.08, 3.52, and 5.47%, respectively.The selected feature wavelengths are presented in Table 2.

Extraction of feature wavelengths by CARS
When the CARS method was used to select feature wavelengths, the number of Monte Carlo sampling runs and the group amount for cross-validation were 50 and 5.For predicting SSC, firmness, L*, a*, and b*, the root mean square error of cross validation (RMSECV) at different sampling runs exhibited a consistent trend, i.e., first decreasing and then increasing.The smallest RMSECV was obtained at the 22nd, 28th, 24th, 23rd, and 22nd sampling runs, respectively.This optimal wavelength subset contained 32, 18, 26, 29, and 32 feature wavelengths for the prediction of SSC, firmness, L*, a*, and b*.The proportion of the feature wavelengths by CARS in the total of 256 wavelengths is 12.50, 7.03, 10.16, 11.33, and 12.50%, respectively.The selected feature wavelengths are given in Table 2.

Modeling results
In this study, we first constructed a PLSR model for predicting the physicochemical indices of kiwifruits based on 256 full-band variables and measured reference values.Then, we established a simplified MLR model for predicting the physicochemical indices of kiwifruits by taking the feature wavelengths selected by SPA and CARS as independent variables and the reference values of such physicochemical indices as dependent variables.The prediction results for the physicochemical indices of kiwifruits by PLSR and MLR models are listed in Table 3.These results indicate that, for the prediction of each physicochemical index of kiwifruits, the R 2 C , R 2 P , and RPD values of the CARS-MLR model were higher than those of the SPA-MLR model, and the RMSEC and RMSEP of the CARS-MLR model were lower than those of the SPA-MLR model.This indicates that the CARS algorithm was a better feature wavelength selection method compared to the SPA algorithm.By comparing the PLSR model based on full wavelengths and the CARS-MLR model based on feature wavelengths in Table 3, we can see that for the prediction of each physicochemical index of kiwifruits, the R 2 C , R 2 P , and RPD values of the latter model were higher than those of the former model.Moreover, the RMSEC and RMSEP of the CARS-MLR model were

Distribution visualization of physicochemical indices
Hyperspectral imaging can acquire spectral information for each pixel in a test sample (23) and then use this information to generate visualization maps of reference values for physicochemical indices.In this manner, it is more intuitive to detect the reference values of the physicochemical indices of kiwifruit at different maturity stages.In In particular, the color distribution of SSC gradually became yellow (i.e., SSC gradually increased), whereas that of firmness gradually turned green (i.e., the firmness values gradually decreased) as kiwifruits gradually ripened, which was consistent with the results of the actual chemical experiments (26).The changes in the color distributions of L*, a*, and b* of kiwifruits at different maturity stages were relatively small, and consistent with the statistical results of the physicochemical indices of kiwifruits described in Subsection 3.1.

Conclusion
A rapid detection model for the physicochemical indices (SSC, firmness, L*, a*, and b*) of kiwifruits at different maturity stages was developed using hyperspectral imaging and chemometrics, making it possible to visualize the distributions of the physicochemical indices of kiwifruits.Compared with the full-band detection model, the CARS algorithm was used to select 32, 18, 26, 29, and 32 feature wavelengths from 256 full-band wavelengths for the prediction of SSC, firmness, L*, a*, and b*, respectively, which improved the detection efficiency of the prediction model.Furthermore, the constructed CARS-MLR model exhibited the best performance in predicting the physicochemical indices.For this optimal CARS-MLR model, the prediction set R 2 P was 0.89, 0.88, 0.81, 0.86, and 0.88, the RMSEP was 0.63, 1.09, 0.97, 0.47, and 0.97, and the RPD was 3.09, 2.90, 2.32, 2.74, and 2.91, respectively.The results indicated that the physicochemical indices of kiwifruits at different maturity stages can be rapidly and accurately detected.Based on the optimal detection model, the pseudo-color technique was used to visualize the distributions of the physicochemical indices of kiwifruits at different maturity stages, which made detecting these physicochemical indices more intuitive.The combination of hyperspectral imaging and chemometrics led to the rapid detection and distribution visualization of the physicochemical indices of kiwifruits, which laid a theoretical foundation for the development of nondestructive detection equipment for fruit quality and ripeness.

FIGURE 2
FIGURE 2Physicochemical indices of kiwifruit samples at different maturity stages.

FIGURE 4
FIGURE 4Prediction results for physicochemical indices of kiwifruits by CARS-MLR model.

TABLE 1
Statistics of partitioning sample sets using the SPXY algorithm.
FIGURE 3Reflectance spectra of kiwifruits.furtherindicating the excellent prediction effect of the CARS-MLR model.The results of the CARS-MLR model for each physicochemical index of kiwifruits are given in Figure4.It can be seen from Figure4that the linear relationship between the predicted and measured values of the physicochemical index were relatively favorable for all samples except for a few deviating from the regression line, indicating that the CARS-MLR model can accurately predict the physicochemical index of kiwifruits.The CARS-MLR model formulas (9-13) for predicting each physicochemical index of kiwifruits are given as follows:

TABLE 2
Feature wavelengths for predicting the physicochemical indices of kiwifruits selected by SPA and CARS.

TABLE 3
Prediction results for the physicochemical indices of kiwifruits by the PLSR and MLR models.Y Firmness , Y L* , Y a* , and Y b* are the predicted values for each physicochemical index of kiwifruits.X inm represents the SNV preprocessed spectral value at the wavelength of i nm.