Manuscript Offprint
arXiv:2609.05038PuTR-CouT: Counting-by-Tracking in Camera-Trap Image Sequences
Abstract
Species identification in camera trap images has been widely studied, but key ecological modeling tasks such as species abundance or density estimation also require counting individual animals. However, the lack of counting labels in most datasets and low frame rates (typically 1 frame per second) make sequence-level tracking and count estimation particularly challenging. In this work, we present PuTR-CouT, a counting-by-tracking framework built on a transformer-based learned association mechanism for sequence-level animal counting in camera trap images. To address the scarcity of annotated tracking data, we generate synthetic training data by exploiting structural priors, such as static backgrounds and short temporal bursts, to heuristically create pseudo-tracking labels in a weakly supervised manner. The resulting tracker associates detections across frames, using these tracks to estimate per-species counts. We also refine the MaxBoxCount heuristic used by the top solutions of the iWildCam 2021 challenge as a strong baseline, setting the highest score reported to date. When evaluated on the iWildCam 2021 benchmark, our framework PuTR-CouT delivers competitive counting results compared to the improved MaxBoxCount, with the added capability of multi-species predictions and track-level verification.
1. Introduction
Camera traps are a non-invasive and cost-effective tool for wildlife monitoring and ecological research [2, 11, 30]. However, they produce large volumes of image data whose manual processing is expensive and time-consuming [21, 27]. In the last decade, the computer vision community has investigated diverse approaches to improve automated information extraction from these data. Much effort has been dedicated to species identification [3, 21, 25, 29, 33], which enables scientists to model species richness, occurrence, and distribution [5, 30]. Yet, certain ecological modeling tasks, such as estimating species abundance or density, also require counting the number of individuals captured across
image sequences [5, 20, 23].
Counting the number of individuals in a single image can be proxied using an object detector, such as MegaDetector [4, 22]. However, most camera trap projects capture multiple images per event to ensure a clear shot for identifying the photographed animal [3, 21]. Therefore, simply counting bounding boxes can over- or underestimate the actual number of individuals, as the same individual may appear in multiple images, or different individuals may appear across different images of the same sequence. This motivates more sophisticated approaches for sequence-level counting, which may require tracking or re-identification (re-ID) methods [5].
Nevertheless, we observe that camera-trap data present several challenges for animal counting. First, image sequences are typically captured at low frame rates (e.g., 1 frame per second), causing large displacements between consecutive frames and low bounding box overlap. This can limit the effectiveness of traditional multi-object tracking (MOT) methods that rely primarily on geometric cues. Second, significant appearance changes from varying poses, illumination, or occlusions complicate re-ID across frames. Third, most camera-trap datasets lack counting or tracking labels.
The iWildCam 2021 Challenge [5] introduced a benchmark addressing this setting: sequence-level counting at low frame rates without training count labels, which were only collected for the private test set. Top challenge solutions relied on simple heuristics, such as taking the maximum count of bounding boxes (MaxBoxCount) across images, but restricting the prediction to a single species per sequence. Despite their simplicity, these heuristic approaches have proven to be strong baselines, with top solutions in the 2022 challenge continuing to adopt similar strategies [31]. In this work, we revisit MaxBoxCount using stronger detection and classification models to establish an improved baseline for this counting challenge.
Recent work further demonstrates the potential of combining temporal correspondence with individual-level wildlife monitoring. Schall et al. [24] introduced Go-rillaWatch, an end-to-end system integrating detection, multi-object tracking, and individual re-identification for in-the-wild gorilla monitoring. While their work focuses primarily on video sequences of a single species and relies on re-ID for counting, our approach is complementary: we investigate sequence-level counting in low-frame-rate camera traps, leveraging tracking as an explicit intermediate representation for count estimation.
In this work, we present a counting-by-tracking framework built on a transformer-based learned association mechanism for sequence-level animal counting in camera trap images. To address the scarcity of annotated tracking data, we generate synthetic training data by exploiting structural priors, such as static backgrounds and short temporal bursts, to heuristically create pseudo-tracking labels in a weakly supervised manner. The resulting tracker associates detections across frames, using these tracks to estimate per-species counts. When evaluated on the iWildCam 2021 benchmark, our improved version of MaxBoxCount achieves the highest score reported to date, while our learned counting-by-tracking framework yields competitive results enabling full sequence-level tracking and multi-species predictions.
As the main contributions of this paper, we can highlight:
-
A novel strategy for generating synthetic labeled data for multi-object tracking that takes advantage of camera trap image sequence priors, allowing supervised training of trackers with learned association modules.
-
The development of a transformer-based counting-by-tracking framework that estimates the number of individuals via tracklets, enabling multi-species predictions across sequences and species classification based on multiple views per individual.
-
An improved maximum bounding box counting heuristic leveraging state-of-the-art detection and classification models, which achieves the top result reported to date on the iWildCam 2021 benchmark private score.
Counting individuals in camera-trap data. In recent years, some efforts have been made to address the task of counting animals in camera-trap images. Counting animals in a single image has been framed as a classification problem [21] or solved using object detectors to count individuals based on bounding-box counts [14, 22]. For counting in sequences of camera-trap images, early solutions relied primarily on simple heuristics, such as selecting the maximum number of bounding boxes across frames, as proposed by top solutions in the iWildCam 2021 and 2022 challenges [5, 9, 31]. In other domains, animal counting has frequently been formulated as multi-object tracking (MOT), such as pig counting from top-down cameras [7, 12, 15], underwater fishway monitoring [35], and sonar video analysis [13]. Recently, Schall et al. [24] introduced the GorillaWatch dataset, combining MOT and individual re-identification (re-ID) to count gorillas in camera-trap videos. However, counting animals in image bursts remains challenging: low frame rates (e.g., 1 frame per second) cause large displacements that degrade traditional MOT methods reliant on motion or geometric cues, while severe appearance changes further complicate tracking.
3. Improving the MaxBoxCount heuristic as a strong counting baseline
The top solutions in the iWildCam 2021 Challenge adopted a heuristic strategy in which the number of individuals is estimated as the maximum number of bounding boxes (MaxBoxCount) in any image across a sequence, assuming that only one species is present [9]. Although this heuristic, by construction, is unable to predict multiple species within a sequence, this baseline has been shown to be effective on iWildCam 2021. In this section, we revisit MaxBoxCount by updating its detection and classification modules with improved wildlife monitoring models introduced since the conclusion of the challenge, providing a strong baseline for comparison with our proposed counting-by-tracking framework.
For the animal detector, we used MegaDetectorV1000-redwood both to generate bounding boxes for training the
https://github.com/agentmorris/MegaDetector/blob/main/docs/release-notes/mdv1000-release.md classifier and to evaluate the counting heuristic. The authors recommend a default threshold of 0.3 or 0.4 for this model family. We set the threshold to 0.3 when generating bounding boxes for classifier training, as the classifier is more robust to noisy detections, and to 0.4 for the counting heuristic as a more conservative choice. For species classification, we used a Swin-B model with an input resolution of 224 × 224 from the Swin Transformer family [18]. Following top challenge solutions, we adopted an ensemble approach using two models: one trained on full images and another on cropped bounding boxes.
Image preprocessing. For the crop classifier, we first applied a square crop centered on each bounding box. Then, for both the full-image and crop models, the images were resized so that the smallest side was 450 pixels. During training, we used a set of standard data augmentation operations: a random crop with aspect ratio sampled in [3/4, 4/3] and area in [0.65, 1.0], random horizontal flipping with 50% probability, and RandAugment [8] with parameters N = 2 and M = 9. Finally, images were normalized using the ImageNet mean and standard deviation and resized to 224 × 224. During inference, preprocessing consisted only of normalization and resizing to match the input resolution of the architecture.
Implementation details. The models were initialized with ImageNet-1k pretrained weights from the timm library [32] and trained using the AdamW [19] optimizer with a batch size of 64 for 30 epochs. The initial learning rate was set to 10⁻⁵, and the weight decay was set to 10⁻⁷. The learning rate was linearly warmed up from 0 to the initial value for 2 epochs and then decayed to 0 using a cosine schedule [10]. We also employed label smoothing [28] with ε = 0.1.
Classification inference. Following the top solutions of iWildCam 2021, image-level predictions are computed using a weighted ensemble of predictions: 0.15 × full image + 0.15 × mirrored full image + 0.35 × bbox + 0.35 × mirrored bbox. Sequence-level species predictions are then obtained by averaging the predictions across all non-empty images in the burst.
4. Counting-by-Tracking in Camera Trap Image Sequences
A natural approach to counting animals in a sequence is to track them across images. In this approach, the detections in each image are associated with the corresponding detections in other images of the same sequence, framing the problem as a multi-object tracking task. The number of animals can then be obtained by counting the number of unique tracks, which we refer to as counting-by-tracking.
In this section, we explore a counting-by-tracking approach built upon Pure Transformer (PuTR) [17] trained to track animals in camera trap image sequences. Each track

