Introduction

Egg is one of the most important foods because of its healthy function to people. It is rich in protein, lipid and carbohydrates, and it also contains mineral elements and vitamins1. In food industry, eggs can be used for making cakes, breads, ice creams, etc. Also, eggs have therapeutic and diagnostic functions2. However, eggs can often be damaged due to their fragile eggshells. According to a previous study, cracked eggs made up from 6% to 8% of the total eggs production3. The eggshell is a natural protection for egg, and thus it is significant to get a high value of eggshell strength4. The eggshell strength, reflecting the resistance ability to damage, can protect eggs when they are in collecting, packaging, storage and transportation. It can be found the higher the eggshell strength, the stronger resist to damage. Cracked eggs can finally cause economic loss in two ways, one is that they cannot be sold at a high price, another is cracked eggs may raise the risk of bacterial contamination to intact eggs, which can even produce food quality and safety problems5,6,7. Therefore, cracked eggs should be identified and taken out before they are sent to the market. Egg color is also an important factor in egg industry. It can affect people’s choice due to the regional or national cultural preferences for different colors, directly affecting eggs’ production8,9. Thus, the determination of egg color and eggshell strength is of importance.

Hyperspectral imaging technique can produce spectral information as well as spatial information for objectives at the same time. A spatial hyperspectral cube can be generated when one sample was scanned by the hyperspectral imaging camera. The hyperspectral cube (hyperspectral image) contains a series of images covering the whole wavelengths, and each pixel for one image has both spectral and spatial information10. Because of this feature, it can be used to detect external characteristics, such as fruit defect11,12, color13 and sugar beet disease14, and internal information, such as moisture content10 and other chemical indexes15,16. By studying spectral features at different wavelengths, it may be possible for color and eggshell strength determination and cracked eggs identification, which can be seen in many previous studies. Wu et al. predicted beef color (L*, a* and b*) using hyperspectral imaging technique17. Wu et al. investigated color distribution in salmon fillet by using hyperspectral imaging18. Iqbal et al. detected the color in turkey hams by hyperspectral imaging method19. Huang et al. studied color feature in vegetable soybean during drying based on hyperspectral imaging20. All of these studies showed the feasibility of hyperspectral imaging technique for color determination.

This study investigated the determination of egg color and eggshell strength values and detection of cracked eggs using hyperspectral imaging technique. The specific objectives of this study were: (1) to detect egg color and eggshell strength values by using spectral information; (2) to select significant wavelengths for predicting color and eggshell strength values and (3) to develop a technique to classify intact and cracked eggs based on full and selected wavelengths, respectively.

Results and Discussion

Spectral feature

Spectral reflectance curves of all chicken eggs were shown in Fig. 1. It is obviously there was some noise at the beginning of the wavelengths. The general trend of the spectral reflectance curves for different eggs were very similar. In order to classify intact and cracked eggs quantitatively, the classification model should be considered using the information from spectral curves. In a previous study, wavelengths between 570 and 750 nm were used to detect egg freshness21. In order to reduce the noise influence, wavelengths from 450 to 950 nm were used in this study.

Figure 1
figure 1

Spectral reflectance curves of samples.

Color and eggshell strength values

The minimum, maximum, mean and standard deviation of L*, a* and b* values for cracked and intact eggs can be found in Fig. 2(a–c). In this figure, the L*, a* and b* values for both intact and cracked eggs were very similar. This is because the eggs which were used to create crack were randomly selected from the total eggs. However, for each sample, it has a different and specific color feature. The eggshell strength values of intact eggs were higher than those of cracked ones as shown in Fig. 2(d). This is because cracked eggs have more fragile eggshells, directly resulting in lower values of eggshell strength. In order to avoid bias in subset partition, all samples were arranged in an ascending order according to the Y variables (L*, a*, b* and eggshell strength, respectively) for each model22. Then one egg was selected from every three ones consecutively, resulting in the calibration set and prediction set at a ratio of 2:1. No single sample was used in both calibration and prediction sets at the same time. Thus, there were 68 samples in the calibration set and 34 ones in the prediction set. The statistical values of L*, a*, b* and eggshell strength for both sets can be seen in Table 1. For each parameter, a broad range values can be found in the two sets. Therefore, the samples in both sets can represent the range of all possible values, which contributed to develop an accurate and robust model23.

