Assessment and Feasibility Study of Lemon Ripening Using X-ray Image of Information Visualization

: Digital radiography (DR) is a mature technology and has been broadly used in medical diagnosis. Currently, it’s also used for fruit quality inspection in the market. This purpose of the study is to conduct non-destructive experiments for visual comparisons of digital radiography images, further construct visualized grayscale image analysis technology, and analyze the changes in lemon quality and ripening using quantitative statistical methods. The materials used for the experiments were three lemons of different ripening. A general medical X-ray DR system for was used in this study for 2D digital radiography. The medical X-ray DR images were created based on the Digital Imaging and Communications in Medicine (DICOM) standard. Photometric interpretation of monochrome was applied to create multi-layered grayscale images. Then quantitative analyses and comparisons were performed with image matrix structures and grayscale pixel values in the tissues using visualization techniques and statistical methods. After layer segmentation on the radiological images, the correlations between the lemon structures and tissue changes were assessed by using the Kruskal–Wallis test. The results showed that the p values for lemon, ﬁber, and pulp were all under 0.05, while the peel layer did not exhibit signiﬁcant change. The pulp layer is the best region for statistical analyses to determine the lemon ripening. In conclusion, this study can provide a solid reference for future quality classiﬁcation in the agricultural market. The research ﬁndings can be referenced for developing computing techniques applied to agricultural inspection, expanding the scope of application of the medical DR technology.


Introduction
The traditional way to determine the qualities of fruit is subject to measurement using a penetrometer or the farmer's subjective experience on the flipping sounds caused by finger tapping on fruits. Fruits are classified into solid-sound fruits, hollow-sound fruits, and bad fruits. This is how people identify and discard defective products. This manual non-destructive inspection method for selecting fruit is manually intensive, and only those with significant experience able to accurately determine fruit quality. The classification accuracy of this method varies according to personal psychological states.
Scientific non-destructive inspection techniques for selecting cultural products include ultrasound, magnetic resonance imaging, X-ray, and near infrared spectroscopy (NIRS), which have been developed over decades [1]. Ultrasound is those sound waves or vibrations with frequencies higher than 20 kHz, the upper limit of the human hearing range. Ultrasound is particularly suited to identifying the hollowness and quality of fruits and vegetables [2]. Morrison  and water content of navel oranges. They found that the ultrasound signals were highly correlated to navel oranges' hardness [3]. Ignat and Mizrach et al. exploit the feature of ultrasound in relation to attenuation coefficients of substances and discovered that there was a relationship between dry weights and the ripening of bell peppers and avocados [4,5].
Magnetic resonance imaging (MRI) uses a strong magnetic field, radio waves and a computer to produce detailed images of the nucleuses in the target and make it possible to gain a deep insight into the real damages inside the agricultural product [6,7]. Zhang et al. used the MRI technology to observe the ripening of tomatoes. They used MR images to observe significant changes in signal strength with tomatoes of different ripening. The ripening of tomatoes was identified based on the T2 relaxation and diffusion weighting MR images [8]. Joyce et al. applied the MRI technology to observe the ripening of mangos. The changes in MRI signal strength according to the ripening did not follow a regular pattern due to the differences in fruit peels. Thus, the choices of the regions of interest (ROIs) on the MR images were essential [9]. Zhang et al. adopted partial least squares (PLS) to analyze pomegranate MR images to retrieve information on the quality of the collected pomegranates using a non-destructive inspection method such as brix, acidity, and pH scale [10].
The wavelength range of NIRS is between 780 nm and 2500 nm. NIRS can be used to identify the characteristic substance in the target object based on the property that the energy levels of molecules and atoms of the agricultural product are different and may lead to different absorption rates due to different wavelengths. Then, combined with the characteristic spectrum database of the known substance, the composition and structure of each point can be obtained. Most functional groups within molecules, such as C-H, O-H, and N-H, of most substances have fixed vibrational absorption spectra within this range. The NIRS inspection technology for agricultural products utilizes the absorption and transform of spectrum energy to perform qualitative and quantitative analyses on the compositions of agricultural products. Currently, many efforts have been done on the applications of this technology on agricultural products such as apples, cherries, bananas, grapes, peppers, and paddy rice [11][12][13][14][15][16][17][18][19].
Since the discovery of X-rays in 1895 by Germany physicist Wilhelm Corad Röntgen, photostimulable substances have been used to transform invisible light energy into visible light energy with the ionizing radiation energy produced from the three basic exposure controlling factors, kV, mA, and s. Different linear attenuation coefficients of substances and different absorption intensities of ionizing radiation can be reflected through film imaging [20].
With the advance of technology, the development of thin-film transistor (TFT) array technology, and the application of flat panel detectors (FPDs), high-resolution X-ray imaging has been quite mature [21,22]. Multilayered monochrome grayscale images can be created based on the DICOM (Digital Imaging and Communications in Medicine) standard [23,24], and X-ray image interpretation has been developed from intuitive interpretation to statistical interpretation based on grayscale values [25]. Monochrome is black and white. Tones of a grayscale are based on its bit depth. DICOM grayscale standard is the basis for radiography analyses. The exposure signals from the linear attenuation of the X-ray tube voltage and the absorber's density are received by the flat panel detector, which then produces signals in the form of images. If the outputs are 8-bit grayscale images, the signals are transformed into 2 8 = 256 monochrome grayscale levels according to their intensities. The images are composed of pixels of values ranged from 0 to 255. The pixel value for pure black is 0. Colors closer to white have higher grayscale pixel values. The grayscale pixel value of pure white is 255. There are systems using bit depths higher than 256 for signal sampling and display, producing 2D array radiographic grayscale images of the target object [26,27]. Grayscale values corresponding to signal intensities are put in arrays to create grayscale images [28].
Without destroying fruits, the X-ray radiography technology can display density differences inside fruits using grayscale levels to show detailed density changes caused by insect pests, and thus identify healthy fruits and fruits with pest damages and classify them. Densities may vary with water content in fruits, hard tissues of kernels, holes caused by insect pests, hollowness, and corruption, etc. Different densities are represented by different grayscale levels [29,30].
Currently, radiography has been applied to classification based on quality and disease detection for citrus fruits. Besides citrus fruits, X-ray radiography is extensively used for the sorting of mature lettuce heads [31], and the assessment of the ripening of mangoes [32], and tomatoes [33] based on tomography. Surface defects of fruits are often detected using color-scale analysis and radiography with appearance images of the fruits [34]. Moreover, radiography is also used in fruit quarantine. Fluoroscopy images are captured and analyzed based on color scales to mark the problematic areas [35,36]. However, hyperspectral imaging and radiography can only be used to perform qualitative analyses for surfaces of citrus fruits. Internal ripening of citrus fruits cannot be analyzed using these methods [36,37]. This study adopted radiography for non-destructive grayscale X-ray imaging for lemons and then performed quantitative quality analyses and comparisons based on the changes in structures and tissues using data visualization and statistical analyses, aiming to provide scientific-technical references and to expand the scope of applications of radiography.

