Machine Learning Applications in Pig Welfare
Summary
Machine learning has become integral to modern pig welfare management by enabling continuous, objective monitoring of animal health and behaviour. Through the integration of sensors—including depth and RGB cameras, microphones and accelerometers—with advanced algorithms, subtle deviations in posture, activity and feeding can be captured and interpreted in real time. These approaches facilitate early detection of disease, stress or aggression, reducing reliance on manual observation, optimising interventions and promoting sustainable husbandry. By shifting from group-level assessment to individual pig surveillance, precision livestock farming enhances diagnostic accuracy, refines welfare outcomes and supports global efforts to mitigate antimicrobial use and improve production efficiency.
Research from Nature Portfolio
A foundational 2017 study introduced an automated system employing depth video cameras and machine learning to track pig movement in three dimensions. By extracting standing, feeding, drinking and locomotor activities from 3D trajectories, the system reliably detected behavioural changes induced by a controlled challenge, demonstrating its utility as an early-warning tool in commercial barns. Subsequent work has focused on broadening the range of detectable behaviours, improving robustness across varied facility layouts and integrating continuous alerts for stockpersons, thereby laying the groundwork for scalable real-time welfare surveillance systems.
Machine Learning Applications in Pig Welfare publication trend
The graph below shows the total number of articles in machine learning applications in pig welfare across all publications each year (not limited to Nature Index journals).
Technical terms
Convolutional neural network (CNN): A deep learning architecture that applies hierarchical filters to extract spatial patterns from images.
XGBoost: A scalable gradient-boosted decision tree algorithm widely used for classification and regression.
Average Precision (AP): The area under the precision–recall curve, assessing detection accuracy across confidence thresholds.
Mean Average Precision (mAP): The average of AP values over multiple classes or tasks, indicating overall detection performance.
Area under the curve (AUC): The integral of the receiver operating characteristic curve, reflecting a model’s ability to discriminate between classes.
References
- Disease detection in pigs based on feeding behaviour traits using machine learning. Biosystems Engineering (2023).
- Automated tracking to measure behavioural changes in pigs for health and welfare monitoring. Scientific Reports (2017).
- Towards on-farm pig face recognition using convolutional neural networks. Computers in Industry (2018).
- Automatically detecting pig position and posture by 2D camera imaging and deep learning. Computers and Electronics in Agriculture (2020).
About these summaries
This Nature Research Intelligence Topic summary is created with the cited references and a large language model. We take care to ground generated text with facts, and have systems in place to gain human feedback on the overall quality of the process in line with our AI principles. We strive to create accurate and useful summaries for people unfamiliar with the research topic and that supports this goal. These pages are a beta release and will be updated as we learn how best to help people gain value from a research topic summary.
Turn complex research questions into confident strategic decisions
When you're under pressure to set direction, justify investment, or understand your competitive position, you need more than raw data — you need trusted insights you can act on.
Benchmark your performance against global peers using robust, methodologically sound analysis.
Combine quantitative metrics with qualitative expert insight to uncover strengths, gaps and emerging opportunities.
Gain tailored, decision-ready recommendations aligned to your strategic priorities.
Talk to us to learn more about our data dashboards and bespoke strategy reports.
Grow research skills, confidence and careers with training built for every stage of the research lifecycle.
Developed with Nature Portfolio journal Editors and internationally renowned experts. Discover three ways to learn:
Self-paced, online courses in convenient bite-sized units, covering key skills across scientific writing, publishing, grant writing, data analysis, and more.
Expert trainer-led workshops with hands-on exercises and real-time feedback across core research skills, delivered via interactive group sessions.
Editor-led workshops combining core principles in writing and publishing, personalised 1:1 feedback from Nature Portfolio Editors and hands-on exercises.
Explore course catalogues and workshop agendas, enquire about the options or request institutional pricing.