A Hard-to-Beat Baseline for Training-free CLIP-based Adaptation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Wang, Zhengbo, Liang, Jian, Sheng, Lijun, He, Ran, Wang, Zilei, Tan, Tieniu
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866909095547633664
author Wang, Zhengbo
Liang, Jian
Sheng, Lijun
He, Ran
Wang, Zilei
Tan, Tieniu
author_facet Wang, Zhengbo
Liang, Jian
Sheng, Lijun
He, Ran
Wang, Zilei
Tan, Tieniu
contents Contrastive Language-Image Pretraining (CLIP) has gained popularity for its remarkable zero-shot capacity. Recent research has focused on developing efficient fine-tuning methods, such as prompt learning and adapter, to enhance CLIP's performance in downstream tasks. However, these methods still require additional training time and computational resources, which is undesirable for devices with limited resources. In this paper, we revisit a classical algorithm, Gaussian Discriminant Analysis (GDA), and apply it to the downstream classification of CLIP. Typically, GDA assumes that features of each class follow Gaussian distributions with identical covariance. By leveraging Bayes' formula, the classifier can be expressed in terms of the class means and covariance, which can be estimated from the data without the need for training. To integrate knowledge from both visual and textual modalities, we ensemble it with the original zero-shot classifier within CLIP. Extensive results on 17 datasets validate that our method surpasses or achieves comparable results with state-of-the-art methods on few-shot classification, imbalanced learning, and out-of-distribution generalization. In addition, we extend our method to base-to-new generalization and unsupervised learning, once again demonstrating its superiority over competing approaches. Our code is publicly available at \url{https://github.com/mrflogs/ICLR24}.
format Preprint
id arxiv_https___arxiv_org_abs_2402_04087
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle A Hard-to-Beat Baseline for Training-free CLIP-based Adaptation
Wang, Zhengbo
Liang, Jian
Sheng, Lijun
He, Ran
Wang, Zilei
Tan, Tieniu
Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
Contrastive Language-Image Pretraining (CLIP) has gained popularity for its remarkable zero-shot capacity. Recent research has focused on developing efficient fine-tuning methods, such as prompt learning and adapter, to enhance CLIP's performance in downstream tasks. However, these methods still require additional training time and computational resources, which is undesirable for devices with limited resources. In this paper, we revisit a classical algorithm, Gaussian Discriminant Analysis (GDA), and apply it to the downstream classification of CLIP. Typically, GDA assumes that features of each class follow Gaussian distributions with identical covariance. By leveraging Bayes' formula, the classifier can be expressed in terms of the class means and covariance, which can be estimated from the data without the need for training. To integrate knowledge from both visual and textual modalities, we ensemble it with the original zero-shot classifier within CLIP. Extensive results on 17 datasets validate that our method surpasses or achieves comparable results with state-of-the-art methods on few-shot classification, imbalanced learning, and out-of-distribution generalization. In addition, we extend our method to base-to-new generalization and unsupervised learning, once again demonstrating its superiority over competing approaches. Our code is publicly available at \url{https://github.com/mrflogs/ICLR24}.
title A Hard-to-Beat Baseline for Training-free CLIP-based Adaptation
topic Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2402.04087