Application of Visual Radiographic Analysis of Quality Grade of Table Eggs

: Digital radiography is currently the main method of medical imaging diagnosis. It also has a wide range of applications across different ﬁelds. This study used radiation to conduct nondestructive visual imaging, and further established a quantitative analysis for visual gray-scale images to determine changes in the quality of eggs. Eggs of the same weight with three quality classes were chosen according to the egg labels available on the market. Furthermore, a general medical X-ray digital imaging system was used to apply two-dimensional digital radiography. A photometric interpretation of monochrome gray-scale imaging established by the Digital Imaging and Communications in Medicine (DICOM) standard was used to conduct a quantitative stratiﬁcation analysis of the matrix data visualization, along with one-way analysis of variance (ANOVA) for quantitative statistics of the gray-scale values for the three structures, i.e., shell, air cell, and yolk. The statistical results showed that X-ray digital gray-scale images and a quantitative stratiﬁcation analysis of the matrix data visualization results are less easily identiﬁed based on visual differences. In the quantitative statistical results of the one-way ANOVA gray-scale values, the whole-egg and in-egg quantitative matrix analysis both show p < 0.05. In the analysis of egg freshness, the quantitative statistics of the percentage of space occupied by the air cell in the eggs also showed p < 0.05. In addition, the results of the freshness of each egg were graded. The quality and freshness of the eggs can be quantitatively analyzed through radiographic imaging. The results of this study will provide a more scientiﬁc and quantitative reference for the quality and freshness of agricultural products in the future. eggs by comparing the distribution of the gray-scale density values. Results indicate that the whole-egg and in-egg quantitative matrix analysis both show p < 0.05. In the analysis of egg freshness, the quantitative statistics of the percentage of space occupied by the air cell in the eggs show p < 0.05. This study provides a solid reference for scientiﬁc veriﬁcation of the application of radiographic imaging on egg quality inspection. The ﬁndings can further expand the application of radiography technology in agriculture ﬁelds combined with machine learning.


Introduction
The structure of eggs mainly constitutes the shell, yolk, albumen, and air cell [1]. Currently, the quality of eggs on the market is graded according to the US Department of Agriculture based on the appearance and internal characteristics of the eggs. Using the standards for the interior quality of chicken eggs by candling, with the air chamber, egg albumin, egg yolk, and spots as the basis of grading, the four grades applied are AA, A, B, and inedible [2]. The quality of eggs also varies with storage time and the way of raising the laying hens [3]. The European Union established the Welfare of Laying Hens Directive in 1999. Eggs are graded as 0-Organic, 1-Free Range, 2-Barn, and 3-Caged. Different housing systems have impacts on egg production performance [4,5] and the health of hens [5,6] leading to the egg qualities. This information is printed on the outer packaging of the eggshell, and makes a difference in the quality and market pricing [7].
The analysis of egg quality is mostly based on physical measurements, such as grading the interior quality by candling, calculation from a Haugh unit conversion, shell thickness Current grading of egg quality in the market is based on the standards set by the U.S. Department of Agriculture [2]. A variety of imaging techniques were used in the research for egg quality grading. Most of them use spectroscopy capturing and analysis for quality grading [21][22][23], which can only determine the superficial visual difference but cannot quantitatively analyze the entire egg. X-ray radiographic imaging techniques are gaining popularity nowadays in various fields of agriculture and food-quality evaluation [24,25]. England et al. have shown that dual-energy X-ray absorptiometry scanning can be used as a non-invasive technique to determine egg composition and shell quality [26]. However, limited studies have focused on the evaluation of egg quality using X-ray radiographic imaging. The purpose of this study is to conduct nondestructive X-ray gray-scale fluoroscopy imaging using medical digital radiography. In addition, a stratification analysis of the matrix data visualization is used to conduct statistical calculations on the quantitative quality and percentage of air cells with gray-scale values. Quality and freshness were quantitatively calculated for analysis and compared to provide more scientific references on calculation techniques for expanding the application fields of digital radiography.

