3.2.1. Variable Optimization

Based on the spectral information of samples cultivated in the rain shelter, the selection of SSC characteristic wavelengths using IRIV is shown in Figure 5. Thirteen strongly informative variables and ninety-three weakly informative variables were selected. After reverse elimination of variables, the final number of optimal characteristic wavelengths was 73.

**Figure 5.** Selection of characteristic wavelength using IRIV based on rain-shelter cultivation.

Based on the extracted characteristic wavelengths using IRIV, SPA was used to extract the characteristic wavelengths for the second time. Ten characteristic wavelengths were extracted when the RMSE was 1.0257%. According to the importance, the extracted characteristic wavelengths using IRIV-SPA were 1257, 962, 905, 1137, 2337, 2300, 1541, 2378, 2386, 1947, 1907, 1480, 1058, 2128, 811, and 693 nm in turn.

For fresh jujubes from two cultivation modes, the selected characteristic wavelengths using IRIV-SPA are shown in Figure 6. There was a certain difference between the extracted characteristic wavelengths using the two cultivation modes. For the characteristic wavelengths extracted from a single cultivation mode, it was difficult to cover up the characteristic information of another cultivation mode.

**Figure 6.** Fusion of characteristic wavelength.

Therefore, a new variable combination that integrated the extracted characteristic wavelengths of open-field and rain-shelter cultivation was proposed. In Figure 6, there were also the same and similar wavelengths between the characteristic wavelengths of those two cultivation modes. The selected variables of the two cultivation modes were added, redundant repeat variables were removed from the added characteristic variables, and the remaining variables were used as the fused characteristic wavelengths. Due to differences in the physicochemical properties of the sample, the external environment, and other factors, there would be a certain positional shift between wavelengths [38–40]. In this study, the wavelength corresponding to the position shift in the range of (−30 nm, 30 nm) was used as a repeated variable. Only one variable remained among the repeated variables, and redundant variables were removed. The extracted SSC characteristic wavelengths after fusion (in Figure 6) were 602, 647, 693, 811, 920, 957, 1008, 1058, 1137, 1257, 1480, 1541, 1907, 1976, 2128, 2248, 2300, 2339, and 2394 nm.

#### 3.2.2. Model Update

Because of the difference between the spectral curves of the two modes, the Euclidean distance between full wavelength spectrum of samples from the rain shelter. The KS algorithm was used to sequentially select samples from the calibration set of fresh jujubes cultivated in the rain shelter, sequentially. The new selected samples were added to the calibration set of fresh jujubes cultivated in the open field to form an updated calibration set, sequentially. PLSR was adopted to establish SSC detection models based on the updated calibration set, and the minimum value of RMSECV was used as the rule for selecting samples. The changing curve of RMSECV for SSC is shown in Figure 7. The minimum value of RMSECV was 1.33%. Correspondingly, 33 samples were selected from the calibration set of fresh jujubes cultivated in the rain shelter.

**Figure 7.** RMSECV distribution in different numbers of samples.

Thirty-three selected samples from rain shelter cultivation were combined with the calibration set from open-field cultivation (114 samples) to form an updated calibration set (147 samples). Based on the fused characteristic wavelengths, the original calibration set and the updated calibration set were used to establish LS-SVM detection models, respectively. The predicted results are shown in Table 5.


**Table 5.** Prediction results of SSC after model update.

For the prediction ability (in Table 5) of fresh jujubes from two cultivation modes, the established model based on wavelength fusion was better than the model established before updating. This indicated that the updated characteristic wavelengths after wavelength fusion did not interfere with the performance of the established model on the open-field cultivation. For the SSC prediction results of fresh jujubes cultivated in the open field, the two update methods were good and similar. For the SSC prediction results of fresh jujubes cultivated in the rain shelter, the updated model based on wavelength fusion-Euclidean distance (Rp2 = 0.81, RMSEP = 1.35%, RPD = 2.10) was significantly better than the updated model based on wavelength fusion (Rp<sup>2</sup> = 0.69, RMSEP = 2.96%, RPD = 0.96). Compared with the prediction performance before the model update, the ability of the updated LS-SVM model with the wavelength fusion-Euclidean distance was significantly improved. For

fresh jujubes cultivated in open field, the Rp<sup>2</sup> (0.79) was the same, the RPD increased from 2.14 to 2.20, and the RMSEP decreased from 1.20% to 1.17%. For fresh jujubes cultivated in the rain shelter, the Rp2 (from 0.65 to 0.81) and the RPD (from 0.85 to 2.10) were significantly increased, and the RMSEP (from 3.33% to 1.35%) decreased significantly. Therefore, the LS-SVM model based on the updated method of wavelength fusion-Euclidean distance achieved the best SSC prediction for fresh jujubes in both cultivation modes.

To validate the performance of the model based on the updated method of fusion wavelength-Euclidean distance, 50 samples from open-field cultivation and 50 samples from rain-shelter cultivation were collected for testing. To better show the detection results, the SSC-predicted and true values of samples from two cultivation modes are shown in Figure 8.

**Figure 8.** Detection results of SSC after model update using wavelength fusion-Euclidean distance. (**a**) Prediction set results; (**b**) test set results.

It was shown that the LS-SVM model using the update method of wavelength fusion-Euclidean distance achieved good prediction and test results for the SSC of fresh jujubes from both cultivation modes in Figure 8. The R2, RMSE, and RPD of the test set were 0.82, 1.49%, and 2.18 for the SSC of "Huping" jujubes from open-field cultivation, respectively. The R2, RMSE, and RPD of the test set were 0.81, 1.44%, and 2.17 for the SSC of "Huping" jujubes from rain-shelter cultivation, respectively.

In the field of fruit quality detection, a common problem was the failure of VIS/NIR spectral models. The established model has good prediction results under a single condition, but the model fails under new conditions with some variability. In the actual production of "Huping" jujube, there are two cultivation modes (open-field cultivation and rain-shelter cultivation). The established SSC detection model based on samples cultivated in open-field cultivation failed to predict samples cultivated in rain-shelter cultivation. In the SSC detection, there was some difference between the extracted characteristic wavelengths from the open-field samples and those from the rain-shelter samples. The dimensionality of the visible/NIR spectra was high and a direct replication of the VIS/NIR spectrum resulted in redundant information, which would affect model performance. In this study, the IRIV-SPA was used to preferentially select feature wavelengths that removed the effects of interfering information and uninformative variables. It was ensured that valid information was extracted, while the dimensionality was reduced. At the same time, variable recombination combined with wavelength position shift theory was used for variable selection. The preferred fusion wavelengths covered the variable information under the new conditions, which increased the coverage of feature information and did not interfere with the modeling ability of the original variables because of the new variables. When new samples were introduced based on Euclidean distances, the variability under the new conditions was increased. These variables were involved in the modeling when the model was recalibrated, which improved the accuracy and robustness of the model. Therefore, the wavelength fusion-Euclidean distance update method achieved good SSC prediction

results for fresh jujube from two cultivation modes synchronously. The proposed method is an effective model updating method, which provides methods for the establishment of a robust VIS/NIR detection model and ideas for the online detection of agricultural product quality based on VIS/NIR spectroscopy.
