*3.6. Correction of Near Infrared Spectroscopy for Apples of Various Diameters*

From Formula (4), apple size affects the prediction model of soluble solids content, and the light intensity of the apple and its fruit diameter are logarithmic functions. The deformation of Formula (4) can be obtained as Formula (5).

$$\ln(I) = \ln(I\_0) - \mu\_c d \tag{5}$$

If the light intensity of the apple at its two internal depths *d1* and *d2* are *I1* and *I2*, respectively, Formula (5) can be deformed as:

$$1 - \mu\_{\mathcal{E}} = \frac{\ln(I\_1) - \ln(I\_2)}{d\_1 - d\_2} \tag{6}$$

From Formula (5), we can find the extinction coefficient of apples or the collection method in Figure 1, the light range *d* is the fruit diameter at the equator of apples, and *I* is the light intensity of the transmission spectra of apples collected by the fiber optic probe. From Table 3, it can be seen that the PLSR performance of SSC with medium apple size is better, so the average spectra of the medium fruit size group are taken as IR and the average fruit size of the medium fruit size group is taken as *d1*, and the average extinction coefficients of all samples can be obtained as shown in the following Formula (7).

$$\begin{aligned} \frac{\sum\_{i=1}^{n} \left( \frac{\ln(I\_R) - \ln(I\_i)}{d\_R - d\_i} \right)}{n} \end{aligned} \tag{7}$$

where *IR* is the reference spectra, *Ii* is the spectra of the apple sample *i*-th, *dR* is the reference fruit diameter, *di* is the average fruit size of the apple sample *i*, *n* is the number of samples, and the extinction coefficient applicable to all apple samples can be obtained from Formula (7). The inverse operation of Formula (7) leads to Formula (8).

$$I\_i^\* = \exp\left(-\mu\_c(d\_R - d\_i) + \ln(I\_i)\right) \tag{8}$$

where *Ii \** is the size-corrected spectra of apple sample *i* according to its fruit diameter. The size-corrected spectra of all samples can be obtained according to Formula (8), and their average size-corrected spectra of different apple fruit diameter groups are shown in Figure 5.

**Figure 5.** Apple spectra after size correction.

Compared with the uncorrected apple spectra, the size-corrected apple spectra have a cross-over phenomenon in the spectra of each fruit diameter group, and the spacing between the vertical aspects of each fruit diameter group in the spectra is reduced compared with Figure 2. This spacing exists as a result of the differences in apple fruit diameter. Our proposed size correction approach was used to correct the near-infrared spectra for apples of various dimensions.

The corrected NIR spectra of apples were used to build the PLSR of SSC with different fruit sizes. The large and small fruit size groups were predicted using the medium fruit size group, and the predicted results are shown in Table 5.



As can be seen from Tables 4 and 5, the model prediction performance of the corrected NIR spectra compared to the PLSR built for the original apple spectra was significantly improved. Among them, the correlation coefficient Rp of the PLSR established for the small fruit size group improved from 0.769 to 0.869, and RMSEP decreased from 0.990 to 0.721. the correlation coefficient Rp of the PLSR established for the large fruit size group improved from 0.787 to 0.932. the RMSEP decreased from 0.878 to 0.531. the PLSR of the two fruit size groups scatters plots are shown in Figure 6. The results show that after the spectral correction of Formula (7), the spectra of apples of different sizes can be converted into a standard spectrum to correct the NIR spectra of apples of different sizes, which is used to improve the performance of its prediction model. Similarly, this spectral correction method can be applied to other fruits such as pear, citrus, and watermelon.

**Figure 6.** The PLSR scatter plot was created by the corrected spectra. (**a**) 75–85 mm fruit size group predicted 65–75 mm fruit size group, (**b**) 75–85 mm fruit size group predicted 85–95 mm fruit size group.
