IT is more often deployed to held identify criminals in a crowd, to unlock a phone or to tag friends on a social media photo post.

But now scientists are using facial recognition software to find out if a pig in mud really is as happy as has been believed up to now.

The state of the art technology is to be used to pigs in a wide-ranging study to determine if it can help farmers identify the animals' mood and gain helpful insights into their wellbeing.

Animal behaviourists from Scotland’s Rural College (SRUC) in Edinburgh have teamed up with machine vision experts at the University of the West of England (UWE Bristol) for the research, which it is hoped will lead to a tool that can monitor individual animals’ faces and alert farmers to any health and welfare problems.

The Herald:

A rough version of the tech in operation

Pigs are highly expressive and SRUC research has previously shown they can signal their intentions to other pigs using different facial expressions.

READ MORE: Police face watchdog probe over use of facial recognition technology

There is also evidence of different expressions when they are in pain or under stress.

At SRUC’s Pig Research Centre in Midlothian, scientists are capturing 3D and 2D facial images of the breeding sow population under situations which are likely to result in different emotional states.

One example they are paying special attention to is whether sows which have gone lame  show different facial expressions relating to pain before and after being given pain relief.

However, detecting a positive emotional state is more novel but the scientists are hoping that pigs' well-known love of food will help them out.

Sows are said to be highly motivated by food, and appear calm and content when they are full. It is hoped their mood will be reflected in their facial expressions, giving researchers a template to indicate when the pigs are feeling well.

Images of the pigs are  processed at UWE Bristol’s Centre for Machine Vision, where various cutting-edge learning techniques are being developed to automatically identify different emotions conveyed by the animals' particular facial expressions.

READ MORE: Rare pigs offered up for pet auction as breed is saved from extinction

After validating these techniques, the team will develop the technology for on-farm use with commercial partners where individual sows in large herds will be monitored continuously.

It is hoped that the technique could help farmers save money by spotting problems with their livestock early, as well as improving the pigs welfare.

The Herald:

Pigs are emotional animals

Dr Emma Baxter from SRUC said: “Early identification of pig health issues gives farmers the potential to improve animal wellbeing by tackling any problems quickly and implementing tailored treatment for individuals.

"This will reduce production costs by preventing impact of health issues on performance.

"By focussing on the pig’s face, we hope to deliver a truly animal-centric welfare assessment technique, where the animal can ‘tell’ us how it feels about its own individual experiences and environment.

She added: "This allows insight into both short-term emotional reactions and long-term individual ‘moods’ of animals under our care.” 

READ MORE: Scottish football officials criticised over facial recognition proposal to ID offenders

Professor Melvyn Smith from UWE Bristol’s Centre for Machine Vision, part of the Bristol Robotics Laboratory, said that work to identify individual expressions sported by pigs was well underway, and that the next stage would be to tie that to their emotional states.

Then a computer will have to be taught to make the link automatically, allowing herds to be  monitored by artificial intelligence.

Prof Smith said: “Machine vision technology offers the potential to realise a low-cost, non-intrusive and practical means to biometrically identify individual animals on the farm.

"Our work has already demonstrated a 97 per cent accuracy at facial recognition in pigs. "Our next step will be, for the first time, to explore the potential for using machine vision to automatically recognise facial expressions that are linked with core emotion states, such as happiness or distress, in the identified pigs.”

The study, which is being funded by the Biotechnology and Biological Sciences Research Council (BBSRC), is also being supported by industry stakeholders JSR Genetics Ltd and Garth Pig Practice as well as precision livestock specialists Agsenze.