Nondestructive detection of apple crispness via optical fiber spectroscopy based on effective wavelengths

Abstract Crispness is regarded as a significant quality index for apples. Currently, destructive sensory evaluation is the accepted method used to detect apple crispness, making it essential to develop a method that can detect apple crispness in a nondestructive manner. In this study, spectroscopy was proposed as the nondestructive technique for detecting apples' crispness, ultimately obtaining a spectral reflectance curve between 450 nm and 1,000 nm. In order to simplify and improve modeling efficiency, successive projections algorithm (SPA) and x‐loading weights (x‐LW) methods were used to select the most effective wavelengths. Partial least squares (PLS) algorithm, radial basis neural networks (RBNN), and multilayer perceptron neural networks (MLPNN) methods were used to establish the models and to predict the crispness of “Fuji” and “Qinguan” apple varieties. Based on the full wavelength (FW), the prediction accuracy of the PLS model for “Fuji” and “Qinguan” apple varieties was 92.05% and 95.87%, respectively. The effective wavelengths selected via SPA for the “Fuji” apple variety were 450.41 nm, 476.80 nm, 677.75 nm, and 750.72 nm, and the effective wavelengths selected via x‐LW for the “Qinguan” apple variety were 542.51 nm, 544.79 nm, 676.96 nm, and 718.29 nm. The prediction accuracy of the PLS model based on effective wavelengths for “Fuji” and “Qinguan” apple varieties reached 91.31% and 96.41%, respectively. Compared with the RBNN model, the MLPNN model achieved better prediction results for both “Fuji” and “Qinguan” apples, with the prediction accuracy reaching 97.8% and 99.9%, respectively. Based on the above findings, effective wavelength selection and MLPNN modeling were able to detect apple crispness with the highest accuracy. Overall, it can be concluded that the less effective wavelengths are conducive to developing an instrument for crispness detection.


| INTRODUC TI ON
Apples are popular among consumers due to their high nutritional value and their ability to improve and beautify skin. China has the largest area of apple orchards and the highest total apple yield in the world, with the "Fuji" apple being the major Chinese cultivar, accounting for more than 70% of the apple acreage in China (Qiang, Bei-Bei, Min-Ji, Qin-Ping, & Zhen-Hai, 2018). The "Qinguan" apple is another important cultivar in China's apple industry, with its large size, red color, superior storability, and unique flavor making it popular with consumers. Crispness is a vitally significant factor when evaluating apple texture quality, and however, there are distinct differences between "Fuji" and "Qinguan" apple cultivars in this regards. Therefore, it is of great importance to study both the "Fuji" and "Qinguan" apple cultivars when determining an improved method for assessing crispness.
Apple losing their crisp quality during storage leads to consumers' dissatisfaction, as such fruits no longer feel fresh during consumption, with the apple varieties that maintain crispness having a greater long-term consumer appeal (Chang, Vickers, & Tong, 2018). Nowadays, destructive sensory evaluation is the major method used for detecting crispness, and destructive testing is wasteful and costly. Therefore, it is imperative to develop a nondestructive method. In recent years, spectroscopy has been proposed as a nondestructive crispness detection technique. Some studies have explored spectroscopy as a method for the nondestructive analysis of other crops and fruits, research which has included apples (Dong & Guo, 2015;Kong, Zhang, Huang, Liu, & He, 2018;Li et al., 2018;Peng et al., 2018;Sun, Künnemeyer, Mcglone, & Rowe, 2016). Spectroscopy techniques were also used in other fields such as oil and soil detection He et al., 2018;. Although some studies have investigated the use of spectroscopy for the quality evaluation of apples (Betemps et al., 2012;Guang-Hui, Ren, Ren, & Zhao, 2012), and some studies have explored crispness detection using contact acoustic emission (Belie, Smedt, & Baerdemaeker, 2000;Demattè et al., 2014;Piazza & Giovenzana, 2015;Zdunek, Konopacka, & Jesionkowska, 2010), there has been little research done on the crispness of "Fuji" and "Qinguan" apple varieties specifically, and a nondestructive crispness detection method, combining spectroscopic and chemometric approaches, remains unexplored. In order to obtain an accurate and stable prediction model based on the spectroscopic technique, different models were developed via a range of modeling methods, including partial least squares (PLS) and artificial neural networks (ANN) (Cliff & Bejaei, 2018;Feng et al., 2018;He, Jian, Ying, & Li, 2015). However, these modeling methods were not applied to the detection of apple crispness via optical fiber spectroscopy.
The specific goals of this study were: (a) to determine effective wavelengths for assessing the apples' crispness; (b) to establish quantitative prediction models for apple crispness based on the effective wavelengths; and (c) to validate and optimize the prediction models for apple crispness.

