Skip to main content
QUICK REVIEW

[Paper Review] Adapting CLIP For Phrase Localization Without Further Training

Jiahao Li, Greg Shakhnarovich|arXiv (Cornell University)|Apr 7, 2022
Multimodal Machine Learning ApplicationsComputer Science10 citations
TL;DR

This paper proposes a zero-shot phrase localization method that adapts CLIP for dense visual grounding without any fine-tuning or human-annotated bounding boxes. By extracting high-resolution spatial feature maps from both ViT and ResNet variants of CLIP, the method computes per-pixel similarity between text queries and image features to generate localization heatmaps, achieving state-of-the-art performance on Flickr30k and Visual Genome under zero-shot settings, outperforming prior no-training methods by up to 5% absolute gain.

ABSTRACT

Supervised or weakly supervised methods for phrase localization (textual grounding) either rely on human annotations or some other supervised models, e.g., object detectors. Obtaining these annotations is labor-intensive and may be difficult to scale in practice. We propose to leverage recent advances in contrastive language-vision models, CLIP, pre-trained on image and caption pairs collected from the internet. In its original form, CLIP only outputs an image-level embedding without any spatial resolution. We adapt CLIP to generate high-resolution spatial feature maps. Importantly, we can extract feature maps from both ViT and ResNet CLIP model while maintaining the semantic properties of an image embedding. This provides a natural framework for phrase localization. Our method for phrase localization requires no human annotations or additional training. Extensive experiments show that our method outperforms existing no-training methods in zero-shot phrase localization, and in some cases, it even outperforms supervised methods. Code is available at https://github.com/pals-ttic/adapting-CLIP .

Motivation & Objective

  • To address the high cost and scalability limitations of human-annotated phrase localization datasets.
  • To eliminate reliance on object detectors or other pre-trained models with category biases.
  • To enable zero-shot phrase localization using only a pre-trained CLIP model without any additional training.
  • To develop a generalizable method that works across open-vocabulary, rare, and unseen object categories.

Proposed method

  • Adapts CLIP to produce high-resolution spatial feature maps from both ViT and ResNet architectures by modifying the model's forward pass to preserve spatial information.
  • Uses the CLIP text encoder to embed the input phrase into the same semantic space as the image features.
  • Computes per-pixel cosine similarity between the text embedding and each spatial feature map to generate a score heatmap.
  • Applies a non-maximum suppression-like procedure to extract the highest-scoring bounding box from the heatmap.
  • Employs upsampling techniques to enhance spatial resolution of feature maps, improving localization accuracy.
  • Leverages the pre-trained CLIP model's zero-shot generalization capability without any fine-tuning on grounding-specific data.

Experimental results

Research questions

  • RQ1Can CLIP be adapted to perform dense visual grounding without any additional training or annotations?
  • RQ2How effective is CLIP's zero-shot capability for phrase localization when the model has never seen grounding annotations?
  • RQ3Does the choice of CLIP backbone (ViT vs. ResNet) and feature resolution impact localization performance?
  • RQ4How does the method perform on rare or unseen object categories compared to methods relying on pre-trained detectors?

Key findings

  • The method outperforms existing no-training methods by up to 5% absolute gain on three out of four zero-shot splits across Flickr30k and Visual Genome.
  • On the Flickr-All split, the method achieves 43.80% average IoU, significantly outperforming ZSGNet's 38.31% under the same zero-shot setting.
  • The ViT-L/14 model achieves 40.37% IoU on Flickr-S0 and 36.10% on Flickr-S1, demonstrating strong generalization to unseen phrases and categories.
  • Higher-resolution feature maps (2× upsampling) improve performance consistently across all models and datasets, with gains up to 2.5% on some splits.
  • The method generalizes better to long-tailed and rare object categories than methods relying on pre-trained object detectors, reducing category bias.
  • Ablation studies confirm that larger CLIP models and finer spatial resolution lead to better localization, with ViT-B/16 and ViT-L/14 outperforming ResNet-based variants.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.