Skip to main content
Poultry Science logoLink to Poultry Science
. 2025 Jul 3;104(11):105530. doi: 10.1016/j.psj.2025.105530

Research note: bright-field automated identification method for eggshell moist spots detection

Jiajie Yang 1, Lin Xuan 1, Guoxuan Huang 1, Anning Huang 1, Qi liu 1, Guiyun Xu 1, Jiangxia Zheng 1,
PMCID: PMC12361819  PMID: 40803224

Abstract

Eggshell moist spots are a common eggshell defect that reduces consumer purchase acceptance of eggs. Current detection methods typically use single-sided dark-field imaging to assess the ratio of sum of spot areas to sum of shell area (RSS), but overestimate moist spot severity compared to consumer perception under natural lighting, leading to commercial waste. Therefore, accurate detection methods aligning with consumer visual perception are crucial for optimizing commercial egg grading. This study aimed to verify the representativeness of single-side imaging and to develop and validate a bright-field automated identification method to ensure the accuracy of RSS. 510 pink-shell eggs were detected. First, the symmetry of moist spots on eggshell was assessed. Results showed the distribution of moist spots on both sides of the image bounded by the long axis of the egg was significantly symmetrical for both under dark-field (r = 0.979, P < 0.001) and bright-field (r = 0.952, P < 0.001), confirming single-side imaging representativeness. Second, a bright-field automated method was established using optimized threshold, background subtraction, and feature filters. Comparison of the RSS by bright-field images (RSSb) and dark-field images (RSSd) revealed a significant difference (P < 0.001). This indicates that dark-field imaging could not accurately reflect the true RSS under bright-field conditions. The limitations of RSSd were further analyzed using segmented linear regression. The results showed that when the severity of eggshell moist spots was high, RSSd was greater than 7.12 %, which was significantly correlated with the RSSb (r = 0.969, P < 0.001). However, when the severity of eggshell moist spots was low, RSSd was less than 7.12 %, the correlation became smaller (r = 0.498, P < 0.001), and RSSd could not evaluate the true RSS. This meant that the old method based on dark-field images could not accurately reflect the degree of eggshell moist spots and bright-field image method should be used in future.

Keywords: Egg quality, Eggshell moist spots, Bright-field imaging, Automated identification, Segmented regression

Introduction

As eggs are stored, moisture gradually evaporates from the shell. When structural defects occur in the eggshell, water accumulates within the shell and forms darker spots on the surface (Talbot and Tyler, 1974). These watery spots on the eggshell surface are called moist spots. They are also named eggshell translucent spots because they appear as bright areas under dark-field candling conditions (Xuan and Zheng, 2024). Moist spots usually develop after 24 hours and stabilize after 120 hours (Talbot and Tyler, 1974). Moist spots are influenced by genetic, nutrition, disease and environmental factors and are more common in summer. Consumers prefer eggs without moist spots and show reluctance toward purchasing and using eggs with moist spots (Chen et al., 2023), therefore accurate eggshell moist spot detection is crucial for egg grading.

Eggshell moist spot has been studied for nearly a century, and its detection methods have evolved from subjective visual grading to complex automatic quantification methods. Early research by Holst et al. (1932) established a basic three-class classification system based on shell texture, indicating that there was no correlation between eggshell thickness and moist spots. The moist spot assessment methods relies primarily on candling the eggs in a dark environment, which causes the spots to stand out due to their high translucency (Talbot and Tyler, 1974). Various subjective scoring systems have emerged over time, such as the 0-3 scale used by Holst et al. (1932) and the more refined 0-5 scale developed by Shi et al. (2023), where multiple assessors evaluate eggs using a reference sample to improve reliability. To address the inherent subjectivity and labor-intensive nature of these methods, Wang et al. (2019) proposed a quantitative methods based on the ratio of sum of spot areas to sum of shell area (RSS), which was based on the grayscale recognition method required manual measurement and selection of moist areas. Xuan et al. (2023) further provided an automated identification method implementing a machine learning algorithms. The proposed method uses multiple feature extraction techniques with a random forest classifier to automatically segment and quantify moist regions, enabling efficient and consistent assessment of eggshell moist spots. The automated method processes illuminated egg images through a series of computational steps, including Gaussian blur application, contour enhancement, and feature extraction. These features served as classification criteria for moist spot identification, and finally the RSS value was calculated as a quantitative indicator of moist spot severity. The above detection methods all used dark-field images of a single side of the eggs.

