Author
Listed:
- Syed U. Yunas
(Centre for Machine Vision, University of the West of England (UWE), Bristol BS16 1QY, UK)
- Ajmal Shahbaz
(Centre for Machine Vision, University of the West of England (UWE), Bristol BS16 1QY, UK)
- Emma M. Baxter
(Scotland’s Rural College (SRUC), Edinburgh EH9 3JG, UK)
- Kenneth M. D. Rutherford
(Scotland’s Rural College (SRUC), Edinburgh EH9 3JG, UK)
- Mark F. Hansen
(Centre for Machine Vision, University of the West of England (UWE), Bristol BS16 1QY, UK)
- Melvyn L. Smith
(Centre for Machine Vision, University of the West of England (UWE), Bristol BS16 1QY, UK)
- Lyndon N. Smith
(Centre for Machine Vision, University of the West of England (UWE), Bristol BS16 1QY, UK)
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.
Suggested Citation
Syed U. Yunas & Ajmal Shahbaz & Emma M. Baxter & Kenneth M. D. Rutherford & Mark F. Hansen & Melvyn L. Smith & Lyndon N. Smith, 2025.
"A Deep Learning Framework for Detecting Cross-Generational Facial Markers Associated with Stress in Pigs,"
Agriculture, MDPI, vol. 15(21), pages 1-15, October.
Handle:
RePEc:gam:jagris:v:15:y:2025:i:21:p:2253-:d:1782011
Download full text from publisher
Corrections
All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jagris:v:15:y:2025:i:21:p:2253-:d:1782011. See general information about how to correct material in RePEc.
If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.
We have no bibliographic references for this item. You can help adding them by using this form .
If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager The email address of this maintainer does not seem to be valid anymore. Please ask MDPI Indexing Manager to update the entry or send us the correct address
(email available below). General contact details of provider: https://www.mdpi.com .
Please note that corrections may take a couple of weeks to filter through
the various RePEc services.