Estimation of Apple Mealiness by Means of Laser Scattering Measurement

Mealiness is a phenomenon in which intercellular adhesions in apples loosen during storage, causing a soft and floury texture at the time of eating, and leading to lower consumer preference. Although apples can be stored and commercially sold throughout the year, the occurrence of mealiness is not monitored during storage. Therefore, the objective of this research was to non-destructively estimate the mealiness of apple fruit by means of laser scattering measurement. This method is based on laser light backscattering imaging but can quantify a wider range of backscattered light than the conventional method by utilizing high dynamic range (HDR) rendering techniques. Lasers with wavelengths of 633 nm and 850 nm were used as a light source, and after acquiring backscattered images, profiles, and images were obtained. Profile features such as curve fitting coefficients and profile slopes and image features such as statistical image features and texture features were extracted from the profiles and images, respectively. PLS, SVM, and ANN models were used for the estimation of mealiness. The results of the estimation based on these features showed that the ANN model combining both wavelengths had a higher performance (R = 0.634, RMSE = 7.621) than the models constructed from features of single wavelength measurements. In order to further improve the performance of the model, we applied various ensemble learning methods to combine different estimation models. As a result, the ensemble model showed the highest performance (R = 0.682, RMSE = 7.281). These results suggest that laser scattering measurement is a promising method for estimating apple fruit mealiness.