The primary goal of moist spot detection and grading is to identify and improve consumer-visible moist spot defects. However, there were inconsistencies in the RSS results of dark-field and bright-field imaging. Sometimes eggs that look normal in bright-field (natural light) were mistaken for moist spot eggs in dark-field imaging grading detection, leading to unnecessary product downgrading and commercial waste. Moist spot detection methods need to be improved to simulate and reflect the real situation under bright-field. Furthermore, the symmetry of the eggshell moist spot distribution remains unclear. To address these key issues, we proposed a bright-field automated identification method and compared the detection results under two imaging conditions, ultimately providing a more practical and economical method for eggshell quality assessment.

Materials and methods

Egg collection and treatment

The experiment was conducted at the Experimental Unit for Poultry Genetic Resources and Breeding of China Agricultural University (Beijing, China). A total of 510 pink-shell eggs were collected from Jingfen-6 laying hens at 58 weeks of age and stored at a temperature of 20 to 25°C and relative humidity of 30 to 40 %.

Eggshell moist spots measurements

All eggs were imaged under bright-field and dark-field conditions after 120 h of storage. The eggshell contour and surface features were captured using an industrial camera placed vertically at a distance of 10 cm. In dark-field imaging, images were taken using transmitted light from a point light source located at the bottom of the egg. For bright-field imaging, a ring-shaped LED cold light source positioned 10 cm above the egg was used for illumination. Images of both sides were taken (front and back) to assess the symmetry of moist spot on the eggshell.

Image processing was performed using ImageJ (version 1.54f, National Institutes of Health, USA), using a modified version of the dark-field automated identification method originally developed by Xuan et al. (2023). For dark-field imaging, egg outline was extracted using Huang thresholding, followed by targeted background subtraction, where a slightly scaled Region of Interest (ROI) (98 % of original size) with a Gaussian blur (sigma = 2) was subtracted from the original image. The resulting image was then enhanced by contrast amplification (multiplication factor of 15) to clearly distinguish the moist spots from the background. For bright-field imaging, we modified this method by employing a minimum thresholding method to extract contours and applying a larger scaling factor (0.3 compared to 0.5 for dark-field) to enhance the detection of subtle spots.

The processed images were then analyzed using the Trainable Weka Segmentation plugin with different feature extraction configurations for each imaging condition. For dark-field images, five main features were used: Gaussian blur for noise reduction, Hessian matrix for detecting structural boundaries, Difference of Gaussians for edge enhancement, Mean filter for local intensity averaging, and Entropy for texture feature extraction. For bright-field images, the feature set was expanded to include additional filters such as Sobel filter, Minimum, Maximum, Median, Anisotropic diffusion, Bilateral, Kuwahara, and Neighbors filters to better detect less obvious moist spots visible under bright-field conditions. In both cases, the features were input into a FastRandomForest classifier (1000 trees, depth 15), configured to classify each pixel as either a moist spot or a normal eggshell region, thus creating a binary mask of the detected spots. The RSS by dark-field images (RSSd) and the RSS by bright-field images (RSSb) were calculated. RSS was used as a standard to assess the severity of moist spots on eggs. The higher the RSS value, the more obvious the moist spots on the eggshell.

Statistical analysis

Statistical analyses were conducted using R (version 4.4.3, R Foundation for Statistical Computing, Vienna, Austria). Data processing and modeling were primarily performed using packages including 'segmented', 'boot', and 'caret'. Various mathematical models were constructed to describe the relationships between RSSb and RSSd. The models were compared based on R² and adjusted R² values to select the optimal model. Paired t-test and correlation analysis were used to assess differences and relationships between moist spots on the front and back of eggs. For clarity of presentation, all RSS values and model parameters in this paper were expressed as percentages (ranging from 0 % to 100 %).

Results and discussion