Equipment
The X-ray system used in this study includes the medical diagnostic X-ray system Hitachi PHF-15XH2 (Hitachi Medical Corporation, Tokyo, Japan) the digital radiography system (Rayence Inc., Fort Lee, NJ, USA), and the Xmaru View V1 Ver. 2.0 software used by the Department of Medical Imaging and Radiological Technology, Yanpei University of Medical Technology. The system model is 1717SCC CsI (Cesium Iodide Scintillation) Tethered, with the following specs: 17 × 17 inch flat panel detector, sensor type: Amorphous Silicon with TFT, pixel matrix: 3328 × 3328, pixel pitch: 127 µm, A/D conversion: 14/16 bit, resolution: Max. 3.5 lp/mm.
The scientific name of the lemon used in this study is citrus limon, which is a fruit of warm climates of the Rutaceae family and the citrus genus [38]. The fruit is composed of two major parts, the peel and the pulp. The peel is composed of the exocarp and the mesocarp, which is a white layer. The pulp is made of ovarian locules, which are filled with juice vesicles. The pulp is the edible part of the fruit. Citrus limon is a crude fruit [39,40]. The materials used in the experiments were three lemons of similar sizes, but different ripening (fresh, mature and overripe) selected by professional farmers with 20 years of experience. The lemons harvested from Eureka lemons grown in Taiwan were imaged by a vertical x-ray radiographic system with exposure conditions of 53 kVp, 160 mA, and 63 ms. Lemons were imaged in a lying horizontally position and a standing position, respectively. Two grayscale images of the median plane and axial plane of the three lemons with different ripening levels were obtained, and then the images were visualized and processing for statistical analysis. Figure 1 shows the process of data visualization. After radiographic imaging of the lemons, the monochrome grayscale radiographic images based on the DICOM format were generated for photometric interpretation of the lemons. The radiographic images were then transformed to a 2D matrix that contains the XY coordinate positions and grayscale value of each pixel using ImageJ software (National Institutes of Health and the Laboratory for Optical and Computational Instrumentation, University of Wisconsin, Madison, WI, USA). Then, the color scale conversion was conducted based on the XY positions and grayscale value of each pixel using Sigmaplot 12.5 software (Systat Software Inc., Chicago, IL, USA). Three layers of lemon peel (exocarp), fiber (mesocarp) and pulp (endocarp) can be clearly distinguished and visualized from the colored scale image. In addition, we employed multi-level Otsu thresholding to separate peel, fiber, and pulp regions. The outputted XY positions and grayscale value of each layered pixel group can be obtained for stratification image visualization. Finally, the statistical analysis of the grouped grayscale data was performed using Kruskal-Wallis test to evaluate the classification results of lemon qualities. The null hypothesis was that the average pixel values of the layer between lemons were the same, and the significance level α was set as 0.05.

