Enhancing CLIP with GPT-4: Harnessing Visual Descriptions as Prompts

Mayug Maniparambil, Chris Vorster, Derek Molloy, Noel Murphy, Kevin McGuinness +1 more
7/21/2023
cs.CVcs.AIcs.CL

Official code: mayug/VDT-Adapter (30 stars, MIT, last commit 2024-02-21).

Abstract

Contrastive pretrained large Vision-Language Models (VLMs) like CLIP have revolutionized visual representation learning by providing good performance on downstream datasets. VLMs are 0-shot adapted to a downstream dataset by designing prompts that are relevant to the dataset. Such prompt engineering makes use of domain expertise and a validation dataset. Meanwhile, recent developments in generative pretrained models like GPT-4 mean they can be used as advanced internet search tools. They can also be manipulated to provide visual information in any structure. In this work, we show that GPT-4 can be used to generate text that is visually descriptive and how this can be used to adapt CLIP to downstream tasks. We show considerable improvements in 0-shot transfer accuracy on specialized fine-grained datasets like EuroSAT (~7%), DTD (~7%), SUN397 (~4.6%), and CUB (~3.3%) when compared to CLIP's default prompt. We also design a simple few-shot adapter that learns to choose the best possible sentences to construct generalizable classifiers that outperform the recently proposed CoCoOP by ~2% on average and by over 4% on 4 specialized fine-grained datasets. The code, prompts, and auxiliary text dataset is available at https://github.com/mayug/VDT-Adapter.

View on arXivView PDF

Code Implementations(1)

mayug/VDT-AdapterOfficial100%
MIT

This repository contains the code and datasets for our ICCV-W paper 'Enhancing CLIP with GPT-4: Harnessing Visual Descriptions as Prompts'

304Shell, PythonAug 8, 20232 years agoMIT

Similar Papers

Cite this paper

@article{maniparambil2023enhancing,
  title  = {Enhancing CLIP with GPT-4: Harnessing Visual Descriptions as Prompts},
  author = {Mayug Maniparambil and Chris Vorster and Derek Molloy and Noel Murphy and Kevin McGuinness and Noel E. O'Connor},
  year   = {2023},
  eprint = {2307.11661},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.11661v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.11661.svg)](https://codeofpaper.com/paper/2307.11661)

Discussion