Figure 2: Distribution of color (L*, a* and b*) and eggshell strength values.
figure 2

(a) L*, (b) a*, (c) b* and (d) eggshell strength.

Table 1 Color (L*, a* and b*) and eggshell strength values in calibration and prediction sets.

PLS models based on full wavelengths

Four different partial least squares (PLS) models based on the full spectral wavelengths were developed for predicting L*, a*, b* and eggshell strength, respectively. Performance of each prediction model was evaluated according to the values of correlation coefficient of calibration (rc), correlation coefficient of prediction (rp), root mean square error of calibration (RMSEC) and root mean square error of prediction (RMSEP). The results were shown in Table 2. Each model obtained a good result with high values of rc and rp and low values of RMSEC and RMSEP. The values of rp were 0.788 for L*, 0.810 for a*, 0.766 for b* and 0.835 for eggshell strength, respectively. The results proved that spectral information could be used to determine color and eggshell strength values for chicken eggs.

Table 2 Prediction results of PLS models for color (L*, a* and b*) and eggshell strength values.

Significant wavelengths

In this study, regression coefficient (RC) method was used to select the effective wavelengths. The size of the coefficients gives an indication of which wavelengths were important for predicting Y values. It can be seen in Fig. 3(a–d) that some peaks and valleys with high absolute values were identified as the optimal wavelengths. The horizontal lines showed the upper and lower cutoff threshold values. As a result, five wavelengths were selected for L* (544, 568, 596, 649 and 672 nm), three ones for a* (543, 664 and 950 nm), four ones for b* (458, 615, 649 and 936 nm) and eight ones for eggshell strength (450, 456, 624, 649, 687, 741, 754 and 816 nm). The numbers of these selected wavelengths only took up 1.26%, 0.76%, 1.01% and 2.02% of that of the full spectral wavebands, respectively. They were then used to replace the full wavelengths for predicting L*, a*, b* and eggshell strength values.

Figure 3: Effective wavelengths selected by RC method.
figure 3

The horizontal lines show the upper and lower cutoff threshold values. (a) L*, (b) a*, (c) b* and (d) eggshell strength.

Prediction results based on selected wavelengths

Based on the selected wavelengths, four different RC-PLS models were established for L*, a*, b* and eggshell strength, respectively. Each model obtained a good result with high values of rc and rp and low values of RMSEC and RMSEP as can be seen in Table 3. Though the results based on selected wavelengths did not change too much compared with the corresponding values based on full spectral wavelengths, the number of input variables was fewer. The fewer input variables will be helpful to develop a multispectral imaging detection system. Also, it can be found the rp values for b* and eggshell strength in RC-PLS models were even a little higher than those in PLS models. Thus, it proved the selected wavelengths can be equal to or even more efficient than full spectral wavelengths24. This may because the whole wavelengths contained too much redundant information that directly affected the prediction performance. It demonstrated that RC method could be used to identify the useful wavelengths and abandon the uninformative ones.

Table 3 Prediction results of RC-PLS models for color (L*, a* and b*) and eggshell strength values.

Classification based on spectral information

