Abstract
Recent advancements in image captioning have explored text-only training methods to overcome the limitations of paired image-text data. However, existing text-only training methods often overlook the modality gap between using text data during training and employing images during inference. To address this issue, we propose a novel approach called Image-like Retrieval, which aligns text features with visually relevant features to mitigate the modality gap. Our method further enhances the accuracy of generated captions by designing a Fusion Module that integrates retrieved captions with input features. Additionally, we introduce a Frequency-based Entity Filtering technique that significantly improves caption quality. We integrate these methods into a unified framework, which we refer to as IFCap (Image-like Retrieval and Frequency-based Entity Filtering for Zero-shot Captioning). Through extensive experimentation, our straightforward yet powerful approach has demonstrated its efficacy, outperforming the state-of-the-art methods by a significant margin in both image captioning and video captioning compared to zero-shot captioning based on text-only training.
Addressing the Modality Gap and Noisy Retrieval
Training an AI to describe images usually requires millions of human-annotated image-caption pairs, which are incredibly costly to produce. "Text-only" training is a promising alternative where models learn to describe concepts using only large text corpora. However, this approach faces two major hurdles:
- The Modality Gap: Training happens on text embeddings, but the model must process image embeddings during actual use. These two modalities live in different parts of the embedding space, leading to a performance drop when the model encounters a real image for the first time.
- Noisy Retrieval: Many systems try to help the model by "retrieving" similar captions from a database. However, if the retrieval is slightly off, the model might hallucinate objects that aren't there (e.g., seeing a "backpack" when there is only a "man").
Methodology
IFCap introduces three core components designed to bridge these gaps and improve zero-shot performance:
Image-like Retrieval (ILR)
To solve the modality gap, IFCap injects Gaussian noise into text features during the training phase. This "blurs" the text embeddings, pushing them closer to the distribution of image embeddings. This ensures that the sentences retrieved during training are similar to the ones that will be retrieved by an image at test time, effectively simulating the cross-modal retrieval process.
Frequency-based Entity Filtering (EF)
During inference, the model retrieves several candidate captions for an image. IFCap counts how often specific nouns appear across these candidates. If a noun (like "motorcycle") appears frequently, it’s considered a high-confidence "entity." These entities are then fed into the language model as a "hard prompt" (e.g., "There are motorcycle, man in image"), providing explicit, reliable guidance for the final caption generation.
Fusion Module (FM)
Instead of just looking at one retrieved caption, IFCap uses a cross-attention mechanism to merge the features of the input (text or image) with the features of multiple retrieved sentences. This allows the model to weigh which pieces of retrieved information are most relevant to the visual context.
Key Results
IFCap set new records for text-only trained models across several standard benchmarks:
- MS-COCO: Achieved a CIDEr score of 108.0, a significant jump over the previous state-of-the-art (SynTIC at 101.1).
- NoCaps: On the "Entire" set, it reached a CIDEr of 70.5, outperforming the previous best (ViECap at 66.2).
- Video Captioning: The model showed remarkable transferability. On the MSVD video dataset, it achieved a CIDEr of 83.9, significantly exceeding the previous best of 63.8.
Conclusion
IFCap demonstrates that simple yet effective strategies like noise injection for modality alignment and frequency-based consensus for entity identification can significantly boost zero-shot captioning performance. By leveraging off-the-shelf components like CLIP and GPT-2 within this novel framework, the model achieves state-of-the-art results without the need for expensive paired image-text data.
Summary updated