CLIP4Caption: CLIP for Video Caption

Mingkang Tang, Zhanyu Wang, Zhenhua Liu, Fengyun Rao, Dian Li, Xiu Li

Abstract

Video captioning requires bridging the gap between visual and textual modalities to generate accurate natural language descriptions. CLIP4Caption addresses this challenge by utilizing CLIP-enhanced features within a two-stage framework: Video-Text Matching (VTM) pre-training followed by fine-tuning for caption generation. By incorporating a novel metric-based ensemble strategy and a simplified Transformer architecture, the model achieves state-of-the-art performance on the MSR-VTT benchmark, notably boosting the CIDEr score by approximately 10% over previous methods.

Introduction

Generating natural language descriptions for video content is a complex task due to the inherent "modality gap." Traditional video captioning models often rely on CNNs to extract visual features in isolation, which frequently fails to capture the semantic correlations between visual elements and language. This leads to representations that are not optimized for translation into text. Furthermore, many existing models utilize older architectures like LSTMs or GRUs, which struggle with the long-range dependencies that modern Transformers handle with ease.

Another significant hurdle is the limited size of popular datasets like MSR-VTT. Complex models often overfit these small datasets, making it difficult to effectively transfer knowledge from massive pre-trained vision-language models. CLIP4Caption aims to solve these issues by leveraging the pre-aligned representations of CLIP and a streamlined architecture designed for better generalization.

Methodology

The CLIP4Caption framework consists of two primary stages designed to align modalities and then generate text.

1. Video-Text Matching (VTM) Pre-training

In the first stage, the model learns to align video and text in a shared embedding space. It employs a CLIP-based Video Encoder (specifically ViT-B/32) and a Transformer-based Text Encoder. To enhance the diversity of visual data and capture temporal dynamics, the authors implement Temporal Segment Network (TSN) sampling. This method divides a video into $K$ segments and randomly samples one frame from each segment, rather than relying on fixed-position frames. The objective is to maximize the cosine similarity between paired video and text embeddings, creating "strongly text-correlated" visual features.

The two-stage CLIP4Caption framework: Video-Text Matching (VTM) pre-training followed by fine-tuning for caption generation.

2. Fine-tuning for Video Captioning

The aligned features from the VTM stage are fed into a Transformer-based encoder-decoder. To mitigate overfitting on smaller datasets, the authors simplified the architecture to a 1-layer encoder and a 3-layer decoder. This architecture is initialized with weights from Uni-VL, a large-scale pre-trained video-language model, providing a robust starting point for the captioning task.

3. Metric-Based Ensemble Strategy

Rather than using standard model averaging, the authors developed a sophisticated "voting" mechanism. Captions are generated from multiple models—varying in layer counts and training data splits. An "importance score" is calculated for each candidate sentence by treating the other generated sentences as "ground truth" and calculating standard metrics like CIDEr or SPICE. The sentence with the highest average score across these metrics is selected as the final output, operating on the intuition that self-consensus serves as a strong quality signal.

Experimental Setup and Datasets

The model was primarily evaluated on the MSR-VTT benchmark, which contains 10,000 video clips, each paired with 20 natural language descriptions. Additionally, the framework was tested on the ACM MM Grand Challenge 2021 private test data for the "Pre-training for Video Understanding Challenge," where it achieved a 2nd place ranking. The HowTo100M dataset served as the source for the Uni-VL pre-trained weights used during initialization.

Key Results and Discussion

CLIP4Caption established a new state-of-the-art on the MSR-VTT dataset. Most notably, it achieved a CIDEr score of 60.0, representing a significant leap from previous top-performing models such as MSAN (52.4) and Uni-VL (49.9). Improvements were consistent across all standard evaluation metrics, including BLEU-4, ROUGE-L, and METEOR.

Comparison of CLIP4Caption against state-of-the-art methods on the MSR-VTT dataset.

Several key insights emerged from this research:

  • CLIP as a Foundation: Because CLIP is pre-trained on 400 million image-text pairs, its visual features are inherently "linguistic." This significantly reduces the mapping effort required to translate pixels into words.
  • Architectural Simplicity: The finding that reducing Transformer layers improved performance suggests that for smaller datasets, shallower models generalize better than "heavy" models that tend to memorize training data.
  • Ensemble Effectiveness: The metric-based ensemble strategy proved highly effective at identifying the most representative and accurate descriptions from a pool of candidates.

Conclusion

While CLIP4Caption achieves impressive results, challenges remain regarding domain gaps between different datasets (e.g., GIF-based vs. standard video datasets). Future work will focus on exploring more robust ways to handle these domain shifts and refining the ensemble strategy to accommodate a larger variety of candidate models without excessive computational overhead. Additionally, moving beyond mean pooling to more sophisticated temporal modeling could further enhance the capture of complex actions in video.

Summary updated

BibTeX
@inproceedings{tang2021clip,
  author = {Mingkang Tang and Zhanyu Wang and Zhenhua Liu and Fengyun Rao and Dian Li and Xiu Li},
  title = {{CLIP4Caption: CLIP for Video Caption}},
  booktitle = {ACM Multimedia},
  year = {2021},
  doi = {10.1145/3474085.3479207},
}
Figure