Towards Facial Expression Recognition for On-Farm Welfare Assessment in Pigs

Mark F. Hansen*, Emma M. Baxter, Kenny M. D. Rutherford, Agnieszka Futro, Melvyn Smith, Lyndon N. Smith

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

10 Citations (Scopus)
44 Downloads (Pure)


Animal welfare is not only an ethically important consideration in good animal husbandry but can also have a significant effect on an animal’s productivity. The aim of this paper was to show that a reduction in animal welfare, in the form of increased stress, can be identified in pigs from frontal images of the animals. We trained a convolutional neural network (CNN) using a leave-one-out design and showed that it is able to discriminate between stressed and unstressed pigs with an accuracy of >90% in unseen animals. Grad-CAM was used to identify the animal regions used, and these supported those used in manual assessments such as the Pig Grimace Scale. This innovative work paves the way for further work examining both positive and negative welfare states with the aim of developing an automated system that can be used in precision livestock farming to improve animal welfare.
Original languageEnglish
Article number847
Pages (from-to)e847
Number of pages15
JournalAgriculture (Switzerland)
Issue number9
Early online date4 Sept 2021
Publication statusFirst published - 4 Sept 2021


  • Animal welfare
  • Computer vision
  • Deep learning
  • Facial expression recognition
  • Pigs
  • Stress detection


Dive into the research topics of 'Towards Facial Expression Recognition for On-Farm Welfare Assessment in Pigs'. Together they form a unique fingerprint.

Cite this