AI egg scanners make poultry farms more humane

Machine Learning


Although eggs look simple from the outside, each egg contains valuable information about life, health, and future production. For hatcheries, that hidden information is important. A single egg may contain a healthy embryo, a dead embryo, an unfertilized yolk, or a chick that is killed after hatching.

Researchers at the University of Illinois at Urbana-Champaign are working to visualize this hidden world without breaking out of its shell. Their research uses near-infrared imaging, hyperspectral imaging, and machine learning to quickly and safely assess eggs. The goal is to help hatcheries increase productivity while reducing waste, disease risk, and animal welfare concerns.

The initiative could change the way the poultry industry handles millions of eggs. Rather than relying on time-consuming and labor-intensive tests, hatcheries may one day scan eggs automatically. Computer models can then identify which eggs are alive, which embryos are dead, and even which eggs contain male or female embryos.

See inside an egg without breaking it

Traditional egg inspection often requires breaking the egg or relying on visual inspection. Hatcheries typically use candlings, which shine a bright light on the eggs to check their development. Although convenient, candle treatment is time-consuming, relies on operator judgment, and can miss early problems.

The poultry industry handles millions of eggs. Rather than relying on time-consuming and labor-intensive tests, hatcheries may one day scan eggs automatically. (Credit: Shutterstock)

The Illinois team tested whether the imaging tool could do more. Hyperspectral imaging (HSI) captures hundreds of bands of light across the visible and near-infrared spectrum. These bands reveal subtle chemical and biological clues hidden within the egg.

Near-infrared spectroscopy (NIR) captures fewer bands but is less expensive. Useful information about shell strength, shell thickness and yolk ratio can be detected. Both methods allow researchers to study eggs without damaging them.

“With NIR and HSI, there is no need to destroy the eggs. You just scan the eggs and the machine learning model determines the necessary parameters,” said Mohamed Kamruzzaman, assistant professor of agricultural bioengineering.

Detection of non-viable embryos

In one recent study, researchers focused on fetal mortality in chickens. More than 10% of embryos can be lost in hatcheries, impacting profits, efficiency, and animal welfare. Dead embryos may also harbor bacteria, raising biosecurity concerns.

“If we can detect and remove them early in the incubation period, we can avoid biosecurity problems,” said lead author Wadud Ahmed.

The research team collected 300 chicken eggs from the university’s poultry farm and placed them in commercial incubators. They took hyperspectral images before and 4 days after hatching. After hatching, they determined which embryos were alive and which had died.

The researchers then trained a machine learning model to read spectral patterns associated with embryo survival. By the fourth day, the accuracy of the best model reached ~97%. After that, the test accuracy of the feature-selected model reached 98.7%.

Spectral characteristics of eggs producing live and dead embryos: (a) spectra of preincubated eggs from both groups, (b) average spectra of preincubated eggs, (c) spectra of eggs on day 4 of hatching, and (d) corresponding average spectra. (Credit: British Poultry Science)

The images showed clear biological differences. Live embryos absorbed more light in areas related to blood development, water balance, and energy use. Dead embryos appeared brighter across many wavelengths because they lacked normal angiogenesis and metabolism.

Why light patterns are important

The strongest signals appeared between 500 and 900 nanometers. Some bands reflect carotenoids in the yolk that support embryonic growth. Others reflected hemoglobin, an oxygen-carrying molecule that is tied to developing blood vessels.

Wavelengths around 750 and 773 nanometers were indicative of water and protein changes. The band around 837 nanometers reflected lipids that embryos use for energy. By combining these markers, the model was able to distinguish between viable and unsuccessful embryos.

The team also used explainable artificial intelligence to understand the model’s decisions. One important wavelength, 709 nanometers, is associated with hydration and tissue development. Another 545 nanometers reflected oxygen-rich blood formation.

This is important because hatcheries need more than black box predictions. They need a system they can trust, account for, and improve. By linking the model’s results to biology, the researchers made the technology even more useful for real-world adoption.

Efforts to kill male chicks

Another study focused on embryonic sex determination. In the egg industry, male chicks are often killed after hatching because they do not lay eggs and are therefore inefficient for meat production. Mr Ahmed said around 6 billion male chicks are culled around the world every year.

Principal component analysis (PCA) of eggs producing live and dead embryos: (a) PCA score plot before incubation, and (b) PCA score plot on day 4 of incubation. (Credit: British Poultry Science)

If we can identify the gender early, we may be able to prevent this behavior. If hatcheries knew which eggs contained male embryos before they were fully hatched, those eggs could be directed into edible eggs or food production. This could reduce animal welfare concerns and improve hatchery efficiency.

For this study, researchers scanned eggs before and during hatching. Each egg had a reference result, meaning the researchers knew whether the egg would later give birth to a male or female chick. The machine learning model then learned patterns associated with the embryo’s sex.

The system reached 75% accuracy on day zero, or early in culture. Although this is not yet sufficient for full commercial use, it shows clear promise. It has also been demonstrated that useful biological information may exist before visible development begins.

Determination of shell quality and egg characteristics

The researchers also studied shell strength, shell thickness, and yolk ratio. These properties are important for food quality, hatchability, and transportation safety. A weak shell can break easily, while poor shell properties can affect embryo survival.

Traditional shell testing is often destructive. For example, to measure shell strength, researchers typically need to crack open an egg. NIR spectroscopy offers a non-destructive option.

NIR has a lower cost than hyperspectral imaging and may be suitable for simpler measurements. HSI provides richer molecular details, making it suitable for complex tasks such as embryonic mortality and sex prediction.

Researchers have already made freely available NIR datasets on shell strength, shell thickness, and yolk ratio. We also plan to release the HSI dataset. This could help other scientists build more powerful models and accelerate progress across the field.

Confusion matrices of the PCA feature selection PLS-DA model for chick embryo mortality classification on day 4 of incubation: (a) Confusion matrix for validation set, (b) Confusion matrix for test set. (Credit: British Poultry Science)

Toward an automated hatchery system

For this technology to work in commercial hatcheries, it must be fast and automated. Kamruzzaman said the team is developing a system with a robotic arm that can separate the eggs after scanning.

“We are working on developing a system with a robotic arm that can separate eggs,” he said. “For example, after the machine learning model identifies eggs as male or female, the arm can remove male eggs.”

This type of system could potentially scan eggs on the production line. It can remove dead embryos early, separate eggs by gender, and classify eggs by shell quality. The result could be cleaner, faster, and more humane hatchery operations.

Challenges still remain. Hyperspectral systems can be expensive. Current image collection can take too long over high-speed commercial lines. Researchers need to test more breeds, egg colors, and hatchery conditions.

Still, early results are strong. These studies suggest that image processing and artificial intelligence may be able to reveal things through shells that are invisible to the human eye.

Practical implications of the research

This research could help hatcheries reduce losses by identifying dead embryos early. Removing these eggs sooner may reduce contamination risk and improve biosecurity. It also saves space, time and energy inside the incubator.

This approach could also reduce the need to cull male chicks after hatching. Improved sex prediction could allow hatcheries to change the induction of male eggs before the chicks are fully grown. This would create new uses for otherwise-waste eggs while tackling critical animal welfare issues.

For consumers, this technology has the potential to support safer and more reliable poultry production. For farmers, it could improve efficiency and reduce costs. For researchers, open datasets have the potential to accelerate better imaging models across agriculture, food safety, and animal science.






Source link