CLIP-CID: Efficient CLIP Distillation via Cluster-Instance Discrimination

Kaicheng Yang, Tiancheng Gu, Xiang An, Haiqiang Jiang, Xiangzi Dai, Ziyong Feng, Tom Weidong Cai, Jiankang Deng

TL;DR

This paper introduces CLIP-CID, a novel knowledge distillation method to train smaller, efficient vision-language models from large ones like CLIP. It tackles the computational cost of CLIP's massive pre-training by first filtering out redundant data and then using a "cluster-instance discrimination" approach to transfer knowledge more effectively.

What Problem Does This Paper Address?

Contrastive Language-Image Pre-training (CLIP) models have shown remarkable performance on various tasks, especially in zero-shot learning. However, their effectiveness hinges on enormous datasets and extensive pre-training, demanding significant computational resources and time. This makes it challenging to deploy these powerful models in resource-constrained environments. While knowledge distillation (KD) is a common technique for compressing large models, applying it efficiently to large-scale vision-language foundation models remains an open problem. Existing KD methods often focus on instance-level knowledge and struggle to capture the broader semantic structure of the training data, leading to suboptimal transfer.

Methods

CLIP-CID proposes a two-pronged approach to address these challenges:

  1. Image Semantic Balance: To reduce transfer learning bias and improve distillation efficiency, the authors introduce a method to balance semantic concepts within the training data. This involves extracting image embeddings using a pre-trained model (OPENCLIP ViT-bigG/14), calculating pairwise Euclidean distances, and using a Union-Find algorithm to group semantically similar images. The central image of each group is retained, effectively filtering out redundant data. This process reduces the LAION400M dataset to LAION225M while maintaining performance.
  2. Cluster-Instance Discrimination Distillation: This core mechanism facilitates knowledge transfer. It combines two types of distillation:
  3. Cluster-level Distillation: This stage groups visually similar instances into clusters using k-means. It then uses a logit distillation loss and KL divergence to align the student model's predictions with the teacher's cluster centers and probability distributions. This helps the student model capture a holistic semantic understanding.
  4. Instance-level Distillation: To capture finer-grained semantic details and improve image-text alignment, this stage uses the teacher's pre-computed image and text embeddings to supervise the student's embeddings. A bi-directional contrastive loss is employed for this alignment.

The overall loss function combines a base CLIP loss, the cluster-level distillation loss, and the instance-level distillation loss.

Datasets

  • Training Data: LAION400M (filtered to LAION225M) is used for pre-training.
  • Evaluation Datasets: The paper evaluates performance on 14 common downstream datasets for linear probe and zero-shot classification, including: Food101, CIFAR10, CIFAR100, Birdsnap, Stanford Cars, Aircraft, DTD, Oxford Pets, Caltech101, Flowers102, SUN397, STL10, EuroSAT, and ImageNet. Robustness is also evaluated on ImageNet-V2, ImageNet-A, ImageNet-R, ObjectNet, and ImageNet-Sketch.

Key Insights and Ideas

  • Data Redundancy is a Major Bottleneck: The paper strongly suggests that a significant portion of large-scale datasets like LAION400M is semantically redundant, hindering efficient learning and distillation. Filtering this data is crucial.
  • Beyond Instance-Level Knowledge: Traditional KD often focuses on matching individual sample predictions. CLIP-CID's innovation lies in explicitly leveraging cluster-level semantic structures to provide a richer, more generalized understanding to the student model.
  • Balancing Efficiency and Performance: The proposed "Image Semantic Balance" method achieves a substantial data reduction (43.7%) without sacrificing performance, demonstrating the potential for more efficient pre-training.
  • Synergy of Cluster and Instance Distillation: Combining both cluster-level and instance-level distillation is key. Cluster distillation provides broad semantic understanding, while instance distillation refines cross-modal alignment and captures subtle details.

Key Results

  • Improved Zero-Shot Performance: CLIP-CID ViT-B/32 and ViT-B/16 achieved average zero-shot performance of 69.4% and 71.3% respectively across 14 datasets, surpassing OPENCLIP trained on LAION400M by 1.8%.
  • Enhanced Linear Probe Performance: CLIP-CID demonstrated an average performance improvement of 2.3% and 1.8% in linear probe tasks compared to OPENCLIP.
  • Significant Data Filtering: The "Image Semantic Balance" method successfully filtered out 43.7% of image-text pairs from LAION400M, reducing it to LAION225M, while maintaining or improving performance.
  • Robustness: CLIP-CID consistently showed superior robustness compared to OPENCLIP on various out-of-distribution datasets.
  • Teacher Model Impact: A larger teacher model (OPENCLIP ViT-bigG/14) led to better student performance, highlighting the importance of the teacher's knowledge.

Limitations and Future Work

  • Computational Cost of Clustering: While the filtering method is efficient, the initial clustering step still requires significant computation, especially for very large datasets.
  • Hyperparameter Sensitivity: The performance is sensitive to hyperparameters like the distance threshold ($\beta$) for filtering and the weights ($\alpha, \gamma$) for combining distillation losses.
  • Future Work: The authors suggest exploring more advanced clustering techniques and investigating the impact of different teacher architectures and dataset sizes. Further research into optimizing the balance between data filtering and knowledge transfer could also be beneficial.

Summary updated

BibTeX
@inproceedings{yang2025clip,
  author = {Kaicheng Yang and Tiancheng Gu and Xiang An and Haiqiang Jiang and Xiangzi Dai and Ziyong Feng and Tom Weidong Cai and Jiankang Deng},
  title = {{CLIP-CID: Efficient CLIP Distillation via Cluster-Instance Discrimination}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i20.35505},
}
Figure