ConceptioArchivearXiv CS
arXiv CSopen access

Parameter-Efficient Vision-Language Adaptation with Continuous Metadata Conditioning for Animal Re-Identification

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
artificialintelligenceknowledgerepresentationreasoning
artificial intelligence, reasoning, knowledge representation

Parameter-Efficient Vision–Language Adaptation with Continuous Metadata Conditioning for Animal Re-Identification⋆ Anil Osman Tura , Tonje Knutsen Sørdalenb,c , Kim Tallaksen Halvorsenb and Cigdem Beyana,∗ a Department of Computer Science, University of Verona, Verona, 37134, Italy b Institute of Marine Research, Nye Flødevigveien 20, 4817 His, Norway

arXiv:2607.09443v1 [cs.CV] 10 Jul 2026

c University of Agder, Centre for Coastal Research, Grimstad, 4604, Norway

ARTICLE INFO

ABSTRACT

Keywords: Animal Re-Identification Vision–Language Models Prompt Learning Low-Rank Adaptation Continuous Metadata Conditioning Longitudinal Evaluation

Long-term animal re-identification (ReID) must remain robust to gradual morphological evolution and seasonal appearance shifts. Although recent vision–language models provide strong pretrained visual representations, adapting them to longitudinal ecological settings remains challenging, particularly under identity and temporal distribution shifts. We present a parameter-efficient CLIP adaptation framework for animal ReID and introduce a continuous metadata-conditioning mechanism that incorporates numerical attributes directly into the prompt representation during training. While lowrank visual adaptation, prompt-based supervision, and cross-modal alignment provide the adaptation framework, the proposed metadata-conditioning strategy constitutes the primary methodological contribution. By preserving the continuous structure of numerical metadata rather than discretizing it into textual categories, the proposed approach enables smooth modulation of the embedding space during training while maintaining a purely visual inference pipeline. Experiments on a seven-year longitudinal fish dataset and multiple wildlife benchmarks demonstrate improved performance under closed-set, open-set, and time-aware evaluation protocols. The results demonstrate that continuous metadata conditioning improves robustness to longitudinal appearance variation and temporal distribution shifts, while parameter-efficient adaptation enables a purely visual inference pipeline without requiring metadata at test time. Code and evaluation splits can be found at: https://github.com/ AnilOsmanTur/MetaPrompt-ReID.

Author’s Note. This is the author’s accepted manuscript of the paper accepted for publication in Expert Systems with Applications. The final authenticated version will be available from the publisher.

1. Introduction Animal re-identification (ReID) refers to the recognition of previously observed individuals across time and has long been an important component of wildlife population monitoring, capture–recapture studies, and behavioral ecology [34]. In computer vision, the term more specifically denotes identifying individual animals from images or video sequences without the use of invasive tagging. Automated visual ReID enables large-scale longitudinal tracking under natural conditions [17, 9, 31]; however, this requires models to learn identity-discriminative representations capable of matching individuals across encounters based solely on visual appearance as it changes over time [40, 50, 27, 3]. Unlike person or vehicle ReID, animal ReID frequently involves long-term re-observation, where the same individual may be encountered months or even years apart [1, 39, 2]. This setting introduces challenges beyond viewpoint ⋆

∗ Corresponding author. Email: [email protected]

[email protected] (A.O. Tur); [email protected] (T.K. Sørdalen); [email protected] (K.T. Halvorsen); [email protected] (C. Beyan) ORCID (s): 0000-0001-7772-5235 (A.O. Tur); 0000-0001-5836-9327 (T.K. Sørdalen); 0000-0001-6857-2492 (K.T. Halvorsen); 0000-0002-9583-0087 (C. Beyan) 1

and illumination variation. Animals exhibit deformable body structures and substantial pose variability, while interindividual differences are often subtle and fine-grained. Moreover, appearance evolves over time due to growth, seasonal coloration shifts, and life-stage transitions, increasing intra-individual variation and complicating identity matching across extended temporal spans [7, 50, 19, 3]. In this work, we focus on fish ReID, a setting that is ecologically and economically relevant for fisheries management and population monitoring [6, 43]. We conduct experiments on the Melops dataset [53, 52], which contains images of wild corkwing wrasse (Symphodus melops) collected over seven years. The dataset comprises approximately 24K images of 9K PIT-tagged individuals and includes around 3K resighting events spanning multiple years. Melops [53, 52] reflects a fully in-the-wild data collection setting, with images acquired and annotated within a biological monitoring framework. As such, it captures realistic longitudinal variability rather than curated shortterm observations. The dataset exhibits several characteristics not fully represented in many existing animal ReID benchmarks. First, it contains substantial longitudinal variation, as individuals undergo natural growth and seasonal appearance changes over multi-year time spans. Second, the identity distribution is highly imbalanced, with many individuals observed only once and a smaller subset repeatedly re-sighted. Third, it provides rich capture-level metadata, including body length, morph type, spawning status, spatial location, and precise capture date. These properties make Melops a challenging and ecologically realistic benchmark

for studying long-term identity stability and metadata-aware representation learning. Recent advances in vision-language models (VLMs), particularly CLIP [48], provide a strong pretrained foundation for ReID by learning transferable visual representations from large-scale image-text data. Such large-scale pretraining has the potential to improve robustness to subtle inter-individual differences and gradual appearance changes, which are common in longitudinal animal monitoring settings. Recent CLIP-based ReID approaches adapt these pretrained encoders by introducing identity-specific learnable text tokens and leveraging cross-modal alignment losses. In particular, CLIP-ReID [28] adopts a two-stage training strategy in which ID-specific text tokens are first optimized while keeping both encoders frozen, and the image encoder is subsequently fine-tuned under constraints imposed by the learned text representations. Similarly, IndivAID [58] adopts a two-stage framework in which a text description generator first produces individual- and image-specific textual descriptions, and an attention module subsequently merges these descriptions to guide the fine-tuning of the image encoder. While these approaches demonstrate the benefit of exploiting CLIP’s cross-modal structure for ReID, they rely on staged optimization procedures and additional components to mediate interaction between visual and textual features. In longitudinal animal ReID, where identity must remain stable while appearance evolves over extended time spans, it is desirable to adapt pretrained representations in a stable and parameter-efficient manner without substantially expanding the architecture. Moreover, in many ecological monitoring programs, structured numerical attributes accompany visual observations, including capture time, body size, or reproductive state. Such attributes are biologically meaningful and may correlate with systematic appearance variation over time. Existing methods, e.g., [29, 1], typically incorporate metadata by converting it into discrete textual descriptions or by integrating it through additional attention-based fusion mechanisms. However, incorporating continuous numerical metadata directly within a learnable prompt representation, without introducing additional expert branches, crossattention modules, or inference-time metadata dependencies, remains largely unexplored in animal ReID. In this work, we propose a parameter-efficient adaptation framework for animal ReID built upon a frozen CLIP backbone. Our method jointly optimizes low-rank visual adaptation (LoRA [16]) modules in the vision encoder together with learnable prompt context tokens, while retaining fixed template tokens. Unlike staged optimization strategies, both visual adaptation and prompt parameters are trained endto-end under a unified objective. Cross-modal contrastive alignment between projected visual features and identityconditioned text embeddings further structures the shared embedding space during training. At inference time, all text-related components and metadata inputs are discarded, and ReID is performed via nearest-neighbor retrieval using visual descriptors. This design enables deployment without

inference-time metadata or auxiliary modules while preserving the general visual knowledge of the pretrained model and adapting it through a limited number of additional trainable parameters. To address longitudinal appearance variation, we further introduce continuous metadata conditioning. Instead of discretizing numerical attributes into symbolic text tokens, we preserve their numerical structure by injecting them directly into the learnable prompt representation. This allows metadata to induce smooth geometric modulation of the embedding space, which is better aligned with metric learning objectives than step-wise symbolic discretization. We investigate sinusoidal encodings and FiLM-based modulation mechanisms to condition the prompt during training, allowing metadata to influence representation learning without introducing additional fusion branches or attention modules. We evaluate our approach under four protocols: closedset, open-set, time-aware closed-set, and time-aware openset, designed to reflect realistic deployment scenarios. Across these settings, our method consistently improves performance over CLIP-based baselines. We observe notable gains in performance under both closed-set and open-set conditions, and metadata conditioning further enhances performance in temporally constrained evaluation. Additional experiments on multiple benchmarks, including various animals other than fish, confirm consistent generalization across species and acquisition conditions. While our framework builds on established components such as LoRA [16] and prompt learning, the primary methodological contribution of this work lies in a fundamentally different paradigm for incorporating metadata in ReID. Rather than treating metadata as discrete tokens or auxiliary modalities, we formulate it as a continuous training-time conditioning signal that shapes the geometry of the embedding space. This enables smooth adaptation to longitudinal appearance variation and, critically, decouples representation learning from inference requirements by eliminating any dependence on metadata at test time. In summary, our contributions are as follows. • Continuous metadata-conditioned prompt learning. We introduce a metadata-conditioning mechanism that embeds numerical metadata directly into the prompt representation, avoiding discretization and eliminating the need for auxiliary fusion modules. This design enables smooth modulation of the embedding space and better aligns with the gradual temporal and morphological changes inherent in longitudinal animal ReID. • Training-time-only metadata conditioning without inference dependency. We propose a formulation in which metadata is used exclusively during training to shape the representation space, while all metadata and text-related components are removed at inference time. This preserves a purely visual deployment 2

pipeline, in contrast to prior multimodal approaches that rely on metadata during inference.

studies explicitly address such long-term ReID, animal ReID must additionally contend with deformable body structures, substantial pose variation, and fine-grained inter-individual • Unified end-to-end parameter-efficient adaptation differences [13, 2, 67]. Consequently, animal ReID places framework. We develop a single-stage training stratgreater emphasis on learning robust identity representations egy that jointly optimizes low-rank visual adaptafrom intrinsic appearance cues, rather than relying primarily tion, learnable prompt context tokens, and symmetric on short-term cross-camera or viewpoint transitions. cross-modal contrastive alignment under a frozen With the widespread adoption of deep learning techCLIP backbone. Unlike prior staged or multi-component niques, most animal ReID approaches rely on convolupipelines, our approach enables stable and efficient tional neural networks (CNNs) trained with metric learning adaptation without full backbone fine-tuning. objectives, such as triplet or contrastive loss [27, 8, 35]. To improve robustness under pose deformation and back• Longitudinal evaluation protocol and temporal ground clutter, many works incorporate pose-aware or partanalysis. We introduce time-aware evaluation protobased representations, attention mechanisms, or geometric cols that explicitly model temporal distribution shifts constraints, either through explicit keypoints and landand provide an empirical analysis of identification marks [27, 36] or detection-driven masking strategies [8, performance as a function of temporal distance, high13]. More recently, transformer-based architectures and lighting the impact of longitudinal appearance variahybrid CNN–Transformer models have been explored to tion. capture long-range dependencies and multi-granularity fea• Comprehensive empirical validation across datasets. tures, demonstrating improved performance [63, 30, 2, 23]. We demonstrate consistent improvements over CLIPBeyond deep metric learning, a distinct line of research based baselines across multiple evaluation settings adopts content-based image retrieval (CBIR) principles for and wildlife benchmarks, while using substantially animal ReID. These methods avoid end-to-end metric learnfewer trainable parameters and maintaining strong ing and instead rely on local pattern descriptors, geometric generalization performance. consistency, and similarity matching to identify individuals [41, 38, 42]. Such CBIR-based pipelines are particuThe remainder of this paper is organized as follows. larly effective for patterned species and support open-set Sec. 2 reviews related work in animal ReID, longitudinal identification without retraining; however, they often depend wildlife datasets, VLMs in animal ReID, and parameteron accurate segmentation, handcrafted or semi-handcrafted efficient adaptation strategies. Sec. 3 presents the proposed descriptors, and species-specific design choices, which can framework, including low-rank visual adaptation, prompt limit scalability and adaptability across datasets. learning, and continuous metadata conditioning. Sec. 4 deRecent studies have also explored incorporating auxilscribes the experimental setup, evaluation protocols, impleiary cues to enhance discriminability in animal ReID. These mentation details, and empirical results. Sec. 5 discusses the include pose information, often obtained through keypoint findings and their implications for longitudinal ecological or landmark estimation and used to guide feature extraction ReID, and Sec. 6 concludes the paper. or alignment [36, 27, 51]; behavioral metadata, such as standing or lying states, which condition identity matching on activity context [45, 13]; orientation information 2. Related Work derived from body geometry or spine direction to normal2.1. Animal ReID ize viewpoint effects [45]; temporal context from video Although automated ReID has been extensively studied sequences to aggregate identity evidence across frames or in the context of person and vehicle analysis [25, 47, 65, 21, tracklets [56, 59]; and segmentation masks that isolate an61], animal ReID has more recently emerged as an important imal regions or distinctive patterns before feature extracand rapidly growing research area. It plays a critical role in tion [41, 8]. These auxiliary cues are typically fused with viwildlife monitoring, ecological studies, and livestock mansual features to mitigate appearance ambiguity and improve agement by enabling non-invasive identification of individrobustness. While such multimodal strategies can yield peruals across images and videos [50, 3, 17, 31, 9]. formance gains, they often rely on additional annotations A fundamental distinction between animal ReID and (e.g., pose keypoints, behavior labels, segmentation masks) person or vehicle ReID lies in the temporal and observational or task-specific modules, such as pose estimators, behavior assumptions underlying the task. Person and vehicle ReID classifiers, detection-driven attention masks, or geometryare typically formulated in multi-camera settings, where based alignment components. As a result, these approaches the same individual is observed across different viewpoints are frequently tailored to particular species, datasets, or within relatively short time spans, making viewpoint variaacquisition protocols, which can limit scalability and gention and camera-specific bias the dominant challenges [3]. eralization across animal ReID scenarios. In contrast, many animal ReID scenarios operate under Overall, existing animal ReID methods, whether based fixed or semi-fixed acquisition setups, e.g., [5, 37], but may on deep metric learning or CBIR, primarily rely on viinvolve re-observation of the same individual over weeks sual supervision and species-specific modeling, with limited or years apart [1, 39]. While only a subset of existing 3

exploitation of large-scale pretrained priors. In contrast, vision–language models offer a complementary direction by leveraging semantic and cross-modal knowledge learned from massive image–text corpora. However, the application of such models to animal ReID remains relatively unexplored.

