Revisiting Classifier: Transferring Vision-Language Models for Video Recognition

Wenhao Wu, Zhun Sun, Wanli Ouyang

Abstract

The standard approach to fine-tuning pre-trained models for video recognition involves replacing the final classification layer with a randomly initialized linear head. This paper argues that such a practice is suboptimal for Vision-Language Models (VLMs) like CLIP, as it discards the rich semantic relationships captured by the text encoder. We propose a "Text-as-Classifier" paradigm that uses fixed textual embeddings of class labels as the classifier's weights. This approach not only simplifies the transfer process but also significantly boosts accuracy and training speed, achieving state-of-the-art results on Kinetics-400 and outperforming existing methods in zero-shot and few-shot settings by substantial margins.

The Problem: Wasteful Fine-Tuning

In the traditional "pre-train then fine-tune" pipeline, a powerful visual backbone is stripped of its original head and fitted with a new, random linear layer. While effective for pure vision models, this process is wasteful when applied to VLMs. VLMs are specifically trained to align visual features with linguistic concepts; their text encoders already possess a structured understanding of class relationships (e.g., the semantic proximity of "playing guitar" and "playing violin").

Comparison of standard vision-only tuning (a) and common vision-language tuning (b) paradigms.

By starting with a random classifier, the model is forced to re-learn these semantic correlations from scratch. In video recognition, where labeled data is often scarce, this leads to slower convergence and a higher risk of overfitting. Furthermore, as shown in Figure 5, while standard vision-language tuning often relies on contrastive loss, the proposed method seeks to leverage textual knowledge within a more efficient cross-entropy framework.

Proposed Method: Text-as-Classifier

The authors propose a paradigm shift in how the final linear layer ($W$) is initialized and utilized. Instead of random weights, each row of the classifier matrix is initialized with the $d$-dimensional embedding of the corresponding class label, generated by a pre-trained text encoder (such as CLIP's or DistilBERT).

The proposed framework for obtaining inter-class correlations via textual semantic knowledge (A2) to initialize the classifier.

Crucially, these textual weights are frozen during the fine-tuning process. This forces the visual encoder to map video features directly into a pre-defined, semantically meaningful space. To handle the temporal dimension of video, the authors incorporate a Temporal Transformer (T-Trans) that applies attention across frames. Unlike contrastive fine-tuning methods that require active text encoders and large batch sizes, this approach uses standard cross-entropy loss, making it significantly more efficient in terms of memory and computation.

Key Insights: Semantic Regularization

A primary discovery of this work is that even when a classifier is trained from scratch, it eventually attempts to replicate the inter-class correlations inherent in the text encoder. By providing these correlations upfront, the model converges much faster. Furthermore, the frozen textual classifier acts as a powerful regularizer, preventing the visual encoder from distorting its pre-trained representations when faced with limited data (e.g., 1-shot or 2-shot learning). Interestingly, the method is "text encoder agnostic"; using a text-only model like DistilBERT yields results nearly as strong as those from CLIP’s multi-modal encoder.

Experimental Results

The "Text-as-Classifier" approach was evaluated on major benchmarks including Kinetics-400, Kinetics-600, UCF-101, HMDB-51, and ActivityNet-v1.3.

  • State-of-the-Art Accuracy: The model achieved 87.8% Top-1 accuracy on Kinetics-400, outperforming much larger models like Florence.
  • Zero-Shot Dominance: In zero-shot settings, the method improved accuracy on UCF-101 by +27.1% and on ActivityNet by +52.1% over previous baselines.
  • Efficiency: The model is 29x faster in throughput and uses 44x fewer FLOPs than the ViViT model. Training is also roughly 2x faster than contrastive video-text tuning methods because it avoids complex batch-gathering across GPUs.

Conclusion

By revisiting the role of the classifier in VLM transfer learning, this paper demonstrates that simple semantic initialization can replace complex multi-modal loss functions. While the method depends on labels having linguistic meaning—making it less suitable for tasks like human re-identification where labels are numerical IDs—it sets a new standard for efficient and effective video recognition. Future work may explore combining these textual priors with visual statistics, such as Linear Discriminant Analysis, for even more robust initialization.

Summary updated

BibTeX
@inproceedings{wu2023revisiting,
  author = {Wenhao Wu and Zhun Sun and Wanli Ouyang},
  title = {{Revisiting Classifier: Transferring Vision-Language Models for Video Recognition}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i3.25386},
}
Figure