Figure 1. The PuTR-Cout framework first detects bounding boxes using MegaDetectorV1000, connects frame-to-frame detections via a synthetic-trained Transformer tracker to form single-animal tracks, and finally classifies each track independently to output per-species animal counts for the sequence.
is then classified individually using all associated bounding boxes, and the number of individuals per species is estimated by counting unique tracks. Since labeled datasets for multi-object tracking in camera trap image sequences are usually not available, we propose a method for generating a synthetic training set with pseudo-labels, enabling weakly supervised training of the tracking model. Fig. 1 summarizes our approach, which we call Pure Transformer for Counting-by-Tracking (PuTR-CouT).
4.1. Generating a synthetic training set for tracking using camera trap sequence priors
Classical trackers such as SORT and ByteTrack rely on motion models and geometric overlap. Therefore they do not require a labeled tracking dataset. Trackers that incorporate learned association modules, such as PuTR, require track-let annotations for training. Unfortunately, obtaining such labels is infeasible in most camera trap projects.
We overcome this limitation, we begin by defining a base case for generating tracking labels as sequences in which an animal detector produces at most one bounding box per image. Under this condition, we assume that only a single individual appears throughout the entire sequence. Although this assumption does not always hold, it provides a reasonable starting point, and we accept the potential noise introduced by this simplification.
Next, to synthesize sequences containing more than one individual, i.e. to simulate animal herds, we leverage the static nature of camera traps by merging base-case tracks from sequences obtained at the same location, as shown in Fig. 2. As the background may gradually change due to vegetation growth over time, illumination variations throughout the day, or different weather conditions, to minimize domain shift and visual inconsistencies across merged frames, we restrict the merging process to sequences captured at the same location and within the same coarse timeslot : morning, afternoon, or night. Importantly, under the PuTR formulation, each input token represents a bounding box rather than the full image. Therefore, synthetic sequences can be constructed simply by combining cropped bounding boxes from the original sequences, without explicitly generating synthetic composite images.
Finally, the number of individuals or different species present in a sequence may vary across species and locations. Since the number of individuals per sequence is unknown in our problem setting, we cannot directly replicate real-world count distributions when generating our synthetic dataset by merging single-individual sequences. To address this limitation, we employ the MaxBoxCount heuristic as a proxy for the number of individuals per sequence in a weakly supervised formulation. By generating synthetic samples that follow this distribution, we aim to mitigate the impact of distribution shift in the number of tracks per sequence when evaluating the model on the real test set.
Given the counts produced by MaxBoxCount on the iWildcam 2021 training set, we used the statsmodels library [26] to fit a Negative Binomial distribution (NB), finding the parameters and . We then use the fitted model to sample the number of individuals for each synthetic sequence. For the number of species, based on the observation that in
Algorithm 1 Synthetic Sequence Generation
1: Input: Training set , animal detector , target number of samples
2: Output: Synthetic dataset
3: {Extract detections}
4: {Sequence counts}
5: Fit Negative Binomial parameters to
6: {Single-individual sequences}
7:
8:
9: for to do
10: Sample {Number of individuals}
11: Sample {Number of species}
12: Sample location and timeslot
13: sequences from matching
14: such that total distinct species
15:
16:
17: end for
18: return
the Snapshot Serengeti dataset [27] 95% of non-empty sequences contain a single species, we set the probability of observing a single species to 95%, two species to 4.9%, and three species to 0.1%. Algorithm 1 provides a pseudo-code for generating the synthetic dataset for tracking.
Implementation details. To generate bounding boxes, we used MegaDetectorV1000-redwood with a confidence threshold of 0.4, following the improved baseline. We filtered out sequences labeled as empty and generated 75,000 synthetic sequences, of which 35,804 were non-empty. Empty sequences are ignored during PuTR training and do not contribute to the loss. This number is comparable to the iWildCam 2021 training set, which contains 36,547 sequences. Since sequences contain 1–10 images, we aligned images from the first capture of each sequence and generated synthetic sequences matching the length of the longest base sequences to preserve temporal consistency.
4.2. Adapting PuTR for tracking under camera trap constraints
We build our counting-by-tracking framework on top of the original PuTR implementation, introducing adaptations to handle the characteristics of camera-trap image sequences. We retain the original model architecture, composed of 6 transformer blocks with multi-head self-attention (8 heads), including temporal and spatial positional encodings and a causal attention mask. The model is trained to associate each bounding box with one from the previous frame.
We define the timeslots as follows: morning from 05:00 to 11:00, afternoon from 11:00 to 17:00, and night for the remaining hours.

