Researchers design AI system to diagnose pain levels in sheep

May 31, 2017, University of Cambridge
Left: Localized facial landmarks. Right: Normalized sheep face marked with feature bounding boxes. Credit: University of Cambridge

The researchers have developed an AI system which uses five different facial expressions to recognise whether a sheep is in pain, and estimate the severity of that pain. The results could be used to improve sheep welfare, and could be applied to other types of animals, such as rodents used in animal research, rabbits or horses.

Building on earlier work which teaches computers to recognise emotions and expressions in human faces, the system is able to detect the distinct parts of a 's face and compare it with a standardised measurement tool developed by veterinarians for diagnosing pain. Their results will be presented today (1 June) at the 12th IEEE International Conference on Automatic Face and Gesture Recognition in Washington, DC.

Severe pain in sheep is associated with conditions such as foot rot, an extremely painful and contagious condition which causes the foot to rot away; or mastitis, an inflammation of the udder in ewes caused by injury or bacterial infection. Both of these conditions are common in large flocks, and early detection will lead to faster treatment and . Reliable and efficient pain assessment would also help with early diagnosis.

As is common with most animals, facial expressions in sheep are used to assess pain. In 2016, Dr Krista McLennan, a former postdoctoral researcher at the University of Cambridge who is now a lecturer in animal behaviour at the University of Chester, developed the Sheep Pain Facial Expression Scale (SPFES). The SPFES is a tool to measure pain levels based on of sheep, and has been shown to recognise pain with high accuracy. However, training people to use the tool can be time-consuming and individual bias can lead to inconsistent scores.

In order to make the process of pain detection more accurate, the Cambridge researchers behind the current study used the SPFES as the basis of an AI system which uses machine learning techniques to estimate pain levels in sheep. Professor Peter Robinson, who led the research, normally focuses on teaching computers to recognise emotions in human faces, but a meeting with Dr McLennan got him interested in exploring whether a similar system could be developed for animals.

"There's been much more study over the years with people," said Robinson, of Cambridge's Computer Laboratory. "But a lot of the earlier work on the faces of animals was actually done by Darwin, who argued that all humans and many animals show emotion through remarkably similar behaviours, so we thought there would likely be crossover between animals and our work in human faces."

According to the SPFES, when a sheep is in pain, there are five main things which happen to their faces: their eyes narrow, their cheeks tighten, their ears fold forwards, their lips pull down and back, and their nostrils change from a U shape to a V shape. The SPFES then ranks these characteristics on a scale of one to 10 to measure the severity of the pain.

"The interesting part is that you can see a clear analogy between these actions in the sheep's faces and similar facial actions in humans when they are in pain - there is a similarity in terms of the muscles in their faces and in our faces," said co-author Dr Marwa Mahmoud, a postdoctoral researcher in Robinson's group. "However, it is difficult to 'normalise' a sheep's face in a machine learning model. A sheep's face is totally different in profile than looking straight on, and you can't really tell a sheep how to pose."

To train the model, the Cambridge researchers used a small dataset consisting of approximately 500 photographs of sheep, which had been gathered by veterinarians in the course of providing treatment. Yiting Lu, a Cambridge undergraduate in Engineering and co-author on the paper, trained the model by labelling the different parts of the sheep's faces on each photograph and ranking their pain levels according to SPFES.

Early tests of the model showed that it was able to estimate pain levels with about 80% degree of accuracy, which means that the system is learning. While the results with still photographs have been successful, in order to make the system more robust, they require much larger datasets.

The next plans for the system are to train it to detect and recognise sheep faces from moving images, and to train it to work when the sheep is in profile or not looking directly at the camera. Robinson says that if they are able to train the system well enough, a camera could be positioned at a water trough or other place where sheep congregate, and the system would be able to recognise any sheep which were in . The farmer would then be able to retrieve the affected sheep from the field and get it the necessary medical attention.

"I do a lot of walking in the countryside, and after working on this project, I now often find myself stopping to talk to the sheep and make sure they're happy," said Robinson.

Explore further: New review article suggests sheep milk may be the next functional dairy food

Related Stories

Farmers can spot lame sheep, but fail to prevent footrot spread

October 14, 2008

Sheep farmers are highly able to spot even mildly lame sheep, but many do not take steps to prevent the spread of lameness in their flocks by catching and treating these animals. A study in the open access journal BMC Veterinary ...

Sheep with scrapie found in Japan

April 14, 2011

A dead sheep infected with scrapie -- a degenerative disease of the nervous system similar to mad cow disease -- has been found in western Japan, an official said on Thursday.

South African farmer equips sheep with cell phones

July 11, 2012

A South African farmer is fielding phone calls from his sheep, after equipping them with cell phones to keep tabs on the flock amid recent livestock thefts, according to local press Wednesday.

Assessing stress in trucked sheep

May 30, 2014

A new way of measuring the stress levels of sheep during road transport, was discussed at the Australian Veterinary Association's Annual Conference this week.

Recommended for you

Cells lacking nuclei struggle to move in 3-D environments

January 20, 2018

University of North Carolina Lineberger Comprehensive Cancer Center researchers have revealed new details of how the physical properties of the nucleus influence how cells can move around different environments - such as ...

Microbial communities demonstrate high turnover

January 19, 2018

When Mark Twain famously said "If you don't like the weather in New England, just wait a few minutes," he probably didn't anticipate MIT researchers would apply his remark to their microbial research. But a new study does ...

1 comment

Adjust slider to filter visible comments by rank

Display comments: newest first

not rated yet Jun 01, 2017
I wish they had this for dogs. I have a daniff that was hurting so bad the vet could not tell what was wrong. She completely quit eating for 3 weeks, so I had to force feed her rice and chicken, pureed and poured down her throat. She refused to show the vet what was hurting and x rays and blood work showed nothing. Using this technique the vet could probe her and as he touched her he could have read the pain level.

Please sign in to add a comment. Registration is free, and takes less than a minute. Read more

Click here to reset your password.
Sign in to get notified via email when new comments are made.