Semi-Supervised Image Captioning with CLIP

Chuanyang JinarXiv 2023 · DOI

Abstract

This paper presents a novel two-stage training framework for image captioning that significantly reduces reliance on large-scale human-annotated datasets. By leveraging the Contrastive Language-Image Pre-training (CLIP) model to provide a self-supervised relevance signal, our method achieves performance comparable to state-of-the-art models using less than 2% of standard labeled data. Furthermore, the approach overcomes the "quality ceiling" of generic human references, producing captions that are more distinctive and descriptive.

Introduction

Traditional image captioning models face two primary challenges: the high cost of human annotation and the inherent limitations of human-written references. Datasets like MS COCO often contain generic descriptions that focus on prominent objects while ignoring fine-grained details. Models trained solely to maximize similarity to these references (using metrics like BLEU or CIDEr) tend to inherit this lack of distinctiveness. We propose a semi-supervised approach that uses a small supervised seed to establish syntax, followed by a self-supervised refinement stage that optimizes for image-text relevance using CLIP.

Methodology

Our architecture, based on ClipCap, integrates a CLIP visual encoder, a mapping network, and a LLaMA 2 language model decoder. The training process is divided into two distinct phases:

  1. Supervised Initialization: The model is trained on a minimal subset of 10,000 captioned images from MS COCO. This "nudge" is essential to ensure the model generates syntactically coherent language before the self-supervised phase.
  2. Self-Supervised Refinement: The model generates candidate captions and uses CLIP to measure their relevance to the source image. To enable backpropagation through the discrete text sampling process, we employ the Gumbel-Softmax reparameterization trick. This allows the model to learn directly from the CLIP relevance score, encouraging the generation of more informative and distinctive descriptions.
Figure 6: The RefCompare score significantly improves during the self-supervised refinement stage compared to the static supervised baseline.

Experimental Results

We evaluate our model using the RefCompare Score, which measures the frequency with which model-generated captions achieve higher CLIP relevance than human-written ground truth.

Performance Comparison

Despite the drastic reduction in labeled training data, our model achieves RefCompare scores exceeding 0.5, indicating that its captions are often more relevant to the specific image than the human references. As shown in Figure 5, while traditional models like Oscar and VLP achieve higher BLEU scores by mimicking human references more closely, our models (particularly those using Transformer-based mapping) achieve significantly higher RefCompare scores.

Figure 5: Comparison of various model architectures on RefCompare Score vs. BLEU@4. Our models prioritize image relevance over exact reference matching.

Human Evaluation

In head-to-head human evaluations against the Oscar model (trained on the full COCO dataset), our method was judged to be 58.6% more distinctive and 69.2% more informative. This confirms that optimizing for CLIP relevance leads to descriptions that better identify the unique traits of an image rather than relying on commonplace genericisms.

Conclusion

By shifting the training objective from reference-matching to image-relevance, we demonstrate that high-quality image captioning is possible with minimal labeled data. The use of a powerful, frozen LLM like LLaMA 2 provides a robust linguistic foundation, while CLIP-based refinement pushes the model beyond the limitations of human-annotated datasets. Future work will explore scaling this approach to larger unlabeled datasets to achieve broader domain adaptation.

Summary updated

BibTeX
@misc{jin2023semi,
  author = {Chuanyang Jin},
  title = {{Semi-Supervised Image Captioning with CLIP}},
  year = {2023},
  eprint = {2306.15111},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.15111},
}
Figure