imbalanced identity distribution, where the majority of individuals are observed only once while a subset is repeatedly recaptured over extended intervals.

2.3. Fish ReID Methods and Datasets Visual ReID of individual fish is increasingly studied due to its relevance for fisheries management, behavioral ecology, and population monitoring. Fish present distinct challenges for long-term ReID, as many species exhibit indeterminate growth with continuous changes in body size and shape, while coloration and pigmentation may vary with age, season, social status, or environmental conditions [46, 20, 55]. These biological factors undermine appearance constancy assumptions and complicate temporally robust identification. Early fish ReID approaches relied on classical computer vision methods and focused on species with distinctive surface patterns. Pattern-based matching of spots, stripes, or scars has been widely applied to whale sharks and manta rays, combining local keypoint descriptors with manual or semi-automated verification [14, 54]. Such methods are effective at moderate temporal scales, typically months to a few years, provided that visual patterns remain stable and image quality is sufficient. Recent work increasingly adopts deep learning, typically using CNNs trained with metric learning objectives. For instance, [11] demonstrates few-shot Siamese learning. Lonati et al. [32] further show that growth-induced appearance changes significantly affect deep ReID performance across life stages in epaulette sharks. Despite these advances, fish ReID remains limited by the scarcity of datasets with repeated observations of known individuals over long time spans. Most datasets feature few individuals, sparse re-sightings, or short temporal coverage, restricting evaluation of long-term robustness. Addressing this issue, [43] shows that fish facial patterns can remain identifiable over multi-year intervals, although performance degrades as temporal gaps increase. Overall, the combination of fine-grained inter-individual variation, continuous growth, and temporal appearance change makes fish ReID a particularly challenging problem.

2.2. Recent Animal Re-ID Datasets Animal Re-ID datasets have expanded in scale and annotation richness, shifting from small benchmarks annotated only with identity labels toward ecologically grounded datasets that provide complementary supervision, such as localization, pose, and temporal metadata [67, 19]. Despite this progress, most datasets remain temporally shallow and do not capture long-term appearance evolution in a biologically meaningful sense. Early wildlife benchmarks such as ATRW [27] established Re-ID feasibility under unconstrained conditions through rich spatial and pose annotations, but rely on shortterm collections and relatively few individuals due to ecological constraints. A similar pattern appears in outdoor pasture and farm datasets, including YakReID-103 [62] and the Holstein dairy cow dataset [26], which demonstrate robustness to environmental variability but lack longitudinal identity tracking. Only a small number of datasets extend beyond shortterm observations. SealID [39] aggregates multi-year data and supports fine-grained pattern matching through segmentation and pelage annotations, although identity observations remain sparse and seasonally clustered. SeaTurtleID2022 [1] represents a notable exception, spanning 13 years and introducing time-aware closed-set (identity overlap with temporal separation) and open-set (temporally emerging unseen individuals) evaluation protocols, while also demonstrating that random splits substantially overestimate performance. Nevertheless, for long-lived species, such as sea turtles, even decade-scale data capture only a limited fraction of lifespanrelated appearance drift. Other benchmarks primarily incorporate short-term temporal cues via videos or tracklets rather than true long-term monitoring. For example, MultiCamCows2024 [59] and PolarBearVidID [66] provide multi-camera observations and motion information over days or short sequences, supporting cross-view and motion-aware Re-ID but remaining temporally shallow. As a result, reported temporal robustness in animal Re-ID often reflects short-term appearance consistency rather than genuine long-term identity stability. In contrast to the benchmarks discussed above, the fish dataset used in this paper provides a relatively large-scale longitudinal setting specifically designed to study long-term identity stability under natural growth and seasonal variation. Unlike short-term or cross-view datasets, it captures continuous morphological changes associated with indeterminate growth, as well as seasonal coloration shifts and lifestage transitions. Moreover, the dataset exhibits a highly

2.4. Vision–Language Models for Animal ReID Recent work has explored VLMs as a way to provide structured cross-modal supervision for Re-ID, even when only identity labels are available, and no explicit semantic descriptions are given. CLIP-ReID [28] is the first work to adapt CLIP to the Re-ID setting, demonstrating that identity discrimination can be achieved by learning identity-specific text tokens in the absence of concrete textual labels. While effective, the method relies on a two-stage optimization procedure in which prompt tokens and image encoders are optimized sequentially, preventing fully joint end-to-end training. Several follow-up approaches extend CLIP-based ReID to animal domains characterized by stronger appearance variability. Wu et al. [58] propose an identity-driven 4

framework, called IndivAID, that generates image- and individual-specific textual descriptions, which are then used to refine visual embeddings. Although this design improves robustness to pose and viewpoint variation, it also introduces a multi-stage pipeline with frozen components and additional attention modules, increasing training complexity and limiting end-to-end optimization. Jiao et al. [19] further incorporate large language models (LLMs) to guide semantic prompt construction for cross-species and openworld animal Re-ID. While such LLM-assisted designs improve generalization to unseen categories, they depend on substantially larger models than CLIP and external prompt-generation mechanisms, raising concerns regarding efficiency, reproducibility, and practical deployment. Beyond language-only supervision, some work has explored multimodal augmentation of VLM-based Re-ID. MetaWild [29], for example, integrates environmental metadata through adapter-style modules to improve robustness under ecological variability. Although effective, this approach treats metadata as an auxiliary modality that must be explicitly modeled through additional architectural components and assumes the availability of such metadata during representation learning. Overall, existing VLM- and MLLM-based Re-ID methods demonstrate the promise of language and auxiliary information for identity discrimination, but they commonly rely on staged optimization, auxiliary modules, external language models, or increased model scale. In addition, auxiliary information is typically incorporated either by converting numerical metadata into discrete textual descriptions or by introducing dedicated fusion mechanisms, which may impose artificial discretization boundaries or increase architectural complexity. In contrast, our approach embeds continuous numerical attributes directly into the prompt representation, preserving their numerical structure and enabling smooth geometric modulation of the embedding space. Furthermore, metadata is used exclusively during training and is not required at inference time, resulting in a purely visual deployment pipeline without additional dependencies. This form of continuous metadata conditioning within the prompt space, combined with training-time-only usage without inference dependency, has not been explored in the context of ReID.

Prompt learning provides a complementary PEFT mechanism by adapting the input representation rather than the model weights. Context Optimization (CoOp) [64] demonstrates that learning continuous prompt tokens can effectively adapt frozen VLMs to downstream tasks, while followup works explore variations such as class-specific prompts, deeper prompt insertion, or hybrid prompt-adapter designs [64, 18]. Despite their success, different prompt formulations and PEFT strategies often exhibit dataset- and task-dependent behavior, and their relative effectiveness remains an empirical question [24]. In this work, we adopt LoRA-based visual adaptation together with learnable prompt context tokens, enabling joint end-to-end optimization under a frozen CLIP backbone. We further provide a systematic ablation study comparing different PEFT configurations and prompt-learning strategies.

3. Proposed Method Given a training dataset of image-identity pairs {(𝐱𝑖 , 𝑦𝑖 )}𝑁 , 𝑖=1 𝐻×𝑊 ×3 where 𝐱𝑖 ∈ ℝ denotes an input image and 𝑦𝑖 ∈ {1, … , 𝐶} represents the corresponding identity label, the goal of Re-ID is to learn an embedding function 𝑓 ∶  → ℝ𝑑 that maps images of the same identity close together while separating different identities in a shared feature space. To this end, we propose a parameter-efficient adaptation framework built upon a frozen vision-language backbone, in which identity-aware visual representations are learned via the joint optimization of low-rank visual adaptation modules, learnable prompt-based supervision, and metadata-conditioned prompt representations. Fig. 1 provides an overview of the proposed framework. The combination of low-rank visual adaptation and prompt-based conditioning is motivated by their complementary roles: LoRA enables controlled adaptation of pretrained visual features, while prompt-based supervision structures the embedding space through cross-modal alignment. Continuous metadata conditioning further extends this framework by introducing smooth, biologically meaningful variation aligned with temporal drift.

3.1. Architecture Overview

2.5. Parameter-Efficient Fine-Tuning and Prompt Learning PEFT has emerged as an effective strategy for adapting large pretrained models while avoiding the cost and overfitting risks of full fine-tuning [15, 60]. Representative approaches include adapter modules, partial layer fine-tuning, low-rank adaptations, and prompt-based methods, all of which update only a small subset of parameters while keeping the backbone largely frozen. Among these, Low-Rank Adaptation (LoRA) [16] has gained particular attention due to its simplicity and effectiveness, injecting trainable lowrank updates into existing layers without introducing additional inference-time overhead. 5

Our framework builds upon the CLIP model [48] and adopts a Vision Transformer (ViT) as the image encoder. The vision encoder produces visual features of dimension 𝑑𝑣 , which are further projected into the shared embedding space of dimension 𝑑𝑡 , consistent with the CLIP text embedding space. Given an input image 𝐱, the vision encoder first partitions the image into non-overlapping patches and maps them to patch embeddings. Let 𝑁𝑝 denote the number of image patches. A learnable class token is prepended to the patch sequence, and positional embeddings are added, yielding the initial token representation 𝐳0 = [𝐳cls ; 𝐄patch (𝐱)] + 𝐄pos , where 𝐳cls ∈ ℝ𝑑𝑣 denotes the class token, 𝐄patch (𝐱) ∈ ℝ𝑁𝑝 ×𝑑𝑣 is the patch embedding projection, and 𝐄pos ∈ ℝ(𝑁𝑝 +1)×𝑑𝑣 represents positional embeddings. The resulting

Figure 1: Overview of the proposed framework. Training (left): A frozen CLIP ViT vision encoder is adapted using LoRA modules inserted into the query, key, and value linear projection layers of each multi-head self-attention block. The visual embedding 𝐟𝑣 proj and its CLIP-projected counterpart 𝐟𝑣 are supervised with dual-space batch-hard triplet losses and auxiliary identity classification heads. In parallel, identity-conditioned prompts composed of fixed prefix tokens, learnable context tokens, class tokens, identity tokens, and optional metadata tokens are processed by a frozen CLIP text encoder to produce text embeddings 𝐭. Continuous metadata is incorporated via sinusoidal encoding or FiLM-based modulation at the embedding level. Cross-modal alignment proj between 𝓁2 -normalized projected visual features 𝐟𝑣 and text embeddings 𝐭 is enforced using symmetric contrastive cross-entropy proj proj losses CCE (𝐟𝑣 , 𝐭) and CCE (𝐭, 𝐟𝑣 ). Inference (right): Only the LoRA-adapted vision encoder is retained. The 𝓁2 -normalized proj embeddings 𝐟𝑣 and 𝐟𝑣 are concatenated and re-normalized to form the final descriptor used for nearest-neighbor retrieval. All text-related components, metadata conditioning, and auxiliary identity heads are removed at inference time.

token sequence 𝐳0 ∈ ℝ(𝑁𝑝 +1)×𝑑𝑣 is processed by a stack of 𝐿 transformer blocks. As commonly adopted in ViT architectures, the final visual representation is obtained from the class token of cls . This representation is the last transformer layer, 𝐟𝑣 = 𝐳𝐿 subsequently projected into the CLIP embedding space via proj a linear projection 𝐟𝑣 = 𝐟𝑣 𝐖proj , where 𝐖proj ∈ ℝ𝑑𝑣 ×𝑑𝑡 denotes the pretrained projection matrix used to map visual features into the shared CLIP embedding space. The projected embeddings are 𝓁2 -normalized before metric learning and retrieval. All pretrained backbone parameters, including both the vision encoder and the text encoder, remain frozen during training. Model adaptation is achieved through additional lightweight modules introduced in subsequent sections.

Let 𝐖0 ∈ ℝ𝑑out ×𝑑in denote a pretrained linear weight (for attention projections, 𝑑in and 𝑑out correspond to the layer input and output dimensions; in practice 𝑑in = 𝑑out = 𝑑𝑣 for the per-layer projections unless otherwise noted). LoRA augments the forward computation as 𝐡 = 𝐖0 𝐱 + 𝛼𝑟 𝐁𝐀𝐱, where 𝐀 ∈ ℝ𝑟×𝑑in and 𝐁 ∈ ℝ𝑑out ×𝑟 are trainable lowrank matrices with 𝑟 ≪ min(𝑑out , 𝑑in ), and 𝛼 is a scalar scaling factor controlling the magnitude of the adaptation. The pretrained weight 𝐖0 (and any associated bias) remains fixed throughout training; only 𝐀 and 𝐁 are optimized. This formulation is equivalent to applying an additive low-rank update to the pretrained weight, i.e., 𝐖 = 𝐖0 + 𝛼𝑟 𝐁𝐀, while keeping 𝐖0 fixed. In practice, LoRA is applied to the full projection matrices prior to head partitioning within MHA. In our experiments, 𝐀 and 𝐁 are initialized such that the LoRA branch is effectively inactive at initialization (e.g., 3.2. Low-Rank Adaptation (LoRA) initializing 𝐀 to zero or using small-scale initialization for To enable parameter-efficient adaptation while preserv𝐁), thereby preserving pretrained behavior at the start of ing the pretrained knowledge of CLIP, we introduce LoRA [16] training. This design enables efficient adaptation to the ReID modules into the ViT-based vision encoder while keeping task while retaining the general visual knowledge encoded in all original backbone parameters frozen. Specifically, LoRA the frozen CLIP backbone. is applied to the query, key, and value linear projection layers within each multi-head self-attention (MHA) block, 3.3. Learnable Prompt-Based Text Representation allowing the model to adapt to identity-level discrimination To adapt the frozen CLIP text encoder to the ReID task, without full fine-tuning. we adopt the Context Optimization (CoOp) framework [64] and introduce a small set of learnable context tokens within a 6