Correlation analysis showed strong positive correlations between front and back both RSSd (r = 0.979, P < 0.001) and RSSb (r = 0.952, P < 0.001). Paired t-test analysis showed that there was no statistically significant difference in the mean RSSd or RSSb between front and back sides (P > 0.05). The analysis demonstrated that the distribution of moist spots on the front and back of the eggshell under the two imaging conditions was highly consistent. Current moist spot assessment methods typically relied on single-side imaging (Wang et al., 2019; Shi et al., 2023), so this study determined the representativeness of this method by investigating the symmetry of moist spot distribution on the front and back of eggs. Zhang et al. (2021) found that the moist spots were asymmetrically distributed along the short axis of eggshell. The current study showed that the moist spots were symmetrical around the long axis. There were no significant differences between the front and back, indicating that single-side perfectly represented the entire eggshell.

For bright-field imaging, we developed an automated bright-field identification method that was differed from the dark-field method. The Minimum threshold method was used to extract the eggshell contour. This method constructed a dynamic threshold by identifying the minimum pixel value within multiple local windows, making it particularly suitable for processing images with uneven brightness under bright-field illumination and able to more effectively distinguish between subtle moist spots and the background on the eggshell surface. A larger scaling factor (0.3) was used for background subtraction, a technique that scales the original image down, applies a Gaussian blur, and then expands it back to its original size before subtracting the background from the original image, effectively enhancing local contrast and making tiny moist spots visible. After image processing, the analysis pipeline integrated eight additional filters (Sobel, Minimum, Maximum, Median, Anisotropic diffusion, Bilateral, Kuwahara, and Neighbors filters), which together enhanced spot boundaries, reduced noise while preserving details, and increased the detection sensitivity of subtle brightness changes. This multi-filter approach enabled the FastRandomForest classifier to accurately identify moist features visible under bright-field, thereby achieving an egg quality assessment that was closer to consumer perception.

The differences in the appearance of moist spots on the eggshell between bright-field and dark-field imaging was demonstrated in Fig. 1. As shown in Fig. 1A and B, eggs with lower RSSd values (0.23 % and 5.16 %) had little or no visible moist spots under bright-field conditions, but moist spots could be detected under dark-field imaging. Correlation analysis showed that there was a significant correlations (P < 0.001) among RSSb and RSSd. The correlation coefficient between RSSd and RSSb was r = 0.874. These findings complemented recent micro-CT studies (Xuan et al., 2023), which revealed that eggs with severe moist spots had significantly different pore structures, characterized by higher pore volume ratios and rounder pore morphology, contributing to moist spot formation through altered moisture retention.

Fig. 1.

Fig 1

Relationship between RSSb and RSSd in eggshells. (A-B) Different severities of moist spots under bright-field and dark-field imaging. Bright-field and dark-field images for each egg represent the same side of the egg. (C) Scatter plot showing the correlation between RSSb and RSSd. The solid gray line indicates the linear regression fit, while the solid dark line represents the segmented linear regression fit. The vertical dashed teal line marks the breakpoint identified by the segmented model at RSSd = 7.12 %. Regression equation and adjusted R² value were displayed on the plot. Abbreviations: RSS, ratio of sum of spot areas to sum of shell area; RSSb, RSS by bright-field images; RSSd, RSS by dark-field images.

To quantify the relationship between bright-field and dark-field moist spot measurements, seven mathematical models were fitted to the data (Table 1): linear, segmented linear, exponential, power, sigmoid, quadratic, and threshold models. For the relationship between RSSb and RSSd, the linear regression model (adjusted R² = 0.764), which assumed a simple linear relationship between variables, provided a relatively poor fit, suggesting that the relationship was nonlinear in nature. In contrast, several nonlinear models showed better performance, among which the segmented linear regression model provided the best fit (adjusted R² = 0.938).

Table 1.

Comparison of different mathematical models for eggshell moist spot detection.

Models R2 Adjusted R2
Segmented linear regression 0.938 0.938
Threshold function 0.933 0.933
Sigmoid function 0.932 0.932
Power function 0.922 0.922
Quadratic polynomial regression 0.918 0.918
Exponential function 0.794 0.793
Linear regression 0.765 0.764

Abbreviations: RSS, ratio of sum of spot areas to sum of shell area; RSSb, RSS by bright-field images; RSSd, RSS by dark-field images.

