Referring Expression Instance Retrieval and A Strong End-to-End Baseline

Xiangzhao Hao, Kuan Zhu, Hongyu Guo, Haiyun Guo, Ning Jiang, Quan Lu, Ming Tang, Jinqiao Wang

TL;DR

This paper introduces Referring Expression Instance Retrieval (REIR), a new vision-language task that requires a system to simultaneously retrieve a target image from a large gallery and precisely localize a specific object instance using a fine-grained natural language query. To tackle this challenge, the authors release a large-scale dataset called REIRCOCO and propose CLARE, an efficient, end-to-end dual-stream baseline model that achieves state-of-the-art performance by aligning language queries directly with object instances across images.

What Problem Does This Paper Address?

Imagine asking a photo app to find "the brown dog lying on a cushion near the fireplace with a red rug underneath" across thousands of your vacation photos. Current vision-language frameworks struggle with this request because they split the problem into two distinct paradigms:

  1. Text-Image Retrieval (TIR): Excellent at finding the right image out of a massive gallery based on global context, but completely lacks the ability to pinpoint or localize specific objects within that image.
  2. Referring Expression Comprehension (REC): Highly precise at localizing a specific object given a description, but it only works within a single pre-selected image. Scaling REC to a large gallery requires running expensive cross-modal fusion operations across every single image-query pair, making it computationally impossible for real-world use.

Cascading these two tasks (using TIR to find the top images, then REC to find the object) often leads to catastrophic failure if the retrieval step misses the exact instance or picks globally similar but incorrect images. To bridge this gap, the authors define the REIR task, demanding a unified, scalable approach to cross-image instance retrieval and localization.

Figure 1: Comparison of three vision-language tasks and their datasets. REIR enables end-to-end instance-level retrieval and localization, addressing the limitations of Text-Image retrieval and Referring Expression Comprehension.

Methods

The authors present CLARE (Contrastive Language-Instance Alignment with Relation Experts), an end-to-end baseline designed to keep computation scalable via a decoupled dual-stream architecture:

  • Visual Stream: Uses a pre-trained SigLIP vision encoder paired with a Deformable-DETR object extractor. It generates candidate object proposals and extracts instance-level visual features that capture both the object's appearance and its spatial context within the scene.
  • Textual Stream: Encodes the query text and refines it using a novel Mix of Relation Experts (MORE) module. Inspired by Mixture-of-Experts (MoE) architectures, MORE routes the text embedding through a combination of shared experts (for general semantics) and specialized routed experts to better capture complex spatial and inter-object relationships.
  • Contrastive Language-Instance Alignment (CLIA): Instead of heavy cross-modal fusion, CLARE aligns the text and visual streams using a sigmoid-based contrastive loss extended to the instance level. By computing dot-product similarities between text queries and all candidate object features across the entire batch/gallery, the model learns a unified embedding space optimized for both retrieval and localization.

Training happens in two stages: a grounding pretraining phase on standard object detection and REC datasets, followed by an end-to-end fine-tuning phase on the newly introduced REIRCOCO dataset.

Overview of the CLARE architecture.

Datasets

Because no existing dataset perfectly fits the REIR task, the authors constructed REIRCOCO, a benchmark built on top of MSCOCO and RefCOCO images.

To ensure the text queries are uniquely discriminative across a massive gallery (avoiding ambiguous descriptions like "the girl"), they leveraged a two-stage LLM pipeline:

  1. Generation: GPT-4o was prompted with bounding boxes, category labels, and global captions to generate 5–10 highly detailed, relation-rich referring expressions per object instance.
  2. Filtering: DeepSeek R1 was used to filter out vague, inaccurate, or non-discriminative descriptions.

The final REIRCOCO dataset contains 30,106 images, 215,835 object instances, and 613,548 verified fine-grained descriptions.

Key Insights and Ideas

  • Decoupled Alignment Scales: The paper proves that you don't need expensive, early-stage cross-modal fusion to achieve precise visual grounding. A dual-stream architecture can handle instance-level localization across a gallery if trained with the right cross-image contrastive objective.
  • MoE for Text Semantics: Using a Mix of Experts (MORE) specifically for text processing allows the model to dynamically adapt to different types of language cues (e.g., shifting focus between an object's color attributes vs. its spatial relation to a neighboring object).
  • Global Negatives Matter: Extending the SigLIP contrastive loss to evaluate object instances across different images in a batch forces the model to learn highly discriminative features, preventing it from getting confused by similar distractors in the gallery.

Key Results

The authors evaluated models using a unified metric called BoxRecall@k (IoU>$\tau$), which considers a prediction correct only if the true object instance is ranked in the top-$k$ results and its predicted bounding box sufficiently overlaps with the ground truth.

  • REIR Performance: CLARE significantly outperformed strong two-stage baselines (combining models like SigLIP/EVA-CLIP with DeepSeek-VL2/SimVG). For instance, CLARE-ViT-L achieved a 29.53% BoxRecall@1 ($\tau=0.5$), outperforming the best two-stage cascade baseline (18.52%) by a wide margin.
  • Generalization: Despite being optimized for gallery-wide retrieval, CLARE remains highly competitive on traditional single-image REC benchmarks (RefCOCO, RefCOCO+, RefCOCOg), performing on par with or better than several state-of-the-art one-stream and MLLM-based models.

Limitations and Future Work

While CLARE sets a strong baseline, the authors note that it still struggles with highly complex spatial reasoning and ambiguous linguistic constructs (e.g., "the boy sitting behind the girl wearing a red hat" in a crowded scene). When multiple visually similar instances exist, the model occasionally misinterprets subtle relational keywords, leading to incorrect localizations.

Future research directions include enhancing the model's reasoning capabilities over multi-object contexts and improving performance on rare object configurations.

Summary updated

BibTeX
@inproceedings{hao2025referring,
  author = {Xiangzhao Hao and Kuan Zhu and Hongyu Guo and Haiyun Guo and Ning Jiang and Quan Lu and Ming Tang and Jinqiao Wang},
  title = {{Referring Expression Instance Retrieval and A Strong End-to-End Baseline}},
  booktitle = {ACM Multimedia},
  year = {2025},
  doi = {10.1145/3746027.3755457},
}
Figure