fixed prompt template. Following CoOp, the text encoder remains fully frozen, and only the context tokens are optimized to adapt the pretrained CLIP model to the target domain. Each prompt is composed of four types of tokens: (i) fixed prefix tokens corresponding to the textual phrase “this is a photo of”, (ii) shared learnable context tokens, (iii) a fixed class token that denotes the semantic category (e.g., [fish]), and (iv) a fixed identity token. The identity token is defined per identity and shared across all images of the same individual; different identities are assigned distinct identity tokens, enabling identityspecific conditioning of the prompt representation. Each identity token is implemented as a randomly initialized embedding vector in the CLIP text embedding space and remains fixed throughout training. These tokens are not part of the pretrained CLIP vocabulary and are used solely to construct identity-conditioned prompts during training. Although identity tokens may appear superficially similar to proxy-based or prototype-based representations used in metric learning [22, 4], they serve a fundamentally different role. Proxy-based methods introduce learnable class representatives in the visual embedding space that act as classification anchors. In contrast, identity tokens in our framework are fixed, non-learnable embeddings defined in the text (prompt) space. They do not function as class prototypes, but instead provide identity-specific conditioning that facilitates crossmodal alignment during training. All prompt components, including prefix, context, class, identity, and metadata tokens introduced below, are represented directly as embedding vectors in the CLIP text embedding space and concatenated prior to being processed by the frozen text encoder. The resulting embedding sequence is passed to the frozen text transformer, with positional encodings applied in the standard CLIP manner. To reduce sensitivity to prompt structure, we construct multiple prompt variants by permuting the position of the learnable context tokens relative to the fixed class and identity tokens, while preserving the relative order of the class and identity tokens. Specifically, we consider three prompt layouts:

variants: 𝐭𝑖 =

(𝑘) 1 ∑ TextEncoder(𝐩𝑖 ) , (𝑘) ‖ || 𝑘∈ ‖ ‖TextEncoder(𝐩𝑖 )‖ ‖ ‖2

(1)

where  indexes the set of prompt layouts. Averaging normalized embeddings across prompt variants encourages invariance to prompt structure while preserving semantic consistency in the shared CLIP embedding space. During training, only the shared context tokens 𝐂 are optimized jointly with the LoRA parameters in the vision encoder, while the text encoder weights, prefix tokens, class tokens, and identity tokens remain fixed. Although the text branch is discarded at inference time, the identityconditioned prompts provide structured supervision during training, encouraging the vision encoder to learn visual embeddings that are geometrically aligned with identityaware textual representations in the shared CLIP embedding space.

3.4. Metadata-Conditioned Prompt Adaptation In addition to identity labels, longitudinal ecological monitoring programs systematically record structured numerical metadata, such as capture date, body length, spatial location, and reproductive status. These attributes are not auxiliary in a statistical sense, but reflect biologically meaningful processes, including growth, seasonal coloration, and life-stage transitions that directly influence visual appearance. Unlike prior approaches that discretize such information into categorical bins or fixed tokens (e.g., [29]), we preserve its continuous structure and incorporate it directly into the prompt representation. Discretization may discard fine-grained numerical relationships and introduce artificial boundaries that limit generalization, particularly in openworld or longitudinal settings where newly observed values may fall outside predefined bins. We therefore encode realvalued attributes as continuous embeddings compatible with the CLIP text embedding space, without quantization. By operating directly in the embedding space, metadata can facilitate smoother adaptation of the learned representation geometry. This design more naturally reflects the gradual nature of longitudinal appearance variation and supports metric learning under temporal drift. Metadata is used only during training, where it acts as a conditioning signal that shapes the geometry of the learned embedding space. By exposing the model to continuous temporal and morphological variation, the visual encoder learns to internalize these patterns within its representations. As a result, the model becomes more robust to such variations at inference time, even in the absence of metadata, which is particularly beneficial under temporal distribution shifts and open-set conditions. Let 𝐚 ∈ ℝ𝑛𝑎 denote a vector of numerical metadata associated with an input image. The metadata is image-specific and may vary across different samples of the same identity. In all cases, a metadata embedding 𝐞𝑎 ∈ ℝ𝑑𝑡 is appended

• End: [𝐞pref ix , 𝐞cls , 𝐂, 𝐞id𝑖 ], • Middle: [𝐞pref ix , 𝐂1 , 𝐞cls , 𝐂2 , 𝐞id𝑖 ], • Front: [𝐞pref ix , 𝐂, 𝐞cls , 𝐞id𝑖 ], where 𝐂 ∈ ℝ𝑀×𝑑𝑡 denotes the full set of 𝑀 learnable context tokens shared across identities, and 𝐂1 and 𝐂2 correspond to the first and second halves of 𝐂, respectively. In all cases, the class token precedes the identity token, but they are not required to be adjacent. Each prompt variant is processed by the frozen CLIP text encoder to produce a layout-specific embedding. The final identity-conditioned text representation is obtained by averaging the 𝓁2 -normalized embeddings across all prompt

7

to the prompt sequence after the identity token, yielding prompts of the form [𝐞pref ix , 𝐂(⋅) , 𝐞cls , 𝐞id𝑖 , 𝐞𝑎 ], where 𝐂(⋅) denotes one of the prompt layouts defined in Sec. 3.3. The position of the metadata token remains fixed and is not affected by the layout permutations described previously. We introduce two alternative strategies for constructing the metadata embedding 𝐞𝑎 : (i) sinusoidal encoding followed by linear projection, and (ii) Feature-wise Linear Modulation (FiLM)-based conditioning of learnable attribute tokens. Both approaches produce embeddings in ℝ𝑑𝑡 that are appended to the prompt sequence without altering the architecture of the frozen CLIP text encoder.

signal that shapes the embedding geometry without introducing inference-time dependencies.

3.5. Auxiliary Identity Supervision Although identity tokens provide structured supervision through the text branch, they do not constitute a classification mechanism in the visual embedding space. To encourage explicit identity separation in the visual representation, we introduce auxiliary identity supervision directly on the features learned by the vision encoder. Auxiliary supervision is particularly beneficial in our setting, where most of the CLIP backbone is frozen, and the model is adapted in a parameter-efficient manner using low-rank updates and prompt learning. While the primary objective is metric learning via triplet loss, such relative constraints can be noisy and sensitive to batch composition, especially in early training stages. Cross-entropy supervision provides an absolute class-level signal that stabilizes optimization and promotes compact intra-identity clusters. Specifically, given the visual representation 𝐟𝑣 ∈ ℝ𝑑𝑣 extracted from the final transformer layer and its projection proj 𝐟𝑣 ∈ ℝ𝑑𝑡 in the shared CLIP embedding space, we apply batch normalization followed by linear classifiers: 𝐬𝑣 = proj (𝑝) (𝑣) 𝐶×𝑑𝑣 𝐖(𝑣) aux BN(𝐟𝑣 ), 𝐬𝑝 = 𝐖aux BN(𝐟𝑣 ), where 𝐖aux ∈ ℝ

3.4.1. Sinusoidal Metadata Encoding Inspired by positional encodings in transformer models, we encode each scalar component of the numerical metadata using sinusoidal functions at multiple frequencies. For each metadata dimension 𝑎𝑘 , we compute PE(𝑎𝑘 )2𝑗 = sin(𝜔𝑗 𝑎𝑘 ) and PE(𝑎𝑘 )2𝑗+1 = cos(𝜔𝑗 𝑎𝑘 ), where {𝜔𝑗 } are fixed frequencies spaced exponentially following the standard Transformer formulation. The encodings for all metadata dimensions are concatenated to form PE(𝐚). The resulting sinusoidal representation is projected into the CLIP text embedding space via a learnable linear transformation 𝐖𝑎 ∈ ℝ𝑑𝑡 ×𝑑PE and normalized: 𝐞𝑎 = BN(𝐖𝑎 PE(𝐚)), 𝐶×𝑑𝑡 are trainable weights. The resulting and 𝐖(𝑝) aux ∈ ℝ where BN(⋅) denotes batch normalization. logits are supervised using cross-entropy loss with identity The metadata embedding 𝐞𝑎 ∈ ℝ𝑑𝑡 is computed from labels. Supervising both feature spaces ensures that identity the input metadata through the parameterized transformation discrimination is enforced both before and after the frozen described above and is not treated as a learnable prompt CLIP projection. token. The auxiliary identity heads are used only during training and removed at inference time. 3.4.2. FiLM-Based Metadata Conditioning As an alternative, we adopt Feature-wise Linear Modu3.6. Loss Function lation (FiLM) [44] to condition prompt representations on The model is trained using a composite objective that numerical metadata. In this formulation, the attribute vector combines (a) metric learning, (b) cross-modal alignment, 𝐚 ∈ ℝ𝑛𝑎 is mapped to feature-wise scaling and shifting and (c) auxiliary identity supervision. parameters via a learnable transformation 𝐖f ilm ∶ ℝ𝑛𝑎 → proj Given projected visual embeddings 𝐟𝑣,𝑖 and identityℝ2𝑑𝑡 : [𝜷, 𝜸] = BN(𝐖f ilm (𝐚)), where 𝜷, 𝜸 ∈ ℝ𝑑𝑡 denote conditioned text embeddings 𝐭𝑖 , we compute the similarity additive and multiplicative modulation vectors, respectively. matrix Batch normalization is applied to stabilize the scale of the generated modulation parameters. proj 𝐟𝑣,𝑖 ⋅ 𝐭𝑗 These parameters are applied feature-wise to a set of , (2) 𝑆𝑖𝑗 = learnable attribute basis tokens 𝐓𝑎 ∈ ℝ𝑀𝑎 ×𝑑𝑡 , shared across 𝜏 samples, as 𝐞𝑎 = 𝜸 ⊙ 𝐓𝑎 + 𝜷, where modulation is broadwhere 𝜏 is a learnable temperature parameter. All projected cast across the 𝑀𝑎 tokens. This allows metadata-dependent visual and text embeddings are 𝓁2 -normalized before simimodulation of attribute-specific basis tokens while operating larity computation. entirely at the embedding level prior to the frozen CLIP text The image-to-text and text-to-image cross-modal crossencoder. entropy losses are defined as: For both sinusoidal and FiLM-based variants, metadata embeddings are computed per image during training and 𝐵 exp(𝑆𝑖𝑖 ) 1 ∑ proj appended to the prompt sequence as standard token embed− log ∑𝐵 CCE (𝐟𝑣 , 𝐭) = , (3) 𝐵 𝑖=1 dings. These embeddings receive positional encodings and 𝑗=1 exp(𝑆𝑖𝑗 ) participate in self-attention without modification to the CLIP text encoder architecture. 𝐵 At inference time, metadata and all text-related compoexp(𝑆𝑖𝑖 ) 1 ∑ proj . (4) − log ∑𝐵 CCE (𝐭, 𝐟𝑣 ) = nents are removed, and ReID relies solely on visual embed𝐵 𝑖=1 𝑗=1 exp(𝑆𝑗𝑖 ) dings. Thus, metadata serves as a training-time conditioning 8

