Manuscript Offprint

arXiv:2609.03463

BMCTrack-d: Pig re-identification and tracking via back marks in challenging camera settings

David Brunner, Maciej Oczak, Marie Bordes, Jean-Loup Rault, Stephan M. Winkler, Viktoria Dorfer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Automated pig monitoring is essential for assessing their health, behaviour, and welfare. To date, most pig monitoring solutions operate on the group-level, because individual-level monitoring requires reliable long-term identification and tracking of each animal. For domesticated pigs this remains challenging because pigs of the same breed often have highly uniform appearances. Moreover, research on pig monitoring is almost exclusively reported in top-down view camera settings, which considerably ease tracking, but are not always an option in practice. In this work, BMCTrack-d is presented, a novel tracking-by-detection approach that leverages unique back marks to enable robust pig re-identification and tracking in a challenging side-view camera setting, afflicted by rapidly moving pigs, severe occlusions and low resolution. The method first predicts the detected pigs' identities using a neural network-based back mark classifier. To improve re-identification reliability over time, two dedicated post-processing stages are introduced: a temporal prediction consistency check, which validates the identity assignments against the recent prediction history, and deduplication, which resolves conflicting identity assignments in each time step. By explicitly prioritising accurate, appearance-based re-identification over continuous tracking, the proposed approach addresses a key limitation of existing trackers for individual-level monitoring scenarios. On a demanding test set BMCTrack-d outperforms two strong baselines, BoT-SORT-ReID and TrackTrack-ReID, by 9.11% and 1.03%, respectively, in higher-order tracking accuracy. These results demonstrate the effectiveness of back mark-based re-identification and tracking for robust individual-level pig monitoring in challenging settings.

Keywords: precision livestock farming; tracking; re-identification; pigs; back marks; detection

1 Introduction

Animal observation is an established way of deriving information on their reproductive state (Foote, 1975), health condition (Fernández-Carrión et al., 2017) and social relations (Clouard et al., 2024). Given that continuous observation imposes significant time investment on human observers and can be subjective, there is great interest in automated monitoring solutions, which typically take the form of sensors collecting data and machine learning (ML) algorithms extracting insights from these data. For the analysis of behaviour, a range of sensors can be used, like acceleration sensors (Mayrhuber et al., 2026) or cameras (Oczak et al., 2024). The latter show better scalability, because a single camera can cover multiple animals. However, while some sensors allow differentiating animals simply by virtue of being attached to individuals, cameras necessitate advanced computer vision algorithms for this task. A number of studies have shown ML's capacity for detecting animals (Liu et al., 2023) and analysing their behaviour (Liu et al., 2020). However, many of the existing studies perform behaviour recognition only on group level (Gan et al., 2021, 2022; Gao et al., 2023; Li et al., 2020, 2024; Liu et al., 2020; Zhang et al., 2019), e.g., counting the number of occurrences of certain behaviours in a pen. For specific interventions like treating a sick animal, or to identify social interactions between specific individuals (e.g., tail biting), it is necessary to monitor animals on the individual level instead.

To date, only few studies have reported results on individual-level monitoring in a group of animals (Odo et al., 2024, 2025; Psota et al., 2020). The main obstacle is the difficulty of tracking (Parmiggiani et al., 2023), i.e., continuously differentiating the animals, that is required for attributing behaviours to individuals. Unlike humans, who often can be differentiated by clothing alone, animals tend to have uniform appearance, which is especially true for domesticated species like pigs, that have been intensely bred for homogenous traits to enable the standardisation of production systems. To support humans in recognising individual pigs, measures

Brunner et al.

like ear marks or back marks are commonly employed, e.g., to track medical treatment or reproductive state. However, to date, only few algorithms have made use of such marks for automatic livestock monitoring (Fruhner et al., 2022; Kashiha et al., 2013; Psota et al., 2020; Wutke et al., 2025).

Furthermore, research on pig monitoring is almost exclusively reported on top-down view camera recordings (e.g., Kashiha et al. (2013); Odo et al. (2025); Psota et al. (2020)). Such a setup significantly eases tracking, e.g., by limiting the possibility of occlusions, but might be prohibitive to downstream tasks such as behaviour detection, or unfeasible due to facility constraints (see Section 3.1.2). A side-view camera setting, in contrast, can pose significant challenges to tracking due to the possibility of severe occlusions and fluctuations in resolution whenever the pigs change their angle and distance to the camera, leading to lost identities. To enable true individual-level monitoring, a tracking algorithm must have strong re-identification (reID) capabilities to recover from such practical challenges.

Taking a step towards individual-level pig monitoring in non-idealised settings, this study proposes BMCTrack-d (back-mark-classification-based tracking with deduplication), a novel algorithm aimed at identifying and tracking pigs via their back marks, designed to prioritise strong reID over tracking in order to deal with challenging camera settings. The main contributions of this study are as follows:

  • BMCTrack-d, a novel algorithm for pig reID and tracking via back marks
  • A challenging test dataset, consisting of video recordings in side-view, containing high levels of occlusion, and motion blur, as well as low-resolution pigs
  • A comprehensive set of experiments, including of a study of BMCTrack-d's modules and a comparison to state-of-the-art trackers

References (46)