Every year millions of fluffy newly hatched chicks are shredded to death because they are male. In a bid to stop this, scientists in Germany are trying to find a way to work out their sex before they emerge from their shells.

Male chicks are discarded after hatching because they cannot lay eggs and their meat is not popular. To get rid of the males, people are employed as "chicken-sexers". After splitting the females from the males, the latter are killed. Footage released by animal welfare group Viva! in 2010 showed them on a "conveyor belt of death", with some being gassed and others being thrown into an electronic mincer.

In the UK gassing is the most common method used, but in other countries shredding is more common. Some are also crushed to death and used as animal feed.

However, Gerald Steiner and colleagues from Dresden University Clinic have found a way to work out the sex of chicks before they hatch, meaning they can be disposed of before they can feel pain. They do this using a technique called spectroscopy, AFP reports. This uses scattered light to look at blood vessels to work out the sex of the embryos. This can be done when blood vessels have formed, but before the nerve cells: "So they can't feel pain," Steiner said.

"To the naked eye, we can't see the difference (between male and female embryos) but the computer can, if it's programmed to do so." The team say they now have an accuracy rate of about 95%, but say there are still big obstacles to overcome. The method used would need to be automated and carried out on a large scale.

But the team are hopeful it will one day be used in the farming industry instead of gas or mincers. A Dresden-based start-up is currently working to develop the machines needed to carry out chicken sexing.