IFCap: Image-like Retrieval and Frequency-based Entity Filtering for Zero-shot Captioning

Soeun Lee, Si-Woo Kim, Taewhan Kim, Dong-Jin Kim

Abstract

Zero-shot image captioning aims to generate descriptive text for images without relying on paired image-text training data. Traditional methods often struggle with the "modality gap" in shared embedding spaces and the inaccuracies of external object detectors. This paper presents IFCap, a framework that utilizes text-only training data. IFCap introduces Image-like Retrieval (ILR) to simulate image features during training via noise injection and a Frequency-based Entity Filtering (EF) mechanism to extract reliable object prompts from retrieved captions. Experimental results show that IFCap significantly outperforms existing state-of-the-art text-only models on MS-COCO, Flickr30k, and video captioning benchmarks.

Introduction

The creation of large-scale paired image-text datasets is a significant bottleneck in training image captioning models. Text-only training offers a promising alternative, but it is hindered by the modality gap—the inherent distributional difference between image and text embeddings in shared spaces like CLIP. Furthermore, many existing zero-shot methods depend on pre-trained object detectors, which can introduce errors and computational overhead. IFCap addresses these challenges by aligning the training and inference retrieval processes and leveraging statistical filtering for object identification.

Methods

IFCap introduces three main innovations to enable effective zero-shot captioning from text-only data:

1. Image-like Retrieval (ILR)

To bridge the modality gap, IFCap injects Gaussian noise into text features during the training phase. This "fuzzes" the text embeddings so they occupy a distribution similar to image embeddings. This ensures that the sentences retrieved during training (text-to-text) are representative of the sentences that will be retrieved during testing (image-to-text), making the model more robust to the "noisier" queries encountered at inference time.

2. Fusion Module (FM)

Instead of directly feeding retrieved text to a language model, IFCap uses a dedicated Fusion Module. It employs cross-attention to integrate input features with the top-k retrieved sentences, allowing the model to dynamically weigh which retrieved information is most relevant before passing it to a GPT-2 decoder.

3. Frequency-based Entity Filtering (EF)

Rather than using a fallible object detector, IFCap looks at the "wisdom of the crowd" within retrieved captions. It parses nouns from the top-retrieved sentences and calculates their frequency. If a noun appears across multiple retrieved captions above a certain threshold, it is considered a highly reliable "entity" and is used as a "hard prompt" to guide the final caption generation.

Conceptual overview of Image-like Retrieval (ILR) to bridge the modality gap and Frequency-based Entity Filtering (EF) compared to standard retrieval methods.

Key Results

IFCap outperformed previous state-of-the-art (SOTA) text-only models by a significant margin across several standard benchmarks:

  • MS-COCO: Achieved a 108.0 CIDEr score, a substantial jump from the previous best of 101.1.
  • Flickr30k: Reached a 64.4 CIDEr score, compared to the previous SOTA of 59.4.
  • Video Captioning: On the MSVD dataset, IFCap achieved a CIDEr of 83.9, dwarfing the previous best of 63.8.

A key factor in this success is the precision of the Frequency-based Entity Filtering. In the COCO test set, IFCap's entity extraction precision was 86.1%, whereas previous methods like ViECap and DETR-based systems hovered between 40% and 68%.

Comparison of entity extraction precision between IFCap's Frequency-based Entity Filtering and baseline methods (ViECap, DETR) across different datasets.

Conclusion and Future Work

IFCap demonstrates that strategic noise injection and statistical filtering can effectively overcome the limitations of text-only training for zero-shot captioning. By aligning training-time retrieval with inference-time conditions and replacing fallible detectors with frequency-based filtering, IFCap provides a robust and cost-effective solution for multi-modal tasks. Future work will involve finding a more automated way to determine optimal noise levels and extending the framework to more complex visual tasks like Visual Question Answering (VQA).

Summary updated

BibTeX
@inproceedings{lee2024ifcap,
  author = {Soeun Lee and Si-Woo Kim and Taewhan Kim and Dong-Jin Kim},
  title = {{IFCap: Image-like Retrieval and Frequency-based Entity Filtering for Zero-shot Captioning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1153},
}
Figure