Figure 2. Illustration of the proposed synthetic sequence generation. Base-case tracks captured at the same location and within the same coarse timeslot can be merged to simulate a multi-individual sequence. Each cropped box is treated as a token by PuTR, removing the need to reconstruct composite images.
Detections. To maintain consistency with the MaxBox-Count baseline, we use MegaDetectorV1000-redwood to generate bounding boxes for both training and inference. This version is based on YOLOv5x6, while the original PuTR uses YOLOX during inference. We assume that MegaDetectorV1000 produces high-quality detections for this task, and all detections with confidence above 0.4 are treated as ground truth during training.
Tokenization. In PuTR, each bounding box is translated into a token. Although the authors suggest using Re-ID models or DETR-based features to obtain high-dimensional representations, the embeddings for the tokens are extracted directly from raw image patches. Given the high appearance variance across images in camera-trap data, in our framework we choose to adopt MegaDescriptor [6] to generate the embeddings, a re-ID model designed for wildlife data. Additionally, we evaluate embeddings extracted from the species classifier trained on iWildCam 2021, the same model used to identify the species in the framework.
Sequence length. During training, the original PuTR implementation progressively increases the number of frames used per clip by adjusting the sampling rate, with the number of frames going from 4 to 128 according to the epoch. However, while the original implementation consid-
ers videos with a regular frame rate (for example, 30 FPS), this is not the case for camera-trap image sequences, which usually have 1 FPS and a small number of frames per sequence. In our dataset, bursts vary from 1 to 10 frames. Therefore, we fix the sequence length to 10 frames for both training and inference, padding sequences with fewer frames as needed.
Implementation details. To generate the tokens, the bounding boxes are cropped, resized, and vectorized resulting in 1024-dimensional embeddings, which are precomputed during synthetic dataset generation for computational efficiency. These embeddings are then passed through a linear projection layer to obtain the token representation, matching the PuTR model dimension ().
To prevent the model from exploiting ordering biases introduced during synthetic data generation, we randomly permute the bounding boxes within each frame during training. Finally, no image-level data augmentation is applied.
We train PuTR from scratch on the synthetic dataset following the original training recipe. The model is trained for 7 epochs with a batch size of 4. We use the AdamW optimizer with an initial learning rate of 0.0002 and a weight decay of 0.0005. Gradients are accumulated over 32 steps, and gradient clipping is applied with a maximum norm of
1.0. We also employ a cosine learning rate decay schedule.
4.3. Tuning PuTR inference for the counting task
PuTR relies on a runtime manager to handle tracklet states and uses the Hungarian algorithm [16] to associate detections across frames based on the Transformer affinity matrix. We retain the original runtime manager with minor adaptations for camera-trap image sequences.
First, we set the detection threshold to 0.4, so only these detections are visible to the tracker. Each detection is associated with a detection in the previous frame; if unmatched, it is initialized as a new track only if its confidence exceeds 0.5. These settings maintain consistency with the thresholds used in the MaxBoxCount baseline and other multi-object trackers in our experiments.
In the PuTR runtime, a track must accumulate at least three hits to be confirmed, remaining in a “new track” state until then to ensure stability. While this is suitable for videos with regular frame rates, it is impractical for camera-trap sequences at 1 FPS, where animals may appear in only a single frame. Given this constraint, and considering the high quality of MegaDetector detections, we remove this stabilization requirement.
To improve tracking, PuTR applies a series of geometric and positional compensations to the affinity matrix produced by the Transformer. However, the large displacements of animal detections between frames in camera-trap sequences can make these compensations ineffective or even harmful. Therefore, we remove them, relying solely on the Transformer predictions for association, and evaluate this design choice in an ablation study.
We also relax the association thresholds ASSO_THRE1 and ASSO_THRE2, which control the association of detections to tracks based on bounding box IoU and visual affinity, respectively. We set ASSO_THRE1 to 0.0, effectively disabling the IoU constraint, and reduce ASSO_THRE2 from 0.8 to 0.25 to account for large appearance variations across frames. This helps reduce track fragmentation, i.e. cases where a track is incorrectly split into multiple tracks, artificially increasing the counts.
5. Experiments and Results
Our experiments were conducted on the iWildCam 2021 dataset using the official challenge metric, the mean column-wise root mean squared error (MCRMSE). Since the test set labels are not publicly available, we evaluated our method on the Kaggle competition platform via late submissions. We report both public and private scores, each corresponding to approximately 50% of the test set: the public score was visible during the competition, whereas the private score, revealed only after the competition ended, determined the final rankings.
5.1. Improved MaxBoxCount heuristic results
To evaluate the extent to which the proposed improvements in Sec. 3 impact the performance of the MaxBoxCount heuristic, we first replace only the classifier component. As shown in Tab. 1, while keeping the bounding box counts from MegaDetectorV4 as in the winning solution, the error is reduced by 12.4%, from 0.0293278 to 0.0256999. Notably, the error gap between the first- and second-place solutions is less than 0.2%, while the gap to the third place is approximately 4.9%. When using MegaDetectorV1000 to generate bounding boxes for counting, the error decreases further to 0.0238785, corresponding to an improvement of approximately 18.5% relative to the winning solution. These results demonstrate the effect of the updated models on the heuristic.
5.2. PuTR-CouT results
Trackers experimental settings. The improved MaxBoxCount heuristic, despite its strong performance, is inherently limited to predicting a single species per sequence (sequence-level classification). In contrast, PuTR-CouT overcomes this limitation by adopting a count-by-tracking strategy, where each track is classified independently (track-level classification). Therefore, we also include ByteTrack and BoT-SORT, two multi-object trackers, in our experiments to compare PuTR-CouT with approaches that support track-level classification, enabling a fairer evaluation. Additionally, all trackers use the same MegaDetectorV1000 bounding boxes as MaxBoxCount, as well as the same Swin-B-based bounding box classifier for track classification.
For ByteTrack, we set the high track threshold (used as the primary criterion for selecting bounding boxes for tracking) to 0.4 to maintain consistency with MaxBoxCount, while keeping the default low track threshold of 0.1. For the new track threshold, we follow the original ByteTrack implementation, setting it to be 0.1 higher than the high track threshold (i.e., 0.5 in this case). For BoT-SORT, we use the same threshold values. For the additional thresholds in BoT-SORT, we relax both the proximity and appearance thresholds (to 0.95 and 0.5, respectively) to account for the characteristics of camera trap image sequences, which often exhibit large displacements and higher appearance variability across images. Furthermore, since camera traps are static, we disable the Camera Motion Compensation module.
For BoT-SORT, we conduct experiments both with and without re-ID module to evaluate their impact. For the re-ID features, we use MegaDescriptor as well as features produced by the classifier, using the same models employed during the tokenization process for PuTR.
Trackers results. The results shown in Tab. 1 highlight several important trends. When comparing Byte
Table 1. Main results on iWildCam 2021 for animal counting (MCRMSE). We compare the top-3 challenge submissions, the improved MaxBoxCount baseline, classical multi-object trackers, and PuTR-CouT. All classifier entries are ensembles of the specified architecture. Bold and underlined values indicate the best and second-best scores, respectively. Lower is better.
| Strategy | BBoxes | Classifier | Re-ID | Counting | Classif. | Public ↓ | Private ↓ |
|---|---|---|---|---|---|---|---|
| 2021 Winning solution [9] | MDv4 | Eff.-B2 | – | Boxes | Sequence | 0.0300970 | 0.0293278 |
| 2nd place solution | MDv3 | Eff.-B2ResNet152 | – | Boxes | Sequence | 0.0297267 | 0.0293786 |
| 3rd place solution | MDv4 | + Eff.-B3+ Eff.-B7 | – | Boxes | Sequence | 0.0315964 | 0.0308570 |
| MaxBoxCount (ours) | MDv4 | Swin-B | – | Boxes | Sequence | 0.0269689 | 0.0256999 |
| MaxBoxCount (ours) | MDv1000 | Swin-B | – | Boxes | Sequence | 0.0254706 | 0.0238785 |
| ByteTrack | MDv1000 | Swin-B | – | Tracks | Sequence | 0.0297142 | 0.0282785 |
| ByteTrack | MDv1000 | Swin-B | – | Tracks | Tracks | 0.0285004 | 0.0284988 |
| BoT-SORT | MDv1000 | Swin-B | – | Tracks | Tracks | 0.0279936 | 0.0283493 |
| BoT-SORT | MDv1000 | Swin-B | Swin-B | Tracks | Tracks | 0.0272002 | 0.0273195 |
| BoT-SORT | MDv1000 | Swin-B | MegaDescriptor | Tracks | Tracks | 0.0270137 | 0.0272918 |
| PuTR-CouT (ours) | MDv1000 | Swin-B | Swin-B | Tracks | Tracks | 0.0254377 | 0.0248642 |
| PuTR-CouT (ours) | MDv1000 | Swin-B | MegaDescriptor | Tracks | Tracks | 0.0250704 | 0.0250820 |
Track configurations, track-level classification performs slightly worse than sequence-level classification on the private score. However, it shows a larger advantage on the public score. Although ByteTrack yields the weakest performance among all evaluated trackers, it still surpasses the winning solution.
For BoT-SORT, the use of re-ID module leads to improved performance compared to configuration without re-ID. Finally, PuTR-CouT outperforms all other trackers, achieving an error of 0.0248642, corresponding to an improvement of nearly 9% over BoT-SORT when using the same re-ID model. In particular, PuTR-CouT with Swin-B features reduces the error by approximately 15.2% compared to the winning solution on the private score. Moreover, PuTR-CouT with MegaDescriptor achieves the best result on the public score, surpassing even the improved MaxBoxCount heuristic (0.0250704 vs. 0.0254706). Qualitative examples of the resulting tracks and counting predictions are shown in Fig. 3.
5.3. Ablation studies on PuTR-CouT
Improving tracks. When constructing the synthetic training set for tracking, we observed that some image sequences were incorrectly ordered. In this ablation study, we evaluate the impact of reordering sequences based on timestamp information extracted from EXIF metadata. For PuTR, we assess all combinations of applying or not applying reordering during both training and inference. In contrast, since ByteTrack and BoT-SORT do not involve a training phase, we evaluate reordering only at inference time.
Table 2. Effect of reordering camera-trap sequences based on EXIF information for the training and test sets, and pre-filtering empty bounding boxes. Results are reported on the private test set. Lower is better.
| Tracker | Reorder | FilterBBoxes | Private ↓ | |
|---|---|---|---|---|
| Train | Test | |||
| ByteTrack | 0.0282683 | |||
| ByteTrack | ✓ | 0.0284988 | ||
| BoT-SORT (MegaDesc.) | 0.0270292 | |||
| BoT-SORT (MegaDesc.) | ✓ | 0.0272918 | ||
| PuTR (MegaDesc.) | 0.0256394 | |||
| PuTR (MegaDesc.) | ✓ | 0.0248314 | ||
| PuTR (MegaDesc.) | ✓ | 0.0258654 | ||
| PuTR (MegaDesc.) | ✓ | ✓ | 0.0250820 | |
| PuTR (MegaDesc.) | ✓ | ✓ | ✓ | 0.0253143 |
As shown in Tab. 2, reordering slightly degrades performance for both ByteTrack and BoT-SORT, increasing the private error by less than 1%. However, for PuTR-CouT, reordering reduces the error by approximately 3% compared to the original dataset ordering. This improvement is consistent regardless of whether reordering is applied during training, highlighting the effectiveness of sequence reordering for PuTR-CouT. We also investigate filtering out detections classified as empty before passing them to the tracker. This strategy, however, leads to an increase in error.
Improving the affinity matrix. In this ablation study, we evaluate the impact of disabling the additional compo-

