Concept-Guided Prompt Learning for Generalization in Vision-Language Models

Yi Zhang, Ce Zhang, Ke Yu, Yushun Tang, Zhihai He

Introduction

Large-scale Vision-Language Models (VLMs), such as CLIP, have demonstrated remarkable zero-shot capabilities. However, when these models are fine-tuned for specific downstream tasks using current state-of-the-art methods like CoOp or CoCoOp, they often suffer from a significant drop in generalization. These methods typically focus on global image features or class-specific prompts, neglecting the fundamental building blocks of visual representation: visual concepts.

Visual concepts—attributes like color, shape, and material (e.g., "striped," "metallic," or "cylindrical")—are universal. While a specific object category (e.g., a "Boeing 707") might be novel to a model, its constituent concepts are often well-represented in the pre-training data. This paper introduces Concept-Guided Prompt Learning (CPL), a framework that explicitly incorporates these low-level visual attributes into the prompting process to bridge the gap between base and novel class performance.

Methodology

CPL enhances the prompting mechanism through three primary components:

  1. Visual Concept Cache: The authors curated a dictionary of 2,000 common text descriptions for visual attributes. During training, CLIP is used to pre-align these text concepts with visual features from the training set, creating a key-value cache where visual features are keys and text concepts are values.
  2. Concept-Guided Prompting: For a given input image, the model extracts visual features and queries the cache for the "Top-K" most similar visual concepts. These concepts are then injected into a natural language template (e.g., "A brown fluffy little round photo of a {class}"), providing the text encoder with rich, descriptive context that goes beyond just the class name.
  3. Multi-level Feature Projector & Task Adapter:
  4. Projector: CPL utilizes a Transformer decoder to map features from multiple layers of the vision backbone into the text space. This captures a hierarchy of information, from low-level edges and colors in early layers to high-level semantics in later layers.
  5. Task Adapter: A small learnable matrix is integrated into the final text features to capture task-specific nuances without destroying the pre-trained knowledge of CLIP.

Experimental Results

The model was evaluated across 11 representative image classification datasets, including generic objects (ImageNet), fine-grained categories (OxfordPets, StanfordCars), and specialized tasks (EuroSAT, UCF101).

Performance comparison of CPL (Ours) against CoOp and CoCoOp in base-to-novel generalization and cross-dataset transfer scenarios.

Base-to-Novel Generalization

CPL consistently outperformed baselines across all datasets. On average, it improved accuracy on unseen "novel" classes by 2.89% and the Harmonic Mean (balancing base and novel performance) by 2.53%. This suggests that by focusing on transferable concepts, the model avoids overfitting to the specific training classes.

Cross-Dataset Transfer and Robustness

When trained on ImageNet and tested on 10 other datasets, CPL achieved an average target accuracy of 68.07%, surpassing the previous state-of-the-art (MaPLe) by 1.77%. Furthermore, CPL demonstrated superior robustness on out-of-distribution (OOD) versions of ImageNet (V2, Sketch, A, and R), indicating that concept-guided learning helps the model avoid "shortcut" features.

Efficiency

Notably, CPL is significantly more efficient than its predecessors. For instance, on 16-shot ImageNet, CPL reaches higher accuracy in just 50 minutes, compared to over 14 hours for CoOp.

Conclusion

Concept-Guided Prompt Learning (CPL) represents a shift from class-centric to concept-centric fine-tuning for VLMs. By leveraging a visual concept cache and multi-level feature projection, CPL achieves superior generalization and efficiency. While the method currently relies on a pre-defined concept dictionary, future work may explore unsupervised concept discovery to further scale this approach.

Summary updated

BibTeX
@inproceedings{zhang2024concept,
  author = {Yi Zhang and Ce Zhang and Ke Yu and Yushun Tang and Zhihai He},
  title = {{Concept-Guided Prompt Learning for Generalization in Vision-Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i7.28568},
}
Figure