Abstract
Contrastive language-image pretraining (CLIP) using image-text pairs has achieved impressive results on image classification in both zero-shot and transfer learning settings. However, we show that directly applying such models to recognize image regions for object detection leads to unsatisfactory performance due to a major domain shift: CLIP was trained to match an image as a whole to a text description, without capturing the fine-grained alignment between image regions and text spans. To mitigate this issue, we propose a new method called RegionCLIP that significantly extends CLIP to learn region-level visual representations, thus enabling fine-grained alignment between image regions and textual concepts. Our method leverages a CLIP model to match image regions with template captions, and then pretrains our model to align these region-text pairs in the feature space. When transferring our pretrained model to the open-vocabulary object detection task, our method outperforms the state of the art by 3.8 AP50 and 2.2 AP for novel categories on COCO and LVIS datasets, respectively. Further, the learned region representations support zero-shot inference for object detection, showing promising results on both COCO and LVIS datasets.
Introduction: The Localization Gap
Recent advancements in vision-language models, most notably CLIP, have transformed image classification by leveraging web-scale image-caption pairs. However, these models exhibit a significant "localization gap" when applied to object detection tasks. Because CLIP is trained to associate a global image with a global text description, it lacks the granularity required to identify specific objects within an image.
As illustrated in Figure 1, while CLIP achieves high accuracy (59.6%) on standard ImageNet classification, its performance drops precipitously to 19.1% when tasked with classifying cropped regions from the LVIS dataset. This domain shift—from global image-level matching to local region-level recognition—hinders the direct application of CLIP to object detection.
Methodology: Region-Level Pretraining
To bridge this gap, RegionCLIP introduces a framework that bootstraps the knowledge of a pretrained CLIP model to teach a new visual encoder how to recognize specific regions. The methodology consists of three primary stages:
- Concept Pool Generation: A large set of object names (concepts) is extracted from text corpora and formatted into descriptive prompts (e.g., "A photo of a [concept]").
- CLIP-Guided Region-Text Alignment: Using unannotated images, a Region Proposal Network (RPN) identifies candidate object boxes. A "Teacher" CLIP model then matches these regions against the concept pool, generating pseudo-labels that pair specific image patches with textual concepts.
- Region-based Pretraining: A "Student" visual encoder is trained to align its region features with the corresponding text embeddings. This training utilizes both a contrastive loss and a distillation loss, the latter of which encourages the student to mimic the teacher's full probability distribution across the concept pool, capturing semantic nuances.
Experimental Results
RegionCLIP demonstrates superior performance across several challenging benchmarks, particularly in "open-vocabulary" settings where the model must detect objects not seen during supervised training.
- Open-Vocabulary Detection: On the COCO dataset, RegionCLIP improved upon the previous state-of-the-art (OVR-CNN) by 3.8 AP50 for novel categories. On the LVIS dataset, it outperformed the ViLD model by 2.2 AP for rare object classes.
- Zero-Shot Detection: The model exhibits remarkable zero-shot capabilities. Without any detection-specific fine-tuning, it achieved 34.6 AP50 on COCO novel categories, significantly outperforming standard CLIP-based baselines.
- Transfer Learning: When used as a backbone for fully supervised detectors, RegionCLIP-initialized models converge faster and reach higher accuracy levels compared to those initialized with ImageNet or standard CLIP weights.
Conclusion
RegionCLIP effectively extends the power of contrastive language-image pretraining to the region level. By explicitly aligning local visual features with textual concepts through pseudo-labeling and distillation, the framework overcomes the localization gap inherent in global models. This approach not only improves performance in standard detection tasks but also paves the way for scalable, open-vocabulary scene understanding. Future work may involve expanding the concept pool to include attributes and complex relationships, further enhancing the model's ability to interpret intricate visual scenes.
Summary updated