Related Experiment Video
Updated: Jul 18, 2026

Noninvasive, In-pen Approach Test for Laboratory-housed Pigs
Published on: June 5, 2019
Determining the posture and location of pigs using an object detection model under different lighting conditions
Alice J Scaillierez1, Tomás Izquierdo García-Faria2, Harry Broers3
1Animal Production Systems group, Wageningen University & Research, P.O. Box 338, 6700 AH Wageningen, The Netherlands.
Computer vision accurately detects pig behavior and posture under various lighting conditions. Grouping resting postures improved detection accuracy, highlighting potential for reliable pig welfare monitoring.
Area of Science:
- Animal Science
- Computer Vision
- Agricultural Technology
Background:
- Computer vision, particularly object detection, is increasingly used for monitoring pig behavior, including location and posture.
- Lighting conditions significantly impact the performance of detection models and can influence pig activity and resting patterns.
- Accurate pig behavior monitoring is crucial for welfare assessment and optimizing farming practices.
Purpose of the Study:
- To validate a YOLOv8 object detection model for identifying pig postures (standing, sitting, sternal lying, lateral lying) under diverse lighting conditions.
- To assess the model's performance across varying light intensity, spectrum, and uniformity.
- To evaluate the model's accuracy in localizing and classifying pig behaviors in group-housed settings.
Main Methods:
- Development and training of a YOLOv8 object detection model using annotated data from pigs aged 10-24 weeks.
- Inclusion of 10 different lighting settings (varying intensity, spectrum, uniformity) in the training, validation, and test datasets.
- Evaluation of detection accuracy using mean average precision (mAP), precision, sensitivity, and F1 scores, with localization accuracy measured by intersection over union (IoU).
Main Results:
- The model achieved a mean average precision (mAP) of 89.4% for pig detection across different lighting conditions.
- Standing posture detection was most accurate; sitting posture detection had the lowest sensitivity and F1 score due to visual confusion and dataset limitations.
- Grouping sternal and lateral lying postures improved detection (mAP = 97.0%), and localization accuracy (IoU) exceeded 95.5% for 75% of the dataset.
Conclusions:
- The YOLOv8 model demonstrates robust performance in detecting pig location and postures under varied lighting, with minor challenges in specific conditions like warm or uneven light.
- Distinguishing between specific lying postures and sitting can be improved by data augmentation and by analyzing active versus resting behaviors collectively.
- The study confirms the potential of computer vision for reliable pig behavior monitoring, though challenges in individual pig tracking and occlusion require further research.
More Related Videos
06:59A Pipeline using Bilateral In Utero Electroporation to Interrogate Genetic Influences on Rodent Behavior
Published on: May 21, 2020
06:32Author Spotlight: Automated Deep Brain Stimulation for Parkinson's Disease - Exploring the Possibilities and Challenges of Home Monitoring
Published on: July 14, 2023