Language-Driven Cross-Modal Classifier for Zero-Shot Multi-Label Image Recognition

Yicheng Liu, Jie Wen, Chengliang Liu, Xiaozhao Fang, Zuoyong Li, Yong Xu, Zheng Zhang

TL;DR

Researchers have developed CoMC (Cross-Modal Classifier), a framework that trains multi-label image recognition models using zero training images. By leveraging Large Language Models (LLMs) to generate descriptive text and introducing a novel mapping technique to bridge the "modality gap" in vision-language models like CLIP, this method outperforms existing zero-shot benchmarks and even rivals models trained on actual image data.

What Problem Does This Paper Address?

Multi-label recognition (MLR)—the task of identifying every object present in a complex scene—is significantly harder than single-label classification. While models like CLIP have revolutionized zero-shot learning, adapting them for MLR usually requires a massive amount of human-annotated image data (e.g., "this photo contains a dog, a car, and a tree").

Collecting these annotations is expensive and does not scale well. Furthermore, even though CLIP maps images and text into a "shared" embedding space, there is still a persistent modality gap: a text embedding for the word "dog" and a visual embedding of a dog do not sit in the exact same spot. This gap causes performance to drop significantly when a classifier trained on one modality (text) is used to recognize the other (images).

Methods

To tackle these challenges, the authors propose a two-stage framework called CoMC:

The CoMC Framework
  1. Text-Only Training: Instead of searching for annotated images, the researchers used GPT-3 to generate 40,000 descriptive sentences covering various combinations of labels (e.g., "A cat perches curiously on the hood of a parked car"). These sentences are passed through CLIP’s text encoder to create embeddings. A simple linear classifier is then trained on these embeddings using a ranking loss to learn which labels belong to which text strings.
  2. Cross-Modal Inference: To use this text-trained classifier on images, the authors introduce two clever tricks:
  3. Fine-grained Embeddings: Instead of just looking at the whole image (global), they extract local feature maps to find smaller, secondary objects.
  4. Cross-Modal Mapping: To bridge the modality gap, they represent an image embedding as a linear combination of label-specific text embeddings. They then fuse this "mapped" embedding with the original visual embedding. This "translates" the image into the language space that the classifier understands best, while still retaining crucial visual details.

Datasets

The model was evaluated on three standard multi-label benchmarks:

  • MS-COCO: A widely used dataset with 80 object categories.
  • VOC2007: A classic computer vision benchmark with 20 categories.
  • NUS-WIDE: A large-scale web image dataset with 81 categories.

Importantly, the model never saw the images from these datasets during the training phase; they were used strictly for testing.

Key Insights and Ideas

  • LLMs as Data Engines: The paper proves that LLMs can act as a high-quality, "free" source of training data for vision tasks. By generating diverse, descriptive sentences, GPT-3 provides the "visual" context the classifier needs without a single pixel being processed.
  • The Modality Gap is the Real Enemy: Simply training on text and testing on images usually fails. The breakthrough here is the Cross-Modal Mapping. By treating the image as a mixture of text concepts, the model effectively "re-aligns" the modalities on the fly during inference.
  • Local Matters: In multi-label scenes, the "global" image embedding often ignores smaller objects. By splitting the image into local regions and aggregating scores, the model becomes much better at spotting the "hidden" labels in a busy photo.
Effect of Textual Training Data Size

Key Results

CoMC sets a new state-of-the-art for zero-shot multi-label recognition:

  • Superiority over Zero-Shot Baselines: On MS-COCO, CoMC achieved a Mean Average Precision (mAP) of 68.7%, outperforming the previous best "image-free" method (TaI-DPT) which sat at 65.1%.
  • Beating Few-Shot Models: Remarkably, CoMC (which uses 0 images for training) outperformed CoOp-DPT (a model trained with 8 images per class) on the MS-COCO dataset.
  • Robustness: The method showed consistent gains across different CLIP backbones (ResNet-50, ResNet-101, and ViT-B/32), proving the framework isn't tied to a specific architecture. Performance also scales well with the amount of generated text data, plateauing around 20,000 to 40,000 sentences.

Limitations and Future Work

  • Template Dependency: The cross-modal mapping relies on simple text templates like "a photo of a [class]." The authors note that if these templates are too simple, the model might lose important visual information.
  • LLM Bias: The quality of the classifier is tethered to the quality of the LLM's descriptions. If the LLM has a biased or narrow "understanding" of how objects appear together, the classifier will inherit those gaps.
  • Future Directions: The authors suggest exploring more complex text-to-image alignment strategies and potentially applying this "image-free" training logic to other tasks like object detection or segmentation.

Summary updated

BibTeX
@inproceedings{liu2024language,
  author = {Yicheng Liu and Jie Wen and Chengliang Liu and Xiaozhao Fang and Zuoyong Li and Yong Xu and Zheng Zhang},
  title = {{Language-Driven Cross-Modal Classifier for Zero-Shot Multi-Label Image Recognition}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=sHswzNWUW2},
}
Figure