Skip to main navigation Skip to search Skip to main content

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

  • Gytis Bernotas*
  • , Mark F Hansen
  • , Melvyn L Smith
  • , MC Jack
  • , EM Baxter
  • , RB D'Eath
  • *Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

2 Downloads (Pure)

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.
Original languageEnglish
Article number101967
JournalSmart Agricultural Technology
Volume14
Early online date13 Mar 2026
DOIs
Publication statusPrint publication - 23 Mar 2026

Keywords

  • animal welfare
  • computer vision
  • dataset
  • deep learning
  • long-term tracking
  • multi-object tracking
  • pigs
  • swine

Fingerprint

Dive into the research topics of 'A Large-Scale Longitudinal Dataset for Pig Tracking and Re-Identification'. Together they form a unique fingerprint.

Cite this