Figure 3. Illustrative examples of counting predictions. Bounding box colors denote the tracks generated by PuTR-CouT. Only the first three images of each sequence are displayed. The first row demonstrates a key advantage of PuTR-CouT over MaxBoxCount in handling multi-species counting scenarios. Best viewed in color.
Table 3. Ablation of affinity-matrix components in PuTR on camera-trap sequences. Results are reported on the private test set. Lower is better.
| Tracker | IoU comp. | HMIOU | HIOU | Traj. conf. | Det. conf. | Private |
|---|---|---|---|---|---|---|
| PuTR | 0.0250820 | |||||
| PuTR | ✓ | 0.0252154 | ||||
| PuTR | ✓ | 0.0253234 | ||||
| PuTR | ✓ | 0.0253234 | ||||
| PuTR | ✓ | 0.0254082 | ||||
| PuTR | ✓ | 0.0251428 | ||||
| PuTR | ✓ | ✓ | ✓ | ✓ | ✓ | 0.0253416 |
nents of the affinity matrix introduced in the original PuTR implementation. As shown in Tab. 3, none of these components improve performance in our setting. This finding supports our hypothesis that incorporating geometric features is challenging for this task, and suggests that predictions based solely on transformer representations are already competitive.
6. Conclusions
Counting animals in camera trap image sequences is a challenging task, particularly when count labels are unavailable, as is the case for most public datasets. In this work, we introduced PuTR-CouT, a counting-by-tracking approach built on a transformer-based multi-object tracker with learned association. The method was trained using a synthetic dataset generation strategy that exploits structural priors in camera trap sequences, within a weakly supervised setting.
We evaluated our approach against traditional multi-object trackers and the state-of-the-art heuristic MaxBoxCount. The results show that PuTR-CouT achieves competitive performance while offering key advantages: unlike MaxBoxCount, it inherently supports counting multiple species within the same sequence and enables direct verification through track analysis.
Acknowledgments
This study was financed in part by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior - Brasil (CAPES) - Finance Code 001. This work was partially supported by Amazonas State Research Support Foundation - FAPEAM - through the POSGRAD project.
References
[1] Nir Aharon, Roy Orfaig, and Ben-Zion Bobrovsky. Botsort: Robust associations multi-pedestrian tracking. arXiv preprint arXiv:2206.14651, 2022. 2
[2] Jorge A Ahumada, Johanna Hurtado, and Diego Lizcano. Monitoring the status and trends of tropical forest terrestrial vertebrate communities from camera trap data: a tool for conservation. PloS one, 8(9):e73707, 2013. 1
[3] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision, pages 456–473, 2018. 1
[4] Sara Beery, Dan Morris, and Siyu Yang. Efficient pipeline for camera trap image review. arXiv preprint arXiv:1907.06772, 2019. 1
[5] Sara Beery, Arushi Agarwal, Elijah Cole, and Vighnesh Birodkar. The iwdcam 2021 competition dataset. arXiv preprint arXiv:2105.03494, 2021. 1, 2
[6] Vojtěch Čermák, Lukas Picek, Lukáš Adam, and Kostas Papafitsoros. Wildlifedatasets: An open-source toolkit for animal re-identification. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 5953–5963, 2024. 5
[7] Guang Chen, Shiwen Shen, Longyin Wen, Si Luo, and Liefeng Bo. Efficient pig counting in crowds with keypoints tracking and spatial-aware temporal response filtering. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 10052–10058. IEEE, 2020. 2
[8] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 702–703, 2020. 3
[9] Fagner Cunha, Juan G. Colonna, and Eulanda M. dos Santos. Counting animals in camera-traps image sequences without count labels: Winning solution to the iwdcam 2021 challenge. arXiv preprint arXiv:2609.03233, 2026. 2, 7
[10] Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 558–567, 2019. 3
[11] Zhihai He, Roland Kays, Zhi Zhang, Guanghan Ning, Chen Huang, Tony X Han, Josh Millspaugh, Tavis Forrester, and William McShea. Visual informatics tools for supporting large-scale collaborative wildlife monitoring with citizen scientists. IEEE Circuits and Systems Magazine, 16(1):73–86, 2016. 1
[12] Yigui Huang, Deqin Xiao, Junbin Liu, Zhujie Tan, Kejian Liu, and Miaobin Chen. An improved pig counting algorithm based on yolov5 and deepsort model. Sensors, 23(14):6309, 2023. 2
[13] Justin Kay, Peter Kulits, Suzanne Stathatos, Siqi Deng, Erik Young, Sara Beery, Grant Van Horn, and Pietro Perona. The caltech fish counting dataset: a benchmark for multiple-object tracking and counting. In European Conference on Computer Vision, pages 290–311. Springer, 2022. 2
[14] Frank G. Kilima, Shubi Kaijage, Edith Luhanga, and Colin Torney. A yolov4 method for wild animal counting and behaviour detection using small-sized camera-trap image dataset. ICTACT Journal on Soft Computing, 15(4):3722–3728, 2025. 2
[15] Jonggwan Kim, Yooil Suh, Junhee Lee, Heechan Chae, Hanse Ahn, Yongwha Chung, and Daihee Park. Embeddedpigcount: Pig counting with video object detection and tracking on an embedded board. Sensors, 22(7):2689, 2022. 2
[16] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955. 2, 6
[17] Chongwei Liu, Haojie Li, Zhihui Wang, and Rui Xu. Is a pure transformer effective for separated and online multi-object tracking? ACM Transactions on Multimedia Computing, Communications and Applications, 21(12):1–21, 2025. 2, 3
[18] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10012–10022, 2021. 3
[19] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. 3
[20] Anna K Moeller, Paul M Lukacs, and Jon S Horne. Three novel methods to estimate abundance of unmarked animals using remote cameras. Ecosphere, 9(8):e02331, 2018. 1
[21] Mohammad Sadegh Norouzzadeh, Anh Nguyen, Margaret Kosmala, Alexandra Swanson, Meredith S Palmer, Craig Packer, and Jeff Clune. Automatically identifying, counting, and describing wild animals in camera-trap images with deep learning. Proceedings of the National Academy of Sciences, 115(25):E5716–E5725, 2018. 1, 2
[22] Mohammad Sadegh Norouzzadeh, Dan Morris, Sara Beery, Neel Joshi, Nebojsa Jojic, and Jeff Clune. A deep active learning system for species identification and counting in camera trap images. Methods in Ecology and Evolution, 12 (1):150–161, 2021. 1, 2
[23] J Marcus Rowcliffe, Roland Kays, Chris Carbone, and Patrick A Jansen. Clarifying assumptions behind the estimation of animal density from camera trap rates. Journal of Wildlife Management, 2013. 1
[24] Maximilian Schall, Felix Leonard Knöfel, Noah Elias König, Jan Jonas Kubeler, Maximilian von Klinski, Joan Wilhelm Linnemann, Xiaoshi Liu, Iven Jelle Schlegelmilch, Ole Woyciniuk, Alexandra Schild, et al. Gorillawatch: An automated system for in-the-wild gorilla re-identification and population monitoring. In 2026 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pages 8364–8375. IEEE, 2026. 1, 2
[25] Stefan Schneider, Saul Greenberg, Graham W Taylor, and Stefan C Kremer. Three critical factors affecting automated image species recognition performance for camera traps. Ecology and Evolution, 10(7):3503–3517, 2020. 1
[26] Skipper Seabold, Josef Perktold, et al. Statsmodels: econometric and statistical modeling with python. scipy, 7(1):92–96, 2010. 4
[27] Alexandra Swanson, Margaret Kosmala, Chris Lintott, Robert Simpson, Arfon Smith, and Craig Packer. Snapshot serengeti, high-frequency annotated camera trap images of 40 mammalian species in an african savanna. Scientific data, 2, 2015. 1, 4
[28] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016. 3
[29] Michael A Tabak, Mohammad S Norouzzadeh, David W Wolfson, Steven J Sweeney, Kurt C VerCauteren, Nathan P Snow, Joseph M Halseth, Paul A Di Salvo, Jesse S Lewis, Michael D White, et al. Machine learning to classify animal species in camera trap images: Applications in ecology. Meth. in Ecology and Evolution, 10(4):585–590, 2019. 1
[30] Devis Tuia, Benjamin Kellenberger, Sara Beery, Blair R Costelloe, Silvia Zuffi, Benjamin Risse, Alexander Mathis, Mackenzie W Mathis, Frank van Langevelde, Tilo Burghardt, et al. Perspectives in machine learning for wildlife conservation. Nature communications, 13(1):1–15, 2022. 1
[31] Yizhen Wang, Yang Zhang, Yuan Feng, and Yi Shang. Deep learning methods for animal counting in camera trap images. In 2022 IEEE 34th International Conference on Tools with Artificial Intelligence (ICTAI), pages 939–943. IEEE, 2022. 1, 2
[32] Ross Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019. 3
[33] Marco Willi, Ross T Pitman, Anabelle W Cardoso, Christina Locke, Alexandra Swanson, Amy Boyer, Marten Veldthuis, and Lucy Fortson. Identifying animal species in camera trap images using deep learning and citizen science. Methods in Ecology and Evolution, 10(1):80–91, 2019. 1
[34] Nicolai Wojke, Alex Bewley, and Dietrich Paulus. Simple online and realtime tracking with a deep association metric. In 2017 IEEE international conference on image processing (ICIP), pages 3645–3649. IEEE, 2017. 2
[35] Bilang Wu, Chunna Liu, Furen Jiang, Jianyuan Li, and Zuobin Yang. Dynamic identification and automatic counting of the number of passing fish species based on the improved deepsort algorithm. Frontiers in Environmental Science, 11:1059217, 2023. 2
[36] Yifu Zhang, Peize Sun, Yi Jiang, Dongdong Yu, Fucheng Weng, Zehuan Yuan, Ping Luo, Wenyu Liu, and Xinggang Wang. Byetrack: Multi-object tracking by associating every detection box. In European conference on computer vision, pages 1–21. Springer, 2022. 2