Instruments
The equipment with an X-ray imaging system used for this study was composed of a general Hitachi PHF-15XH2 medical diagnostic X-ray system (Hitachi Medical corporation, Tokyo, Japan), a digital radiography system (Rayence Inc., Closter, NJ, USA), and Xmaru View V1 Ver.2.0 operating software used in the teaching and experimentation at the Department of Medical Imaging and Radiological Technology, Yanpei University of Medical Technology, Hsinchu, Taiwan. 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.

Research Materials
In this study, three egg classes with different rearing systems were purchased from supermarkets for establishing a detection model of non-destructive egg quality. Eggs were first evaluated using an electronic scale, and similar weights (~61 g) were screened for the experiment. The total number of eggs was 45, 15 eggs for each class. The classification of eggs is based on the egg traceability label (the place of origin) certified by the Council of Agriculture, Executive Yuan, Taiwan. Through the traceability label, one can clearly know the origin of the egg, its production, preservation date, etc., while understanding its ways of laying hens. Accordingly, the classified eggs in the study are from three rearing systems including free range, deep litter house, and conventional cage. As the production time of all selected eggs is the same (five days), the eggs with different freshness are not investigated in this study. In addition, the selected 15 eggs in each class were found to have no obvious difference in the image visualization analysis; Therefore, three representative eggs with different qualities were analyzed in the study.
The three systems can correspond to three quality classes, namely, special organic (SO), general organic (GO), and conventional (CO). SO eggs are eggs obtained from domestic pastures, which use humane and friendly rearing methods under The Welfare of Laying Hens Directive of the EU. The feathers of the hens producing these eggs were not manipulated and the hens received no injections. They were fed high-quality vegan corn and natto fungus with ganoderma polysaccharides and a ginseng saponins formula added and were not fed antibiotics or animal protein. In general, organic eggs are eggs bred from hens that are raised in a drug-free, antibiotic-free, and organic manner on organic farmland whose first consideration is animal welfare. They eat local certified organic multi-grain vegetables and other healthy foods. CO eggs are produced through traditional centralized rearing of the laying hens without special rearing methods. The three quality classes will be hereafter employed as representatives for egg classification.

Image Acquisition
The X-ray system used in this study consists of a medical diagnostic X-ray system Hitachi PHF-15XH2 (Hitachi Medical Corporation, Tokyo, Japan), a digital radiography system (Rayence Inc., Closter, NJ, USA), and a Xmaru View V1 (version 2.0) software. The evaluated eggs were imaged with a top-down X-ray inspection, where the central X-ray beam is directed vertically into perpendicularity with the image receptor in the X-ray table. The exposure parameters were set to 50 kVp and 20 mAs. The median and axial imaging planes of the eggs were acquired in a lying horizontally position and a standing position, respectively.

Data Visualization Analysis
After X-ray radiography, the radiographic images were stored as monochrome grayscale in a DICOM format for photometric interpretation of the eggs. The full process of a visualized stratified analysis of radiographic image is shown in Figure 1. We first employed ImageJ software (National Institutes of Health and the Laboratory for Optical and Computational Instrumentation, University of Wisconsin, Madison, WI, USA) to transform the radiographic images of eggs to a 2D matrix that contains the grayscale value of each pixel and its XY coordinate position. The 2D matrix was then fed to Sigmaplot 12.5 software (Systat Software Inc., Chicago, IL, USA) to perform a gray-to-color scale conversion.
ganic farmland whose first consideration is animal welfare. They eat local certified organic multi-grain vegetables and other healthy foods. CO eggs are produced through traditional centralized rearing of the laying hens without special rearing methods. The three quality classes will be hereafter employed as representatives for egg classification.