Fig. 1C shows the scatter plot of RSSb versus RSSd for both linear regression (solid gray line) and segmented linear regression fits (solid dark line). The segmented model identified a breakpoint at RSSd = 7.12 %. The slope was 0.07318 when RSSd ≤ 7.12 % and 0.6743 when RSSd > 7.12 %. It was noteworthy that the distribution pattern of RSSd values observed in the present study was consistent with the results reported by Wang et al. (2019).

To validate the reliability of the identified breakpoint, different statistical methods were used to calculate the confidence intervals for the breakpoints. The 95 % confidence interval obtained by the Wald method was −6.831 % to 21.064 %, the interval obtained by the profile likelihood methods was 6.832 % to 7.401 %, while the interval obtained by the bootstrap resampling (1000 iterations) using percentile and Bias-Corrected and accelerated (BCa) methods were 6.250 % to 7.791 % and 6.248 % to 7.791 %, respectively. The Davies test confirmed the significance of the breakpoint (P < 0.001). The coefficient of variation for the breakpoint estimate was 5.3 %, indicating that the estimated threshold had high stability.

Through systematic validation, the moist spots detection threshold RSSd = 7.12 % was determined and quantified through analysis, as shown by the vertical green dashed line in Fig. 1C. Correlation analysis further verified the eggshell moist spots detection threshold effect. Eggs with RSSd values above the threshold (n = 51) showed a strong positive correlation (r = 0.969, P < 0.001), whereas eggs below the threshold (n = 459) showed a weaker correlation (r = 0.498, P < 0.001). When RSSd was below this threshold, RSSb changed little with RSSd, which was reflected in the shallow slope (0.07318) of the segmented regression line, indicating that RSSb increased minimally with RSSd below the threshold. Conversely, the slope increased sharply to 0.6743 when RSSd > 7.12 %, suggesting a much stronger relationship where increases in RSSd correspond to substantial increases in RSSb above the threshold. This change in slope highlighted the threshold effect, where dark-field measurements below 7.12 % poorly reflect bright-field appearance, while those above show increasing correspondence. Traditional dark-field-based grading strategies typically classify eggs with RSSd values below 0.5 % as excellent grade and eggs with RSSd values of 0.5 - 7 % as good grade. However, our findings demonstrate that from the consumer perspective under natural lighting conditions, these two grades are indistinguishable, as both categories show minimal RSSb values with weak correlation to their RSSd measurements. This discrepancy indicates that dark-field imaging leads to overestimation of moist spot severity and unnecessary commercial downgrading, while the bright-field automated identification method could better match the real eggshell moist spots visible to consumers.

The moist spots under dark-field imaging were not visible under bright-field imaging. This might be related to the multi-level pore structure of eggshells described by Zhou et al. (2011). Using electron microscopy, Zhou et al. revealed a three-level hierarchical pore system: nano-scale pores (between nano-rods and primary nano-particles), submicro-scale pores ("bubble pores"), and micro-scale pores (opening of "gas pores"), with eggshells primarily regulating gas conduction by adjusting the sizes and numbers of submicro-scale bubble pores, suggesting that punctate and blocky moist spots might represent defects at different levels of the eggshell structure. The differential detection of punctate and blocky moist spots reflects potential variations in shell microstructure and moisture accumulation patterns (Talbot and Tyler, 1974; Xuan and Zheng, 2024).

Moist spots were generally more severe in pink-shelled eggs than in brown-shelled eggs (Zhang et al., 2021). In recent years, the market for pink-shelled eggs has continued to grow and has reached nearly 40 % of total egg consumption (Zeng, 2023). Given that consumers generally have negative attitudes toward eggs with moist spots, it is particularly important to solve the problem of moist spots in laying hens. The bright-field automated identification method addressed the mismatch between consumers’ bright-field based moist spots perception and dark-field based laying hen production phenotype detection. And it requires only conventional LED lighting equipment and can be readily integrated into existing egg grading systems.

