AutoCLIP:視覚言語モデルのためのゼロショット分類器の自動チューニング
AutoCLIP: Auto-tuning Zero-Shot Classifiers for Vision-Language Models
September 28, 2023
著者: Jan Hendrik Metzen, Piyapat Saranrittichai, Chaithanya Kumar Mummadi
cs.AI
要旨
CLIPなどの視覚言語モデルに基づいて構築された分類器は、幅広い画像分類タスクにおいて驚異的なゼロショット性能を示しています。先行研究では、プロンプトテンプレートに基づいて各クラスの記述子セットを自動生成するさまざまな方法が検討されてきました。これには、手動で設計されたテンプレートから、大規模言語モデルから得られたテンプレート、さらにはランダムな単語や文字から構築されたテンプレートまで含まれます。一方で、エンコードされたクラス記述子からゼロショット分類器を導出する方法はほとんど変化がなく、具体的には、エンコードされたクラス記述子の平均とエンコードされた画像とのコサイン類似度を最大化するクラスに分類するという方法が一般的です。しかし、すべてのクラス記述子を均等に重み付けすることは、特定の記述子が与えられた画像の視覚的手がかりにより適合する場合には最適ではない可能性があります。本研究では、ゼロショット分類器を自動調整する方法であるAutoCLIPを提案します。AutoCLIPは、推論時にクラス記述子と画像の類似度の統計に基づいて、各プロンプトテンプレートに画像ごとの重みを割り当てます。AutoCLIPは完全に教師なしで、非常に低いオーバーヘッドを持ち、数行のコードで簡単に実装できます。我々は、幅広い視覚言語モデル、データセット、およびプロンプトテンプレートにおいて、AutoCLIPがベースラインを一貫して上回り、最大で3パーセントポイントの精度向上を達成することを示します。
English
Classifiers built upon vision-language models such as CLIP have shown
remarkable zero-shot performance across a broad range of image classification
tasks. Prior work has studied different ways of automatically creating
descriptor sets for every class based on prompt templates, ranging from
manually engineered templates over templates obtained from a large language
model to templates built from random words and characters. In contrast,
deriving zero-shot classifiers from the respective encoded class descriptors
has remained nearly unchanged, that is: classify to the class that maximizes
the cosine similarity between its averaged encoded class descriptors and the
encoded image. However, weighting all class descriptors equally can be
suboptimal when certain descriptors match visual clues on a given image better
than others. In this work, we propose AutoCLIP, a method for auto-tuning
zero-shot classifiers. AutoCLIP assigns to each prompt template per-image
weights, which are derived from statistics of class descriptor-image
similarities at inference time. AutoCLIP is fully unsupervised, has very low
overhead, and can be easily implemented in few lines of code. We show that for
a broad range of vision-language models, datasets, and prompt templates,
AutoCLIP outperforms baselines consistently and by up to 3 percent point
accuracy.