Data Processing and Visualization
. 2021, 11, x FOR PEER REVIEW 4 of 12 positions and grayscale value of each pixel using Sigmaplot 12.5 software (Systat Software Inc., Chicago, IL, USA). Three layers of lemon peel (exocarp), fiber (mesocarp) and pulp (endocarp) can be clearly distinguished and visualized from the colored scale image. In addition, we employed multi-level Otsu thresholding to separate peel, fiber, and pulp regions. The outputted XY positions and grayscale value of each layered pixel group can be obtained for stratification image visualization. Finally, the statistical analysis of the grouped grayscale data was performed using Kruskal-Wallis test to evaluate the classification results of lemon qualities. The null hypothesis was that the average pixel values of the layer between lemons were the same, and the significance level α was set as 0.05.

Results
Through DR, the X-ray radiographic DICOM grayscale images of the 3 lemons were obtained. After applying the quantitative comparison methods, fresh, mature, and overripe lemons were identified, as shown in Figure 2. Different X-ray intensities and different densities of the absorbers led to different signals. The low-density substances exhibited low absorption of ionizing radiation, meaning the ionizing radiation direction attenuation coefficients of the substances were also low. Thus, the exposure effect of the FPD to ionizing radiation was high, leading to low-signal (dark) images. On the other hand, the high-density substances exhibited high absorption of ionizing radiation, leading to high-signal (bright) images. Figure 2 shows the median-plane images (A) and the axial-plane images (B) of the lemons. (1), (2), and (3) represent different ripening of the lemons. These images are DICOM grayscale images of the (1) fresh, (2) mature, and (3) overripe lemons. According to the results, the images of the overripe lemon were low-signal (dark) images, while those of the fresh and mature lemons were high-signal (bright) images. The visual differences could be identified. However, it remains difficult to distinguish the fresh lemon from the mature one based on visual differences.