| Sample preparation
"Fuji" and "Qinguan" apples are two the main cultivars in China, and however, the crispness of "Fuji" and "Qinguan" is distinctly different, with the "Fuji" apple tending to be far crisper than "Qinguan." Therefore, this study was conducted using both the "Fuji" and "Qinguan" apple cultivars, which were obtained in October 2018 from Baishui County, Shaanxi Province, China. To confirm that testing process took place under identical conditions, 60 "Fuji" apples and 60 "Qinguan" apples of a similar shape were placed in an Artificial Climate Chamber (PRx-250B, Ningbo Saifu Experimental Instrument Co., Ltd.) where the temperature was set to 4 ± 2°C, and the relative moisture was set to a humidity level of 85 ± 1%. The step test method was adopted for the experimental scheme. Sixty "Fuji" apples and 60 "Qinguan" apples were marked, and then, each variety was divided into 12 groups on average. The experiment was conducted over a period of 12 weeks.

| Equipment and methods for spectra acquisition
Spectra were measured using an optical fiber spectrometer (USB4000, Ocean optics) equipped with SpectraSuite (64 bit) software, an optical fiber (Ocean optics QR200-7-UV-VIS), and an optical fiber probe (Ocean optics QR200-7-UV-VIS). The spectrometer was preheated for 15 min before use. The wavelength range of the spectrometer is 350-1000 nm, the range of integration time is from 3.8 ms to 10 s, the optical resolution of the spectrometer is 1.5-2.3 nm FWHM, and the sampling interval is 0.21 nm. A white panel was used as a reference in order to eliminate interference by the light source itself. All spectra were obtained using an optical fiber probe. Before collecting the apple spectra, some parameters were set by the SpectraSuite software. The integration time was set to 10 ms, the scan-to-average was set to 15, and the boxcar smoothing was set to 10. Spectra were obtained every week from three points which were evenly distributed along the equator of each apple. Figure 1 depicts the physical structure of the spectrometer, as well as the diagrammatic structure of the spectra collection process.

| Equipment and methods for crispness measurement
An Artificial Climate Chamber (PRx-250B, Ningbo Saifu Experimental Instrument Co., Ltd. China) was used to store samples. The Texture Analyzer (TA.XT plus) was used to detect crispness values of the samples, and a computer (Lenovo QiTianM7300) was used to operate the Texture Analyzer software and store the detection information.
After the spectra were collected, samples were conveyed to detect crispness via a Texture Analyzer. Three cylindrical samples were evenly chosen from the equator of each apple at regular intervals which corresponded with the points where the spectra were collected. In addition, both the diameter of the cross section and length of each sample were 1 cm. Before the crispness was detected, the Texture Analyzer was set according to the desired requirements. The compression speed was set to 1 mm/s, the amount of compression was set to 80%, and the trigger force was set to 50 N (Liu et al., 2016).

| Chemometrics methods
The partial least squares (PLS) method is a most widely used regression modeling method in spectral data analysis, favored for its flexibility and reliability when dealing with redundant spectral data. The Both MLPNN and RBNN were used to develop the models in this study.

| Software and model evaluation methods
The data processing software included Unscrambler X 10.1 (Camo ProcessAS Oslo Norway), Microsoft Excel 2010, SPSS (Statistical Package for the Social Sciences, version 18), and Matrix Laboratory (MATLAB 8.5, R2015a, MathWorks company). Throughout the PLS modeling process using the software Unscrambler X 10.1, the modeling effect was evaluated by the determination coefficient (R 2 ) and the root mean square error (RMSE). The closer the R 2 is to 1, the closer the RMSE is to 0, the better the performance of the prediction model will be (Kawamura et al., 2017). The prediction residual error sum of squares (PRESS) and standard error of cross-validation (SECV) obtained via cross-validation were used to evaluate the models' whole performance. Throughout the PLS modeling process using the software SPSS, the determination coefficient (R 2 ), the sum of square deviation, and relative deviation were used to evaluate the ANN model; the lower the sum of square deviation and relative deviation are, the more effective the model will be.