The symmetric cross-modal alignment loss is ) ( 1 proj proj cm = CCE (𝐟𝑣 , 𝐭) + CCE (𝐭, 𝐟𝑣 ) . 2

𝓁2 -normalized representations, and apply 𝓁2 normalization to the concatenated vector to obtain the final descriptor. the Euclidean distance between the resulting descriptors is used to rank the gallery images. Although triplet supervision is applied independently proj to 𝐟𝑣 and 𝐟𝑣 during training, both embeddings are optimized for identity discrimination. Their concatenation at inference aggregates complementary information from the raw visual and CLIP-aligned spaces without introducing additional trainable parameters. The use of concatenation is motivated by the observation that the visual and projected representations capture complementary identity information. This is supported by the experimental results, where supervision in both embedding spaces yields substantially higher performance than relying on either representation individually. Consequently, concatenation provides a simple parameter-free mechanism for preserving information from both embedding spaces without introducing additional trainable fusion modules.

(5)

This bidirectional formulation is particularly important in longitudinal settings (as also supported by the ablation results), where identity representations may drift over time. Image-to-text alignment alone constrains visual embeddings toward identity-conditioned text anchors, but does not enforce reciprocal consistency. By optimizing both directions, symmetric alignment provides additional regularization across modalities, providing additional regularization that improves robustness under temporal shift. Batch-hard triplet losses are applied independently to the visual and projected embeddings: proj

tri = (𝑣) (𝐟 , 𝑦) + (𝑝) (𝐟 tri 𝑣 tri 𝑣

, 𝑦).

(6)

Triplet losses are computed independently within each embedding space: anchors, positives, and negatives are proj formed exclusively from either 𝐟𝑣 or 𝐟𝑣 , and no crossspace triplets are used. All embeddings are 𝓁2 -normalized prior to distance computation, and the Euclidean distance is employed for both triplet optimization and retrieval. Auxiliary classification losses are applied to the logits 𝐬𝑣 and 𝐬𝑝 : aux = CE (𝐬𝑣 , 𝑦) + CE (𝐬𝑝 , 𝑦).

4. Experimental Analysis In this section, we first describe the dataset, evaluation protocols, and implementation details. We then present quantitative results under different evaluation settings, followed by ablation studies that analyze the contribution of individual components of the proposed framework. Finally, we report additional experiments on external benchmarks to assess generalization.

(7)

The overall training objective is  = 𝜆tri tri + 𝜆cm cm + aux .

4.1. Melops Dataset

(8)

We evaluated our approach in the Melops dataset [53, 52], a large-scale longitudinal image dataset for individual ReID of wild corkwing wrasse (Symphodus melops). The dataset comprises 24578 images of 9861 PIT-tagged individuals collected over a seven-year capture–mark–recapture program (2018–2024) in Western Norway. Each fish was photographed from both left and right sides under standardized imaging conditions against a white background with a color reference card, enabling consistent cropping and color normalization. A defining characteristic of Melops is its temporal depth. Of the 9861 individuals, 1883 were recaptured at least once, yielding 2916 resighting events and 8524 images of repeated encounters. Capture intervals range from within-season recaptures to multi-year spans, reflecting natural growth, seasonal coloration changes, and morphological variation. At the same time, the majority of individuals were observed only once, creating a highly imbalanced identity distribution that poses a significant challenge for metric-based learning. In addition to temporal variation, Symphodus melops exhibits pronounced left–right asymmetry in pigmentation and patterning. As illustrated in Figure 2, longitudinal captures of the same individual show substantial variation in size, coloration, and side-specific appearance, with distinct visual patterns often present on each lateral side. Such an asymmetry increases intra-individual variability and prevents trivial

proj

Although 𝐟𝑣 is a linear projection of 𝐟𝑣 , supervising both spaces serves distinct functions. The two representations reside in different dimensional spaces and are used jointly at inference through feature concatenation. Applying metric supervision in both spaces encourages consistent identity separation before and after projection and ensures that LoRA-induced updates remain discriminative under the frozen CLIP projection. During training, only the LoRA parameters, learnable prompt context tokens, metadata-related parameters, auxiliary identity heads, and batch normalization layers are optimized, while all pretrained CLIP backbone parameters remain frozen.

3.7. Inference In this study, ReID is formulated as retrieval rather than classification, allowing the model to generalize to unseen identities without requiring a fixed label space at inference. At inference time, only the LoRA-adapted vision encoder is retained, and all text-related components and auxiliary supervision heads are removed. Given a query image and a gallery set, ReID is performed by nearest-neighbor retrieval using the Euclidean distance between fused visual descriptors. Specifically, we extract the visual embedding 𝐟𝑣 proj and its CLIP-projected counterpart 𝐟𝑣 , concatenate their

9

Figure 2: Multiple observations of the same individual from the Melops dataset [53] across different capture years. The top and middle rows show full-body lateral views from different time points and body sides, illustrating natural growth, size variation, and side-specific appearance differences. The bottom row presents corresponding head crops, highlighting fine-grained facial patterns that remain discriminative despite longitudinal morphological and coloration changes, while also exhibiting the left-right asymmetry.

memorization of the mirrored views. Furthermore, biological studies suggest that head and facial regions contain stable and identity-relevant morphological cues in fish, particularly around the operculum, eye, and snout regions [10]. This motivates the examination of head-based crops in addition to full-body views. Furthermore, this dataset provides rich capture-level metadata, including total body length, sex, capture location, and precise capture date recorded in day-sequence format. These attributes reflect biologically meaningful factors such as growth, reproductive state, and seasonal variation, which directly influence visual appearance over time. In our experiments, we use both the full-body and head crop variants provided with the dataset. Temporal information is derived from the normalized day-sequence index to represent absolute progression across the study period, enabling systematic evaluation under time-aware protocols. Besides, the body length and capture year are also incorporated as numerical attributes into our model.

Table 1 Statistics of the defined evaluation protocols. Identity counts refer to the unique identities per split. Protocol

Train IDs

Train Imgs

Query IDs

Query Imgs

Gallery Imgs

CS OS TACS TAOS

9814 9470 9290 9209

20656 19761 22420 22225

1837 1872 37 86

1843 2254 76 173

1953 2533 84 188

Open-Set (OS). Following the protocol in [1], the test set contains a mixture of seen and unseen identities. Seen seen ⊆  identities satisfy test train , while unseen identities unseen seen ∪  unseen satisfy test ∩ train = ∅, with test = test test seen unseen and test ∩ test = ∅. Within the test set, 20% of identities are designated as unseen, and the remaining 80% as seen identities overlapping with train . Test identities are distributed across both query and gallery splits, ensuring that query and gallery share the same identity set. Time-Aware Closed-Set (TACS). We construct a chronologically constrained CS protocol in which identities overlap between training and testing, but test images are restricted to the final year of data collection, while all earlier years are used for training. This enforces strict temporal separation and evaluates forward-time generalization under realistic longitudinal conditions.

4.2. Evaluation Protocols To comprehensively evaluate generalization under different deployment scenarios, we define four evaluation protocols that vary in identity overlap and temporal ordering. Table 1 summarizes the resulting data splits under each protocol. Closed-Set (CS). In the CS protocol, identities appearing in the test split overlap with those in the training split, i.e., test ⊆ train . The dataset is partitioned at the image level within each identity such that training and testing images are disjoint. Approximately 70% of the images per identity are allocated to training, with the remainder used for evaluation and divided into query and gallery sets. Query and gallery images are image-disjoint but identity-overlapping, following standard closed-set ReID practice [27, 28, 57, 19, 7, 1]. For identities with fewer than three samples, all samples are assigned to the training split.

Time-Aware Open-Set (TAOS). TAOS follows the same identity partitioning as OS, with the test set comprising both seen and unseen identities. However, evaluation images are restricted exclusively to observations from the final year, while all earlier years are used for training. This protocol evaluates generalization across both identity novelty and longitudinal appearance changes under forward-time conditions.

10

retrieval. Projected visual and text embeddings are 𝓁2 normalized before similarity computation for the crossmodal loss. In line with prior art [28, 58], the triplet loss weight 𝜆tri is set to 1, the cross-modal loss weight 𝜆cm is set to 1, and the temperature parameter 𝜏 in the similarity computation is set to 1. The batch composition follows a standard PK sampling strategy with 𝑃 = 16 identities and 𝐾 = 4 images per identity per mini-batch (64 images in total). Batch-hard triplets are constructed within each mini-batch following the standard batch-hard mining strategy. We optimize the model using AdamW [33] with a learning rate of 5 × 10−4 and the weight decay of 1 × 10−5 in line with [28]. Training is conducted for up to 60 epochs with a batch size of 64. All experiments were performed on a single NVIDIA GeForce RTX 5090 GPU.

4.3. Evaluation Metrics We employ standard ranking-based metrics for ReID evaluation. Let 𝑓 ∶  → ℝ𝑑 denote the embedding function. Gallery samples are ranked for each query according to ascending Euclidean distance ‖𝑓 (𝑞) − 𝑓 (𝑔)‖2 . Cumulative Matching Characteristic (CMC). The CMC curve measures the probability that at least one correct match appears within the top-𝑘 ranked gallery samples. We report Rank-1 and Rank-5 accuracy, defined as [ ] 1 ∑ 𝟙 ∃ 𝑔 ∈ + ∶ rank(𝑔) ≤ 𝑘 , (9) Rank-𝑘 = 𝑞 || 𝑞∈ where  denotes the query set, + 𝑞 is the set of gallery samples sharing the same identity as query 𝑞. Mean Average Precision (mAP). To account for multiple correct matches per query, we compute mean Average Precision (mAP) as mAP =

Our Method. Unless otherwise specified, we use a LoRA rank of 𝑟 = 16 and set the LoRA scaling factor 𝛼 = 16. LoRA is applied to the query, key, and value linear projection layers within each multi-head self-attention block. LoRA parameters are initialized such that the adaptation branch is inactive at the beginning of training (i.e., initialized to produce zero effective update), ensuring that the initial forward pass recovers the pretrained CLIP behavior. The prompt consists of fixed prefix tokens, a fixed class token, a fixed identity token, and a set of learnable context tokens. Learnable context tokens are randomly initialized, and their number is set to 𝑀 = 4 per identity. To reduce sensitivity to prompt structure, we employ prompt-order ensembling with three layouts (front, middle, and end) [64]. For the middle layout, the context tokens are split evenly into two halves. The final text representation is obtained by averaging the 𝓁2 -normalized embeddings produced by the frozen CLIP text encoder across all prompt layouts. Each identity is assigned a unique, fixed identity token initialized randomly in the CLIP text embedding space. All images belonging to the same identity share the same identity token, while different identities are assigned distinct tokens. Identity tokens are not learnable and remain fixed throughout training. Both identity and class tokens are discarded at inference time. Metadata is image-specific and consists of numerical attributes such as capture time and physical measurements. All scalar metadata attributes are normalized using perattribute min-max scaling computed on the training set, and the same scaling parameters are reused during testing to prevent information leakage. During training, metadata embeddings are appended to the end of the prompt sequence and are not used at inference time, ensuring that the deployed model remains purely visual. For sinusoidal metadata encoding, fixed exponentially spaced frequencies are used following the standard sinecosine positional encoding formulation in Transformers. Encodings are computed independently for each metadata dimension and concatenated before linear projection. We use

1 ∑ AP(𝑞), || 𝑞∈

where the Average Precision for query 𝑞 is AP(𝑞) =

∑ 1 𝑃𝑞 (𝑘), + |𝑞 | 𝑘∶𝑔 ∈+ 𝑘

(10)

𝑞

and }| |{ | 𝑔 ∈ + || 𝑗 ≤ 𝑘 | | | 𝑗 𝑞 | | 𝑃𝑞 (𝑘) = | 𝑘

(11)

denotes the precision at rank 𝑘.

4.4. Implementation Details Training Setup. Our model and all ablation variants are trained under identical optimization settings. We use a CLIP ViT-B/16 backbone [48] initialized from publicly available pretrained weights to remain consistent with prior CLIPbased ReID approaches [28, 58] and to emphasize parameter efficiency. The vision encoder has feature dimension 𝑑𝑣 = 768 and is projected into the shared embedding space of dimension 𝑑𝑡 = 512. For the Melops dataset, we apply standard ReID augmentations, including random horizontal flip, padding, random crop, normalization, and random erasing [28, 57]. Unless otherwise specified, backbone parameters remain frozen, and only task-specific adaptation modules are optimized. Training is performed using a composite objective consisting of two batch-hard triplet losses, symmetric crossmodal contrastive cross-entropy losses, and two auxiliary identity classification losses. The triplet losses are computed independently in the visual feature space and the CLIPprojected feature space. All embeddings are 𝓁2 -normalized before distance computation for triplet optimization and 11

16 frequencies per metadata dimension, following common practice in sinusoidal positional encoding, resulting in 32 encoded features (sine and cosine pairs) per attribute and a total pre-projection dimension of 𝑑PE = 32 𝑛𝑎 . For FiLM-based conditioning, learnable attribute basis tokens 𝐓𝑎 ∈ ℝ𝑀𝑎 ×𝑑𝑡 are shared across samples and optimized during training. Scaling and shifting parameters are generated from metadata via a learnable projection and applied feature-wise to the attribute basis tokens. The number of attribute basis tokens is set to 𝑀𝑎 = 𝑛𝑎 , corresponding to one basis token per metadata dimension. All metadatarelated projection layers and FiLM parameters are trained jointly with the remaining learnable components. Only the LoRA parameters in the vision encoder, learnable context tokens, metadata-related parameters (including sinusoidal projection or FiLM parameters), auxiliary identity classification heads, and batch normalization layers are updated during training. All remaining CLIP backbone parameters remain frozen. At inference time, only the LoRAadapted vision encoder is retained. All text-related components, metadata embeddings, and auxiliary supervision heads are removed. ReID is performed by nearest-neighbor retrieval using Euclidean distance between 𝓁2 -normalized visual descriptors obtained from the concatenated embeddings.

channel-wise convolution with kernel size 𝑘 = 1, IN(⋅) applies instance normalization, and 𝜎(⋅) is LeakyReLU. Note that kernel size 𝑘 = 1 performs channel mixing without expanding the receptive field across neighboring tokens.

2D Convolutional Adapter. Patch tokens (excluding the

class token) are reshaped into a spatial grid and processed with a 2D convolution before bottleneck projection. Formally, 𝐟2𝐷 = Reshape(𝐟1∶𝑁 ; 𝐻×𝑊 ) and 𝐟conv = Conv2D(𝐟2𝐷 ; 𝑘 = 3, √𝑝 = 1), where 𝐟1∶𝑁 denotes the patch tokens, 𝐻 = 𝑊 = 𝑁 for square grids, and (𝑘, 𝑝) denote kernel size and padding. The convolved features are flattened, concatenated with the class token, and passed through the bottleneck adapter.

Transformer Adapter. A lightweight transformer encoder

layer with multi-head self-attention is inserted before bottleneck projection to model inter-token dependencies. Formally, 𝐟attn = TransformerLayer(𝐟 ; 𝑛heads = 8), where 𝑛heads = 8 denotes the number of attention heads. The resulting features are then passed through the bottleneck projection: 𝐡𝑏 = 𝐖down 𝐟attn . We evaluate inserting adapters after different transformer blocks and observe that inserting adapters after all transformer blocks yields the best performance. Each transformer block employs an independent set of adapter parameters, and parameters are not shared across layers. The bottleneck dimension is set to 𝑏 = 512. Adapter weights are initialized using Kaiming initialization [12], and the initial adapter contribution is scaled to avoid disrupting pretrained CLIP representations at the beginning of training. LeakyReLU is used as the activation function in bottleneck projections. No additional dropout or normalization layers are introduced beyond those explicitly described above.

Alternative Visual Adaptation Methods. To evaluate the effectiveness of LoRA-based adaptation, we compare against several alternative lightweight visual adapters. All alternative modules are inserted into the frozen CLIP vision encoder and trained using the same composite objective and optimization setup described above.

Linear Head. As a minimal baseline, no intermediate adaptation modules are introduced. Frozen CLIP visual features 𝐟𝑣 ∈ ℝ𝑑𝑣 are first batch-normalized and then projected directly to the identity classification space via a single linear layer, 𝐬 = 𝐖𝑐 BN(𝐟𝑣 ), where 𝐖𝑐 ∈ ℝ𝐶×𝑑𝑣 is a trainable weight matrix. This baseline is trained using the same auxiliary cross-entropy loss as in our method.

Other CLIP-based ReID Methods. We compare our method against CLIP-ReID [28] and IndivAID [58], using their official public implementations. For both methods, only dataset-specific configurations (paths and dataset loaders) are adapted to match our evaluation benchmarks. The original architectures, loss functions, optimizer types, learning rate schedules, sampling strategies, data augmentation, and evaluation protocols strictly follow the released repository defaults. All methods share the same CLIP backbone and follow closely related training paradigms, resulting in comparable optimization settings. Each method is evaluated under its original configuration, while using identical dataset splits and evaluation metrics for consistency. Following common benchmarking practice, the compared methods retain their published training recipes and hyperparameter settings. Training is run until convergence when necessary, and the best-performing checkpoint is selected for reporting.

Bottleneck Adapter. A residual bottleneck adapter is in-

serted after each transformer block of the CLIP vision encoder. The adapter projects the feature 𝐟 ∈ ℝ𝑑𝑣 into a lowerdimensional bottleneck space of dimension 𝑏, and then maps it back to the original dimension: 𝐡𝑏 = 𝜎(𝐖down 𝐟 ), 𝐟 ′ = 𝛼 𝜎(𝐖up 𝐡𝑏 ) + (1 − 𝛼)𝐟 , where 𝐖down ∈ ℝ𝑏×𝑑𝑣 and 𝐖up ∈ ℝ𝑑𝑣 ×𝑏 are learnable projection matrices, 𝜎(⋅) denotes LeakyReLU activation, and 𝛼 controls residual scaling.

1D Convolutional Adapter. A 1D convolution is ap-

plied across the token sequence before bottleneck projection. Specifically, 𝐟conv = Conv1D(𝐟 ; 𝑘 = 1) and 𝐡𝑏 = 𝜎(𝐖down IN(𝐟conv )), where Conv1D(⋅; 𝑘 = 1) denotes 12

Table 2 Closed-set performance comparison. Results are reported as mean ± standard deviation over five random seeds. Bold indicates the best result. Full fine-tuning (FT) refers to jointly optimizing both the vision and text encoders of CLIP-B/16.

Table 3 Open-set performance comparison. Results are reported as mean ± standard deviation over five random seeds. Bold indicates the best result.

Method

Crop

mAP

Rank-1

Rank-5

CLIP-B/16 (Full FT) [48] CLIP-B/16 (Full FT) [48]

Head Body

52.70 ± 0.35 52.10 ± 0.63

45.80 ± 0.53 44.50 ± 0.80

62.20 ± 0.30 61.70 ± 0.70

CLIP-ReID [28] CLIP-ReID [28]

Head Body

44.32 ± 0.31 44.34 ± 0.22

37.58 ± 0.46 37.92 ± 0.19

52.90 ± 0.20 52.36 ± 0.61

IndivAID [58] IndivAID [58]

Head Body

43.16 ± 0.52 44.02 ± 0.43

36.30 ± 0.53 37.59 ± 0.62

52.12 ± 0.57 52.60 ± 0.56

Ours Ours

Head Body

52.48 ± 0.33 53.00 ± 0.70

45.04 ± 0.47 44.80 ± 0.75

62.38 ± 0.28 64.32 ± 0.62

4.5. Results This section reports the experimental evaluation of the proposed framework. We first present results on the Melops dataset under standard CS and OS protocols for both fullbody and head-crop inputs. We then evaluate longitudinal robustness using TACS and TAOS settings that enforce temporal separation between training and testing data (Sec. 4.5.1). Next, we analyze the effects of continuous metadata conditioning (Sec. 4.5.2), followed by a series of ablation studies examining the contributions of low-rank visual adaptation (Sec. 4.5.3), prompt learning and promptorder ensembling (Sec. 4.5.4), identity tokens (Sec. 4.5.5), auxiliary supervision (Sec. 4.5.6), cross-modal alignment (Sec. 4.5.7), and triplet learning strategies (Sec. 4.5.8). We further analyze identification performance as a function of temporal distance (Sec. 4.5.9) and present an analysis of temporal and body-side effects (Sec. 4.5.10). Finally, we report efficiency comparisons (Sec. 4.5.11) and assess generalization on additional animal ReID benchmarks (Sec. 4.5.12).

4.5.1. Comparison with Prior Art Closed-Set Evaluation. Table 2 reports performance comparisons under the CS protocol. Our approach consistently outperforms CLIP-ReID [28] and IndivAID [58] by a substantial margin in both head and body crop settings. In addition, we compare against full fine-tuning of the same CLIP-B/16 backbone. On body crops, our method improves over CLIP-ReID by +8.66 points and over IndivAID by +8.98 points. On head crops, we exceed both baselines by more than 8 mAP points. Improvements are also reflected in Rank-1 and Rank-5 accuracy, where our method consistently achieves the highest scores. Compared to full fine-tuning, our method achieves comparable performance on head crops (52.48 vs. 52.70 mAP) and slightly improves performance on body crops (53.00 vs. 52.10 mAP), while requiring substantially fewer trainable parameters. Across methods, body crops yield slightly stronger performance than head crops, particularly for our approach (+0.52 mAP). This suggests that global morphological cues complement the distinctive facial patterns characteristic of the species, and that leveraging full-body information can provide additional discriminative signal under closed-set conditions. These improvements are consistent with the architectural differences

Method

Crop

mAP

Rank-1

Rank-5

CLIP-ReID [28] CLIP-ReID [28]

Head Body

32.40 ± 0.52 30.90 ± 0.20

27.40 ± 0.53 26.00 ± 0.36

42.60 ± 0.57 39.00 ± 0.41

IndivAID [58] IndivAID [58]

Head Body

29.41 ± 0.40 30.05 ± 0.58

24.45 ± 0.37 25.11 ± 0.24

38.02 ± 0.45 38.91 ± 0.21

Ours Ours

Head Body

38.30 ± 0.33 37.90 ± 0.22

32.60 ± 0.30 31.60 ± 0.28

48.60 ± 0.17 48.20 ± 0.13

between the methods. In contrast to CLIP-ReID, which applies staged prompt optimization and full fine-tuning strategies, our method jointly optimizes low-rank visual adaptation and learnable prompts while keeping the backbone frozen. Compared to IndivAID, which employs a multistage pipeline with identity-specific token constructs, our approach integrates identity-aware prompt learning and visual adaptation within a unified training framework. Overall, these results indicate that the proposed parameter-efficient adaptation achieves a strong balance between performance and efficiency, matching or exceeding full fine-tuning while avoiding the need to update the entire backbone. Empirically, this parameter-efficient adaptation strategy yields higher closed-set performance and stable results across random seeds.

Open-Set Evaluation. Under the OS protocol (Table 3),

performance decreases for all methods compared to the CS protocol, reflecting the increased difficulty of generalizing to unseen identities. Nevertheless, our method maintains a substantial performance margin over prior work. On head crops, we improve over CLIP-ReID by +5.90 points and over IndivAID by +8.89 points. On body crops, we surpass both baselines by more than 7 mAP points. Improvements are consistent across Rank-1 and Rank-5 accuracy. Notably, in contrast to the closed-set setting where body crops slightly outperform head crops, the head crop yields the strongest performance under open-set conditions. This suggests that localized facial patterns may generalize more robustly across unseen identities, whereas global body cues may be more sensitive to inter-individual variability. Overall, these results indicate that our joint prompt and low-rank visual adaptation strategy generalizes more effectively to novel identities than prior CLIP-based approaches.

Time-aware Evaluation. We further evaluate all methods

under temporally structured protocols, where training samples precede test samples in time. Time-aware Closed-set. Table 4 evaluates robustness to temporal appearance changes within known individuals. Across both head and body crops, our method outperforms CLIP-ReID and IndivAID. Without metadata conditioning, the proposed model exceeds CLIP-ReID by +2.00 and +1.90 mAP points, respectively. When metadata conditioning is introduced (Ours + Meta), performance further improves 13

Table 4 Time-aware closed-set performance comparison. Results are reported as mean ± standard deviation over five random seeds. Bold indicates the best result in each column.

Table 5 Time-aware open-set performance comparison. Results are reported as mean ± standard deviation over five random seeds. Bold indicates the best result in each column.

Method

Crop

mAP

Rank-1

Rank-5

Method

Crop

mAP

Rank-1

Rank-5

CLIP-ReID [28] CLIP-ReID [28]

Head Body

61.00 ± 0.18 59.40 ± 0.14

54.90 ± 0.16 54.60 ± 0.17

80.20 ± 0.19 76.30 ± 0.15

CLIP-ReID [28] CLIP-ReID [28]

Head Body

47.90 ± 0.17 42.20 ± 0.15

42.80 ± 0.18 35.30 ± 0.16

67.60 ± 0.19 54.30 ± 0.14

IndivAID [58] IndivAID [58]

Head Body

59.18 ± 0.22 57.06 ± 0.21

55.26 ± 0.24 53.95 ± 0.23

81.89 ± 0.20 75.00 ± 0.18

IndivAID [58] IndivAID [58]

Head Body

40.63 ± 0.23 38.82 ± 0.24

33.53 ± 0.22 31.79 ± 0.20

59.54 ± 0.21 54.34 ± 0.19

Ours Ours Ours + Meta (Year+FiLM) Ours + Meta (Year+FiLM)

Head Body Head Body

63.00 ± 0.11 61.30 ± 0.09 65.90 ± 0.12 62.60 ± 0.10

57.90 ± 0.17 52.60 ± 0.12 60.50 ± 0.15 54.94 ± 0.11

82.90 ± 0.09 81.60 ± 0.13 84.20 ± 0.11 81.63 ± 0.17

Ours Ours Ours + Meta (DaySeq+Sin) Ours + Meta (DaySeq+Sin)

Head Body Head Body

51.40 ± 0.12 42.90 ± 0.11 52.02 ± 0.12 45.42 ± 0.15

43.40 ± 0.09 35.30 ± 0.14 45.74 ± 0.09 39.94 ± 0.13

67.10 ± 0.07 55.50 ± 0.11 67.14 ± 0.10 59.54 ± 0.11

defined on the whole dataset. Each bin is mapped to a descriptive textual token (e.g., “small”, “medium”, “large” for body length; “early”, “mid”, “late” for temporal progression; and calendar year descriptors for capture year). The resulting text embedding is appended to the prompt representation in place of the continuous metadata embedding. Apart from this metadata conversion step, all architectural components, optimization procedures, and inference settings remain unchanged. Table 6 shows that the discretized textual variant does not consistently improve performance. This suggests that coarse symbolic conditioning may introduce artificial discontinuities in the embedding space, which can negatively affect fine-grained identity discrimination, particularly for head crops where local appearance cues are already highly discriminative. In contrast, our continuous conditioning demonstrates more consistent benefits. Among individual attributes, capture year provides the strongest signal, with Year+FiLM achieving the best overall performance (65.9 mAP on head crops and 62.6 on body crops). This indicates that temporal progression is a key factor in longitudinal fish ReID, and that smooth geometric modulation of representations is more effective than step-wise discretization. While combining all three attributes does not always yield additive gains, the continuous variants generally maintain or improve upon the baseline, highlighting the importance of preserving numerical structure when modeling gradual temporal and morphological changes. In Table 7, the limitations of discretized textual conditioning become even more pronounced. While the discrete variant yields a slight improvement on body crops (42.9 to 44.1 mAP), it reduces performance on head crops (51.4 to 49.2 mAP) and remains consistently inferior to continuous conditioning. In contrast, continuous metadata encoding achieves the strongest results (52.0 mAP on head and 47.0 on body), demonstrating improved robustness under simultaneous identity and temporal distribution shifts. These findings suggest that step-wise discretization of numerical attributes may hinder the modeling of gradual appearance evolution in longitudinal fish ReID, whereas preserving the continuous structure of metadata enables smoother adaptation of the embedding space. On the other hand, several trends can be observed among the proposed metadata conditioning approaches. Temporal

+2.90 mAP on head crops and +1.30 mAP on body crops. Improvements are also reflected in Rank-1 and Rank-5 accuracy, where Ours + Meta consistently achieves the strongest performance. These results suggest that incorporating continuous temporal metadata enhances robustness to appearance variations across capture periods. Since prior methods do not exploit explicit metadata conditioning, the observed gains indicate the benefit of integrating temporal cues into prompt-based adaptation under temporally constrained evaluation. Time-aware Open-set. Table 5 evaluates the ability of each method to generalize to unseen individuals under temporal distribution shifts. Compared to prior methods, our approach consistently achieves higher performance across both crop types. Without metadata conditioning, our model already improves over CLIP-ReID by +3.50 mAP on head crops and +0.70 mAP on body crops. When metadata conditioning is enabled (Ours + Meta), performance further increases. The benefit of metadata conditioning is particularly pronounced for body crops, where mAP improves by +2.52 points relative to the base and by +3.22 points over CLIP-ReID. Rank-1 accuracy shows a similar trend, increasing from 35.30% to 39.94% for body crops when metadata is incorporated. For head crops, metadata provides a more modest but consistent gain (+0.62 mAP), indicating that facial patterns may already encode stronger identity cues under temporal shifts. Overall, these results demonstrate that combining prompt learning, low-rank visual adaptation, and continuous metadata conditioning enhances robustness in the presence of both unseen identities and temporal appearance changes. We note that alternative metadata configurations can yield higher performance for specific crops, as shown in Table 7. However, for clarity and consistency, we report a single configuration across both crops in this table.

4.5.2. Effect of Metadata Conditioning We investigate the impact of different metadata conditioning strategies relative to the no-metadata baseline under both the time-aware closed-set (Table 6) and time-aware open-set (Table 7) protocols. In addition to our continuous metadata conditioning, we examine a discretized textual encoding strategy inspired by [29]. In this variant, numerical attributes are first partitioned into a fixed number of bins 14

metadata emerges as the most consistently useful conditioning signal across datasets and evaluation protocols, indicating that temporal progression is a key factor in longitudinal animal ReID. While the optimal conditioning strategy varies across evaluation settings and visual representations, FiLM-based conditioning can yield substantial improvements when temporal metadata is highly informative (e.g., capture year), whereas sinusoidal encoding often provides more stable gains across different scenarios. Importantly, combining multiple metadata attributes does not always outperform single-attribute conditioning, suggesting that temporal information already captures a substantial portion of the relevant distribution shift. This behavior is not unexpected, as the head-crop and full-body evaluations represent distinct visual representations that likely emphasize different identity cues and may therefore benefit from different conditioning strategies. From a practical perspective, temporal metadata (e.g., capture year or acquisition time) provides a strong default choice when metadata availability is limited. Moreover, the consistent improvements observed across multiple metadata types and conditioning mechanisms suggest that the benefits of metadata conditioning are not tied to a single attribute or encoding strategy. Overall, these results demonstrate that continuous metadata conditioning effectively leverages temporal structure and enhances robustness under distribution shifts.

Table 6 Metadata conditioning ablation under time-aware closed-set. Bold denotes the best result per crop and metric. Attribute

Approach

Crop

mAP

Rank-1

Rank-5

Base

None

Head Body

63.0 61.3

57.9 52.6

82.9 81.6

All 3

Discrete [29]

Head Body

60.8 60.1

53.9 54.9

80.3 79.5

Dayseq

Sin

Head Body Head Body Head Body

61.5 58.9 62.8 60.3 62.3 59.9

57.9 53.9 59.2 55.3 57.9 52.6

81.6 78.9 77.6 77.6 81.6 76.3

Head Body Head Body Head Body

62.1 60.8 63.8 59.4 61.3 58.7

55.3 54.9 60.2 53.2 53.9 51.6

82.9 79.5 85.5 74.1 84.2 76.0

Head Body Head Body Head Body

62.2 61.6 65.9 62.6 58.1 57.5

57.9 56.6 60.5 54.9 51.3 50.0

85.5 80.3 84.2 81.6 80.3 76.3

Head Body Head Body Head Body

61.1 62.6 62.7 57.1 61.0 58.7

56.6 56.6 55.3 51.3 53.9 51.3

82.9 80.3 80.3 73.7 82.9 76.3

FiLM Sin+FiLM Length

Sin FiLM Sin+FiLM

Year

Sin FiLM Sin+FiLM

All 3

For the following ablation studies, we report results under the closed-set protocol using full-body images. This setting is commonly adopted in animal ReID benchmarks, where identity overlap and full-body observations provide sufficient images per identity for stable comparison of architectural variants. Restricting ablations to this configuration reduces additional variability introduced by identity-disjoint or temporally constrained splits and enables more controlled analysis of model design choices.

Sin FiLM Sin+FiLM

all standard adapters remain substantially below the performance of LoRA-based adaptation. LoRA attains 53.00% mAP with 𝑟 = 16 and 𝛼 = 16, significantly surpassing the other modules. Conversely, an excessively large rank (𝑟 = 512, 𝛼 = 1) yields severe degradation (33.20%), suggesting that overly flexible low-rank updates can destabilize pretrained representations.

4.5.3. Vision Adapter Ablation Table 8 reports the performance of alternative visual adaptation modules under the closed-set protocol using body images. The evaluated adapters cover a range of representative parameter-efficient adaptation strategies, including both lightweight bottleneck designs and more expressive transformer-based modules. All methods are implemented within the same CLIP backbone and trained under identical optimization settings, ensuring a fair and controlled comparison across adaptation mechanisms. In detail, the backbone is fixed and identical to that used in the proposed method. Prompt learning is enabled: prompts include learnable context tokens and prompt-order ensembling (End, Middle, Front layouts) as described in Sec. 3.3. Metadata conditioning is not used. This configuration, therefore, isolates the impact of visual adaptation while retaining the textside prompt optimization of our proposed pipeline. Among conventional adapter designs, the transformer-based adapter achieves the highest performance (41.20% mAP), outperforming bottleneck and convolutional variants. However,

4.5.4. Prompt Layout Ablation Table 9 evaluates the impact of prompt token placement under the closed-set protocol using body images. In this experiment, the backbone is fixed and identical to that used in the proposed method, and visual adaptation is applied either via the Transformer Adapter or LoRA. Metadata conditioning is disabled. Only the relative placement of the learnable context tokens is varied. We evaluate the three prompt layouts defined in Sec. 3.3. Concretely, the End, Middle, and Front layouts differ in the relative placement of the learnable context tokens with respect to the fixed class and identity tokens. While the fixed prefix, class (“fish”), and identity tokens remain unchanged, the context tokens are positioned before, between, or after these tokens according to the respective layout. Across both adaptation strategies, 15

Table 7 Metadata conditioning ablation under time-aware open-set. Bold denotes the best result per crop and metric.

Table 9 Prompt layout ablation on closed-set body images. Results are reported for both Transformer Adapter and LoRA.

Attribute

Fusion

Crop

mAP

Rank-1

Rank-5

Prompt Layout

Base

None

Head Body

51.4 42.9

43.4 35.3

67.1 55.5

All 3

Discrete [29]

Head Body

49.2 44.1

43.4 37.4

62.4 58.6

End Middle Front All layouts (ensemble)

Dayseq

Sin

Head Body Head Body Head Body

52.0 45.4 47.8 44.9 50.9 45.0

45.7 39.9 42.2 35.8 46.2 39.9

67.1 59.5 60.1 62.4 62.4 59.0

Head Body Head Body Head Body

50.4 45.2 46.3 44.6 51.4 46.1

43.9 38.8 39.9 36.9 45.1 40.2

68.8 58.7 63.0 57.5 63.6 59.8

Head Body Head Body Head Body

51.3 43.9 48.1 46.8 50.3 45.3

44.5 37.6 41.0 37.6 44.5 37.0

69.9 59.0 65.9 63.0 66.5 61.3

Head Body Head Body Head Body

50.1 46.8 47.6 43.6 50.0 47.0

43.4 40.5 43.4 36.4 45.1 41.0

68.2 61.8 61.8 53.8 62.4 60.7

FiLM Sin+FiLM Length

Sin FiLM Sin+FiLM

Year

Sin FiLM Sin+FiLM

All 3

Sin FiLM Sin+FiLM

Linear Head Bottleneck 1D Convolutional 2D Convolutional Transformer LoRA (𝑟 = 8, 𝛼 = 8) LoRA (𝑟 = 16, 𝛼 = 16) LoRA (𝑟 = 512, 𝛼 = 1)

LoRA

48.2 48.1 47.4 48.2

52.0 52.4 52.1 53.0

result (53.0% mAP), confirming that prompt diversity enhances semantic alignment in the shared CLIP embedding space.

4.5.5. Ablation of Identity Token To evaluate the contribution of the identity token in prompt construction, we remove the fixed identity token (𝐞id𝑖 ) from the prompt while retaining all other components, including LoRA adaptation and auxiliary identity supervision. Under this ablation, prompts consist only of a prefix, learnable context tokens, and class tokens. On the closed-set body protocol, removing the identity token decreases mAP by 0.9%, Rank-1 by 1.3%, and Rank-5 by 1.0%. Although the magnitude of the drop is moderate, it is consistent across metrics and indicates that identity tokens provide complementary supervision beyond metric learning and auxiliary classification. This supports their role as identity-specific conditioning signals that improve cross-modal alignment rather than acting as proxy-like class representatives. 4.5.6. Ablation of Auxiliary Identity Supervision To assess the necessity of auxiliary identity supervision, we remove the auxiliary classification term aux from the overall objective while retaining dual-space triplet supervision and cross-modal alignment. Under the closed-set protocol with body images, this results in decreases of 6.2% in mAP, 5.7% in Rank-1, and 7.9% in Rank-5. These substantial drops indicate that absolute class-level supervision provides important optimization stability and complementary discrimination beyond metric and cross-modal losses.

Table 8 Vision adapter ablation on closed-set body images. Adapter Variant

Transformer

mAP (%) 38.50 40.60 39.50 40.00 41.20 48.30 53.00 33.20

4.5.7. Cross-Modal Loss Ablation To evaluate the contribution of the symmetric crossmodal alignment objective, we perform ablations on the image-to-text and text-to-image contrastive terms. We conproj sider the following variants: (i) without i2t: cm = CCE (𝐭, 𝐟𝑣 ); proj (ii) without t2i: cm = CCE (𝐟𝑣 , 𝐭); (iii) without both: cm = 0. All other training settings remain unchanged. Removing either direction of cross-modal alignment leads to a performance drop compared to the full model, indicating that both image-to-text and text-to-image supervision contribute to identity discrimination (see Table 10). The largest degradation is observed when both terms are removed, confirming the importance of symmetric cross-modal alignment.

prompt layout influences performance, although differences between individual layouts remain moderate. For the Transformer Adapter, the End layout achieves the strongest performance (48.2% mAP), while the Front layout performs slightly worse. For LoRA, the Middle layout yields the best single-layout performance (52.4% mAP). Importantly, ensembling all layouts by averaging normalized embeddings consistently improves stability and achieves the best overall

16

For each evaluation protocol (CS, OS, TACS, and TAOS), we fitted separate binomial logistic regression models describing identification probability as a function of temporal separation. Success was defined independently for Rank1 and Rank-5 retrieval. The predicted probabilities and corresponding 95% confidence intervals were obtained from the fitted models and visualized across the empirically observed temporal range of each protocol. Because TACS and TAOS involve shorter temporal intervals by design, prediction ranges were restricted to the observed time span within each configuration. ReID accuracy declined significantly with increasing temporal separation across nearly all model configurations (logistic regression with log-transformed temporal distance; all 𝑝 < 0.001 for Rank-1 and Rank-5, except Rank-5 in the TACS protocol, where the effect was not significant). The estimated slopes were negative in all protocols (Rank1: 𝛽1 ranging from −0.46 to −0.77; Rank-5: 𝛽1 ranging from −0.42 to −1.15), confirming decreasing identification probability with increasing time gap. Identification probability changed most rapidly at shorter temporal intervals and varied more gradually over longer time scales (Figure 3). Models incorporating temporal constraints achieved higher short-term accuracy compared with the standard CS and OS approaches, although these models were evaluated over shorter temporal ranges. These results provide direct empirical evidence that ReID performance varies systematically with real temporal separation, indicating that longitudinal variation is measurable and exhibits systematic temporal structure in retrieval performance. The nonlinear decay pattern further suggests that performance changes are more pronounced at shorter temporal intervals, while longer-term variation manifests more gradually. This observation reinforces the relevance of temporally structured evaluation protocols, as the CS/OS and TACS/TAOS configurations exhibit distinct baseline levels and temporal ranges. Moreover, the continuous nature of the observed decay supports the conceptual motivation for modeling temporal attributes without discretization, in contrast to discretizationbased approaches such as [29]. Because performance varies smoothly as a function of time, conditioning strategies that preserve numerical structure, as applied by the proposed method, are conceptually better suited to capture the underlying longitudinal dynamics than step-wise temporal binning. While this analysis does not directly compare methods, it substantiates the importance of explicitly accounting for temporal variation in long-term animal ReID.

Table 10 Ablation of cross-modal alignment terms under the closed-set body protocol. See text for variants’ explanations. Variant

mAP (%)

Ours w/o i2t Ours w/o t2i Ours w/o both Ours Full (i2t + t2i)

51.5 51.9 49.5 53.0

Table 11 Ablation on triplet supervision on closed set body images. Triplet Supervision Variant Triplet(𝐟𝑣 ) proj Triplet(𝐟𝑣 ) Triplet(𝐟concat ) proj Triplet(𝐟𝑣 + 𝐟𝑣 , Ours)

mAP (%) 47.6 48.4 50.7 53.0

4.5.8. Ablation of Triplet Supervision To examine whether directly optimizing the fused descriptor provides additional benefits, we conduct an ablation comparing different metric supervision strategies under the closed-set body protocol. Specifically, we evaluate four variants: (i) triplet supervision applied only in the visual space, i.e., (𝑣) (𝐟 , 𝑦); (ii) triplet supervision applied only in the tri 𝑣 proj projected space, i.e., (𝑝) (𝐟 , 𝑦); (iii) triplet supervision tri 𝑣 proj applied to the fused descriptor 𝐟concat = norm([𝐟𝑣 ; 𝐟𝑣 ]), where norm(⋅) denotes 𝓁2 normalization after concatenation; (iv) independent triplet supervision in both spaces, (𝑣) + (𝑝) (our default setting). tri tri Table 11 shows that independent supervision of both embedding spaces yields the best performance. Applying proj triplet loss only in either 𝐟𝑣 or 𝐟𝑣 leads to lower accuracy, while directly supervising the fused descriptor improves performance but remains inferior to dual-space supervision. The proposed strategy achieves a gain of 2.3% mAP over fused-descriptor supervision, indicating that enforcing metric constraints separately in the raw and projected spaces produces a more discriminative fused representation at inference. 4.5.9. Temporal Distance and Identification Performance To quantify how identification probability varies with temporal separation under the proposed method, we modeled the probability of successful retrieval as a continuous function of temporal distance between observations. Analyses were restricted to different-day comparisons to exclude trivial same-capture matches. Temporal distance was defined as the absolute difference in days between the query image and its corresponding true match. Because the relationship between temporal separation and identification probability was nonlinear, temporal distance was logtransformed using log(1 + days) before model fitting.

4.5.10. Analysis of Temporal and Body-Side Effects To better understand the impact of temporal variation and body-side differences on ReID performance, we analyze performance across stratified conditions (Fig. 4). In particular, we consider matches grouped by temporal proximity (same-day vs. different-day) and by body side (same-side vs. opposite-side), motivated by the pronounced left–right asymmetry observed in fish appearance. 17

Figure 3: Predicted identification probability as a function of temporal distance under the proposed method. Curves represent fitted binomial logistic regression models for Rank-1 and Rank-5 retrieval across evaluation protocols (CS, OS, TACS, and TAOS). Shaded regions denote 95% confidence intervals. Temporal distance is log-transformed as log(1 + days). Prediction ranges are restricted to the empirically observed temporal span of each protocol.

Figure 4: ReID performance across model configurations, stratified by temporal context and body side. Points represent the proportion of queries for which the correct individual was retrieved within the top candidate identities (Rank-1 and Rank-5), with whiskers indicating 95% bootstrap confidence intervals. Results are shown separately for same-day and different-day comparisons and for matches involving the same body side or opposite body sides. Numbers above points indicate the number of queries contributing to each estimate.

18

ReID accuracy is consistently high for same-day comparisons across all models (Rank-1 ≥ 0.95 and Rank-5 ≥ 0.99 in most cases), indicating that identity-specific visual cues remain stable over short temporal intervals. However, accuracy declines substantially for different-day matches, reflecting the challenge of longitudinal appearance variation. Under these conditions, models incorporating temporal constraints achieve noticeably higher identification accuracy than standard closed-set and open-set approaches. For example, Rank-1 accuracy increases from approximately 0.21 (CS) and 0.18 (OS) to 0.58 (TACS) and 0.47 (TAOC) for same-side comparisons, with similar improvements observed for Rank-5. This demonstrates that incorporating temporal structure improves robustness to appearance changes over time. We note that time-aware models are evaluated over shorter temporal intervals due to constrained candidate sets (1–113 days), whereas CS and OS models operate across the full temporal range of the dataset (1–1877 days). This difference highlights the importance of considering temporal distribution when interpreting performance across protocols. Finally, differences between same-side and oppositeside matches are relatively small and largely overlap within confidence intervals. This suggests that the model learns features that are robust to left–right asymmetry, and that cross-side matching does not substantially degrade performance. Overall, these results indicate that temporal variation is the primary factor affecting performance, while body-side differences play a comparatively minor role. Detailed statistics of query counts and temporal gap distributions for each protocol are provided in the Appendix (Table 14).

Table 12 Trainable parameter comparison under the same CLIP-B/16 backbone. For metadata-conditioned variants, we report the largest configuration (all metadata attributes), providing an upper bound on parameter count; configurations using fewer attributes are correspondingly more lightweight. Method Full FT (CLIP-B/16) [48] CLIP-ReID [28] IndivAID [58] Ours Ours + Meta (All 3 +Sin) Ours + Meta (All 3 +FiLM)

Trainable Params (M) 150.00 154.30 154.40 72.90 72.95 98.20

the proposed approach. By restricting adaptation to lowrank updates and prompt parameters, the method reduces training memory usage and optimization cost compared to approaches that fine-tune the full backbone. Importantly, at inference time, all text-related components and metadata conditioning are removed. The model reduces to a standard vision encoder, requiring no additional inputs or modules. Therefore, the inference complexity remains equivalent to the base CLIP model [48], with no additional computational overhead. For completeness, under our experimental setup (NVIDIA RTX 5090 GPU, batch size = 1), the inference time is approximately 8 ms per image, which is comparable to a standard CLIP ViT-B/16 forward pass. In addition, compared to multi-stage training strategies such as CLIP-ReID and IndivAID, the proposed method adopts a unified end-to-end optimization scheme, which avoids sequential training phases and simplifies the overall training procedure.

4.5.11. Efficiency Analysis To further evaluate computational efficiency, we compare the number of trainable parameters across full finetuning of CLIP-B/16 and CLIP-based ReID methods under the same backbone. We report only the parameters updated during training, excluding frozen components, so that the comparison reflects adaptation overhead rather than total model size. Table 12 summarizes the trainable parameter counts for full fine-tuning, CLIP-ReID [28], IndivAID [58], and our method with and without metadata conditioning. Full fine-tuning updates both the vision and text encoders, resulting in approximately 150M trainable parameters. In contrast, CLIP-ReID and IndivAID require updating large portions of the backbone or additional modules. As shown, our approach requires substantially fewer trainable parameters, as adaptation is restricted to low-rank attention updates, learnable prompt context tokens, and lightweight conditioning layers, while keeping the backbone frozen. This demonstrates that the observed performance gains are achieved through structured parameter-efficient adaptation, providing a favorable trade-off between performance and efficiency compared to full fine-tuning. While Table 12 reports the number of trainable parameters, it also reflects the computational efficiency of

4.5.12. Experiments on Other Datasets To further evaluate the generalization ability of our approach across diverse species and acquisition conditions, we conduct additional experiments on multiple publicly available animal ReID datasets. All seven datasets are accessed and standardized using the WildlifeDatasets toolkit [67, 7], which provides unified data loading, preprocessing, and evaluation protocols (i.e., CS). To specifically assess cross-dataset generalization in the presence of temporal metadata, we further evaluate our method on the SeaTurtleID2022 dataset [1], which spans 13 years and includes timestamp annotations. This dataset differs from the Melops dataset in terms of species, imaging conditions, and acquisition setup, while sharing the availability of temporal metadata and time-aware evaluation protocols (i.e., TACS and TAOS). We adopt the same experimental setting and evaluate our method using metadata (year) conditioning with Sin and FiLM configurations. We use full-body images with background removed using SAM2 [49]. Specifically, we apply segmentation to isolate the turtle and replace the background with a uniform (white) mask, followed by resizing to match the CLIP input resolution. 19

This preprocessing reduces background bias and focuses the model on identity-relevant visual features. We evaluate performance using our standard retrieval protocol (mAP) to ensure consistency with the rest of the paper. All hyperparameters are kept identical to those used for the Melops dataset, without any dataset-specific tuning. The corresponding mAP results are summarized in Table 13. For clarity, the primary comparison scope of this work is CLIP-based and parameter-efficient adaptation methods operating under comparable backbone capacity and training regimes. We do not perform a direct numerical comparison with MegaDescriptor [67], as it was trained jointly on 29 wildlife ReID datasets and fully fine-tuned under a large-scale multi-dataset setting. WildFusion [7] similarly relies on MegaDescriptor as its global backbone, which was trained on over 30 wildlife datasets. In contrast, our approach adapts a frozen CLIP-B backbone using datasetspecific supervision, with training performed individually per dataset under the same-species evaluation protocol. Moreover, MegaDescriptor-L and DINOv2 employed in these studies, use substantially larger transformer architectures than the CLIP-B backbone used in our experiments. Therefore, to ensure a fair comparison under comparable backbone capacity and training regimes, we restrict our evaluation to CLIP-based ReID baselines. Note that when implemented without environmental metadata, the method proposed in [29] reduces to the CLIP-ReID baseline [28], as the metadata-conditioned components become inactive. As shown in Table 13, our method achieves the best mAP on six out of seven benchmarks and outperforms both CLIP-ReID and IndivAID on the majority of datasets for the CS setting. In particular, noticeable improvements are observed on SeaStarReID2023 (+2.68% over CLIP-ReID), PolarBearVidID (+1.50%), and SealID (+2.41%). These results demonstrate that our parameter-efficient adaptation and prompt-learning strategy maintains strong cross-dataset generalization performance despite operating under a perdataset training regime without large-scale aggregated supervision. On the other hand, results on the TACS and TAOS protocols on the SeaTurtleID2022 dataset further validate the effectiveness of metadata conditioning under temporal distribution shifts. Under the TACS setting, incorporating temporal metadata improves performance from 39.26 mAP to 41.13 mAP with sinusoidal conditioning and to 43.37 mAP with FiLM, corresponding to gains of +1.87 and +4.11 mAP, respectively. Similarly, under the more challenging TAOS setting, performance increases from 31.05 mAP to 32.63 mAP (+1.58) with sinusoidal conditioning and to 34.51 mAP (+3.46) with FiLM. These improvements are consistent across both evaluation protocols, demonstrating that metadata conditioning enhances robustness to temporal variation and unseen identities. Notably, these gains are achieved using the same training protocol and hyperparameters as in the Melops dataset, without dataset-specific tuning, highlighting the generalization capability of the proposed approach.

Table 13 Comparisons with CLIP-based methods across various datasets. “N/A” indicates that metadata conditioning is not applied to the corresponding methods, as it is not part of their original design. Dataset CS - WildlifeDatasets [67, 7] FriesianCattle2015v2 AerialCattle2017 ATRW SeaStarReID2023 LionData PolarBearVidID SealID TACS - SeaTurtleID2022 [1] wout/ Meta w/ Meta (Year+Sin) w/ Meta (Year+FiLM) TAOS - SeaTurtleID2022 [1] wout/ Meta w/ Meta (Year+Sin) w/ Meta (Year+FiLM)

CLIP-ReID [28]

IndivAID [58]

Ours

58.18 60.09 58.05 57.41 59.32 58.68 56.77

61.27 57.27 58.18 58.18 58.18 56.70 58.56

62.47 58.18 59.52 60.09 59.45 60.18 59.18

32.44 N/A N/A

35.73 N/A N/A

39.26 41.13 43.37

29.46 N/A N/A

30.06 N/A N/A

31.05 32.63 34.51

5. Discussions The experimental results clarify how the proposed framework performs under realistic longitudinal ecological conditions. The absolute performance levels reflect the intrinsic difficulty of longitudinal ecological ReID in the Melops dataset, which comprises nearly 10,000 unique individuals with a highly imbalanced, long-tailed identity distribution. The majority of individuals are observed only once, while relatively few are repeatedly recaptured across years. This sparse per-identity sampling, combined with extended temporal drift and fine-grained inter-individual variation, makes identity discrimination substantially more challenging than in conventional ReID benchmarks. Importantly, such imbalance and limited observations per individual are not artifacts of dataset design, but inherent characteristics of real-world capture–mark–recapture ecological monitoring. Against this backdrop of extreme sparsity and temporal drift, the ablation analyses clarify how the individual components of the proposed framework contribute to retrieval performance. In particular, they show how low-rank attention adaptation, symmetric cross-modal supervision, and temporal variability jointly influence performance across extended time gaps. The vision adapter ablation demonstrates that moderate-rank low-rank updates to attention projections are sufficient to specialize pretrained CLIP representations for fine-grained identity discrimination without full backbone fine-tuning. Identity adaptation therefore, benefits from limited-capacity updates that preserve pretrained embedding structure, whereas excessively flexible updates reduce discriminability. Prompt-based conditioning complements low-rank visual adaptation. Although individual prompt layouts yield similar mean performance, prompt-order ensembling improves overall accuracy and reduces sensitivity to token 20

placement, indicating that varying prompt structure enhances cross-modal alignment consistency. The modest but consistent improvement obtained by retaining identity tokens further confirms that identity-conditioned prompts provide supervision beyond auxiliary classification and metric learning. These tokens introduce identity-specific conditioning signals during training while preserving a purely visual inference pipeline at test time. Importantly, unlike proxy-based or prototype-based approaches, identity tokens are not learnable and do not act as class representatives in the embedding space. Instead, they provide nonparametric, identity-specific conditioning within the prompt structure, guiding cross-modal alignment during training without introducing additional representational capacity. The design of identity-conditioned tokens warrants further clarification. Each training identity is associated with a unique fixed embedding vector that serves solely as a structural conditioning signal within the prompt space. These tokens do not encode semantic attributes and are not optimized during training. Instead, they act as stable anchors that facilitate cross-modal alignment between visual embeddings and identity-specific textual representations. Importantly, identity tokens are used only during training and are discarded at inference time, ensuring that the deployed model remains independent of identity-specific parameters. Keeping identity tokens fixed, rather than learnable, prevents the text branch from absorbing discriminative capacity that should be attributed to the visual encoder. This encourages adaptation through low-rank visual updates and prompt context optimization instead of memorizing identity embeddings in the text space. Scalability is not adversely affected, as identity tokens are instantiated only for identities present in the training split and do not grow with unseen identities at deployment. The ablation experiments also clarify the relative contribution of training objectives. Auxiliary identity supervision proves essential for stable optimization under parameterefficient fine-tuning: removing the classification heads produces a substantial performance drop, indicating that absolute class-level supervision complements batch-dependent metric learning and stabilizes optimization of low-rank and prompt parameters. Similarly, symmetric cross-modal alignment provides complementary geometric constraints. Removing either image-to-text or text-to-image contrastive terms reduces accuracy, and removing both leads to the largest degradation, suggesting that bidirectional alignment reinforces structure in the shared embedding space even when the text branch is used only during training. The triplet supervision ablation further shows that applying metric learning independently in both the raw visual space and the CLIP-projected space yields the strongest fused descriptor. This indicates that the two representations capture complementary identity cues and that dual-space supervision is preferable to optimizing a single embedding space or a fused descriptor directly. Beyond the architectural ablations, the metadata and crop-type analyses offer additional insight into modeling

longitudinal variability. Continuous metadata conditioning generally outperforms discretized textual encoding, suggesting that preserving numerical structure is preferable to imposing artificial categorical boundaries when modeling gradual appearance change. Among individual attributes, capture year provides the strongest signal, indicating that coarse temporal progression captures a substantial component of longitudinal drift. The non-additive behavior observed when combining multiple attributes further implies partial redundancy among temporal cues and highlights the importance of selective conditioning rather than indiscriminate feature fusion. The comparison between head and full-body crops illustrates the role of spatial granularity in identity stability. Full-body cues provide slightly stronger performance under identity-overlapping conditions, whereas head crops exhibit relatively greater robustness in open-set scenarios. This pattern suggests that localized facial features may remain comparatively stable across unseen individuals, while global morphology contributes discriminative information when identity overlap exists but may be more sensitive to growth-related variation. Together, these findings emphasize that both temporal and spatial factors shape representation stability and should be jointly considered in longitudinal ecological ReID. The temporal analysis further underscores that identity similarity in longitudinal animal ReID is inherently timedependent. The consistent decline in retrieval probability with increasing temporal separation indicates that temporal drift constitutes a systematic source of distribution shift rather than random noise. Because each evaluation protocol is constructed from distinct splits with different identity compositions and temporal ranges, absolute performance levels are not directly comparable across configurations. In addition, the relatively small number of query identities in the time-aware protocols reflects the inherent sparsity of long-term recaptures in ecological monitoring, and may introduce increased sensitivity to sample variability; however, this setting provides a realistic evaluation of longitudinal robustness and should be interpreted in that context. Nevertheless, the negative association between elapsed time and identification reliability is observed within all protocols, reinforcing the importance of temporally structured evaluation. The smooth decay pattern suggests that appearance variation evolves continuously rather than in discrete steps, conceptually supporting conditioning strategies that preserve the numerical continuity of temporal attributes. Overall, temporal separation emerges as a fundamental dimension of robustness that should be explicitly considered in longitudinal ecological ReID. Across additional wildlife benchmarks, the proposed method maintains consistent improvements over CLIP-based baselines while requiring fewer trainable parameters and per-dataset training. This indicates that the observed performance gains arise from structured parameter-efficient adaptation rather than increased model capacity. Although performance varies across datasets due to differences in 21

acquisition conditions and species-specific appearance characteristics, the overall improvements demonstrate that lowrank visual adaptation and prompt-based supervision generalize beyond the fish-specific setting. Taken together, these findings indicate that combining constrained visual adaptation, structured prompt learning, and continuous metadata conditioning provides an effective and computationally efficient framework for longitudinal animal ReID, while highlighting the importance of explicitly modeling timedependent appearance variation in ecological monitoring applications.

Acknowledgment This work was supported by the Research Council of Norway (Computer vision to expand monitoring and accelerate assessment of coastal fish (CoastVision), project number 325862.

6. Conclusions In this paper, we presented a parameter-efficient vision–language adaptation framework for longitudinal animal ReID. The framework combines LoRA-based visual adaptation, prompt learning, and cross-modal alignment within a frozen CLIP backbone, while introducing a continuous metadata-conditioning mechanism that incorporates numerical metadata as a training-time-only conditioning signal. Unlike prior approaches that discretize metadata into textual categories or require metadata during deployment, the proposed formulation shapes the embedding geometry during training without introducing any inference-time dependency. Empirical evaluation across multiple protocols and species demonstrates that this conditioning strategy improves robustness under identity and temporal distribution shifts while preserving a purely visual inference pipeline without inference-time metadata or auxiliary components. Despite these advances, several directions remain for future research. The time-aware protocols involve fewer identities than the full dataset, reflecting the natural sparsity of recaptures in longitudinal ecological monitoring. Such imbalance is inherent to real-world capture–mark–recapture studies, where only a subset of individuals is observed across extended time intervals. While this reduces sample density under strict temporal constraints, it provides a realistic evaluation of long-term identity stability. Future work may therefore focus on extending longitudinal data collection efforts and increasing recapture density, enabling more statistically robust evaluation under strict temporal separation. The present study emphasizes scalar, temporal, and morphological metadata. Extending continuous conditioning to behavioral attributes, such as activity state or reproductive behavior [6], represents a promising direction. Incorporating such signals would require consistent behavioral annotation in longitudinal datasets but may further improve robustness under complex ecological variation. More broadly, future research may explore continual adaptation strategies for long-term ecological monitoring, cross-species transfer of identity representations, and deeper theoretical analysis of geometric conditioning effects in representation learning.

22

[11] Gómez-Vargas, N., Alonso-Fernández, A., Blanquero, R., Antelo, L.T., 2023. Re-identification of fish individuals of undulate skate via deep learning within a few-shot context. Ecological Informatics 75, 102036. [12] He, K., Zhang, X., Ren, S., Sun, J., 2015. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification, in: Proceedings of the IEEE international conference on computer vision, pp. 1026–1034. [13] He, Z., Qian, J., Yan, D., Wang, C., Xin, Y., 2023. Animal reidentification algorithm for posture diversity, in: IEEE ICASSP. [14] Holmberg, J., Norman, B., Arzoumanian, Z., 2009. Estimating population size, structure, and residency time for whale sharks rhincodon typus through collaborative photo-identification. Endangered Species Research 7, 39–53. doi:10.3354/esr00186. [15] Houlsby, N., Giurgiu, A., Jastrzebski, S., Morrone, B., De Laroussilhe, Q., Gesmundo, A., Attariyan, M., Gelly, S., 2019. Parameterefficient transfer learning for nlp, in: International conference on machine learning, PMLR. pp. 2790–2799. [16] Hu, E.J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., Chen, W., 2022. Lora: Low-rank adaptation of large language models, in: ICLR. [17] Huang, J., Yu, X., An, D., Ning, X., Liu, J., Tiwari, P., 2025. Uniformity and deformation: A benchmark for multi-fish real-time tracking in the farming. Expert Systems with Applications 264, 125653. [18] Jia, M., Tang, L., Chen, B.C., Cardie, C., Belongie, S., Hariharan, B., Lim, S.N., 2022. Visual prompt tuning, in: European conference on computer vision, Springer. pp. 709–727. [19] Jiao, B., Liu, L., Gao, L., Wu, R., Lin, G., Wang, P., Zhang, Y., 2023. Toward re-identifying any animal. Neurips 36, 40042–40053. [20] John, L., Rick, I.P., Vitt, S., Thünken, T., 2021. Body coloration as a dynamic signal during intrasexual communication in a cichlid fish. BMC Zoology 6, 9. [21] Khan, S.D., Ullah, H., 2019. A survey of advances in vision-based vehicle re-identification. Computer Vision and Image Understanding 182, 50–63. [22] Kim, S., Kim, D., Cho, M., Kwak, S., 2020. Proxy anchor loss for deep metric learning, in: IEEE/CVF CVPR, pp. 3238–3247. [23] Lamping, C., Kootstra, G., Derks, M., 2025. Transformer-based similarity learning for re-identification of chickens. Smart Agricultural Technology . [24] Lester, B., Al-Rfou, R., Constant, N., 2021. The power of scale for parameter-efficient prompt tuning, in: Proceedings of EMNLP. [25] Li, D., Zhang, Z., Chen, X., Huang, K., 2018. A richly annotated pedestrian dataset for person retrieval in real surveillance scenarios. IEEE transactions on image processing 28, 1575–1590. [26] Li, S., Fu, L., Sun, Y., Mu, Y., Chen, L., Li, J., Gong, H., 2021. Individual dairy cow identification based on lightweight convolutional neural network. Plos one 16, e0260510. [27] Li, S., Li, J., Tang, H., Qian, R., Lin, W., 2020. Atrw: A benchmark for amur tiger re-identification in the wild, in: ACM MM. [28] Li, S., Sun, L., Li, Q., 2023. Clip-reid: exploiting vision-language model for image re-identification without concrete text labels, in: Proceedings of the AAAI conference on artificial intelligence, pp. 1405–1413. [29] Li, Y., Zhao, D., Qiao, T., Wu, Y., Pang, B., Koh, Y.S., 2025. Metawild: A multimodal dataset for animal re-identification with environmental metadata, in: Proceedings of the 33rd ACM International Conference on Multimedia, pp. 13009–13015. [30] Li, Z., Yan, Z., Tian, W., Zeng, D., Liu, Y., Li, W., 2024. Redeformtr: Wildlife re-identification based on light-weight deformable transformer with multi-image feature fusion. IEEE Access . [31] Liu, Y., Li, B., Zhou, X., Li, D., Duan, Q., 2024. Fishtrack: Multiobject tracking method for fish using spatiotemporal information fusion. Expert Systems with Applications 238, 122194. [32] Lonati, M., Jahanbakht, M., Atkins, D., Bierwagen, S.L., Chin, A., Barnett, A., Rummer, J.L., 2024. Novel use of deep neural networks on photographic identification of epaulette sharks across life stages. Journal of Fish Biology 105, 1572–1587.

Table 14 Summary of evaluation conditions across models and temporal groups. The table reports the number of queries (𝑛) and the corresponding temporal gap statistics. Model

Day Group

𝑛

Temporal Gap (days)

CS OS TACS TAOS

Different day Different day Different day Different day

1258 1754 72 171

364 (1–1877) 359 (1–1877) 54.8 (1–113) 56.3 (1–113)

CS OS TACS TAOS

Same day Same day Same day Same day

585 464 4 2

0 0 0 0

Appendix Table 14 provides detailed statistics of query counts and temporal gap distributions across different evaluation protocols. As shown, the closed-set (CS) and open-set (OS) protocols span the full temporal range of the dataset (up to 1877 days), while the time-aware protocols operate over shorter temporal intervals due to constrained candidate sets. This difference in temporal coverage should be taken into account when interpreting performance comparisons across protocols, as it directly affects the difficulty of the ReID task.

References [1] Adam, L., Čermák, V., Papafitsoros, K., Picek, L., 2024. Seaturtleid2022: A long-span dataset for reliable sea turtle reidentification, in: IEEE WACV. [2] Bai, X., Islam, T., Bin Azhar, M., 2024. Transformer-based models for enhanced amur tiger re-identification, in: Proc. of IEEE SAMI. [3] Beyan, C., Osman Tur, A., Karimi, E., 2026. From species-specific models to universal re-id: a survey of animal re-identification. Information Fusion 133, 104323. URL: https://www.sciencedirect. com/science/article/pii/S1566253526002022, doi:https://doi.org/10. 1016/j.inffus.2026.104323. [4] Biehl, M., Hammer, B., Schneider, P., Villmann, T., 2009. Metric learning for prototype-based classification, in: Innovations in Neural Information Paradigms and Applications. Springer, pp. 183–199. [5] Borlinghaus, P., Tausch, F., Rettenberger, L., 2023. A purely visual re-id approach for bumblebees and its application to ecological monitoring. Smart Agricultural Technology . [6] Canovi, N., Ellis, B.A., Sørdalen, T.K., Allken, V., Halvorsen, K.T., Malde, K., Beyan, C., 2024. Trajectory-based fish event classification through pre-training with diffusion models. Ecological Informatics 82, 102733. [7] Cermak, V., Picek, L., Adam, L., Neumann, L., Matas, J., 2024. Wildfusion: Individual animal identification with calibrated similarity fusion. arXiv preprint arXiv:2408.12934 . [8] Cheng, X., Zhu, J., Zhang, N., Wang, Q., Zhao, Q., 2020. Detection features as attention (defat): A keypoint-free approach to amur tiger re-identification, in: ICIP. [9] Compte, A., Yan, Y., Cortés, X., Escalera, S., Jacques-Junior, J.C., 2025. Housed pig identification and tracking for precision livestock farming. Expert Systems with Applications 293, 128466. [10] Ellis, B.A., Sørdalen, T.K., Briffa, M., Skiftesvik, A.B., Wilson, A.D.M., Halvorsen, K.T., 2026. Visual cues elicit differential aggression towards female and female mimics in the corkwing wrasse. Behavioral Ecology , arag022doi:10.1093/beheco/arag022.

23

[33] Loshchilov, I., Hutter, F., 2017. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 . [34] McClintock, B.T., Hill, J.M., Fritz, L., Chumbley, K., Luxa, K., Diefenbach, D.R., 2014. Mark-resight abundance estimation under incomplete identification of marked individuals. Methods in Ecology and Evolution 5, 1294–1304. [35] Moskvyak, O., Maire, F., Dayoub, F., Armstrong, A., Baktashmotlagh, M., 2021. Robust re-identification of manta rays from natural markings by learning pose invariant embeddings, in: DICTA. [36] Moskvyak, O., Maire, F., Dayoub, F., Baktashmotlagh, M., 2020. Learning landmark guided embeddings for animal re-identification, in: IEEE WACVw. [37] Murali, N., Schneider, J., Levine, J., Taylor, G., 2019. Classification and re-identification of fruit fly individuals across days with convolutional neural networks, in: 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), IEEE. pp. 570–578. [38] Nepovinnykh, E., Chelak, I., Eerola, T., Immonen, V., Kälviäinen, H., Kholiavchenko, M., Stewart, C., 2024a. Species-agnostic patterned animal re-identification by aggregating deep local features. IJCV . [39] Nepovinnykh, E., Eerola, T., Biard, V., Mutka, P., Niemi, M., Kunnasranta, M., Kälviäinen, H., 2022. Sealid: Saimaa ringed seal reidentification dataset. Sensors . [40] Nepovinnykh, E., Eerola, T., Kalviainen, H., 2020. Siamese network based pelage pattern matching for ringed seal re-identification, in: IEEE WACVw. [41] Nepovinnykh, E., Eerola, T., Kalviainen, H., Chelak, I., 2024b. Norppa: Novel ringed seal re-identification by pelage pattern aggregation, in: IEEE WACVw. [42] Nepovinnykh, E., Immonen, V., Eerola, T., Stewart, C., Kälviäinen, H., 2025. Re-identification of patterned animals by multi-image feature aggregation and geometric similarity. IET Computer Vision . [43] Olsen, Ø.L., Sørdalen, T.K., Goodwin, M., Malde, K., Knausgård, K.M., Halvorsen, K.T., 2023. A contrastive learning approach for individual re-identification in a wild fish population, in: Proceedings of the Northern Lights Deep Learning Workshop. [44] Perez, E., Strub, F., de Vries, H., Dumoulin, V., Courville, A., 2018. Film: Visual reasoning with a general conditioning layer, in: Proceedings of the AAAI Conference on Artificial Intelligence. [45] Perneel, M., Adriaens, I., Verwaeren, J., Aernouts, B., 2025. Dynamic multi-behaviour, orientation-invariant re-identification of holsteinfriesian cattle. Sensors . [46] Price, A.C., Weadick, C.J., Shim, J., Rodd, F.H., 2008. Pigments, patterns, and fish behavior. Zebrafish 5, 297–307. [47] Quan, R., Dong, X., Wu, Y., Zhu, L., Yang, Y., 2019. Auto-reid: Searching for a part-aware convnet for person re-identification, in: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3750–3759. [48] Radford, A., Kim, J.W., Hallacy, C., et al., 2021. Learning transferable visual models from natural language supervision, in: ICML, pp. 8748–8763. [49] Ravi, N., Gabeur, V., Hu, Y.T., Hu, R., Ryali, C., Ma, T., Khedr, H., Rädle, R., Rolland, C., Gustafson, L., et al., 2024. Sam 2: Segment anything in images and videos. arXiv preprint arXiv:2408.00714 . [50] Ravoor, P., T.s.b., S., 2020. Deep learning methods for multi-species animal re-identification and tracking: a survey. Computer Science Review . [51] Rosenberg, B., Zhou, M., Wolf, N., Mathis, M.W., Harris, B.P., Mathis, A., 2026. Individual identification of brown bears using poseaware metric learning. Current Biology 36, 645–659.e14. doi:https: //doi.org/10.1016/j.cub.2025.12.022. [52] Sordalen, T.K., Malde, K., Skiftesvik, A.B., Sauvaitre, C., Beyan, C., Larsen, T.and Halvorsen, K.T., 2026. A wild fish image dataset for individual re-identification and phenotyping. Scientific data . [53] Sørdalen, T.K., Halvorsen, K.T., 2025. Melopsreid: A wild fish image dataset for re-identification. URL: https://doi.org/10.5281/zenodo. 17099925, doi:10.5281/zenodo.17099925. [54] Town, C., Marshall, A., Sethasathien, N., 2013. Manta matcher: Automated photographic identification of manta rays using keypoint

features. Ecology and Evolution 3, 1902–1914. doi:10.1002/ece3.587. [55] Uglem, I., Rosenqvist, G., Wasslavik, H.S., 2000. Phenotypic variation between dimorphic males in corkwing wrasse. Journal of Fish Biology 57, 1–14. [56] Williams, F., Hennessey, S., Kuncheva, L., 2025. Animal reidentification in video through track clustering. PAA . [57] Wu, W., Tao, D., Li, H., Yang, Z., Cheng, J., 2021. Deep features for person re-identification on metric learning. Pattern Recognition 110. [58] Wu, Y., Zhao, D., Zhang, J., Koh, Y.S., 2024. An individual identity-driven framework for animal re-identification. arXiv preprint arXiv:2410.22927 . [59] Yu, P., Burghardt, T., Dowsey, A., Campbell, N., 2025. Holsteinfriesian re-identification using multiple cameras and self-supervision on a working farm. Computers and Electronics in Agriculture . [60] Zaken, E.B., Goldberg, Y., Ravfogel, S., 2022. Bitfit: Simple parameter-efficient fine-tuning for transformer-based masked language-models, in: Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 1–9. [61] Zhang, K., Qin, Y., Pan, H., Ma, B., 2025. Diffusion-based adversarial attack method against person re-identification. Expert Systems with Applications , 128541. [62] Zhang, T., Zhao, Q., Da, C., Zhou, L., Li, L., Jiancuo, S., 2021. Yakreid-103: A benchmark for yak re-identification, in: IEEE IJCB. [63] Zheng, Z., Zhao, Y., Li, A., Yu, Q., 2022. Wild terrestrial animal reidentification based on an improved locally aware transformer with a cross-attention mechanism. Animals . [64] Zhou, K., Yang, J., Loy, C.C., Liu, Z., 2022. Learning to prompt for vision-language models, in: CVPR. [65] Zhu, X., Luo, Z., Fu, P., Ji, X., 2020. Voc-reid: Vehicle reidentification based on vehicle-orientation-camera, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 602–603. [66] Zuerl, M., Dirauf, R., Koeferl, F., Steinlein, N., Sueskind, J., Zanca, D., Brehm, I., Fersen, L.v., Eskofier, B., 2023. Polarbearvidid: A video-based re-identification benchmark dataset for polar bears. Animals 13, 801. [67] Čermák, V., Picek, L., Adam, L., Papafitsoros, K., 2024. Wildlifedatasets: An open-source toolkit for animal re-identification, in: IEEE WACV.

24

Record · ID 361505 · SHA-256 feed4acce2e55a86
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.