Results
Through DR, the X-ray radiographic DICOM grayscale images of the 3 lemons were obtained. After applying the quantitative comparison methods, fresh, mature, and overripe lemons were identified, as shown in Figure 2. Different X-ray intensities and different densities of the absorbers led to different signals. The low-density substances exhibited low absorption of ionizing radiation, meaning the ionizing radiation direction attenuation coefficients of the substances were also low. Thus, the exposure effect of the FPD to ionizing radiation was high, leading to low-signal (dark) images. On the other hand, the highdensity substances exhibited high absorption of ionizing radiation, leading to high-signal (bright) images. Figure 2 shows the median-plane images (A) and the axial-plane images (B) of the lemons. (1), (2), and (3) represent different ripening of the lemons. These images are DICOM grayscale images of the (1) fresh, (2) mature, and (3) overripe lemons. According to the results, the images of the overripe lemon were low-signal (dark) images, while those of the fresh and mature lemons were high-signal (bright) images. The visual differences could be identified. However, it remains difficult to distinguish the fresh lemon from the mature one based on visual differences. The acquired median-plane and axial-plane images were divided into three regions using multi-thresholding image segmentation for visualization of stratification. Figure 3 shows the median-plane and axial-plane results, displayed according to the three layers of the structure, namely the peel layer, the fiber layer, and the pulp layer (endocarp). Then the Kruskal-Wallis test was performed with the visualized grayscale value data for quantitative statistical analyses.
The median-plane DICOM grayscale image of the lemons were transformed into visualized grayscale pixel matrix images, as shown in Figure 3. The visualized results of further stratification analyses of the grayscale pixel matrixes based on the three layers, namely the peel layer, the fiber layer, and the pulp layer, are shown in Figure 3B-D. The grayscale value of each pixel of each layer was marked on the matrix coordinate to create visual images showing all data on the same layer, as shown in Figure 3A. It can be seen that the grayscale pixel matrix stratification results presented in Figure 3A-C (1), and (2) were not different visually, while Figure 3D (1), (2), and (3) exhibited visual differences.
The axial-plane DICOM grayscale images of the lemons were transformed into visualized grayscale pixel matrix images. Figure 4 shows the visualized results of further stratification analyses of the grayscale pixel matrixes. These results are corresponding to Figure 2B (1), (2), and (3). It can be seen that the grayscale pixel matrix stratification results presented in Figure 4B (1), (2), and (3) and Figure 4C (1) and (2) were not different visually, while Figure 4D (1), (2), and (3) exhibited visual differences. The grayscale value analyses and the visualized stratification analyses could only produce qualitative results based on partial visual differences. It was not possible to identify the freshness and ripening of the lemons. Thus, the grayscale matrixes were quantified and analyzed using quantified statistical analysis methods to perform scientific comparisons of the freshness and ripening of the lemons. The results are shown in Figure 5. The acquired median-plane and axial-plane images were divided into three regions using multi-thresholding image segmentation for visualization of stratification. Figure 3 shows the median-plane and axial-plane results, displayed according to the three layers of the structure, namely the peel layer, the fiber layer, and the pulp layer (endocarp). Then the Kruskal-Wallis test was performed with the visualized grayscale value data for quantitative statistical analyses.
The median-plane DICOM grayscale image of the lemons were transformed into visualized grayscale pixel matrix images, as shown in Figure 3. The visualized results of further stratification analyses of the grayscale pixel matrixes based on the three layers, namely the peel layer, the fiber layer, and the pulp layer, are shown in Figure 3B-D. The grayscale value of each pixel of each layer was marked on the matrix coordinate to create visual images showing all data on the same layer, as shown in Figure 3A. It can be seen that the grayscale pixel matrix stratification results presented in Figure 3A-C (1), and (2) were not different visually, while Figure 3D (1), (2), and (3) exhibited visual differences.
The axial-plane DICOM grayscale images of the lemons were transformed into visualized grayscale pixel matrix images. Figure 4 shows the visualized results of further stratification analyses of the grayscale pixel matrixes. These results are corresponding to Figure 2B (1), (2), and (3). It can be seen that the grayscale pixel matrix stratification results presented in Figure 4B (1), (2), and (3) and Figure 4C (1) and (2) were not different visually, while Figure 4D (1), (2), and (3) exhibited visual differences. The grayscale value analyses and the visualized stratification analyses could only produce qualitative results based on partial visual differences. It was not possible to identify the freshness and ripening of the lemons. Thus, the grayscale matrixes were quantified and analyzed using quantified statistical analysis methods to perform scientific comparisons of the freshness and ripening of the lemons. The results are shown in Figure 5. Appl. Sci. 2021, 11, x FOR PEER REVIEW 6 of 12     According to the results of the quantitative statistical analyses of the grayscale data, the densities for lemon and pulp decreased as the ripening increased, while that for fiber increased as the ripening increased. The results are in agreement with Hassan et al. [41]. Only the peel layer did not exhibit any significant change in density while some of the other statistical comparison results of this layer were meaningful (p < 0.05).

Discussion
The theory behind radiography is related to the linear attenuation coefficients of ionizing radiation through substances of uneven densities. The linear attenuation coefficients of X-ray through substances are proportioned to substance densities [42]. The imagining grayscale value of each pixel represents the image converted from the pixel element density [43]. In the fields of food and agriculture, the radiography technique is only used for quality control based on visual differences. For example, in the food industry, the technique based on visual differences of radiography has been widely used [44] and the thresholding of image segmentation technique has been applied with DR to explore the influences of quality loss in fruits caused by plant diseases and insect pests [45]. As for the application of radiography in this study, besides using visual differences for quality control, the DICOM standard was also used to produce monochrome grayscale images, combined with the quantified statistical methods, to analyze the quality and freshness of fruits [24,46]. The standard errors of the means of the grayscale values and the 95% CIs were all under one, meaning the X-ray output exposure quality and the linear attenuation of the substances of uneven densities were quite stable, proven by the accuracies of the results obtained using the quantified statistical method with the grayscale values, as shown in Table 1 [47].  Only the result for the peel layer was not significant. According to the results of the quantitative statistical analyses of the grayscale data, the densities for lemon and pulp decreased as the ripening increased, while that for fiber increased as the ripening increased. The results are in agreement with Hassan et al. [41]. Only the peel layer did not exhibit any significant change in density while some of the other statistical comparison results of this layer were meaningful (p < 0.05).

