Scientists are using facial recognition technology to assess the emotional state of pigs.
It is hoped the project at Scotland's Rural College (SRUC) Pig Research Centre in Penicuik, Midlothian, could help improve animal wellbeing.
Researchers want to work out from a pig's expression whether the animal is content or distressed.
A tool could then be developed to monitor individual faces and alert farmers to health and welfare problems.
Previous SRUC studies have shown pigs can communicate with each other using different facial expressions.
Scientists have been capturing 3D and 2D facial images of the breeding sow population.
The images are then processed at the University of the West of England (UWE Bristol) where techniques are being developed to automatically identify different emotions.
Sows suffering from lameness could benefit if different facial expressions are seen to show pain before and after being given medication.
Prof Melvyn Smith, from UWE Bristol's Centre for Machine Vision, 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% 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."
Dr Emma Baxter, from SRUC, said the research could result in financial benefits for farmers.
"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."