arXiv:2608.26632cs.CVAug 2026

Manuscript Offprint

arXiv:2608.26632

Who Remains, What Changes: Identity Anchored Composed Gait Retrieval

Jingchen Fei, Zengbin Wang, Yukun Liu, Muyi Sun, Shibiao Xu, Man Zhang

Abstract

Gait recognition has achieved remarkable progress, yet existing methods remain confined to rigid visual matching and often overlook the potential of natural language instructions for interactive retrieval. In this paper, we introduce Composed Gait Retrieval (CoGR), a novel task that retrieves a target gait sequence based on a reference sequence and a natural language modification query. To address the absence of existing datasets for this task, we design an automated annotation pipeline powered by large vision-language models (VLMs) to construct the first gait-language datasets: Language-Augmented CCPG and Language-Augmented CASIA-B. Building on this, we propose ComposeGait, an identity-anchored composition framework designed to prevent the identity drift that arises when generic composed retrieval follows the instruction but returns the wrong person. Its Part-aware Identity Adapter (PIA) aggregates multi-frame, part-aware identity evidence into a sample-specific ID token. We inject the ID tokens into both branches of a shared Q-Former to preserve identity, while excluding the ID-token outputs from the final retrieval embeddings. Joint identity and task-adapted composed-retrieval objectives optimize this space end to end. We evaluate ComposeGait on both benchmarks and show that it achieves the best R@1 among the compared methods, reaching 72.38% on Language-Augmented CCPG and 83.61% on Language-Augmented CASIA-B. These results establish ComposeGait as a strong baseline for CoGR. The datasets and code will be made publicly available.

1 Introduction

Gait recognition, a prominent biometric technology, aims to identify individuals by their unique walking patterns from a distance. Driven by deep learning, recent advances have achieved high accuracy in verifying identities under constrained covariates such as carrying a bag or wearing a coat (Yu, Tan, and Tan 2006; Li et al. 2023b; Fan et al. 2025). However, real-world intelligent surveillance often involves dynamic and interactive retrieval. Rather than simply asking “Who is this person?”, an investigator may issue a semantic instruction such as “Find this person, but now wearing a blue shirt and trousers of a different color.” Traditional gait retrieval systems are constrained by a rigid sequence-to-sequence paradigm: they penalize cross-covariate differences and cannot understand natural-language modifications.

To bridge the modality gap between visual queries and user intentions, Composed Image Retrieval (CIR) (Du et al. 2025;

Figure

(a) Composed Gait Retrieval

Figure

(b) Automated VLM-based datasets generation pipeline for constructing gait-language datasets

Figure

(c) Our ComposeGait

Figure 1: Overview of our contributions. (a) CoGR retrieves a target gait sequence that preserves identity while satisfying a relative instruction. (b) The automated VLM-based pipeline constructs gait-language training data. (c) Simplified illustration of our ComposeGait framework, which injects a sample-specific ID token into the Q-Former to anchor identity during semantic modification.

Song et al. 2025) has emerged as a promising paradigm that retrieves target images from reference images and relative text instructions. While successful in general image domains, directly adapting existing CIR frameworks to gait encounters a critical bottleneck: identity–semantic entanglement. Unlike static images, a gait sequence is a high-dimensional spatiotemporal representation in which biometric identity and appearance attributes are deeply intertwined. Mainstream CIR methods typically fuse text and visual features early in the network to predict a combined target embedding. In the gait context, such implicit composition offers no explicit safeguard for the biometric cues that must remain stable. As illustrated in Figure 1(a), this can lead to identity drift: the

∗^{*}Corresponding author.

model successfully modifies target attributes (e.g., retrieving a subject wearing a coat) but fatally fails to preserve the reference identity (e.g., retrieving the wrong subject). This failure mode is distinct from standard CIR, where biometric identity preservation is not a requirement, and motivates an identity-aware composition mechanism rather than generic feature fusion alone.

To overcome these challenges, we formally propose a novel and practical task, namely Composed Gait Retrieval (CoGR). Given a reference gait sequence and a natural-language modification instruction, CoGR retrieves gallery sequences that simultaneously preserve the reference identity and satisfy the specified attribute changes. A key obstacle to this task is the absence of gait-language training data: existing gait datasets provide only discrete alphanumeric condition labels rather than natural-language descriptions. To address this, we develop an automated annotation pipeline powered by large Vision-Language Models (VLMs). As depicted in Figure 2, the pipeline dynamically translates discrete experimental conditions into structurally consistent modification instructions, establishing the Language-Augmented CCPG and Language-Augmented CASIA-B datasets to benchmark this new paradigm.

With these datasets enabling CoGR training, we propose ComposeGait.As illustrated in Figure 3(a), ComposeGait is an identity-anchored composition framework built on BLIP-2. A frozen ViT-G encodes sampled gait frames, while a Part-aware Identity Adapter (PIA)(see Figure 3(b)) extracts a part-aware identity representation and projects it into the Q-Former hidden space as a sample-specific Identity token (ID token). Appended to the pretrained queries, this token conditions multimodal reasoning on gait identity.

ComposeGait injects ID tokens into both retrieval sides: the composed-query branch processes the reference sequence and modification text with the reference ID token, while the target branch processes each candidate with its ID token in a shared Q-Former. Only the original query-token outputs form the retrieval embeddings, allowing the ID tokens to guide attention without directly entering the embedding. Joint learning combines identity classification and hard-triplet losses for PIA with a task-adapted CoGR contrastive loss. The latter supports multiple relevance-consistent positives and excludes same-identity targets that violate the requested condition from the denominator, reducing false-negative and identity-conflicting gradients. The main contributions of our work are summarized as follows:

• We introduce Composed Gait Retrieval (CoGR), a novel interactive retrieval task. To support it, we develop an automated VLM-based pipeline to construct the first benchmarks for CoGR: Language-Augmented CCPG and Language-Augmented CASIA-B.

• We propose ComposeGait, an identity-anchored composition framework integrating a Part-aware Identity Adapter (PIA). This module projects part-aware gait features into sample-specific ID tokens and bidirectionally embeds them into a shared Q-Former. We also tailor the contrastive loss for CoGR matching, enabling multiple valid positives and filtering out same-identity targets with mismatched conditions in the loss denominator.

• Extensive experiments on the two language-augmented benchmarks evaluate retrieval effectiveness, identity preservation, and instruction satisfaction, establishing ComposeGait as a strong baseline for CoGR.

References (73)