Abstract
Traditional visual pretraining often focuses on holistic image-level understanding, potentially overlooking fine-grained spatial details. We present LocCa (Location-aware Captioner), a novel pretraining approach introduced at NeurIPS 2024. By integrating location-aware tasks—such as bounding box prediction and region-specific captioning—directly into a generative image captioner, LocCa develops vision encoders with superior localization capabilities. Our multitask strategy achieves state-of-the-art results on benchmarks like RefCOCO while maintaining high performance on standard classification and VQA tasks, demonstrating that spatial awareness can be learned effectively through a simple language interface.
Introduction
Modern computer vision relies heavily on large-scale pretraining. Two dominant paradigms have emerged: contrastive learning (e.g., CLIP), which aligns images and text in a shared embedding space, and generative captioning, which learns to predict descriptive text from visual inputs. While these methods excel at capturing global image semantics, they often struggle with precise spatial reasoning. Existing solutions for spatial awareness typically involve complex architectures or expensive human-annotated datasets. LocCa addresses this by asking whether a model can learn spatial relationships using only a simple captioning interface and scalable, machine-generated pseudo-labels.
Methodology: The Location-aware Captioner
LocCa utilizes a standard encoder-decoder architecture, comprising a Vision Transformer (ViT) encoder and a Transformer decoder. The core innovation is its multitask pretraining strategy, which uses natural language as a unified interface for both semantic and spatial tasks.
The model is trained on three concurrent tasks, distinguished by specific text prefixes:
- Captioning (Cap): The model generates a description for the entire image.
- Automatic Referring Expression (ARef): Given a caption for a specific region, the model predicts the corresponding bounding box coordinates.
- Grounded Captioning (GCap): The model predicts both the bounding box and the caption for a specific region.
A key design choice is treating bounding box coordinates as plain text strings (e.g., [20, 480, 150, 200]). This approach avoids specialized "location vocabularies" or custom detection heads, allowing the model to treat localization as a standard language modeling task.
Data and Scalability
To achieve scale without the bottleneck of human annotation, LocCa leverages "pseudo-labels." The authors utilized a subset of the WebLI dataset, containing 1 billion image/alt-text pairs. They employed a pretrained open-vocabulary detector (OWL-ViT) to automatically generate bounding boxes for objects mentioned in the alt-text. This noisy but abundant data proves sufficient for teaching the model the fundamental link between text descriptions and pixel regions.
Experimental Results
LocCa was evaluated across a wide range of benchmarks, focusing on both localization and holistic understanding.
State-of-the-Art Localization
LocCa sets new performance bars on referring expression benchmarks. On RefCOCO, RefCOCO+, and RefCOCOg, LocCa consistently outperforms previous state-of-the-art models, including those with significantly more parameters or specialized detection architectures.
Maintaining Holistic Performance
A common challenge in specialized pretraining is the "task tax"—where improving one capability degrades others. LocCa successfully avoids this. It maintains a high accuracy of 84.5% on ImageNet-1k and outperforms standard captioners on VQA and OCR tasks. This suggests that learning spatial details actually enriches the visual representations for general-purpose use.
Zero-shot Capabilities
Beyond fine-tuned performance, LocCa exhibits impressive zero-shot capabilities. By simply adjusting the text prompt, the model can perform basic object detection and region-specific captioning on unseen datasets, demonstrating a flexible understanding of the visual-spatial-linguistic mapping.
Conclusion and Future Work
LocCa demonstrates that location-aware pretraining can be achieved through a simple, scalable generative framework. By treating coordinates as text and leveraging machine-generated labels, it bridges the gap between holistic understanding and fine-grained localization. While currently focused on bounding boxes, future iterations could incorporate pixel-level segmentation masks to provide even more precise spatial grounding. LocCa represents a significant step toward universal visual backbones that truly understand both the "what" and the "where" of the visual world.
Summary updated