This study was then carried out to classify intact and cracked chicken eggs based on spectral information. Partial least squares-discriminant analysis (PLS-DA) model was firstly established to identify cracked samples. The threshold was set as ±0.3. RC method was also carried out to select the useful wavelengths for the classification model, and eighteen wavelengths (451, 457, 469, 475, 497, 573, 633, 701, 800, 804, 816, 821, 848, 884, 915, 925, 938 and 942 nm) were identified (shown in Fig. 4). They were then used to substitute the whole spectral wavelengths for building RC-PLS-DA model. The results of both PLS-DA and RC-PLS-DA models were shown in Table 4. The PLS-DA model performed excellently with the total classification accuracy (CA) of 100% in the calibration set and 97.06% in the prediction set. It also obtained a good result with the total CA of 95.59% in the calibration set and 88.24% in the prediction set for RC-PLS-DA model. Though RC-PLS-DA model performed a little worse compared with PLS-DA model, the result was acceptable. Also, the number of the input variables decreased largely, which only accounted for 4.55% of the whole wavebands. The results demonstrated that spectral reflectance information extracted from the hyperspectral images could be used to detect cracked chicken eggs effectively. Based on hyperspectral imaging technique, intact and cracked eggs can be classified effectively and non-destructively. A multispectral imaging detection system can be developed for identifying cracked eggs, which makes the detection on-line. It not only saves the cost but also speeds up the detection efficiency. When the cracked eggs are identified and taken out, there is no contamination for intact eggs, which can extend the eggs’ shelf lives and also increase the profit.

Figure 4: Effective wavelengths selected by RC method for classification.
figure 4

The horizontal lines show the upper and lower cutoff threshold values.

Table 4 Classification results of PLS-DA and RC-PLS-DA models.

Conclusions

The results showed that hyperspectral imaging technique could be used as an accurate and non-invasive method to predict color and eggshell strength values and detect cracked eggs. PLS models were effective for the prediction of color and eggshell strength parameters, and PLS-DA models performed excellently for the identification of cracked eggs. The numbers of the selected wavelengths for L*, a*, b*, eggshell strength features and cracked samples classification only accounted for 1.26%, 0.76%, 1.01% , 2.02% and 4.55% of that of the whole wavebands. In full wavelengths-based models (PLS), the rp values for each feature were 0.788, 0.810, 0.766 and 0.835, respectively. The overall classification result was 97.06% in PLS-DA model. While the prediction results were 0.771, 0.806, 0.767 and 0.841 for the four features using RC-PLS models, and the CA was 88.24% in RC-PLS-DA model. The results based on the selected wavelengths were quite similar with those acquired by the full spectral wavelengths, which was consisted with two previous studies13,25. The wavelengths obtained in this study were useful for developing a multispectral imaging system in egg industry. In further studies, more samples need to be used for building more accurate and robust models. Also, other wavelength selection methods should be studied.

Materials and Methods

Samples

The eggs (fresh local eggs,) were purchased from the supermarket in China. The contamination on the surface were cleaned and then kept in the refrigerator at 4 °C. In our daily lives, most of the cracked eggs are generated in collecting, storage, transportation, as they are easily broken when contacting with other hard objectives. Thus, in order to imitate the cracked eggs generated in the real daily life, egg cracks were created by slightly hitting the experiment desk in this study. The structure diagram of the hitting device can be seen in Fig. 5. Finally, fifty-one intact and fifty-one cracked eggs were obtained for study.

Figure 5
figure 5

Structure diagram of the hitting device.

Hyperspectral imaging system and operation platform

A laboratory hyperspectral imaging system, which covers the spectral region from 380 to 1023 nm, was used in this study. The schematic diagram of the hyperspectral imaging system can be seen in Fig. 6. It consists of an imaging spectrograph (V10E, Specim, Finland), a charge coupled device (CCD) camera (C8484-05, Hamamatsu City, Japan), a lens (OLE-23), two light sources (Oriel Instruments, Irvine, USA) provided by two 150W quartz tungsten halogen lamps, a conveyer and a computer. The spectral resolution is 2.8 nm, and the area CCD array detector of the camera has 672 × 512 (spatial × spectral) pixels. All samples were scanned by the camera line by line. The ENVI 4.7 (Research System Inc., Boulder, Co., USA), MATLAB R2009a (The Math Works Inc., Natick, MA, USA) and Unscrambler V9.7 (CAMO Process AS, Oslo, Norway) software were used in this study.

Figure 6
figure 6

Schematic diagram of the hyperspectral imaging system.

Image acquisition and correction

