Papers
Topics
Authors
Recent
Search
2000 character limit reached

PigTrack: Benchmark for Multi-Object Pig Tracking

Updated 7 July 2026
  • PigTrack is a benchmark dataset for video-based pig tracking, featuring densely annotated bounding boxes with persistent identity labels under realistic farm conditions.
  • The dataset comprises 80 videos (41 minutes, 26,487 frames) across diverse pens, capturing challenges like occlusion, poor visibility, and high animal density.
  • Evaluation uses HOTA-related metrics to balance detection and temporal association, revealing tradeoffs between detector quality and tracking architecture.

PigTrack is a public benchmark dataset for multi-object tracking of pigs with axis-aligned bounding boxes under realistic farm conditions. It was introduced alongside PigDetect in “Benchmarking pig detection and tracking under diverse and challenging conditions” as a densely annotated video resource in which all visible pigs in each selected video are labeled frame-by-frame with bounding boxes and persistent identity labels across time, enabling evaluation of both per-frame localization and temporal association. Its intended role is to provide a standardized basis for comparing pig-tracking methods under conditions such as occlusion, bad visibility, day and night recording, and strong appearance similarity among animals (Henrich et al., 22 Jul 2025).

1. Definition and curation

PigTrack is the tracking component of a paired benchmark in which PigDetect addresses image-based pig detection and PigTrack addresses video-based multi-object tracking. The distinction is explicit: PigDetect contains independent per-image pig bounding boxes with no temporal identity continuity, whereas PigTrack is a video dataset for tracking, where the core problem is to localize pigs and keep their identities consistent over time despite occlusions, appearance similarity, and poor visibility. In the benchmark formulation, a tracker must output pig bounding boxes and assign track IDs such that detections correspond to the correct individual over the whole visible trajectory (Henrich et al., 22 Jul 2025).

The dataset was curated from the same underlying barn video footage used to derive PigDetect, drawing on previously unpublished recordings from several agricultural projects plus the broader corpus described for PigDetect. Clips were not selected by random sampling alone. Instead, footage was screened to identify segments with challenging tracking conditions, although no formal criterion for “challenging” was specified. To limit identity ambiguity in annotation, the curation process imposed a specific rule: no pig was allowed to leave the scene and later re-enter within an annotated clip. It was acceptable for pigs to leave and never return, or for new pigs to enter during a video, but not to disappear and later come back.

Annotation was assisted rather than fully manual from scratch. A preliminary tracking pipeline used YOLOX for frame-wise detections and C-BIoU for simple motion-based linking; those initial tracks were imported into CVAT and then manually refined. The final annotations were reviewed by a second annotator, with corrections applied if necessary, and five authors participated in the process. Clips judged too ambiguous to label reliably were excluded. The annotation convention was to label all pigs visible in a video, and identity labels are preserved across frames throughout each clip.

2. Dataset structure, scene characteristics, and annotation scope

PigTrack contains 80 videos totaling 41.06 minutes, 26,487 frames, 1,574 unique pig IDs, and 517,961 annotated bounding boxes across 9 pens, all densely annotated at every frame. Most videos have resolution 1280 × 800, with one source at 1920 × 1080. Frame rates are heterogeneous: 62 videos at 10 FPS, 16 at 15 FPS, and 2 at 5 FPS. The dataset includes 26 night videos and spans nine distinct pen environments (Henrich et al., 22 Jul 2025).

The split statistics are as follows.

Split Videos / frames / pens IDs / boxes / night videos
Train 35 / 9,959 / 9 698 / 195,745 / 13
Validation 20 / 7,589 / 7 383 / 141,289 / 3
Test 25 / 8,939 / 9 493 / 180,927 / 10

The scene content is intentionally difficult. Cameras view pens from above, sometimes from different angles, in practical farm environments rather than laboratory settings. Reported conditions include partial and severe occlusion, pigs walking over each other, piling, close physical contact, poor lighting, infrared and night imagery, smudges or dust on lenses, underexposure, overexposure, blur, and dirty optics. On rare occasions neighboring pens were visible; those pigs were annotated if possible, and otherwise the corresponding regions were masked by setting pixel values to zero.

Pig density is substantial. The number of pigs per video ranges from 7 to 26, with most videos containing 23–26 pigs and a smaller subset around 10 pigs. The distribution of box overlap includes many isolated pigs but also many frames with substantial overlap, reflecting frequent occlusion and contact. Motion was summarized through a frame-to-frame “box shift,” defined by computing IoU between a pig’s boxes on adjacent frames and subtracting from 1; most shifts lie between 0 and 0.3, although larger shifts also occur.

