Home About Browse Search

Individual detection and tracking of group housed pigs in their home pen using computer vision

van der Zande, Lisette. E. and Guzhva, Oleksiy and Rodenburg, T. Bas (2021). Individual detection and tracking of group housed pigs in their home pen using computer vision. Frontiers in animal science. 2 , 669312
[Research article]

[img] PDF


Modern welfare definitions not only require that the Five Freedoms are met, but animals should also be able to adapt to changes (i. e., resilience) and reach a state that the animals experience as positive. Measuring resilience is challenging since relatively subtle changes in animal behavior need to be observed 24/7. Changes in individual activity showed potential in previous studies to reflect resilience. A computer vision (CV) based tracking algorithm for pigs could potentially measure individual activity, which will be more objective and less time consuming than human observations. The aim of this study was to investigate the potential of state-of-the-art CV algorithms for pig detection and tracking for individual activity monitoring in pigs. This study used a tracking-by-detection method, where pigs were first detected using You Only Look Once v3 (YOLOv3) and in the next step detections were connected using the Simple Online Real-time Tracking (SORT) algorithm. Two videos, of 7 h each, recorded in barren and enriched environments were used to test the tracking. Three detection models were proposed using different annotation datasets: a young model where annotated pigs were younger than in the test video, an older model where annotated pigs were older than the test video, and a combined model where annotations from younger and older pigs were combined. The combined detection model performed best with a mean average precision (mAP) of over 99.9% in the enriched environment and 99.7% in the barren environment. Intersection over Union (IOU) exceeded 85% in both environments, indicating a good accuracy of the detection algorithm. The tracking algorithm performed better in the enriched environment compared to the barren environment. When false positive tracks where removed (i.e., tracks not associated with a pig), individual pigs were tracked on average for 22.3 min in the barren environment and 57.8 min in the enriched environment. Thus, based on proposed tracking-by-detection algorithm, pigs can be tracked automatically in different environments, but manual corrections may be needed to keep track of the individual throughout the video and estimate activity. The individual activity measured with proposed algorithm could be used as an estimate to measure resilience.

Authors/Creators:van der Zande, Lisette. E. and Guzhva, Oleksiy and Rodenburg, T. Bas
Title:Individual detection and tracking of group housed pigs in their home pen using computer vision
Series Name/Journal:Frontiers in animal science
Year of publishing :2021
Article number:669312
Number of Pages:10
Publication Type:Research article
Article category:Scientific peer reviewed
Version:Published version
Copyright:Creative Commons: Attribution 4.0
Full Text Status:Public
Subjects:(A) Swedish standard research categories 2011 > 4 Agricultural Sciences > 402 Animal and Dairy Science > Animal and Dairy Science.
Keywords:tracking, computer vision, pigs, video, activity, resilience, behavior
Permanent URL:
Additional ID:
Type of IDID
ID Code:26420
Faculty:LTV - Fakulteten för landskapsarkitektur, trädgårds- och växtproduktionsvetenskap
Department:(LTJ, LTV) > Department of Biosystems and Technology (from 130101)
Deposited By: SLUpub Connector
Deposited On:23 Dec 2021 14:25
Metadata Last Modified:23 Dec 2021 14:31

Repository Staff Only: item control page


Downloads per year (since September 2012)

View more statistics