Before images acquisition, the exposure time, moving speed and vertical distance between the lens and samples should be adjusted in order to obtain the hyperspectral image without distortion and overexposure26. Finally, the exposure time was set as 0.13 s, the moving speed was 2.1 mm/s, and the vertical distance between the lens and sample was 40.2 cm. Then a white Teflon board (CAL-tile 200, 200 mm × 25 mm × 10 mm) with the reflectance of about 99% was scanned firstly, and a dark image with the reflectance of about 0% was acquired by covering the camera lens with its cap and turning off the light. Each egg was placed on the moving conveyor to be scanned line by line. For cracked samples, the cracks were oriented to the hyperspectral imaging camera. Finally, the hyperspectral images with the spectral wavelengths from 380 to 1023 nm were acquired. Each hyperspectral image had 672 pixels in the spatial dimension and 512 bands in the spectral dimension. Once the raw hyperspectral image was generated, it should be corrected based on the dark and white images according to equation (1).

where Icorrected is the corrected hyperspectral image, Iraw is the raw hyperspectral image, Idark is the dark image, and Iwhite is the white image.

Color and eggshell strength measurement

The three color values (L*, a* and b*) were measured by the colorimeter (Konica Minolta, CR-400, Japan) with a standard C illuminant. Before color acquisition, the colorimeter should be calibrated by a standard white calibration plate. The colorimeter should totally cover the detection area of the sample, otherwise, color features of other objectives around the sample might be acquired, which made the result incorrect. The CIELAB color scale, which is a three dimensional cube color space, can represent the three color parameters (L*, a* and b*) precisely27. Eggshell strength was determined by the egg shell force gauge (ESFG-1, Nanjing Wanma Uitrasonic Motors Co., Ltd, China). When the egg was put on the plate, a probe would move down. It didn’t stop until the egg was broken. Then, the value shown on the screen was the eggshell strength. The unit of eggshell strength is N.

Models and evaluation index

PLS models were built to predict the color and eggshell strength values in this study. This method is very effective in predicting collinear variables, and has been used in many previous studies28,29,30. The prediction result is acquired by extracting a set of orthogonal factors, which contain most of the useful information31. PLS method can also be used for discrimination analysis in the form of PLS-DA. This method can explain differences between overall class properties, thus, the interpretation becomes more complicated with the class number increasing32. PLS-DA models were established for identifying the cracked eggs in this study. Both PLS and PLS-DA models were calculated using Unscrambler V9.7 software. Performance of prediction models were evaluated according to the values of rc, rp, RMSEC and RMSEP. Excellent prediction models should have high values of rc and rp, low values of RMSEC and RMSEP33. The performance of classification model was determined by CA value, which should be between 0% and 100%. The higher the CA value, the better the classification model. The equations for r and RMSE could be defined as follows:

where is the measurement value of the sample i; is the average value of ; is the predicted value of the sample i; is the average value of ; is the number of samples.

Regression coefficient

In order to improve the prediction performance and simplify the model, effective wavelengths were then selected. These selected wavelengths aimed at identifying a small subset of spectral features to replace the full spectral wavelengths. Selected wavelengths can produce results that a better or identic to results obtained using the whole wavelengths24. RC method was applied to select the useful wavelengths in this study. This method is very efficient for selecting key wavelengths and has been used in many previous studies34,35. In RC algorithm, the high positive and negative peaks represent the wavelengths at these points contain the most effective information36. The RC algorithm was operated in Unscrambler 9.7 software.

Experiment design

All samples were scanned by the hyperspectral imaging system firstly. Then the three color values (L*, a* and b*) were measured by the colorimeter, and the eggshell strength was determined by the egg shell force gauge. Spectral reflectance information was extracted from the corrected hyperspectral image and treated as the independent variable (X variable). PLS models were established to predict the three color parameters and eggshell strength value. The significant wavelengths were selected by RC method. Based on these selected wavelengths, RC-PLS models were built for the prediction of color and eggshell strength values. In this study, PLS-DA and RC-PLS-DA models were then applied to detect cracked chicken eggs.

Additional Information

How to cite this article: Xie, C. and He, Y. External characteristic determination of eggs and cracked eggs identification using spectral signature. Sci. Rep. 6, 21130; doi: 10.1038/srep21130 (2016).