Text-only Synthesis for Image Captioning

Junyu Gao, Qing Zhou, Junlin Huang, Qiang Li, Junyu Gao 0001, Qi WangarXiv 2024 · DOI

Abstract

Training effective image captioning models typically requires millions of high-quality image-text pairs, which are costly to annotate. We present ToCa (Text-only Synthesis for Image Captioning), a framework that utilizes Large Language Models (LLMs) to synthesize massive, diverse caption data from minimal text-only corpora. By deconstructing captions into linguistic structures and lexical relationships, ToCa achieves significant performance gains in zero-shot image captioning while requiring a fraction of the computational power used by traditional image-synthesis methods.

Introduction

The reliance on large-scale paired image-text datasets presents a significant bottleneck in developing image captioning models. While "text-only" training methods leverage the shared semantic space of CLIP to train models without images, they still rely on large volumes of manually curated text. Alternatively, "paired synthesis" using Diffusion models to generate images for LLM-generated captions is computationally expensive and slow.

ToCa addresses this by identifying a middle ground: Text-only Synthesis. The challenge lies in crafting synthetic text that is diverse enough to aid generalization without introducing excessive noise.

Methodology

The ToCa framework follows a three-step pipeline to generate high-quality training data:

Linguistic Deconstruction

Instead of treating captions as simple strings, ToCa deconstructs them into two primary components:

  1. Structure Templates ($G$): The grammatical "skeleton" of a sentence (e.g., [J] [N] [VBG] on [N]).
  2. Lexical Pairs ($R$): Statistical relationships between entities (e.g., the co-occurrence of "dog" and "grass").
POS mapping used for linguistic deconstruction in the ToCa framework.

Recombination and LLM Synthesis

ToCa samples a structure template and populates it with likely lexical pairs based on the source corpus. It then creates a "masked" prompt (e.g., [ ] dog [ ] sitting [ ] grass [ ]) for an LLM. We utilize an open-source, 8-bit quantized Mistral-7B model to "fill in the blanks," leveraging its internal world knowledge to generate natural, varied sentences. By training a captioning model (like ViECap) on this synthetic text within the CLIP embedding space, the model learns to describe visual concepts it may never have seen in a paired dataset.

Experimental Setup

ToCa was evaluated across several standard benchmarks, including COCO, Flickr30k, FlickrStyle10k (for stylized captions), and MSR-VTT (for video captioning). Evaluation sets included COCO (in-domain), NoCaps (out-of-domain/zero-shot), and Flickr30k (cross-domain). We also tested extreme data-efficiency scenarios, synthesizing data from as few as 56 seed captions.

Results and Discussion

ToCa demonstrates superior performance in zero-shot and cross-domain tasks compared to existing text-only and paired-synthesis methods.

Performance comparison of ToCa against state-of-the-art methods on standard image captioning benchmarks.

Key Insights

  • Generalization through Diversity: The LLM acts as a knowledge bridge, generating novel captions that make physical sense, which significantly boosts zero-shot generalization.
  • Efficiency: Generating text with a 7B LLM is orders of magnitude faster than generating high-fidelity images via Diffusion models.
  • Performance Gains: ToCa improved CIDEr scores by nearly 5 points for zero-shot cross-domain captioning on the NoCaps dataset. In extreme low-data regimes (56 seed captions), CIDEr scores jumped from a baseline of 0.3 to 21.3.

Conclusion

ToCa provides a robust and efficient framework for image captioning without the need for expensive paired datasets. By focusing on linguistic composition and leveraging LLM-based synthesis, it outperforms more computationally intensive paired-synthesis methods. Future work will extend ToCa to more complex tasks such as dense and paragraph captioning.

Summary updated

BibTeX
@misc{gao2024text,
  author = {Junyu Gao and Qing Zhou and Junlin Huang and Qiang Li and Junyu Gao and Qi Wang},
  title = {{Text-only Synthesis for Image Captioning}},
  year = {2024},
  eprint = {2405.18258},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.18258},
}
Figure