1. 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 measurement, shell strength measurement, yolk and albumen egg quality measurement, and spectrum analysis. Egg quality inspection by candling is tedious and subjective and is not a scientific way to ensure egg quality. In studies related to the nondestructive detection of egg quality, near-infrared spectroscopy (NIR) has been one of the fastest-developing spectral analysis techniques since the 1990s. With a fast analysis speed and high efficiency, it is widely used in non-destructive detection and analysis. It is commonly used for quality control of agricultural products such as meat, fruits, and vegetables. Abdel-Nour et al. suggested that visible/near infrared reflectance (VIS/NIR) transmission spectroscopy is a good tool for evaluating the freshness and protein pH of eggs and can be used as a non-destructive detection method for predicting the Haugh unit (HU), albumen pH, and storage days. The authors indicated that the wavelengths of VIS and NIR range from 411 to 1729 nm [
8]. Liu et al. combined Raman technology with chemometrics to predict the freshness of eggs by scanning the top, waist, and bottom of the shell surfaces. Their study showed that the Raman spectrum of the shell surface is strongly correlated to its freshness. Furthermore, the model using the top of the eggs was determined to be the best [
9]. Aboonajmi et al. used a non-destructive ultrasonic method to create an evaluation model for the prediction of egg freshness. It can predict the Haugh unit, albumen thickness, air cell height, and storage time by calculating the ultrasonic phase velocity in the egg, and it was observed that the amplitude of the main peak of the ultrasonic signals increases with an increase in the days of storage. Furthermore, there is a significant difference between the average phase velocity obtained at different times [
10].
Using the principle of radiography, by controlling the basic exposure controlling factors of kVp and mAs to produce ionizing radiation X-rays of different intensities, imaging is conducted based on the linear attenuation coefficients of different substances and the absorption intensity of the ionizing radiation [
11]. Over time, the radiography technique has evolved from traditional film radiography to the current era of digital high-resolution X-ray imaging [
12,
13]. The receiving method of the radiation signals has also developed from traditional gray-scale film imaging to a multi-layer photometric interpretation of monochrome gray-scale imaging established through a globally standardized format under the Digital Imaging and Communications in Medicine (DICOM) standard [
14,
15]. The analysis of X-ray images has also evolved from intuitive visual diagnosis to the analysis of gray-scale image data using the region of interest (ROI) and threshold [
16,
17].
Medical gray-scale images are a multi-layer photometric interpretation of monochrome imaging composed of black and white. They are compressed and stored in the file format under DICOM and are the basis for the analysis of radiography [
18]. The number of bits determines the layers of grayness of the image. In radiography, the exposure factors that control kVp not only determine the penetration intensity of the X-rays they also affect the contrast of the image. In addition, the exposure factors that control mAs determines the quality of the continuous production of X-rays and affects the density of the image. Based on these factors, X-rays generate image signals of the illuminated object in response to the linear attenuation coefficients of different substances and the absorption intensity of the ionizing radiation [
19]. The gray-scale imaging of digital imaging equipment aims to render the responses of the display units in each photodiode to the brightness of the received photons, and to reproduce the gray-scale layers, from black to bright, at high resolution [
20]. The digital imaging equipment will then receive, output, and render the signals of the interaction between the X-rays and the density of the illuminated object. Taking 8-bit imaging as an example. According to the intensity of the signals, the output image is converted into 2
8 = 256 layers of a photometric interpretation of the monochrome. The gray layers are composed of pixels with values from zero to 255. On the gray layers, a pixel value of zero is pure black (dark). The higher the value, the whiter (brighter) it is. Therefore, on a gray layer, a pixel value of 255 is rendered as pure white. This mapping renders a two-dimensional matrix gray-scale radiography image of the illuminated object [
12].
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.
2. Materials and Methods
2.1. 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.
2.2. 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.
2.3. 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.
2.4. 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.
3. 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 (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.
Figure 4 shows the results of the stratification analysis of the gray-scale matrix data visualization of the axial plane images of the eggs. The X and Y axes are the number of gray-scale matrix units.
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.
Figure 2,
Figure 3 and
Figure 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 a scientific statistical comparison of the egg quality and freshness. The results are shown in
Figure 5.
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
Figure 2A and
Figure 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. 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 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.
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
Figure 9 and
Figure 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
Figure 3C and
Figure 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
Figure 9 and
Figure 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.
4. 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
Figure 3,
Figure 4 and
Figure 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 intensity-based 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.
Figure 7 and
Figure 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
Figure 9 and
Figure 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.