Manuscript Offprint

arXiv:2608.29917

FoundYou: A Unified Model for Personalized Segmentation and Retrieval

Gabriele Trivigno, Marcos Alfaro, Claudia Cuttano, Gabriele Berton, Luis Payá, Carlo Masone

Gabriele Trivigno ∗^{*} ID^{ID} Marcos Alfaro ∗1,2^{*1,2} ID^{ID} Claudia Cuttano ∗1^{*1} ID^{ID}

Gabriele Berton ID^{ID} Luis Payá 2,3^{2,3} ID^{ID} Carlo Masone 1^{1} ID^{ID}

1^{1} Politecnico di Torino 2^{2} Miguel Hernández University of Elche

3^{3} Valencian Graduate School and Research Network of Artificial Intelligence

https://gal1i13o.github.io/FoundYou/

Abstract. Personalized segmentation and personalized retrieval both aim to identify the same physical object across different images. While the former localizes the object within a target image, the latter retrieves images where it appears. Despite this shared instance-level objective, the two tasks have largely evolved separately and are addressed with distinct solutions. In this work, we introduce FoundYou, a unified framework built on the observation that Segment Anything 2 (SAM 2), trained to preserve object identity across video frames, inherently captures instance-level cues. We leverage this property to match objects across independent images, enabling segmentation and retrieval to emerge as two outcomes of the same instance alignment process. This unified view unlocks new capabilities beyond traditional benchmarks, including few-shot personalized retrieval and promptable personalized segmentation with flexible prompts. Extensive experiments show consistent gains over unified and task-specific methods, including +18.4 mIoU on PerMIS and +17.8 mAP on ILIAS. Performance scales with additional references and remains robust to weaker prompts. Beyond personalization, FoundYou achieves state-of-the-art results on category-level retrieval benchmarks. Notably, our approach keeps the SAM 2-small model entirely frozen and adds only 5.9 M trainable parameters, yielding a 52 M-parameter model that is over 75× faster and 20× smaller than the only prior unified solution.

1 Introduction

Suppose you provide a model with an example of your handbag and ask it to segment the same handbag in completely different photos, in unrelated scenes that may contain other similar items (cf. Fig. 1-a). Personalized segmentation [74] formalizes this setting: given a visual reference identifying an object, the goal is to segment the same physical object in new images. Unlike few-shot segmentation [12, 33, 75], the objective is not to recognize a category (e.g., any handbag), but to preserve identity, i.e. distinguish a particular instance from

∗^{*} Equal contribution.

G. Trivigno et al.

Figure

Figure

Fig. 1: FoundYou: a Unified Model for Personalized Segmentation & Retrieval. Given a visual prompt of a user's handbag, FoundYou segments the same physical instance in a new image (a) and retrieves it from a gallery by ranking images via instance-level similarity (b). We compare performance vs. speed against the only prior unified solution, PDM [49], and the strongest task-specific methods: retrieval performance is shown in (c) as mAP vs. FPS, and segmentation in (d) as mIoU vs. FPS. FoundYou improves over PDM by +17.8 mAP and +18.4 mIoU while being over 75× faster (note: x-axis in log scale). It outperforms also task-specific methods, while being the fastest in segmentation and matching the speed of the fastest retrieval competitor.

visually similar ones. Now consider a related objective: instead of segmenting your handbag in a given image, you want to retrieve all the photos in a personal collection where it appears (cf. Fig. 1-b). Personalized retrieval [49] captures this setting: given the same reference, the task becomes ranking images according to whether they depict that exact instance. Albeit producing different outputs, both tasks fundamentally require instance-level matching, from which a segmentation mask or image-level score is derived. This capability is central to applications, from robotics and embodied perception [5,28,48] to cultural heritage digitization [52,71], personal media organization [1,27], and creative workflows [11,37].

Despite this shared objective, personalized segmentation and retrieval have evolved largely independently. Segmentation-focused approaches, such as PerSAM [74], solve the task via correspondence followed by mask prediction with SAM [26], often relying on external models such as DINOv2 [32,38] or diffusion encoders [45,57]. Conversely, retrieval-specific methods learn instance-aware representations [9,53,56], but do not provide dense localization. PDM [49] represents the closest attempt to bridge the two tasks. However, its reliance on Stable Diffusion leads to prohibitively slow inference (cf. Fig. 1-c,d). Additionally, PDM relies on features extracted at different denoising timesteps for segmentation and retrieval, and still relies on prompting SAM for mask generation.

In this work, we take a different perspective by observing that Segment Anything 2 (SAM 2) [43], trained to track objects across video frames, implicitly learns fine grained instance-aware representations. Building on this, we propose

FoundYou, a unified framework for personalized segmentation and retrieval that repurposes SAM 2 memory attention mechanism: instead of propagating identity across temporally adjacent frames, we use it to match a specific instance across independent images. This shift, however, entails two fundamental challenges. First, because SAM 2 is trained on natural videos, its representations inherit a temporal continuity bias: inter-frame variations are small and scene context remains stable [12,55]. In personalized segmentation and retrieval, however, matching occurs across unrelated images without positional or contextual continuity. To address this, we introduce lightweight feature adaptation layers trained for identity discrimination across distinct images, together with a self-distillation objective that preserves spatial structure of SAM 2 representations, ensuring high-quality segmentation masks. Second, SAM 2 lacks a mechanism to assign an image-level similarity score. We therefore introduce a lightweight retrieval head that aggregates dense correspondences from memory attention into a global score, while reusing the original mask decoder for segmentation. Segmentation and retrieval thus emerge from the same instance alignment process.

Since instance matching is realized through memory attention over a set of reference features, FoundYou naturally supports multiple references at inference time. We therefore introduce the task of few-shot personalized retrieval, reflecting practical cases where users provide several examples of the same object, for example, taking multiple photos of a handbag to search for it more reliably. Additionally, FoundYou supports promptable personalized segmentation with lightweight annotations (e.g., points or boxes), removing the need for full masks. Experiments show that FoundYou consistently outperforms both i) the only prior unified solution and ii) task-specific methods (cf. Fig. 1-c,d). Compared to PDM [49], we improve by +18.4 mIoU on PerMIS (segmentation) and +17.8 mAP on ILIAS (retrieval), while also surpassing specialized approaches such as PerSAM-F [74] (+14.8 mIoU) and AMES [53] (+6.1 mAP). Performance scales with additional references and remains robust to weaker annotations such as point prompts. Beyond personalization, FoundYou sets a new state-of-the-art on category-level retrieval across 6 domains. Notably, we keep SAM 2 frozen and introduce only 5.9 M trainable parameters, resulting in a compact 52 M-parameter model 75× faster and 20× smaller than prior unified methods [49].

References (4)