The new method avoided the overestimation of dark-field detection results, which prevented producers from unnecessarily downgrading or rejecting eggs that were perfectly acceptable to consumers, thereby reducing unnecessary economic losses in commercial grading systems while improving the accuracy and efficiency of moist spot eggshell detection. In addition, this study demonstrated the discrepancy in visible moist spots between bright-field and dark-field conditions. This difference might be related to varying degrees of eggshell pore abnormalities at different structural levels, although the specific underlying mechanisms warranted further investigation. Furthermore, understanding how this observed discrepancy relates to other critical eggshell quality parameters, such as eggshell thickness, eggshell color, and potentially even internal quality attributes, remained an important avenue for future research.

In this study, we developed a bright-field automated identification method for eggshell moist spots visible to consumers. Analysis revealed strong correlations between the front and back sides for eggshell moist spots under both dark-field and bright-field conditions, confirming the representativeness of single-side imaging. Through comparative analysis of bright-field and dark-field data, we determined a moist spots detection threshold at RSSd = 7.12 %, demonstrating the discrepancy between dark-field and bright-field detection methods. This method provides egg producers with a practical tool to detect eggshell moist spots from a bright-field perspective similar to consumers, to avoid unnecessary commercial downgrading while maintaining quality standards that align with consumer expectations.

Disclosures

The authors declare that they have no known competing financial interests or personal relationships that could appear to influence the work reported in this paper.

Acknowledgments

This work was financially supported by the National Key Research and Development Program of China (2022YFD1300100), the China Agriculture Research Systems (CARS-40), the National Key Research and Development Program of China (2021YFD1200803) and the Natural Science Foundation of Sichuan Province (Grant No. 2024NSFSC0389).

References

  1. Chen R., Jiang C., Li X., Shi X., Zhuang L., Zhou W., Zhou C., Xuan L., Xu G., Zheng J. Research on Chinese consumers’ shell egg consumption preferences and the egg quality of functional eggs. Poult. Sci. 2023;102 doi: 10.1016/j.psj.2023.103007. [DOI] [PMC free article] [PubMed] [Google Scholar]
  2. Holst W.F., Almquist H.J., Lorenz F.W. A study of shell texture of the hen’s egg. Poult. Sci. 1932;11:144–149. [Google Scholar]
  3. Shi X., Liang Q., Wang E., Jiang C., Zeng L., Chen R., Li J., Xu G., Zheng J. A method to reduce the occurrence of egg translucency and its effect on bacterial invasion. Foods. 2023;12:2538. doi: 10.3390/foods12132538. [DOI] [PMC free article] [PubMed] [Google Scholar]
  4. Talbot C., Tyler C. A study of fundamental cause of natural translucent areas in egg-shells. Br. Poult. Sci. 1974;15:197–204. [Google Scholar]
  5. Wang D.H., Chen H., Zhou R.Y., Huang C.X., Gao H.X., Fan B.L., Liu G.J., Ning Z.H. Study of measurement methods on phenotype of translucent eggs. Poult. Sci. 2019;98:6677–6683. doi: 10.3382/ps/pez539. [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Xuan L., Shi X., Xu G., Zheng J. Research note: three-dimensional microstructural basis for chicken eggshell translucency. Poult. Sci. 2023;102 doi: 10.1016/j.psj.2023.103149. [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Xuan L., Zheng J. Translucent eggs of laying hens: a review. Poult. Sci. 2024;103 doi: 10.1016/j.psj.2024.103983. [DOI] [PMC free article] [PubMed] [Google Scholar]
  8. Zeng L. PhD Diss. China Agricultural University; Beijing, China: 2023. Eggshell Color Evaluation and Study on N-glycosylation of Eggshell Matrix Protein. In Chinese. [Google Scholar]
  9. Zhang H.D., Zhao X.F., Ren Z.Z., Tong M.Q., Chen J.N., Li S.Y., Chen H., Wang D.H. Comparison between different breeds of laying hens in terms of eggshell translucency and its distribution in various ends of the eggshell. Poult. Sci. 2021;100 doi: 10.1016/j.psj.2021.101510. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Zhou J., Wang S., Nie F., Feng L., Zhu G., Jiang L. Elaborate architecture of the hierarchical hen’s eggshell. Nano Res. 2011;4:171–179. [Google Scholar]

Articles from Poultry Science are provided here courtesy of Elsevier

RESOURCES