Skip to main content
QUICK REVIEW

[Paper Review] Retrieval-Augmented Transformer for Image Captioning

Sara Sarto, Marcella Cornia|arXiv (Cornell University)|Jul 26, 2022
Multimodal Machine Learning ApplicationsComputer Science9 citations
TL;DR

This paper proposes a retrieval-augmented Transformer for image captioning that enhances generation quality by retrieving relevant textual descriptions from an external memory using k-NN search on visual features. By integrating a k-NN-augmented attention layer, the model improves caption diversity and accuracy, achieving state-of-the-art performance on COCO with a 1.2 CIDEr point gain over baseline Transformers when fine-tuned with reinforcement learning.

ABSTRACT

Image captioning models aim at connecting Vision and Language by providing natural language descriptions of input images. In the past few years, the task has been tackled by learning parametric models and proposing visual feature extraction advancements or by modeling better multi-modal connections. In this paper, we investigate the development of an image captioning approach with a kNN memory, with which knowledge can be retrieved from an external corpus to aid the generation process. Our architecture combines a knowledge retriever based on visual similarities, a differentiable encoder, and a kNN-augmented attention layer to predict tokens based on the past context and on text retrieved from the external memory. Experimental results, conducted on the COCO dataset, demonstrate that employing an explicit external memory can aid the generation process and increase caption quality. Our work opens up new avenues for improving image captioning models at larger scale.

Motivation & Objective

  • To address the challenge of generating high-quality, diverse image captions by reducing reliance on model memorization.
  • To explore the integration of external knowledge via retrieval mechanisms in vision-and-language generation.
  • To improve captioning performance without increasing model size or training cost significantly.
  • To evaluate whether retrieval from an external memory can enhance generation quality in a vision-and-language context.
  • To demonstrate the feasibility and effectiveness of k-NN-augmented attention in image captioning.

Proposed method

  • The model uses a vision encoder to extract image features and a differentiable Transformer decoder with a k-NN-augmented attention layer.
  • A knowledge retriever performs approximate k-NN searches in a visual embedding space to retrieve relevant textual captions from an external memory.
  • The k-NN-augmented attention layer attends simultaneously to past generated tokens and retrieved text, enabling context-aware generation.
  • The external memory is built from a large corpus of image-caption pairs, with visual features used to index and retrieve semantically relevant captions.
  • The model is trained end-to-end using cross-entropy loss and further fine-tuned with CIDEr optimization for improved generation quality.
  • Decoding involves running k-NN searches on CPU, increasing inference time by 26% compared to standard Transformers.

Experimental results

Research questions

  • RQ1Can external memory retrieval improve image captioning performance without increasing model size?
  • RQ2How effective is k-NN retrieval based on visual similarity in retrieving relevant textual descriptions for caption generation?
  • RQ3Does integrating retrieved text via a k-NN-augmented attention layer lead to higher-quality and more diverse captions?
  • RQ4How does the retrieval-augmented model compare to state-of-the-art Transformer-based captioners and the RETRO architecture?
  • RQ5Can the model maintain performance when retrieved captions are partially inaccurate or mismatched to the input image?

Key findings

  • The retrieval-augmented model achieves a 1.2 CIDEr point improvement over the standard Transformer baseline when fine-tuned with reinforcement learning.
  • The model outperforms other state-of-the-art models on all standard evaluation metrics (BLEU, ROUGE, CIDEr, METEOR) on the Karpathy test split of COCO.
  • The k-NN-augmented attention layer significantly improves caption quality, especially in generating more descriptive and diverse phrases.
  • Qualitative analysis confirms that retrieved captions often match visual content and guide the model toward more accurate descriptions, such as 'a group of elderly people' or 'a man jumping'.
  • The model maintains robustness even when some retrieved captions are irrelevant, relying on visual features to correct errors.
  • Training with retrieval increases training time by ~6 hours (from 24h to 30h), and inference time increases by 26% due to k-NN search overhead.

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.