Image Acquisition
The X-ray system used in this study consists of a medical diagnostic X-ray system Hitachi PHF-15XH2 (Hitachi Medical Corporation, Tokyo, Japan), a digital radiography system (Rayence Inc., Closter, NJ, USA), and a Xmaru View V1 (version 2.0) software. The evaluated eggs were imaged with a top-down X-ray inspection, where the central X-ray beam is directed vertically into perpendicularity with the image receptor in the X-ray table. The exposure parameters were set to 50 kVp and 20 mAs. The median and axial imaging planes of the eggs were acquired in a lying horizontally position and a standing position, respectively.

Data Visualization Analysis
After X-ray radiography, the radiographic images were stored as monochrome grayscale in a DICOM format for photometric interpretation of the eggs. The full process of a visualized stratified analysis of radiographic image is shown in Figure 1. We first employed ImageJ software (National Institutes of Health and the Laboratory for Optical and Computational Instrumentation, University of Wisconsin, Madison, WI, USA) to transform the radiographic images of eggs to a 2D matrix that contains the grayscale value of each pixel and its XY coordinate position. The 2D matrix was then fed to Sigmaplot 12.5 software (Systat Software Inc., Chicago, IL, USA) to perform a gray-to-color scale conversion.  A multi-level Otsu thresholding algorithm was used to separate the yolk, albumen, and shell inside the egg, yielding the classified pixel groups for stratification image visualization. Finally, the classified three groups underwent a one-way analysis of variance (ANOVA) test using Sigmaplot software to quantitatively analyze the egg quality grading.

Results
Radiographic imaging was used to create DICOM grayscale images for three eggs of different qualities. With the differences in signals between the X-ray intensity and the density of the illuminated object, as the density of the matter goes from low to high, Appl. Sci. 2021, 11, 2815 5 of 15 the linear attenuation coefficient for the ionizing radiation also goes from low to high. Accordingly, the exposure effect of ionizing radiation on digital X-ray flat panel detectors (FPD) changes from strong to weak, and the rendered image gradually changes from a low-signal image (dark) to a high-signal image (bright). The results are shown in Figure 2.
ualization. Finally, the classified three groups underwent a one-way analysis of variance (ANOVA) test using Sigmaplot software to quantitatively analyze the egg quality grading.

