arXiv:2611.06864cs.CVNov 2026

Manuscript Offprint

arXiv:2611.06864

CounterFactual Retrieval for Evidence-Aware Individual Animal Identification

Ankit K. Upadhyay, Aleksandr Algasov, Ekaterina Nepovinnykh, Fedor Zolotarev, Tuomas Eerola, Heikki Kälviäinen, Charles V. Stewart, Lukas Picek

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

Abstract

Automated identification of individual animals is moving from small curated studies toward shared benchmarks and reusable foundation models. This progress is useful, but current evaluation leaves the evidence behind a match unresolved, i.e., high retrieval accuracy does not show whether a model used animal features or identity-correlated shortcuts. We address this with Counterfactual Foreground Retrieval (CFR), an evidence-aware evaluation protocol. CFR evaluates the same query-gallery task under different views: full image, foreground-only, and shortcut-only. The full-image measures standard retrieval performance; the foreground-only measures foreground-supported retrieval; and shortcut-only view measure how much identity signal is recoverable from background, or silhouette. This turns a retrieval score into an evidence profile: how well the model performs on the original images, how much of that performance remains when only the animal is visible, and how much identity signal remains recoverable when the animal is removed. We release around 0.5M masks for 34 datasets and code for mask generation and CFR evaluation.¹

1. Introduction

Identifying individual animals across time and space is central to many ecological studies, e.g., population estimation, survival, and movement [26, 36]. Automating this task is increasingly important as manual photo-identification is slow, unreliable, labor-intensive, and hard to scale [42]. As a result, the field is moving from proprietary design and deployment towards open benchmarks and reusable foundation models [12, 30]. This shift has made methods easier to compare and potentially deploy, but it has also exposed a weakness in their evaluation. A correct retrieval does not necessarily mean that the model used the biometric the dataset was built around, such as a coat pattern, an arrangement of facial scales, or a fin contour. It may also

Figure

Figure 1. Strong retrieval scores depend on different evidence. Standard retrieval reports whether the correct individual is retrieved, but not which visual evidence supports it. We therefore introduce the Shortcut Signal Indicator (SSI), which measures how much of the full-image retrieval signal can be recovered from shortcut-only inputs. Among otherwise strong results, SSI ranges from almost zero to almost one, showing why retrieval performance should be evaluated along with the evidence behind it.

be driven by background, capture context, near-duplicates, training-set overlap, or by body outline in species whose identity comes from a surface pattern (see Tab. 1).

This ambiguity matters because the settings in which the methods for automated identification are used are usually far from the benchmark. Field images vary across cameras, observers, locations, seasons, and capture conditions. If an evaluation rewards context that correlates with identity, its accuracy can overstate the model's reliability once deployed. The core evaluation question should therefore not only be whether a model retrieves the correct individual, but what evidence makes it possible.

¹https://github.com/Imageomics/cfr

We address this with Counterfactual Foreground Retrieval (CFR), a leakage-aware evaluation protocol. CFR evaluates the same query-gallery retrieval task on matched full-image, foreground-only, and shortcut-only. These views separate standard retrieval performance from animal-visible evidence and shortcut evidence. CFR summarizes how much of the full-image retrieval score remains supported by the foreground, while the shortcut signal indicator (SSI) measures how much of the full-image signal is recoverable from the background or from the animal's body outline, which we isolate with a silhouette-only view. Outline is excluded from the shortcut signal for species whose identity is carried by shape, such as whale flukes and dorsal fins. CFR does not replace full-image accuracy or treat foreground-only retrieval as leakage-free; together, CFR and SSI report the evidence profile behind the score.

Alongside the CFR protocol, we update the Wildlife-Datasets library [12] into a leakage-auditable benchmark suite. We add the missing segmentation and evaluation layer on top of existing datasets: foreground masks for roughly 0.5M images from 34 datasets, mask-generation code for future use, and CFR-related evaluation code. All this allows testing whether retrieval is supported by animal-visible evidence, background context, or silhouette cues, whereas previously, only full-image retrieval was reported.

Finally, we use CFR to audit selected models on a wide variety of datasets. The results show that full-image Retrieval@k can hide very different evidence profiles. Some model-dataset pairs are strongly foreground-supported, with high CFR and low SSI. Others are overdetermined, i.e., the animal foreground supports retrieval, but background or silhouette cues are also predictive. In the most confounded cases, shortcut-only inputs recover a large fraction of the full-image signal. These results show why full-image accuracy is not enough. It reports only whether retrieval succeeds, but not whether the success comes from the animal or from the dataset shortcuts.

Contributions. Our work shifts the existing evaluation of individual animal identification towards a more reliable one:

  • We show that standard scores can be incomplete. We provide evidence across multiple datasets and models, that full-image retrieval hides shortcut reliance by retaining identity signals from background and/or silhouette.

  • We introduce Counterfactual Foreground Retrieval. CFR evaluates the same retrieval task under matched full-image, foreground- and shortcut-only views, separating operational performance from animal-visible evidence and shortcut signal.

  • We make existing benchmarks auditable. We add accurate masks to around 0.5M images across 34 publicly available datasets and code to generate them, enabling CFR where it was previously not possible.

DatasetModelRandomFull imageForeg.Shortcut
WhaleSharkID [19]DINov30.535.330.319.1
MegaDC0.530.524.816.3
LeopardID2022 [47]DINov31.157.452.246.3
MegaDC1.151.644.040.5
Saimaa seal [41]DINov30.746.624.439.1
MegaDC0.736.728.328.9
SeaTurtleID2022 [1]DINov30.559.057.318.8
MegaDC0.560.658.613.9
StripeSpotter [24]DINov33.082.181.63.2
MegaDC3.096.696.53.3
HyenaID2022 [46]DINov30.763.760.644.1
MegaDC0.762.852.438.8
BrownBearHeads [34]DINov31.699.098.772.4
MegaDC1.693.691.066.6
CzechLynx [33]DINov31.968.155.756.6
MegaDC1.960.448.645.7
NyalaData [14]DINov30.714.815.85.9
MegaDC0.715.213.96.4

Table 1. Standard evaluation hides shortcut signal. Even in the zero-shot setting, the shortcut-only view can retrieve correct identities above random chance. This indicates that full-image Retrieval@k can reflect not only animal-visible evidence, but also identity-correlated background or silhouette cues. C-not trained on any datasets in this table.

References (42)