| Effective wavelength selection
The successive projections algorithm (SPA) provides a direct method to solve the collinearity problem (Li, Sun, Zhou, & He, 2015). The method starts at one wavelength and then calculates its projection at the unselected wavelength in each loop. The wavelength with the maximum projection vector is introduced into the wavelength combination (Li et al., 2018;Liu & Zhang, 2012).

| Spectral reflectance curves
To avoid noise interference in the head and tail of the spectral reflectance curve and improve accuracy and robustness of the model, the range of wavelength was selected from 450 nm to 1,000 nm. Figure 2a,b display the spectral reflectance curves of "Fuji" and "Qinguan" samples. Owing to individual variation, spectral reflectance curve of each apple sample presented differently, meaning the reflectance curves were scattered. However, on the whole, there was a trough near 670 nm and a crest near 950 nm. The trough was the absorption peak, and the crest was the reflectance peak. To further quantitatively analyze the apples' crispness, chemometrics were used to mine effective optical fiber spectral information.

| Spectral preprocessing
The NIPLS algorithm was used to establish a quantitative prediction model that related apples' crispness with the optical fiber spectral data (reflectance). To improve prediction accuracy, the raw spectra (RS) data need to be preprocessed before establishing the model.  Table 1 shows the modeling results of "Fuji" apple and "Qinguan" apples following spectral preprocessing.
As can be seen in Table 1, the established PLS model based on S-G smoothing preprocessing was better at predicting crispness of "Fuji" apples, and the established PLS model based on raw spectra (RS) was better at predicting crispness of "Qinguan" apples.
After spectral preprocessing, the calibration set and prediction set were divided according to a ratio of 3:1 using the Kennardstone (KS) algorithm in MATLAB (matric laboratory). For "Fuji" apple samples, the number of calibration set and prediction set was 147 and 50, respectively. For "Qinguan" apple samples, the number of calibration set and prediction set was 164 and 55, respectively.

| Effective wavelengths
To simplify model and improve efficiency of modeling, selection of effective wavelength information was taken into consideration. To facilitate the development of instrument, useless spectral information was discarded. The SPA algorithm and the x-LW method were used to select effective wavelengths. The effective wavelengths se- The maximum absolute value of load coefficient for each implicit variable was obtained. The wavelength corresponding to the maximum absolute value was determined as the effective wavelength for each implicit variable. Figure 3 presents the selected effective wavelengths obtained via x-LW method for "Fuji" apple samples, which were 452.55 nm, 570.28 nm, and 712.13 nm. Figure 4 presents the selected effective wavelengths obtained via x-LW method for "Qinguan" apple samples, which were 542.51 nm, 544.79 nm, 676.96 nm, and 718.29 nm. Quantitative prediction models were developed via the newly selected characteristic variables.
F I G U R E 2 Spectral reflectance curves of "Fuji" and "Qinguan" apple samples Abbreviations: 1-Der, first derivation; 2-Der, second derivation; N, number of principal components; R C , correlation coefficient of calibration set; RMSE C , root mean square error of the calibration set (g); RMSE P , root mean square error of the prediction set (g); R P , correlation coefficient of prediction set; RS, raw spectra; S-G, Savitzky-Golay smoothing; SNV, standard normal variate.