Introduction
Apples (Malus × domestica) are one of the most widely cultivated fruits in the world and are sold all year due to the widespread use of controlled atmosphere (CA) storage.The palatability of apples is derived not only from their chemical properties but also from their physical properties.In fact, firmness, crispiness, and ease of swallowing are more important factors in the palatability of apples than sweetness and acidity (Chen Jie Yu et al., 2011;Hayakawa et al., 2012).However, the current market value of apples is assessed by shape, degree of damage, and Brix of fruit juice, not by indicators related to texture.
Therefore, the development of technologies to estimate apple texture indicators is important.However, the change in apple texture during storage varies widely among apple cultivars, and various deterioration phenomena can be observed including a decrease in flesh turgor pressure, increase in the degree of mealiness, and cell fracture (Cárdenas-Pérez et al., 2017;Gwanpua et al., 2016;Iwanami et al., 2005;Iwanami et al., 2008a, b).For instance, the decrease in turgor pressure and increase in mealiness are less likely to occur in "Kanzi" and "Fuji" apples, which are known to soften due to the fracture of the microstructure.On the other hand, "Jonagold" apples are known to become mealy and soften.
Mealiness is an internal damage phenomenon in which the adhesion between cell tissues loosens, causing cells to separate.Loosening of the adhesion between cell tissues is caused by the solubilization of pectin in the fruit.It has been reported that non-mealy apples are juicy because the cells are strongly adhered to each other, and the cells are easily crushed.However, mealy apples are broken down into several cell clusters in the mouth during eating, resulting in less crushed cells and a less juicy mouthfeel (Harker & Hallett, 1992).Barreiro et al. (1998) reported that the increase in mealiness causes loss of crispiness, firmness, and juiciness, and increases a floury mouthfeel.
Two methods have been developed to evaluate mealiness.The confined compression method has been more widely used; the method determines whether or not the apple is mealy by assessing the hardness and juiciness obtained from a compression test based on a certain threshold value (Barreiro et al., 1999).On the other hand, the fruit disc shaking method measures the degree of mealiness quantitatively.In this method, apple discs are shaken in a sucrose solution, and the degree of mealiness (degree of disc collapse) is calculated from the weight ratio before and after the shaking (Iwanami et al., 2005(Iwanami et al., , 2008a;;Moriya et al., 2017;Motomura et al., 2000).
Although the aforementioned methods of measuring mealiness provide objective information, they both involve destructive operations and have little practical application.Since the texture of agricultural products varies greatly between individuals and also changes significantly during storage (Liu et al., 2019;Ma et al., 2020;Saei et al., 2011), there is a need for non-destructive technologies that can inspect all products that are consumed.
LLBI is a technique for quantifying the spatial distribution of backscattered light by capturing the backscattering of an object with a monochrome camera.LLBI simultaneously acquires information related to both the absorption coefficient and the reduced scattering coefficient of the measured object, which are related to its chemical and physical properties, respectively.However, it is possible to focus on the physical properties of the object by selecting illumination wavelengths in which the effect of absorption is small.LLBI is a non-contact, non-destructive technology and can be operated at low cost since its basic configuration is based on a monochrome camera and several single-wavelength laser sources.
LLBI has been used to predict the pre-and post-harvest quality for a variety of agricultural products such as apples (Baranyai et al., 2009), bananas (Zulkifli et al., 2019), pears (Adebayo et al., 2017), sweet potatoes (Sanchez et al., 2020b), apricots (Mozaffari et al., 2022), plums (Rezaei Kalaj et al., 2016), potatoes (Babazadeh et al., 2016), and cocoa beans (Lockman et al., 2019).However, one of the problems in LLBI is that it relies on the analysis of a limited image area.Imaging devices can typically capture the whole object, but the scattered light is saturated near the incident point and cannot be analyzed.In contrast, areas that are far from the incident point are too dark to acquire relevant signals, since the intensity of scattered light in turbid materials decreases rapidly with increasing distance from the incident point.Typically, a circular region with a diameter of 15 mm at most from the incident point can be analyzed (Abildgaard et al., 2015;Cen et al., 2013;Højager Attermann et al., 2011).In other words, conventional LLBI has used local image information to estimate the overall quality.
This problem led us to modify the LLBI method by developing a system that can capture multiple scattering images obtained at different exposure times.These multiple images can then be combined into a high dynamic range (HDR) composite to quantify a wider range of surface area, including areas near and far from the incident point.This modified method, which we termed as the laser scattering method, has been used to estimate the firmness of apples (Iida et al., 2022), and has been shown to increase the analysis area fourfold.This study attempted to estimate apple mealiness using the laser scattering method.As a method for quantifying mealiness, we used the fruit disc shaking method, which provides more detailed information on the degree of mealiness, rather than the confined compression method that has been widely used in previous studies but only distinguishes whether or not the apple is mealy (Mollazade & Arefi, 2017).In addition, the relationship between light scattering and mealiness degree was investigated by measuring the 3-dimensional microstructure using X-ray CT.

Materials
One hundred fresh and externally undamaged "Jonagold" apples which had been harvested in 2021 were purchased from Aomori Prefecture, Japan.The apples were stored in an incubator (LTE510, Tokyo Rikakikai Co., Ltd., Japan) to accelerate mealiness.The apples were divided into 2 groups; the first group was immediately stored at 20 °C, while the other group was first stored at 4 °C for 1 month and were then transferred to the 20 °C incubator.Ten apples were measured each week, including the day of purchase (0 week), and the maximum storage period at 20 °C was 4 weeks.

Laser Scattering System
The laser scattering measurement system was constructed as shown in Fig. 1, following the basic structure explained in previous studies (Babazadeh et al., 2016;Iida et al., 2022;Mollazade & Arefi, 2017;Sanchez et al., 2020a).A 12-bit monochrome CMOS camera (ORCA-spark, Hamamatsu Photonics Co, Tokyo, Japan) was used for image capture.The camera was mounted on a camera stand (EMVA-SL, Misumi Croup Inc., Tokyo, Japan) at a height of 210 mm from the optical surface plate, and images of the samples were captured in a horizontal direction.In order to limit the effect of light absorption by the apple peel, lasers with wavelengths of 633 nm (self-contained He-Ne Laser, 0.8 mW, Thorlabs, Inc.) and 850 nm (Alignment laser diode 5 mW, Edmund Optics Japan Co.) were used for illumination, and both lasers were fixed at a height of 185 mm.He-Ne lasers with a typical wavelength of 633 nm have been used in previous studies for backscattering imaging (Askoura et al., 2016).On the other hand, the 850 nm laser was selected based on the report that the near-infrared region between 800 and 1200 nm shows reduced light absorption in apples (van Beers et al., 2017).Due to limited space around the camera, the 633 nm laser was placed behind the sample and was reflected by three mirrors before being irradiated on the sample at an angle of 15.0°.The laser light was focused on the sample surface with an achromatic lens (MgF 2 -coated achromatic lens, Edmund Optics Japan Co.).The 850 nm laser was directly irradiated onto the sample surface at an angle of 25.5°.These measurements were performed in a dark room.
Backscattering images were captured at two opposing points on the equatorial line of the apple.After the apples were fixed using a ring-shaped spherical container, the height of the apple was adjusted so that the incident point was just on the equatorial plane.
To obtain high-dynamic-range images, the images were captured with eight different exposure times, ranging from 10° ms to 10 3.5 ms at 10 0.5 ms intervals.For all images, the offset and gain were both set to 0, and the binning was set to 1 × 1. LabVIEW 2018 (National Instruments Corp., USA) was used to control the camera, and the acquired images were saved in the TIFF format.

Obtaining the Intensity Profile (Analysis of Backscattered Images)
Figure 2 shows the image analysis flow after capturing images with the eight different exposure times explained above.First, the laser incident point was estimated from the image.Generally, the incident point can be detected as the point in the image with the highest intensity.However, since the strong laser light causes saturation near the incident point even in the image taken with a minimum exposure time of 1 ms, the incident point could not be detected with this method.Therefore, the image taken with an exposure time of 100 ms was binarized using the Otsu method (Otsu, 1979) after smoothing with a 5 × 5 median filter and the incident point was calculated as the point of gravity of the scattering area.
Next, a circular region with a diameter of 70 mm from the incident point was set as the region of interest (ROI).The distance from the incident point was calculated for all pixels in the ROI, and the average intensity value was calculated for the points with equal radial distances.The intensity of the dark frame acquired with the cap on the camera was subtracted from all intensities (dark correction), resulting in eight profiles shown in Fig. 2e.The intensities were normalized by multiplying each of them with the reciprocal of their exposure time (Fig. 2f).Furthermore, the normalized intensity values for the eight exposure times were averaged after logarithmic transformation.The distribution of intensity of scattered light along the radial distance from the incident point is called the intensity profile.Since the intensity was saturated within 1 mm of radial distance from the incident point, the intensity data between 0 and 1 mm radial distance were removed from the obtained profile.
Finally, the intensity profiles were corrected for the effect of fruit curvature.This is important because the backscattering images are captured as images taken from the plane surface of a semi-infinite object and fruit curvature affects both the intensity and radial distance of the measured scattered light.In this study, a correction method based on the Lambert cosine law was used to correct the intensity of scattered light (Peng & Lu, 2006;Qing et al., 2007).This method assumes that backscattered light is strongest in the direction normal to the sample surface and that backscattered light in other directions are proportional to the cosine of the angle between the Since the backscattered light captured with the camera is at an angle with the normal due to the fruit curvature, it is converted back to the maximum intensity using the diameter of the fruit.Similarly, the radial distance was corrected following the method developed by the same authors (Peng & Lu, 2006).These correction methods have been shown to increase estimation performance by 2.0-3.5% in estimating apple firmness and soluble solids content (Peng & Lu, 2006;Qing et al., 2007).
Various libraries in MATLAB (2021b) (Mathworks) and Python (Version 3.8.13)were used for these analyses.

Fruit Disc Shaking Method
Referring to previous studies (Iwanami et al., 2005;Iwanami et al., 2008a;Moriya et al., 2017), the degree of mealiness was quantified using the modified fruit disc shaking method.First, for each incident point, discs (10 mm in diameter, 5 mm thick) were taken just below the skin by a cork borer.The discs were soaked in 12% sucrose solution for 45 min under vacuum condition.After soaking, excess water was wiped off with gauze, and the discs were weighed (W i ).The discs were then transferred to a 30-mm-diameter test tube containing 10 mL of 12% sucrose solution, shaken in a continuous shaker (PLUS SHAKER EP-1, TAITEC, Tokyo) for 7 h, and reweighed (W s ).Finally, the degree of mealiness ((W i -W s )/W i × 100%) was calculated.

Micro-CT
Three apples stored at 20 °C for 0, 2, and 4 weeks were prepared as samples for the observation of microstructure.Five cylindrical samples of 12 mm diameter and 15 mm height were cut out from each apple with their skin on.The samples were wrapped in plastic wrap to prevent drying until observation.Samples were scanned using a high-resolution X-ray μ-CT system (inspXio SMX-100CT, Shimadzu Corp., Japan).The X-ray CT conditions were as follows: tube voltage 60 kV, tube current 100 μA, no metal filter, 600 views, and 12 × 1 averaging.The measurement time was 4 min per sample.The measured projections were digitized by an ultra-high-speed computing system (HPC inspeXio, Shimadzu Corp., Japan) as 512 × 512 size, 16-bit images, with a voxel size of 10 μm.

Image Analysis
A square ROI of 300 × 300 pixels was cropped from the center of the 512 × 512 pixel image and was used for further analysis.Gaussian smoothing (standard deviation: 5) was applied to all images to reduce the noise before applying binarization using the Otsu method (Otsu, 1979) to segment the image into cells (white) and pores (black).The volume distribution of individual pores was then calculated for each sample.Image preprocessing was performed using Pydicom (ver.2.3.0) and OpenCV (ver.4.6.0) of Python (ver.3.8.13),and pore volume distribution was calculated using BoneJ plugin (Richard et al., 2021).BoneJ has been used in previous studies to quantify microstructural differences between different apple varieties with comparable porosity (Ting et al., 2013).

Feature Engineering from Profiles and Backscattered Images
In order to construct an estimation model, it is necessary to extract features from the backscattered images.Features obtained from backscattered images can be classified into two types: profile features and image features (Mollazade & Arefi, 2017;Mollazade et al., 2013;Romano et al., 2008).The profile features were calculated from the intensity profiles and consisted of two types of features: the fitting coefficients obtained by approximating the profile with mathematical functions, and the gradients of the profile.The former was calculated by fitting 11 mathematical functions to the profiles: nine types of semi-Gaussian functions (Mollazade et al., 2012), a Gaussian-Lorentzian function (Mollazade & Arefi, 2017), and Farrell's simplified function (Farrell et al., 1992).Since these 11 functions were developed to fit the intensity profile before logarithmic transformation, the intensity profile was converted back by exponential multiplication.In addition, the intensity profiles were scaled to a maximum value of 1 for Farrell's simplified function.The latter type of profile feature was calculated as the slope of the profile obtained at 1 mm intervals (Iida et al., 2022).A total of 62 profile features were obtained for each laser wavelength.
The image features were obtained from the original laser scattering images.Before any meaningful features could be extracted, it was necessary to segment the ROI from the backscattered image.The ROI segmentation step was performed by first binarizing the backscattered image using the Otsu method to separate the background from the light scattering areas.Subsequently, saturated areas near the incident point were removed, resulting in a donut-shaped ROI.
Two types of image features were obtained by analyzing the ROI, namely statistical and texture features.Statistical features are parameters which could be calculated from the image using standard statistical calculations.Eighteen statistical features such as mean intensity and area of light scattering were calculated.On the other hand, texture features are characterized by the spatial arrangement of the brightness values of the pixels in a region (Zheng et al., 2006).In addition to the texture features used in LLBI analysis (Mollazade et al., 2013;Mozaffari et al., 2022): Gray-Level Co-Occurrence Matrix (GLCM) features, Gray Level Run Length Matrix (GLRLM) features, and Local binary patterns (LBP) features, the following texture features were added to obtain a comprehensive understanding of the data: Neighborhood Gray Tone Difference Matrix (NGTDM) feature, Statistical Feature Matrix (SFM) feature, Law's Texture Energy Measures (LTE) features, Fractal Dimension Texture Analysis (FDTA) features, and Fourier Power Spectrum (FPS) features (Christodoulou et al., 2003;Kaplan, 1999;Wu et al., 1992;Wu & Chen, 1992).These added up to 70 image features for each wavelength.In order to extract these features from the images, pyfeats (ver.1.0.0), a related library in Python was used.
In total, 264 features were calculated with 132 features for each wavelength.The complete list of calculated features can be found in Supplementary data (SI1).

Construction and Evaluation of Estimation Model
To construct an estimation model that retains generalizability, the data were divided into training (80%) and test (20%) sets.Data were divided so that multiple measurements acquired from the same apple would not be separated into the training and test datasets.Next, the training data were standardized to have mean 0 and variance 1, and the test data were standardized with the same mean and variance.In order to eliminate redundant features, the filter method was applied to the features.Specifically, correlation coefficients were calculated between the mealiness and features in the training data, and features with correlation coefficients lower than an absolute value of 0.1 were not used in model construction and estimation.
PLS, SVM, and ANN were used as estimation models to evaluate the possibility of mealiness estimation.Hyperparameters were optimized by Grid Search using tenfold cross-validation, and the hyperparameters which obtained the lowest average root mean squared error (RMSE) were chosen.The hyperparameter in the PLS model was the number of latent variables, and those in the SVM model were the regularization term and the gamma coefficient of the radial basis function (RBF) which was used as the kernel function.Finally, the ANN model was structured with 3 hidden layers, and a linear function and rectified linear unit (ReLU) function were used for the output layer and hidden layer, respectively.Adaptive moment was adopted for the learning algorithm.The hyperparameters for the ANN model were the node size for each layer, batch size, and the L2-regularization term.The estimation model set up with the obtained hyperparameters was trained again on the training data, and the test data were estimated with the constructed estimation model to obtain predicted values.
The multiple correlation coefficient (R) and the root mean square error (RMSE) were used as metrics to evaluate the performance of the models.Moreover, the ratio of prediction to deviation (RPD), the range error ratio (RER), and the evaluation index (EI) were used as assessment guidelines for model performance.RPD, RER, and EI were calculated by the following formulas, respectively.
where SD indicates the standard deviation of the target and RANGE is the difference between the maximum and minimum values of the target.
RPD values below 1.5 indicate that the model performance is not usable, values between 1.5 and 2.0 suggest a possibility to distinguish between high and low values, and values over 2.0 reveal a possibility of quantitative prediction (Saeys et al., 2005).The RER is related to the range of the objective variable, where values over 4.0 indicate that the model is acceptable for sample screening and values over 10.0 reveal a quality control level (Gohain et al., 2021).The EI is also a metric that takes into account the distribution range of the objective variable.The EI can be assigned to the following five ranks: very high (EI < 12.4%), high (12.5-24.9%),slightly high (25.0-37.4%),low (37.5-49.9%),and very low (EI > 50%).Models with EI below 37.4% are described as "practical" (Mizuno et al., 1988;Suzuki et al., 2008).

Changes in Mealiness
The "Jonagold" apples measured in this study are known to become mealy during storage.Figure 3 shows the change in mealiness as the average of 20 measurements from 10 apples each week.Mealiness increased with the increase in storage period, as reported in previous studies (Iwanami et al., 2005(Iwanami et al., , 2008a)).Moreover, the increase was especially rapid in the latter half of the storage period.Two-way ANOVA was performed to determine if mealiness changed by storage group and storage period.As a result, both the storage group and storage period were shown to significantly affect mealiness (p < 0.05).The reason for the significant difference between storage groups is likely to be due to the effect of 1 month of refrigerated storage.These results of two-way ANOVA can be found in Supplementary data (SI2).
The horizontal axis indicates the storage period at 20 °C, and the vertical axis shows the mealiness degree.The error bars show the standard deviation for each storage period.
The degree of mealiness sometimes showed negative values, meaning that the apple discs weighed heavier after the 7-h shaking than their initial weight.In these cases, previous studies (Iwanami et al., 2005) replaced the negative values with zero.However, since the final goal of this study was to estimate the degree of mealiness and the adjustment of the objective variable was expected to affect the performance of the estimation model, the negative values were used as they were in this study.
As can be seen from the large error bar in Fig. 3, mealiness varied largely among apples stored for the same storage period, with standard deviations ranging from 2.13 to 12.78.Furthermore, the mealiness of the two samples obtained from one apple varied greatly, with differences ranging from 0.16 to 27.76%, indicating that the degree of mealiness was not uniform even within the same apple.This Fig. 3 Change in mealiness during storage variation may be attributed to the heterogeneous microstructure of the apple, which has been reported for many other vegetables and fruits (Chaïb et al., 2007;Ella Missang et al., 2011;Iida et al., 2022;Khan & Vincent, 1990;Ma et al., 2021).It should also be noted that the degree of mealiness obtained by the fruit shaking method may be influenced by the amount of liquid adhering to the apple discs when weighed, leading to a margin of error.
The high variability in mealiness among apples stored in similar conditions and even within each apple indicates that mealiness cannot be estimated from storage conditions alone.Therefore, technologies that allow apple mealiness to be estimated non-destructively and on multiple points would be valuable.

Change in Microstructure During Storage and Its Relationship to Mealiness
Figure 4a, b, and c are representative X-ray CT images of apple samples after 0, 2, and 4 weeks of storage.All images are acquired at the same depth from the skin.These images indicate the increase in large pores and the decrease in adhesion between cell tissues during storage.This tendency was analyzed quantitatively.
X-ray CT images for five samples per storage period (0, 2, and 4 weeks) were 3-dimensionally-analyzed and the individual pore volumes were calculated (Fig. 4d-f).Figure 4g is given to compare of the common logarithmically transformed average pore volume distribution for each storage period.The average pore volume was approximately 0.002 mm 3 and increased with prolonged storage.The proportion of small pores was relatively high in all samples, and the proportion of large pores varied among different storage periods, increasing at 4 weeks of storage.The occurrence of large pores is consistent with the increase in the degree of mealiness, and this relationship between the increase in large pores and cell detachment due to cell separation and disintegration has been reported in previous studies (Li et al., 2020;Muziri et al., 2016).

Change in the Laser Scattering Properties During Storage and Their Relationship to Mealiness
Changes in cell microstructure during storage are known to affect their interactions with light as well as the sensory characteristics of the apple such as mealiness.The former was quantified as the intensity profiles and backscattered image features obtained from laser scattering measurement, and their relationship to the degree of mealiness was clarified.Figure 5 shows average backscattered images and average profiles calculated for three groups: the first group consisting of five samples with the highest degree of mealiness, the second group of five samples closest to the average degree of mealiness, and the third group of five samples with the lowest degree of mealiness.The degrees of mealiness for the high, average, and low groups were 41.12 ± 5.37%, 7.88 ± 0.27%, and − 3.55 ± 0.61%, respectively.The profiles showed little difference between the low and middle groups, but the overall intensity of the profiles in the high mealiness group decreased.In addition, the backscattered image showed a decrease in the scattered region with the increase in mealiness.These observations were quantitatively confirmed by calculating the correlation between the features obtained from the laser scattering measurement and the degree of mealiness.
Figure 6 shows scatter plots of the fifteen samples analyzed, where the degree of mealiness is plotted against four feature types: coefficients of fitted functions, gradients of the intensity profile, statistical image features, and texture features.For each feature type, the feature with the highest correlation with mealiness is shown: the first coefficient of the fitted Gaussian function (Fig. 6a), the gradient between 3 and 4 mm in the profile (Fig. 6b), the area of the scattering region (mm 2 ) (Fig. 6c), and the run length non-uniformity (RLN) in GLRLM (Fig. 6d).Although all features were obtained from images acquired with both 633-nm and 850-nm lasers, features with the highest correlations with mealiness were obtained with the 633-nm laser.The correlation coefficients between these features and mealiness were −0.882, −0.704, −0.760, and −0.816, respectively.
The first coefficient of the fitted Gaussian function (Fig. 6a) is the asymptotic value of scattered light intensity at large radial distances from the incident point (Peng & Lu, 2005).On the other hand, the gradient at 3-4 mm from the incident point (Fig. 6b) is obtained relatively close to the incident point.These results show that mealiness is related to the whole profile, ranging from the initial attenuation of the profile to the intensity of scattered light at large distances from the incident point.
As observed from the images in Fig. 5 and shown in Fig. 6c, the area of scattered light was reduced as mealiness increased.The area values were calculated by counting the number of pixels in the scattering area and converting pixels to mm.Mealiness has been related to an increase in intercellular space and porosity within the microstructure as well as cell separation and rupture (Li et al., 2020;Ting et al., 2013).Considering these reports, the decrease in the area of scattered light may be influenced by the decrease in scattering frequency due to the collapse of the dense microstructure of the apple fruit.
The texture feature run length nonuniformity (RLN) quantifies the non-uniformity of the run length matrix (Chu et al., 1990;Tang, 1998).Run length calculates the number of consecutive pixels with the same intensity value, and the run length matrix stores this information as a single intensity value and count (run length).A lower RLN indicates that the run length matrix is more uniform, meaning that the image contains a variety of run lengths (Galloway, 1975) and therefore higher variability in intensity between connected pixels.Based on Fig. 6d, the negative correlation between mealiness and RLN indicates that as mealiness increased, neighboring pixels in the laser scattering image became more varied.This may be caused by the collapse of cells leading to a more complex microstructure which causes non-uniform light scattering patterns.

Results of Estimation Models
To estimate apple mealiness from laser scattering measurement, a total of 132 features were calculated from the laser scattering images acquired with either the 633-nm or 850nm laser light.Forty three of these features were obtained by fitting 11 functions to the intensity profile.All functions were fitted with a coefficient of determination (R 2 ) over 0.91, which is a good fit to the measured data.The fitting performance of all the functions is shown in the Supplementary data (SI3).
After removing redundant features as explained in the construction of the estimation model, 78 features were selected from the features calculated from the 633-nm laser image, and 74 features were selected from the features calculated from the 850-nm laser image.For models using the data obtained from both lasers, a total of 152 features were used.
The sample size was reduced to 198 because 2 samples collapsed during the shaking process of the fruit disc shaking method and the degree of mealiness could not be calculated from these samples.The 198 samples were split into 158 and 40 for the training and test data, respectively.
Table 1 shows the results for all estimation models.For the single wavelength model, the ANN and SVM were able to accurately estimate the test data.As discussed in previous studies (Babazadeh et al., 2016;Lashgari & Imanmehr, 2019;Mollazade & Arefi, 2017;Mozaffari et al., 2022), there is a latent nonlinear relationship between scattering data and mealiness.Therefore, nonlinear models such as ANN and SVM may adapt well to laser backscattering measurements.
When comparing the estimation performance between models built using data acquired with 633-nm and 850-nm lasers, the 633-nm models were superior for all algorithms.Furthermore, when data acquired with the two lasers were combined, estimation performance improved, with the ANN showing the lowest RMSE for the test data (R = 0.634, RMSE = 7.621).
In order to improve the estimation model performance, ensemble learning methods were adopted.Ensemble learning is a method where initial predicted values are calculated from multiple independent weak learning algorithms (base models) and these initial predicted values are used as inputs for further modeling to output the final predicted values.In the field of food quality management, ensemble learning methods have been used as an algorithm for food safety risk prediction (Wu & Weng, 2021), estimation of chicken meat authenticity (Parastar et al., 2020), and milk adulteration detection (Neto et al., 2019).In this study, the simple averaging method, the weighted averaging method, and the stacking method (Mendes-Moreira et al., 2012;Zhou, 2021) were adopted as ensemble learning methods.In the simple averaging method, the predicted values from multiple base models are averaged, giving the final predicted values.In the weighted averaging method, the weighted average is used to average the predicted values from multiple base models.Finally, the stacking method builds a meta-model that uses the predicted values from multiple base models as its features (Anderson et al., 2021;Shen et al., 2020).In this study, we adopted ensemble learning with PLS, SVM, and ANN models as the base models and SVM was used as the meta-model in the stacking method.
The performance of all ensemble models improved over the single model, suggesting that ensemble learning can enhance the strengths of the individual base models.Among the three types of ensemble models, the stacking model showed the best performance.Figure 7 shows the relationship between the observed and estimated degree of mealiness obtained from the stacking model.Although some of the data with high degrees of mealiness were not successfully estimated, the evaluation metrics of the stacking model were 0.682 and 7.281% for R and RMSE, respectively, and the overall tendency of the degree of mealiness could be estimated.Moreover, RPD, RER, and EI were 1.37, 5.60, and 35.8, respectively.The RPD value falls in the range of "not usable," while the ranges for RER and EI evaluated the models as "acceptable for sample screening" and "slightly high accuracy."Overall, these results indicated that In this study, the samples were stored for 1 month to induce mealiness.However, there were still only a few samples with high degrees of mealiness, leading to an imbalanced distribution of the objective variable.For further improvement of the estimation performance, it may be necessary to increase the number of samples with higher degrees of mealiness.Moreover, further research is required to determine whether similar or improved performance can be obtained for estimating mealiness in other cultivars or apples with green skin.

Conclusions
The objective of this study was to estimate apple mealiness by means of laser scattering measurement.Laser scattering measurement is based on conventional backscattering imaging but is improved in terms of exposure time and by adapting high dynamic image rendering.These leads to the advantage of being able to quantify scattered light far from the incident point.In this study, lasers with wavelengths of 633 nm and 850 nm were used based on previous research reports.To estimate apple mealiness from the image data acquired by the laser scattering measurement, comprehensive feature extraction was conducted.The profile features that characterize the intensity profile, and image features that characterize the scattering image itself were calculated, leading to a total of 132 features for each wavelength.
The objective variable, mealiness, was quantified by the fruit disc shaking method, which evaluates the degree of mealiness as a continuous value and provides more detailed information than the conventional binary method.Although mealiness increased gradually due to storage, there was large variability among different apples stored for the same period, indicating the need to evaluate mealiness for each apple.On the other hand, the degree of mealiness was found to correlate with a variety of laser scattering features, such as the coefficient and slope of the fitted curve, statistical image features, and texture features.In addition, microstructure analysis focusing on pore volume using X-ray CT showed that the number of large pores increased with the storage period and suggested that differences in microstructure affected light scattering.Finally, several models were calculated to estimate the degree of mealiness from laser scattering features.When comparing the estimation performance between models built using data acquired with 633-nm and 850-nm lasers, the 633-nm models were superior for all algorithms.Optimization results showed that the use of feature values acquired at both wavelengths combined with a nonlinear model resulted in a good performance.Furthermore, the ensemble learning method showed improved performance (R = 0.682, RMSE = 7.281) compared to models built with a single algorithm.Overall, these results indicated that the laser scattering method can non-destructively estimate the degree of mealiness and has a potential to be applied for practical use.

Fig. 2
Fig. 2 Flow from image analysis to acquisition of the high-dynamicrange intensity profile.(1) The laser incident point is estimated by using the image acquired with 100 ms exposure time: a Raw image.b Image processed with a median filter to reduce noise.c Binarization by Otsu method.d Calculation of the center of gravity (estimated

Fig. 4
Fig. 4 Change in microstructure due to storage.a-c Representative X-ray CT images for each storage period.d-f The pore volume distribution for each storage period.The lines show the mean of the probability density functions estimated by kernel density estimation, and the filled areas show the standard deviations of the probability density function among samples stored for the same period.g Comparison of the mean pore volume distribution between different storage periods

Fig. 5
Fig. 5 The changes in backscattered images and intensity profiles with the increase in mealiness.a-c Average backscattered image for a low, b middle, and c high mealiness groups.d Average profiles for the three groups

Fig. 6
Fig. 6 Relationship between four laser scattering features and the degree of mealiness.a Fitting coefficient (the first coefficient of the fitted Gaussian model).b Gradient feature (gradient between 3 and 4 mm).c Statisti-

Fig. 7
Fig. 7 Observed-Estimated plot of the best ensemble model.Light blue plots show the training data, orange plots show the test data, and the black dashed line is the ideal line (y = x).The evaluation metrics of training and test data are shown in the upper left corner