Discussion
The theory behind radiography is related to the linear attenuation coefficients of ionizing radiation through substances of uneven densities. The linear attenuation coefficients of X-ray through substances are proportioned to substance densities [42]. The imagining grayscale value of each pixel represents the image converted from the pixel element density [43]. In the fields of food and agriculture, the radiography technique is only used for quality control based on visual differences. For example, in the food industry, the technique based on visual differences of radiography has been widely used [44] and the thresholding of image segmentation technique has been applied with DR to explore the influences of quality loss in fruits caused by plant diseases and insect pests [45]. As for the application of radiography in this study, besides using visual differences for quality control, the DICOM standard was also used to produce monochrome grayscale images, combined with the quantified statistical methods, to analyze the quality and freshness of fruits [24,46]. The standard errors of the means of the grayscale values and the 95% CIs were all under one, meaning the X-ray output exposure quality and the linear attenuation of the substances of uneven densities were quite stable, proven by the accuracies of the results obtained using the quantified statistical method with the grayscale values, as shown in Table 1 [47]. Table 1. The statistics of the X-ray imaging results of (1) fresh, (2) mature, and (3) overripe lemons based on the four-layer stratification of lemon, peel, fiber, and pulp after the linear attenuation of the lemon samples with fixed X-ray output exposure quality. According to Table 1, the SEM results showed that the variations of the means of the grayscale values of the grayscale images were rather low, and the corresponding 95% CI results were consistent. The linear regression results are shown in Figure 6. The stratified analysis results of the (A) median-plane and (B) axial-plane images of the lemons showed that the coefficients of determination R 2 of the lemon, fiber, and pulp layers were all higher than 0.8 [48]. The coefficients dropped with freshness of the lemon and pulp layers, and increased of the fiber layer. Only the peel layer did not exhibit any consistent trend. This finding is consistent with the study on the citrus growth [49], verifying the feasibility of applying the non-destructive radiography grayscale imaging and statistical methods on analyzing lemon ripening. The results indicate that the pulp layer is the best region for statistical analyses to determine the lemon ripening, as the averaged gray values at the layer have a significant change with the increase of lemon ripening.

Median Plane of Lemon Samples
Appl. Sci. 2021, 11, x FOR PEER REVIEW 9 of 12 Table 1. The statistics of the X-ray imaging results of (1) fresh, (2) mature, and (3) overripe lemons based on the four-layer stratification of lemon, peel, fiber, and pulp after the linear attenuation of the lemon samples with fixed X-ray output exposure quality. According to Table 1, the SEM results showed that the variations of the means of the grayscale values of the grayscale images were rather low, and the corresponding 95% CI results were consistent. The linear regression results are shown in Figure 6. The stratified analysis results of the (A) median-plane and (B) axial-plane images of the lemons showed that the coefficients of determination R 2 of the lemon, fiber, and pulp layers were all higher than 0.8 [48]. The coefficients dropped with freshness of the lemon and pulp layers, and increased of the fiber layer. Only the peel layer did not exhibit any consistent trend. This finding is consistent with the study on the citrus growth [49], verifying the feasibility of applying the non-destructive radiography grayscale imaging and statistical methods on analyzing lemon ripening. The results indicate that the pulp layer is the best region for statistical analyses to determine the lemon ripening, as the averaged gray values at the layer have a significant change with the increase of lemon ripening. The primary limitation of the study lies in a limited number of lemons for evaluation, although the scope of the study is to evaluate the feasibility of lemon ripening evaluation based on the image quantification of X-ray radiological images. Our preliminary results are promising, and additionally, citruses have a similar structure to lemons. The primary limitation of the study lies in a limited number of lemons for evaluation, although the scope of the study is to evaluate the feasibility of lemon ripening evaluation based on the image quantification of X-ray radiological images. Our preliminary results are promising, and additionally, citruses have a similar structure to lemons. Further work should be made to collect more lemons and other citruses for advanced analysis and eventually establish an automatic system of determining the ripening of lemons based on the statistical analyses of the pulp region.

Conclusions
The ripening inspection methods currently used for agricultural products include hyperspectral images, color and thermal images, and X-ray imaging threshold color analysis. With these methods external defects and internal diseases and insect pests can be identified using visual qualitative inspections. This study applied the medical DR technology for non-destructive inspection, producing grayscale X-ray images, and then applied data visualization and statistical methods on the image matrixes and grayscale pixel values for quantitative analyses and comparisons, to identify the ripening changes of lemons and to verify the relationship between lemon structures and lemon tissue changes. The research findings can be used as references for development of artificial intelligence (AI) applications in agriculture for inspection, expanding the scope of applications of the medical DR technology.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.