A Deep Learning Framework for Detecting Cross-Generational Facial Markers Associated with Stress in Pigs

Maternal stress during gestation can alter offspring physiology, behaviour, and immune function. In pigs, such ‘prenatal stress’ is known to increase stress sensitivity, but the potential to automatically detect such sensitivity has remained unexplored. Automatic detection of facial expression has successfully identified differences in pigs dependent on their stress status. This study progresses this work by demonstrating that, for the first time, using a deep learning framework applied to facial analysis, stress-linked phenotypes can be learned from one generation and detected in the next. Using a dataset of over 7000 facial images from 18 gestating sows and 53 of their daughters, we trained and evaluated five state-of-the-art deep learning architectures across six independent daughter cohorts. Attention-based models significantly outperformed CNN-based models, with the Vision Transformer (ViT) model achieving a mean accuracy of 0.78 and an average F1-score of 0.76. Grad-CAM visualisations showed that the ViT consistently attended to biologically relevant facial regions, such as the eyes and snout, whereas CNNs often focused on diffuse or non-informative areas, resulting in reduced low-stress recall and greater batch sensitivity. Models trained on maternal facial images successfully predicted stress responsiveness in daughters from unrelated lineages, indicating that the model captured generalisable facial cues of stress rather than familial resemblance. This approach supports previous work showing that machine vision can detect putatively stress-related alterations to facial expression in pigs. Future application of this approach could offer a scalable, non-invasive tool for early detection of stress in livestock production systems, opening new avenues for welfare-oriented precision livestock management and informed breeding strategies aimed at improving stress resilience.

Authors

Institutions

Publication Details

Journal
Agriculture
Published
2025-10-29
DOI
https://doi.org/10.3390/agriculture15212253
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Deep Learning Framework for Detecting Cross-Generational Facial Markers Associated with Stress in Pigs

Kenny Rutherford, Ajmal Shahbaz, Lyndon Smith, Melvyn Smith et al.
Agriculture
Animal Behavior and Welfare Studies
article

A Deep Learning Framework for Detecting Cross-Generational Facial Markers Associated with Stress in Pigs

Kenny Rutherford, Ajmal Shahbaz, Lyndon Smith, Melvyn Smith, Syed U. Yunas, Mark Hansen, Emma Baxter
article en

Abstract

Maternal stress during gestation can alter offspring physiology, behaviour, and immune function. In pigs, such ‘prenatal stress’ is known to increase stress sensitivity, but the potential to automatically detect such sensitivity has remained unexplored. Automatic detection of facial expression has successfully identified differences in pigs dependent on their stress status. This study progresses this work by demonstrating that, for the first time, using a deep learning framework applied to facial analysis, stress-linked phenotypes can be learned from one generation and detected in the next. Using a dataset of over 7000 facial images from 18 gestating sows and 53 of their daughters, we trained and evaluated five state-of-the-art deep learning architectures across six independent daughter cohorts. Attention-based models significantly outperformed CNN-based models, with the Vision Transformer (ViT) model achieving a mean accuracy of 0.78 and an average F1-score of 0.76. Grad-CAM visualisations showed that the ViT consistently attended to biologically relevant facial regions, such as the eyes and snout, whereas CNNs often focused on diffuse or non-informative areas, resulting in reduced low-stress recall and greater batch sensitivity. Models trained on maternal facial images successfully predicted stress responsiveness in daughters from unrelated lineages, indicating that the model captured generalisable facial cues of stress rather than familial resemblance. This approach supports previous work showing that machine vision can detect putatively stress-related alterations to facial expression in pigs. Future application of this approach could offer a scalable, non-invasive tool for early detection of stress in livestock production systems, opening new avenues for welfare-oriented precision livestock management and informed breeding strategies aimed at improving stress resilience.

AgricultureVol. 15(21)
University of the West of England (GB), Scotland's Rural College (GB)
Joint Programming Initiative on Antimicrobial Resistance, University of the West of England, Teagasc, Medical Research Council
Openalex Percentile: Top 66%
Animal Behavior and Welfare Studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.