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.