| Establishment and analysis of quantitative models
The NIPLS algorithm was used to develop quantitative prediction models. Quantitative prediction models were based on the full wavelength, allowing us to obtain the selected effective wavelengths Table 2 shows the results of different models based on "Fuji" and "Qinguan" apple samples. Throughout the PLS modeling process using the software Unscrambler X 10.1, spectral data were To simplify the model, a quantitative prediction model was redeveloped based on effective wavelengths which were previously selected by SPA algorithm and x-LW method. For "Fuji" apple samples, four effective wavelengths were selected via SPA algorithm and three effective wavelengths were selected via x-LW method.
For "Qinguan" apple samples, four effective wavelengths were selected via SPA algorithm and x-LW method, respectively. Overall, the effects of SPA-PLS model and x-LW-PLS model were very good.
The differentiated results of modeling for "Fuji" and "Qinguan" apple samples are shown in Table 2.
The SPA-PLS model and the x-LW-PLS model used for "Fuji" apple samples were expressed as formula (1) and formula (2), respectively. In practice, formula (1) was tend to applied to "Fuji" apple samples, because SPA-PLS model achieved better prediction accuracy than x-LW-PLS. The SPA-PLS model and the x-LW-PLS model for "Qinguan" apple samples were expressed as formula (3) and formula (4), respectively.
In practice, formula 4 was generally applied to "Qinguan" apple samples as the x-LW-PLS model was able to achieve better prediction results for this cultivar than SPA-PLS. F I G U R E 3 Effective wavelengths selected by x-LW based on "Fuji" apple samples F I G U R E 4 Effective wavelengths selected by x-LW based on "Qinguan" apple samples accuracy is concerned, according to Table 2, SPA-PLS model was better than x-LW-PLS model when applied to "Fuji" apples because it possessed larger R 2 value and smaller RMSE value. For "Qinguan" apple samples, modeling and prediction accuracy of x-LW-PLS model were superior due to larger R 2 value and smaller RMSE value. Therefore, in order to improve the efficiency of modeling and facilitate the development of a crispness detection instrument, SPA algorithm was used to select effective wavelengths for "Fuji" apple samples, and x-LW method was used to select effective wavelengths for "Qinguan" apple samples.

| Model prediction based on artificial neural network method (ANN)
SPSS software was used to build the quantitative prediction model via ANN, RBNN, and MLPNN. The reflectance of selected effective Abbreviations: RMSE C , root mean square error of the calibration set (g); RMSE P , root mean square error of the prediction set (g); Sn, sample number; Vn, variables number.
TA B L E 2 Differentiated results of different models for "Fuji" and "Qinguan" apple cultivars   In Figure 5a, the activation function of hidden layer was exponential. In Figure 5b, the activation function of hidden layer was softmax.
According to Figures 5 and 6, prediction results of MLPNN model were better than that of RBNN model. Nonlinear fitting was also more effective than linear fitting. Table 5 shows deviations of RBNN and MLPNN models; the MLPNN model possessed a smaller sum of square deviation and relative deviation for "Fuji" apple samples, indicating that MLPNN model was more accurate and stable for "Fuji" apple samples.
As with "Fuji," the prediction model for "Qinguan" apple samples based on RBNN and MLPNN methods was also established, and the results are presented in Table 4. As can be observed, one RBNN model and two MLPNN models were developed according to the different activation function of hidden layer.
In Figure 8a, activation function of hidden layer was sigmoid. In

| CON CLUS IONS
The nondestructive detection of apple crispness for both "Fuji" and "Qinguan" apple cultivars was successfully accomplished. In order to detect apple crispness in a nondestructive manner, a technique that combined spectroscopy with PLS and ANN modeling methods was proposed.
1. Based on the comparison of x-LW method and SPA algorithm, selected effective wavelengths for "Fuji" apple samples were 3. Based on the above, by validating and optimizing the prediction model, SPA algorithm was used to select effective wavelengths for "Fuji" apple cultivar and x-LW method was used to select effective wavelengths for "Qinguan" apple cultivar. The established effective wavelength-based ANN model was shown to be both reliable and accurate. Therefore, it is feasible to nondestructively detect apple crispness via optical fiber spectroscopy, combined with both effective wavelengths and the ANN modeling method.

ACK N OWLED G EM ENTS
We thank Professor Zhengyang Zhao for his help. This research was supported by the National Natural Science Foundation of China (31671965) and the Project of Key Laboratory of Agricultural Internet of Things, Ministry of Agriculture, P.R. China (2017001).

CO N FLI C T O F I NTE R E S T
The authors declare that they have no conflict of interest to this research.

E TH I C A L A PPROVA L
Ethical Review: This study does not involve any human or animal testing; this study was approved by the Institutional Review Board of Northwest A&F University; this study conforms to the Declaration of Helsinki, US.

I N FO R M E D CO N S E NT
Written informed consent was obtained from all study participants.