A defining property of PigTrack is annotation density. Earlier public pig datasets were often sparsely annotated, for example one frame per second, every 500th frame, or only at behavior changes. PigTrack labels every frame, aligning it with standard human MOT benchmarks. The split design, however, is not an unseen-environment benchmark in the strict sense: the test set uses the same pens as training and validation, but with manually selected challenging videos and no near-identical repeated scenarios. The validation set is the least challenging of the three. This means the official test primarily measures robustness to difficult scenes within known environments.

3. Evaluation protocol and benchmark metrics

PigTrack is evaluated primarily with the HOTA family of metrics, which separates detection quality from association quality. For a fixed IoU threshold α\alpha, predicted and ground-truth boxes are matched to define true positives TPTP, false positives FPFP, and false negatives FNFN. Detection accuracy is then

DetA=TPTP+FP+FN.DetA = \frac{|TP|}{|TP| + |FP| + |FN|}.

Association quality is computed per matched pair through the sets of true positive associations, false positive associations, and false negative associations, and then averaged to produce AssAαAssA_\alpha. Overall tracking quality at threshold α\alpha is defined as

HOTAα=DetAαAssAα.HOTA_\alpha = \sqrt{DetA_\alpha \cdot AssA_\alpha}.

Final HOTA, DetA, and AssA are obtained by averaging over IoU thresholds {0.05,0.1,0.15,,0.95}\{0.05, 0.1, 0.15, \dots, 0.95\} (Henrich et al., 22 Jul 2025).

The benchmark also reports MOTA, IDF1, and IDSW. The accompanying discussion is technically important. MOTA is noted as a standard metric that is often criticized for overweighting detection. IDF1 is presented as an association-oriented alternative. IDSW counts identity switches, but the authors caution that it is not a complete association metric because it ignores switch duration and can penalize cases that quickly switch back to the correct identity.

This metric design is closely tied to PigTrack’s intended use. DetA measures whether a tracker finds and localizes pigs at each frame, AssA measures whether it keeps identities consistent over time, and HOTA balances both. In a livestock setting with visually similar animals and frequent occlusion, this separation is particularly important because strong per-frame detection does not guarantee stable long-horizon identity assignment.

4. Benchmarked methods and empirical findings

The PigTrack benchmark includes both detector-tracker pipelines using external detections and end-to-end trainable trackers. In the paper’s terminology, the SORT-based group comprises ByteTrack, OC-SORT, Deep OC-SORT, StrongSORT, BoT-SORT, and Improved Association (ImprAssoc). For all SORT-based methods, the detector was Co-DINO trained on PigDetect, and hyperparameters were tuned via Bayesian optimization on PigTrack validation HOTA using BoxMOT. The end-to-end models are MOTRv2 and MOTIP (Henrich et al., 22 Jul 2025).

On the official PigTrack test set, the strongest SORT-based methods were BoT-SORT and ImprAssoc, while the best end-to-end result came from MOTRv2 (+val). The key scores were:

Method Key test scores Interpretation
ImprAssoc HOTA 87.3, DetA 88.7, AssA 86.1 Best official DetA
BoT-SORT HOTA 87.9, DetA 88.5, AssA 87.4 Best official MOTA 96.1 and lowest IDSW 165
MOTRv2 (+val) HOTA 88.2, DetA 87.9, AssA 88.7 Best official HOTA and AssA
MOTIP (+val) HOTA 86.5, DetA 85.4, AssA 87.9 Best official IDF1 94.2

The main empirical conclusion is a detection–association tradeoff. SORT-based methods achieve stronger detection-related performance because they exploit a high-quality external detector, whereas end-to-end trackers depend on their own integrated detection capability or detector priors inside a unified architecture. Conversely, end-to-end models show better association performance under PigTrack conditions of similar-looking animals, non-linear movement, and frequent occlusion. This is why ImprAssoc and BoT-SORT lead on DetA and MOTA, while MOTRv2 (+val) leads on HOTA and AssA, and MOTIP (+val) reaches the best IDF1.

The oracle analysis sharpens this interpretation. When SORT-based trackers are given ground-truth detections instead of predicted detections, their scores rise dramatically: for example, ImprAssoc reaches HOTA 98.9 and BoT-SORT reaches IDF1 99.1. The paper interprets this as evidence that, in realistic pig tracking, the dominant bottleneck is often missed or poor detections under occlusion and visibility degradation rather than the association logic itself.

