A Large-Scale Longitudinal Dataset for Pig Tracking and Re-Identification

Accurate, non-invasive long-term individual animal tracking and identification is valuable for precision livestock farming. Establishing individual identity is a fundamental prerequisite for monitoring an animal’s health, behaviour, welfare, and productivity over extended periods. However, progress within the field has been limited by the lack of realistic dataset availability. Existing datasets tend to use pigs with distinct natural markings, artificial painted marks, or ear-tags, and focus on short-term tracking lasting only a few minutes rather than extended periods of hours, days, months, or even throughout the animal’s entire life. Therefore, long-term pig tracking and re-identification (ReID) across weeks or months remains an unexplored challenge. This study addresses this gap by developing a large-scale, longitudinal dataset designed to serve as a comprehensive benchmark for testing and advancing tracking and ReID algorithms together with machine learning models for application in complex, multi-object farm environments over prolonged periods. The data were acquired using a high-resolution dual-camera setup, consisting of top-down colour and ultraviolet cameras. To facilitate unique and non-invasive identification, pigs were labelled with invisible sunscreen patterns as an alternative to conventional paint or ink markings, or animal-worn devices, such as RFID or ear tags, or invasive methods, such as notching the ears. These patterns became visible only under ultraviolet light when viewed through a specialised camera. The data were semi-manually annotated by utilising a custom processing pipeline, where a YOLOv8 general-purpose convolutional neural network was first fine-tuned for pig detection. The resulting bounding boxes then served as seed locations for the Segment Anything Model2 (SAM2), which subsequently performed instance segmentation and tracking. Experimental results demonstrated that this pipeline could detect, track, and segment pigs, resulting in a dataset of over 740,000 labelled frames captured over 5.31 ±1.97 weeks, featuring 7.62 ±1.87 pigs per frame. This work presents a unique and valuable dataset that addresses key limitations in the field, offering rich temporal and spatial data, benchmarked using publicly available object detection and multi-object tracking evaluation tools. The release of the dataset is expected to drive the creation of standardised metrics for pig ReID, potentially rendering traditional ear tags obsolete and so significantly enhancing animal welfare through realisation of non-invasive monitoring. Baseline benchmark results are provided to demonstrate the dataset’s utility for object detection and multi-object tracking.

Authors

Institutions

Publication Details

Journal
Smart Agricultural Technology
Published
2026-03-13
DOI
https://doi.org/10.1016/j.atech.2026.101967
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Large-Scale Longitudinal Dataset for Pig Tracking and Re-Identification

Gytis Bernotas, Melvyn Smith, Mhairi Jack, Rick D’Eath et al.
Smart Agricultural Technology
Animal Behavior and Welfare Studies
article

A Large-Scale Longitudinal Dataset for Pig Tracking and Re-Identification

Gytis Bernotas, Melvyn Smith, Mhairi Jack, Rick D’Eath, Emma Baxter, Mark F. Hansen
article en

Abstract

Accurate, non-invasive long-term individual animal tracking and identification is valuable for precision livestock farming. Establishing individual identity is a fundamental prerequisite for monitoring an animal’s health, behaviour, welfare, and productivity over extended periods. However, progress within the field has been limited by the lack of realistic dataset availability. Existing datasets tend to use pigs with distinct natural markings, artificial painted marks, or ear-tags, and focus on short-term tracking lasting only a few minutes rather than extended periods of hours, days, months, or even throughout the animal’s entire life. Therefore, long-term pig tracking and re-identification (ReID) across weeks or months remains an unexplored challenge. This study addresses this gap by developing a large-scale, longitudinal dataset designed to serve as a comprehensive benchmark for testing and advancing tracking and ReID algorithms together with machine learning models for application in complex, multi-object farm environments over prolonged periods. The data were acquired using a high-resolution dual-camera setup, consisting of top-down colour and ultraviolet cameras. To facilitate unique and non-invasive identification, pigs were labelled with invisible sunscreen patterns as an alternative to conventional paint or ink markings, or animal-worn devices, such as RFID or ear tags, or invasive methods, such as notching the ears. These patterns became visible only under ultraviolet light when viewed through a specialised camera. The data were semi-manually annotated by utilising a custom processing pipeline, where a YOLOv8 general-purpose convolutional neural network was first fine-tuned for pig detection. The resulting bounding boxes then served as seed locations for the Segment Anything Model2 (SAM2), which subsequently performed instance segmentation and tracking. Experimental results demonstrated that this pipeline could detect, track, and segment pigs, resulting in a dataset of over 740,000 labelled frames captured over 5.31 ±1.97 weeks, featuring 7.62 ±1.87 pigs per frame. This work presents a unique and valuable dataset that addresses key limitations in the field, offering rich temporal and spatial data, benchmarked using publicly available object detection and multi-object tracking evaluation tools. The release of the dataset is expected to drive the creation of standardised metrics for pig ReID, potentially rendering traditional ear tags obsolete and so significantly enhancing animal welfare through realisation of non-invasive monitoring. Baseline benchmark results are provided to demonstrate the dataset’s utility for object detection and multi-object tracking.

Smart Agricultural TechnologyVol. 14
Scotland's Rural College (GB), Bristol Robotics Laboratory (GB)
Openalex Percentile: Top 21%
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.