The Unreasonable Effectiveness of CLIP Features for Image Captioning: An Experimental Analysis

Manuele Barraco, Marcella Cornia, Silvia Cascianelli, Lorenzo Baraldi, Rita Cucchiara

Abstract

This study investigates the impact of utilizing CLIP (Contrastive Language-Image Pre-training) visual features within standard image captioning architectures. By replacing traditional region-based features from object detectors with grid-based features from CLIP, we demonstrate significant performance improvements across multiple benchmarks. Our findings reveal that CLIP features act as a "cheat code," particularly enhancing out-of-domain and zero-shot captioning capabilities. We also identify a strong correlation between a model's zero-shot classification accuracy and its effectiveness as a captioning encoder.

Introduction

For years, the "gold standard" for image captioning relied on pre-trained object detectors, such as Faster R-CNN trained on Visual Genome, to extract region-based features. However, this approach is limited by the detector's fixed vocabulary. With the emergence of large-scale multi-modal models like CLIP, trained on 400 million image-text pairs, there is a clear opportunity to leverage broader visual representations. This paper provides a systematic experimental analysis to quantify the advantages of CLIP features, exploring their robustness in describing novel objects and their performance relative to traditional baselines.

Methodology

The authors employ an intentionally "simple" architecture to isolate the contribution of the visual backbone: a standard Transformer-based encoder-decoder with three layers each.

Transformer-based architecture with a CLIP-like visual encoder.

The primary experimental variable is the visual backbone. The study compares traditional detection-based features (Faster R-CNN), self-supervised/classification features (DINO, standard ViT), and various CLIP variants (ResNet and ViT-based). Training follows a two-stage process: initial cross-entropy loss optimization followed by Self-Critical Sequence Training (SCST) to directly optimize the CIDEr metric.

Experimental Setup

Evaluation is conducted across a diverse set of benchmarks:

  • COCO (Karpathy split): For in-domain performance.
  • nocaps: For out-of-domain transfer on nearly 400 unseen object classes.
  • CC3M: For zero-shot transfer evaluation.
  • VizWiz and TextCaps: For specialized challenges like low-quality imagery and OCR-dependent captioning.

Key Insights and Results

The transition to CLIP features resulted in a 13.1% relative improvement in CIDEr scores on COCO compared to traditional detection features. A pivotal discovery is the strong correlation between a backbone's zero-shot classification accuracy and its captioning performance.

Correlation between classification accuracy and captioning performance.

Key findings include:

  • Grid Features Over Regions: Modern grid-based features from ViTs or ResNets are now outperforming the region-based features that dominated the field for years.
  • Out-of-Domain Robustness: CLIP's extensive pre-training allows it to recognize objects absent from the captioning training set. On the nocaps dataset, the CLIP-based model achieved a CIDEr of 89.0, vastly outperforming the 60.5 achieved by Faster R-CNN.
  • Competitive Simplicity: Despite the simple architecture, the CLIP-Captioner matches or exceeds the performance of much larger, specialized models like OSCAR and VinVL.

Conclusion

CLIP features represent a significant leap forward for image captioning, offering a simple yet powerful alternative to complex object detection pipelines. While this study focused on frozen encoders, future work exploring fine-tuning and more sophisticated multi-modal architectures could further bridge the gap with massive proprietary models. The results underscore that for image captioning, the quality of visual representation is as critical as the decoding architecture itself.

Summary updated

BibTeX
@inproceedings{barraco2022unreasonable,
  author = {Manuele Barraco and Marcella Cornia and Silvia Cascianelli and Lorenzo Baraldi and Rita Cucchiara},
  title = {{The Unreasonable Effectiveness of CLIP Features for Image Captioning: An Experimental Analysis}},
  booktitle = {Workshops @ CVPR},
  year = {2022},
  doi = {10.1109/cvprw56347.2022.00512},
}
Figure