The benchmark also includes a third-party unseen-pen stress test based on a 2.5-minute video from a different pen environment. In that setting, tuned SORT pipelines generalize better than the end-to-end models. BoT-SORT with Co-DINO trained on PigDetect reaches HOTA 84.9, DetA 83.2, AssA 86.8, MOTA 96.4, IDF1 97.9, and IDSW 4, whereas MOTRv2 (+val) reaches HOTA 81.1 and MOTIP (+val) reaches HOTA 79.0. This supports the paper’s broader conclusion that strong, diverse training data and a strong detector remain decisive for practical pig tracking.

The failure analysis is unusually specific. For MOTRv2, severe occlusion can cause a track query for an occluded pig to latch onto a foreground pig, after which two queries produce nearly identical boxes and, in the next frame, often neither predicts an object. For MOTIP, a different failure mode appears: duplicate ID predictions. The paper reports that about 1.8% of bounding boxes predict an ID already assigned to another box at score at least 0.5, and about 1% still do so at threshold 0.95, producing frequent identity conflicts and explaining the very high IDSW count in weaker MOTIP settings.

5. Relation to other pig-tracking resources and methodologies

PigTrack occupies a specific place within pig-monitoring research. It is a densely annotated, box-level MOT benchmark focused on realistic barn conditions and explicit identity continuity. This differentiates it from Pigtrace, introduced with StarFormer, which targets a broader STAR formulation—Segmentation, Tracking, Action recognition, and Re-identification—and provides instance masks, tracking, and action labels in around 30 short videos with 540 annotated frames in real indoor farm environments (Tangirala et al., 2021).

It also differs from earlier system-oriented pig tracking studies. “Automatic individual pig detection and tracking in surveillance videos” proposed a detector–tracker hybrid for nine finisher pigs in day and infrared farm video, coupling SSD detection with correlation-filter tracking and hierarchical data association (Zhang et al., 2018). “Tracking Grow-Finish Pigs Across Large Pens Using Multiple Cameras” addressed a different deployment problem, namely inter-camera handover across overlapping views in oblong pens using YOLOv4, DeepSORT, and floor-plane homography (Shirke et al., 2021). More recently, “Automated Segmentation and Tracking of Group Housed Pigs Using Foundation Models” described an FM-centered workflow based on Grounding-DINO and Grounded-SAM2 that maintained stable identities over a 132-minute nursery-pig video with no identity switches in the annotated evaluation set (Bi et al., 3 Apr 2026).

A later comparative study of long-term pig MAT methods reached a conclusion consistent with PigTrack’s benchmark: MOT approaches such as ByteTrack generally outperform traditional MAT tools in crowded pig scenes, while foundation-model-based tools like Track-Anything and PromptTrack are competitive low-annotation alternatives (Bibinbe et al., 15 Sep 2025). Taken together, these works show that PigTrack is less a replacement for prior resources than a standardized reference point for box-level pig MOT under difficult farm conditions.

6. Limitations, interpretive cautions, and significance

Several cautions are built into the benchmark design itself. The official test set uses the same pen environments as training and validation, so it is not a strict cross-environment benchmark. Clips that were too ambiguous to label reliably were excluded, which bounds the difficulty by what human annotators judged feasible. The “challenging clip” selection process had no formal criterion. In addition, the annotation rule prohibiting pigs from leaving and later re-entering within a clip simplifies the identity problem relative to unconstrained farm video (Henrich et al., 22 Jul 2025).

These design choices do not diminish the benchmark’s utility, but they define its scope. PigTrack is best interpreted as a standardized benchmark for difficult, densely annotated within-environment pig MOT rather than as a complete model of every farm deployment condition. Its official test emphasizes robustness to hard scenes in known pens, while unseen-pen generalization is examined separately.

The benchmark’s broader significance is data-centric. One of its strongest conclusions is that carefully selected, high-quality, diverse, and challenging training data matter enormously. The paper argues that before inventing specialized architectures, it is often more productive to invest in better benchmark data, realistic hard cases, and robust detector training. PigTrack operationalizes that claim by supplying a public, densely annotated benchmark with code and persistent identifiers. The accompanying resources are public through the PigBench repository and the PigTrack DOI, positioning PigTrack as a reusable reference dataset rather than a one-off experimental corpus.

A common misconception is to treat PigTrack as a tracking model. It is not. PigTrack is the benchmark dataset and evaluation setting; the tracked methods range from SORT-derived pipelines to end-to-end transformers. Another misconception is to conflate PigTrack with PigDetect or Pigtrace. PigDetect is an image detection dataset without identity continuity, and Pigtrace is a separate benchmark aimed at joint STAR tasks with richer annotation modalities. PigTrack’s contribution is narrower but more focused: a large, densely annotated, box-level MOT benchmark designed to expose precisely the failure modes that matter in barn tracking—occlusion, poor visibility, homogeneous appearance, and long-horizon identity maintenance.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to PigTrack.