Results
Radiographic imaging was used to create DICOM grayscale images for three eggs of different qualities. With the differences in signals between the X-ray intensity and the density of the illuminated object, as the density of the matter goes from low to high, the linear attenuation coefficient for the ionizing radiation also goes from low to high. Accordingly, the exposure effect of ionizing radiation on digital X-ray flat panel detectors (FPD) changes from strong to weak, and the rendered image gradually changes from a low-signal image (dark) to a high-signal image (bright). The results are shown in Figure 2. Images (1), (2), and (3) in Figure 2 are the DICOM grayscale imaging of SO eggs, GO eggs, and CO eggs, respectively, where Figure 2A shows a median plane image and Figure 2B shows an axial plane image. The figure shows that the shell structure is mainly composed of calcium carbonate (CaCO3) crystals, which render it as a high-signal image (bright) in a radiographic signal. The air cell is mainly a gas structure, which renders a low-signal image (dark) in the radiographic signal. The yolk and albumen are rendered as a mid-signal image (gray). This is because the yolk and albumen are in a liquid state, which cannot have clear boundaries like the shell. The states of the yolk and albumen cannot be distinguished visually from the gray-scale images, and thus the quality of the egg cannot be distinguished. From the figure, only the difference in size of the air cell in images (1), (2), and (3) in Figure 2A can be seen.
After DICOM grayscale imaging, each egg underwent a stratification analysis of the visualization of 220,000 gray-scale count matrix data in the median plane and 160,000 in Images (1), (2), and (3) in Figure 2 are the DICOM grayscale imaging of SO eggs, GO eggs, and CO eggs, respectively, where Figure 2A shows a median plane image and Figure 2B shows an axial plane image. The figure shows that the shell structure is mainly composed of calcium carbonate (CaCO 3 ) crystals, which render it as a high-signal image (bright) in a radiographic signal. The air cell is mainly a gas structure, which renders a low-signal image (dark) in the radiographic signal. The yolk and albumen are rendered as a mid-signal image (gray). This is because the yolk and albumen are in a liquid state, which cannot have clear boundaries like the shell. The states of the yolk and albumen cannot be distinguished visually from the gray-scale images, and thus the quality of the egg cannot be distinguished. From the figure, only the difference in size of the air cell in images (1), (2), and (3) in Figure 2A can be seen.
After DICOM grayscale imaging, each egg underwent a stratification analysis of the visualization of 220,000 gray-scale count matrix data in the median plane and 160,000 in the axial plane. The stratification analysis results of the data visualization rendered from the median plane images in Figure 3 and the axial plane images in Figure 4 were matched with the DICOM gray-scale images in Figure 2. A one-way ANOVA data visualization test was then conducted on the count matrix of the gray-scale units in separate parts. Because the air cell is hollow, it will be analyzed separately after a percentage of gray-scale signals undergoes stratified visualization analysis and separation. the axial plane. The stratification analysis results of the data visualization rendered from the median plane images in Figure 3 and the axial plane images in Figure 4 were matched with the DICOM gray-scale images in Figure 2. A one-way ANOVA data visualization test was then conducted on the count matrix of the gray-scale units in separate parts. Because the air cell is hollow, it will be analyzed separately after a percentage of gray-scale signals undergoes stratified visualization analysis and separation.     Figure 4 corresponds to the DICOM gray-scale images of Figure 2. Accordingly, the structure of the eggs can be separated into the Figure 4A whole egg, Figure 4B shell, and Figure 4C inner egg. In addition, the separated gray-scale matrix units were subjected to a one-way ANOVA test for data visualization. The air cell part in the axial plane DICOM gray-scale image of the egg overlaps with the inner egg part. Thus, they are analyzed together. Figures 2-4 show the corresponding results of radiometric DICOM gray-scale imaging and stratification analysis of the visualization. The DICOM gray-scale image in Figure  2A corresponds to the result of the stratification analysis of the visualization in Figure 3. The DICOM gray-scale image in Figure 2B corresponds to the result of the stratification analysis of the visualization in Figure 4. For both pairs, there is no significant visual difference in the DICOM gray-scale images. However, in the stratification analysis of visualization, there are indeed some visual differences in the imaging between the inner egg in Figure 3A,C. The quality and freshness still cannot be determined based on the visual differences. To clearly analyze the results, a one-way ANOVA was conducted on the   Figure 4 corresponds to the DICOM gray-scale images of Figure 2. Accordingly, the structure of the eggs can be separated into the Figure 4A whole egg, Figure 4B shell, and Figure 4C inner egg. In addition, the separated gray-scale matrix units were subjected to a one-way ANOVA test for data visualization. The air cell part in the axial plane DICOM gray-scale image of the egg overlaps with the inner egg part. Thus, they are analyzed together. Figures 2-4 show the corresponding results of radiometric DICOM gray-scale imaging and stratification analysis of the visualization. The DICOM gray-scale image in Figure 2A corresponds to the result of the stratification analysis of the visualization in Figure 3. The DICOM gray-scale image in Figure 2B corresponds to the result of the stratification analysis of the visualization in Figure 4. For both pairs, there is no significant visual difference in the DICOM gray-scale images. However, in the stratification analysis of visualization, there are indeed some visual differences in the imaging between the inner egg in Figure 3A,C. The quality and freshness still cannot be determined based on the visual differences. To clearly analyze the results, a one-way ANOVA was conducted on the data visualization statistics for   Figure 5 shows the results for the stratification analysis of visualization and one-way ANOVA test for eggs of three different qualities: (Egg 1) SO eggs, (Egg 2) GO eggs, and (Egg 3) CO eggs among the whole egg, shell, and inner egg. In Figure 5, the results for both the whole egg and inner egg show p < 0.05, which indicates a statistically significant difference. The SO eggs (Egg 1) have the best quality. Although the comparison results obtained for the shell layer are also meaningful (p < 0.05), there are no obviously stable differences in numerical values. This part verifies that there is no direct correlation between the shell layer and egg quality, yet the egg quality is directly related to the inner egg layer.
The analysis of egg freshness mainly focuses on comparing the size of the air cell. The structure of the air cell is composed of gas. It completely overlaps the inner egg in the axial plane direction and cannot be separated for analysis. It can only be separated in the stratification analysis of the median plane visualization imaging, as shown in Figure  6. Because the axial plane images still have some overlaps for the air cell, although the air cell can be completely separated, there are still some gray-scale signals there. The calculation of the size of the air cell is based on a quantitative analysis and statistics of the percentage of gray-scale signals in the separated air cell of each egg in a 220,000 count matrix of the gray-scale units in the axial plane direction.  Figure 5 shows the results for the stratification analysis of visualization and one-way ANOVA test for eggs of three different qualities: (Egg 1) SO eggs, (Egg 2) GO eggs, and (Egg 3) CO eggs among the whole egg, shell, and inner egg. In Figure 5, the results for both the whole egg and inner egg show p < 0.05, which indicates a statistically significant difference. The SO eggs (Egg 1) have the best quality. Although the comparison results obtained for the shell layer are also meaningful (p < 0.05), there are no obviously stable differences in numerical values. This part verifies that there is no direct correlation between the shell layer and egg quality, yet the egg quality is directly related to the inner egg layer.
The analysis of egg freshness mainly focuses on comparing the size of the air cell. The structure of the air cell is composed of gas. It completely overlaps the inner egg in the axial plane direction and cannot be separated for analysis. It can only be separated in the stratification analysis of the median plane visualization imaging, as shown in Figure 6. Because the axial plane images still have some overlaps for the air cell, although the air cell can be completely separated, there are still some gray-scale signals there. The calculation of the size of the air cell is based on a quantitative analysis and statistics of the percentage of gray-scale signals in the separated air cell of each egg in a 220,000 count matrix of the gray-scale units in the axial plane direction. Figure 6A shows the visual difference corresponding to Figures 2A and 3. It also shows the gray-scale signals of the space occupied by the air cells of (1) SO eggs, (2) GO eggs, and (3) CO eggs. In this study, the gray-scale signals of the air cell were normalized before the calculation of the number of effective gray-scale matrix units. The results of the quantitative analysis and statistics of the percentage of gray-scale signals of the occupied space for the effective count matrix of the gray-scale unit were measured through a one-way ANOVA test. The Y-axis of Figure 6B is the ratio of the number of air cells to the number of effective gray-scale matrices. The comparison of the three types of eggs showed that there was no significant difference between Egg 1 and Egg 2. The comparison of Egg 1, Egg 2, and Egg 3 all showed a value of p < 0.05, which means there were statistically significant differences. The percentage of space occupied by Egg 3 was only 0.0171. The ratio was significantly smaller than the 0.032 and 0.0281 percentages of Egg 1 and Egg 2.  Figure 6A shows the visual difference corresponding to Figures 2A and 3. It also shows the gray-scale signals of the space occupied by the air cells of (1) SO eggs, (2) GO eggs, and (3) CO eggs. In this study, the gray-scale signals of the air cell were normalized before the calculation of the number of effective gray-scale matrix units. The results of the quantitative analysis and statistics of the percentage of gray-scale signals of the occupied space for the effective count matrix of the gray-scale unit were measured through a oneway ANOVA test. The Y-axis of Figure 6B is the ratio of the number of air cells to the number of effective gray-scale matrices. The comparison of the three types of eggs showed that there was no significant difference between Egg 1 and Egg 2. The comparison of Egg 1, Egg 2, and Egg 3 all showed a value of p <0.05, which means there were statistically significant differences. The percentage of space occupied by Egg 3 was only 0.0171. The ratio was significantly smaller than the 0.032 and 0.0281 percentages of Egg 1 and Egg 2.
Corresponding to the results of the visual difference comparison, Egg 3, a CO egg, was analyzed as being the best in terms of freshness. Figure 7A shows a comparison of the shell-quality curves of eggs of three different qualities. The distribution of gray-scale values of the SO egg (Egg 1) is significantly larger than that of the GO egg (Egg 2) and normal egg (Egg 3). It indicates that the eggshell quality of SO egg (Egg 1) is significantly higher than that of GO egg (Egg 2) and Egg 3 normal egg. Referring to the optical illuminance simulation and optical density analysis methods [27], a correction was applied to the data visualization analysis and statistical technologies to analyze the distribution of gray-scale density values of eggs of three different qualities (Gd = Gv/Gu, grayscale density = count matrix of grayscale unit/grayscale  Figure 7A shows a comparison of the shell-quality curves of eggs of three different qualities. The distribution of gray-scale values of the SO egg (Egg 1) is significantly larger than that of the GO egg (Egg 2) and normal egg (Egg 3). It indicates that the eggshell quality of SO egg (Egg 1) is significantly higher than that of GO egg (Egg 2) and Egg 3 normal egg. Referring to the optical illuminance simulation and optical density analysis methods [27], a correction was applied to the data visualization analysis and statistical technologies to analyze the distribution of gray-scale density values of eggs of three different qualities (Gd = Gv/Gu, grayscale density = count matrix of grayscale unit/grayscale value). Curves with the distribution of gray-scale density values were sequentially compared. Figure 7D shows that the peak gray-scale density of the shell of CO egg (Egg 3) is 0.176. Because the quality is more concentrated in the low-density gray-scale values, its shell quality is not evenly distributed as in the SO egg (Egg 1) at 0.679, as shown in Figure 7B, and the GO egg (Egg 2) at 0.415, as shown in Figure 7C, whose gray-scale density peak is relatively evenly distributed. Figure 8A is a comparison diagram of the shell quality curves of eggs of three different qualities in the axial plane direction. The results show an overlap of the distribution curves, where the peak gray-scale density of the shell is 0.736 in Figure 8B, 0.831 in Figure 8C, and 0.708 in Figure 8D. The dispersion curve diagram cannot clearly show the analysis results of the comparison of the shell quality. compared. Figure 7D shows that the peak gray-scale density of the shell of CO egg (Egg 3) is 0.176. Because the quality is more concentrated in the low-density gray-scale values, its shell quality is not evenly distributed as in the SO egg (Egg 1) at 0.679, as shown in Figure 7B, and the GO egg (Egg 2) at 0.415, as shown in Figure 7C, whose gray-scale density peak is relatively evenly distributed.  Figure 8A is a comparison diagram of the shell quality curves of eggs of three different qualities in the axial plane direction. The results show an overlap of the distribution curves, where the peak gray-scale density of the shell is 0.736 in Figure 8B, 0.831 in Figure 8C, and 0.708 in Figure 8D. The dispersion curve diagram cannot clearly show the analysis results of the comparison of the shell quality. After obtaining DICOM gray-scale images of the yolk and albumen of eggs of three different qualities in the median and axial plane directions, the results of the gray-scale density distribution analysis, and a comparison of the liquid structure of the yolk and albumen, which cannot be separated, are shown in Figures 9 and 10, respectively. Since the yolk is thicker than the albumen and its relative material density is also higher, cor- After obtaining DICOM gray-scale images of the yolk and albumen of eggs of three different qualities in the median and axial plane directions, the results of the gray-scale density distribution analysis, and a comparison of the liquid structure of the yolk and albumen, which cannot be separated, are shown in Figures 9 and 10, respectively. Since the yolk is thicker than the albumen and its relative material density is also higher, corresponding to the results of the inner egg stratification analysis of visualization in Figures 3C and 4C, the gray-scale value of yolk is greater than that of the albumen. Based on the analysis and statistics of the gray-scale value density curve, the peak value of the yolk is also higher than the peak value of the albumen. The graphs in Figures 9 and 10 show two different density peaks. Figure 9A shows a comparison of the inner egg part of the eggs of three different qualities. It shows that the gray-scale value distribution of the SO egg (Egg 1) is significantly larger than that of the GO egg (Egg 2) and the normal egg (Egg 3).  Comparing the first peaks of the albumen quality, the peak gray-scale density values of the SO egg (Egg 1) at 0.027 and GO egg (Egg 2) at 0.019 are both larger than that of CO egg (Egg 3) at 0.011 (see Figure 9). The gray-scale density peaks of the SO egg (Egg 1) at 0.034, and the GO egg (Egg 2) at 0.021, are both greater than that of the CO egg (Egg 3) at 0.017 (see Figure 10). Therefore, both results present the same phenomenon. Comparing the second peak of the yolk quality, the peaks of the gray-scale densities in the SO egg (Egg 1) at 0.017 and the GO egg (Egg 2) at 0.009, are both larger than that of the CO egg (Egg 3) at 0.007 (see Figure 9). The gray-scale density peaks in the SO egg (Egg 1) at 0.029 and GO egg (Egg 2) at 0.012, are greater than that of CO egg (Egg 3) at 0.017 (see Figure 10), which also demonstrate a corresponding result. This result verifies the accuracy and feasibility of applying non-destructive X-ray gray-scale imaging data visualization analysis and statistics on egg quality and freshness.

Discussion
The principle of radiographic imaging is the result of the effect of the linear attenuation coefficient when ionizing radiation is applied to a non-uniform density material. The linear attenuation coefficient of the X-rays is proportional to the density of the material [28]. The performance of the gray-scale values of the images represents the image converted from every gray-scale matrix unit density value [29].
According to other studies, there is no direct correlation between the quality of the shell and the quality of the egg. The same results are shown in Figures 3-5. However, the Comparing the first peaks of the albumen quality, the peak gray-scale density values of the SO egg (Egg 1) at 0.027 and GO egg (Egg 2) at 0.019 are both larger than that of CO egg (Egg 3) at 0.011 (see Figure 9). The gray-scale density peaks of the SO egg (Egg 1) at 0.034, and the GO egg (Egg 2) at 0.021, are both greater than that of the CO egg (Egg 3) at 0.017 (see Figure 10). Therefore, both results present the same phenomenon. Comparing the second peak of the yolk quality, the peaks of the gray-scale densities in the SO egg (Egg 1) at 0.017 and the GO egg (Egg 2) at 0.009, are both larger than that of the CO egg (Egg 3) at 0.007 (see Figure 9). The gray-scale density peaks in the SO egg (Egg 1) at 0.029 and GO egg (Egg 2) at 0.012, are greater than that of CO egg (Egg 3) at 0.017 (see Figure 10), which also demonstrate a corresponding result. This result verifies the accuracy and feasibility of applying non-destructive X-ray gray-scale imaging data visualization analysis and statistics on egg quality and freshness.

Discussion
The principle of radiographic imaging is the result of the effect of the linear attenuation coefficient when ionizing radiation is applied to a non-uniform density material. The linear attenuation coefficient of the X-rays is proportional to the density of the material [28]. The performance of the gray-scale values of the images represents the image converted from every gray-scale matrix unit density value [29].
According to other studies, there is no direct correlation between the quality of the shell and the quality of the egg. The same results are shown in Figures 3-5. However, the thickness of the shell and the compressive strength indeed reduce the damage rate of the egg [30][31][32]. The shell is mainly composed of calcium carbonate (CaCO 3 ) crystals. The quality of the shell is indeed directly related to the production of the eggs. The measurement of the quality of the shells is mostly achieved through destructive inspection methods, such as optical or electronic inspection methods, to measure the uniformity of shell thickness and determine the shell quality [33]. Radiography visualization is a non-destructive detection, where imaging is based on the principle that the density of the substances, the linear attenuation coefficient, and the absorption of ionizing radiation are different [34]. Figure 4B,C shows the stratification images of the inner egg and air chamber based on the segmented results using the multi-level Otsu thresholding methods. As the grayscale intensities of eggshell partially overlap with that of egg yolk (see Figure 1D), this makes it difficult to perfectly perform image segmentation between eggshell and inner egg using the intensitybased segmentation method. Therefore, the stratification images in Figure 4C retain some eggshell structure. The segmentation error may affect the quantification analysis; however, we consider the effect is small because the grayscale value of the eggshell is small relative to the inner egg. Further improvement can be investigated by using advanced segmentation methods such as K-means segmentation algorithm. Figures 7 and 8 show the results of the comparison of shell qualities, which were obtained through the median and axial plane DICOM gray-scale images of eggs of three different qualities. The gray-scale density values of SO eggshell in the median plane direction are significantly higher than GO and CO eggs. The trend is similar to the results observed in Rachmawanto et al. [35]. They found that the eggshell tendency to break increased as the egg quality decreased (from good quality to rotten and defective eggs).
The yolk and albumen are mainly composed of ovomucin and a variety of amino acids and vitamins [36]. Among them, the structure of ovomucin is directly related to the egg quality. Although the United States Department of Agriculture also has established a quality standard for yolk thickness [2], there are many ways to evaluate the in-egg quality. Taking the regression detection of destructive detection and spectrophotometer detection of albumen height, egg weight, and absorbance between HU values (Haugh values) as the evaluation standard of thickness [37], the difference in consistency is directly related to the internal density of the substance. The quality of an egg is determined by the saturation and thickness of the yolk and albumen after the egg is broken. The density under high saturation and thickness is also relatively high, and correspondingly, the grayscale value in the radiography is also relatively high, the results shown in Figures 9 and 10. The two gray-scale density peaks of the yolk and albumen decrease with the quality of the egg. The phenomenon may be regarded as a quantitative indicator for determining the quality of eggs or selecting double-yolk eggs [38], and this deserves further studies in our future work.
Our study is subject to unavoidable limitations that the sampled number of eggs was small and the eggs with different freshness are not investigated in this study. However, the preliminary results are promising. In addition, we found that the percentage of space occupied by the air cell in the eggs has a significant difference between SO and CO eggs and between GO and CO eggs, even if these eggs have the same production time. It indicates that the freshness of the eggs is subject to multiple factors such as the source of eggs (chicken farm) and storage temperature. Consequently, the results require further validation with larger samples, and further exploration of evaluating the egg freshness under different factors based on X-ray radiographic images. Continuing work on developing advanced image processing and machine learning algorithm should be made before they can be applied to on-site egg quality inspection.

Conclusions
Herein, we have shown the feasibility of digital radiography technology applied to egg quality inspection. Through the data visualization analysis of radiographic images, one can evaluate the liquid structure and quantitatively analyze the quality classes of the eggs by comparing the distribution of the gray-scale density values. Results indicate that the whole-egg and in-egg quantitative matrix analysis both show p < 0.05. In the analysis of egg freshness, the quantitative statistics of the percentage of space occupied by the air cell in the eggs show p < 0.05. This study provides a solid reference for scientific verification of the application of radiographic imaging on egg quality inspection. The findings can further expand the application of radiography technology in agriculture fields combined with machine learning.  Institutional Review Board Statement: Not applicable for studies not involving humans.

Informed Consent Statement:
Not applicable for studies not involving humans.

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