Skip to main content
QUICK REVIEW

[Paper Review] SmallCap: Lightweight Image Captioning Prompted with Retrieval Augmentation

Rita Ramos, Bruno Martins|arXiv (Cornell University)|Sep 30, 2022
Multimodal Machine Learning ApplicationsComputer Science4 citations
TL;DR

SmallCap proposes a lightweight image captioning model that generates captions by retrieving relevant captions from an external datastore, using only 7 million trainable parameters. It achieves competitive performance on COCO and state-of-the-art zero-shot generalization on nocaps by leveraging retrieval-augmented prompting without retraining or fine-tuning.

ABSTRACT

Recent advances in image captioning have focused on scaling the data and model size, substantially increasing the cost of pre-training and finetuning. As an alternative to large models, we present SmallCap, which generates a caption conditioned on an input image and related captions retrieved from a datastore. Our model is lightweight and fast to train, as the only learned parameters are in newly introduced cross-attention layers between a pre-trained CLIP encoder and GPT-2 decoder. SmallCap can transfer to new domains without additional finetuning and can exploit large-scale data in a training-free fashion since the contents of the datastore can be readily replaced. Our experiments show that SmallCap, trained only on COCO, has competitive performance on this benchmark, and also transfers to other domains without retraining, solely through retrieval from target-domain data. Further improvement is achieved through the training-free exploitation of diverse human-labeled and web data, which proves to be effective for a range of domains, including the nocaps benchmark, designed to test generalization to unseen visual concepts.

Motivation & Objective

  • To address the high computational cost of training large-scale image captioning models.
  • To enable domain transfer in image captioning without fine-tuning.
  • To exploit large-scale, diverse text data in a training-free manner for improved generalization.
  • To reduce model parameters while maintaining competitive performance on image captioning benchmarks.
  • To explore retrieval augmentation as an alternative to costly pre-training and fine-tuning in multimodal tasks.

Proposed method

  • SmallCap uses a frozen CLIP vision encoder and a frozen GPT-2 language decoder, with only cross-attention layers between them being trainable.
  • The model generates captions conditioned on both the input image and a set of k retrieved captions from an external datastore.
  • Retrieval is performed via image-to-text retrieval using CLIP embeddings to find semantically relevant captions.
  • The retrieved captions serve as a prompt to guide the decoder, enabling the model to adapt to new visual concepts without parameter updates.
  • The model supports training-free adaptation by replacing the datastore with domain-specific or diverse web/human-labeled caption collections.
  • Performance is evaluated using standard metrics like CIDEr, BLEU, and METEOR on COCO, nocaps, VizWiz, and Flickr30k.
Figure 1 : SmallCap ’s performance on the COCO dataset and on the out-of-domain split of the nocaps dataset, compared to other approaches in terms of number of trainable parameters. We can control the number of trainable parameters through the dimensionality of the cross-attention ( $d=d_{v}=d_{k}$
Figure 1 : SmallCap ’s performance on the COCO dataset and on the out-of-domain split of the nocaps dataset, compared to other approaches in terms of number of trainable parameters. We can control the number of trainable parameters through the dimensionality of the cross-attention ( $d=d_{v}=d_{k}$

Experimental results

Research questions

  • RQ1Can a lightweight image captioning model achieve competitive performance with significantly fewer trainable parameters?
  • RQ2Can retrieval-augmented prompting enable effective zero-shot domain transfer without fine-tuning?
  • RQ3Does access to diverse, non-image-captioning data (e.g., audio, video captions) improve generalization to unseen visual concepts?
  • RQ4How does retrieval augmentation affect model performance across different model sizes and data sources?
  • RQ5Can a model trained only on COCO generalize effectively to out-of-domain benchmarks like nocaps and VizWiz?

Key findings

  • SmallCap achieves a CIDEr score of 122.7 on the COCO test set with only 7 million trainable parameters, outperforming larger models on out-of-domain benchmarks.
  • On the nocaps benchmark, SmallCap outperforms much larger models, demonstrating strong zero-shot generalization to unseen visual concepts.
  • Performance remains stable across model sizes (1.8M to 28M parameters) when retrieval is used, indicating a near-optimal parameter-to-performance trade-off.
  • Removing retrieval leads to a 4.3-point CIDEr drop in performance difference between small and large models, showing retrieval's critical role in stability and performance.
  • SmallCap benefits from diverse data sources, including human-labeled and web-crawled captions, improving performance on VizWiz and other out-of-domain datasets.
  • Ablation with blank images (no visual input) yields a CIDEr score of 90.1, confirming that the model actively uses visual features rather than just paraphrasing retrieved captions.
Figure 2 : The SmallCap approach to image captioning. (a) SmallCap generates a caption conditioned on the encoded input image, as well as on a set of $k$ retrieved captions which are used as a task demonstration, input to the decoder as a prompt. (b) The $k$ captions are retrieved from a datastore o
Figure 2 : The SmallCap approach to image captioning. (a) SmallCap generates a caption conditioned on the encoded input image, as well as on a set of $k$ retrieved captions which are used as a task demonstration, input to the decoder as a prompt. (b) The $k$ captions are retrieved from a datastore o

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.