ClipCap: CLIP Prefix for Image Captioning

Ron Mokady, Amir Hertz, Amit H. Bermano
11/18/2021
cs.CV

Official code: rmokady/CLIP_prefix_caption (1,423 stars, MIT, last commit 2024-06-09).

Abstract

Image captioning is a fundamental task in vision-language understanding, where the model predicts a textual informative caption to a given input image. In this paper, we present a simple approach to address this task. We use CLIP encoding as a prefix to the caption, by employing a simple mapping network, and then fine-tunes a language model to generate the image captions. The recently proposed CLIP model contains rich semantic features which were trained with textual context, making it best for vision-language perception. Our key idea is that together with a pre-trained language model (GPT2), we obtain a wide understanding of both visual and textual data. Hence, our approach only requires rather quick training to produce a competent captioning model. Without additional annotations or pre-training, it efficiently generates meaningful captions for large-scale and diverse datasets. Surprisingly, our method works well even when only the mapping network is trained, while both CLIP and the language model remain frozen, allowing a lighter architecture with less trainable parameters. Through quantitative evaluation, we demonstrate our model achieves comparable results to state-of-the-art methods on the challenging Conceptual Captions and nocaps datasets, while it is simpler, faster, and lighter. Our code is available in https://github.com/rmokady/CLIP_prefix_caption.

View on arXivView PDF

Code Implementations(1)

MIT

Simple image captioning model

1,423225Python, Jupyter NotebookSep 16, 20212 years agoMIT

Similar Papers

Cite this paper

@article{mokady2021clipcap,
  title  = {ClipCap: CLIP Prefix for Image Captioning},
  author = {Ron Mokady and Amir Hertz and Amit H. Bermano},
  year   = {2021},
  eprint = {2111.09734},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.09734}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2111.09734.svg)](https://codeofpaper.com/paper/2111.09734)

Discussion