Discriminative Image Generation with Diffusion Models for Zero-Shot Learning

Dingjie Fu, Wenjin Hou, Shiming Chen, Shuhuang Chen, Xinge You, Salman H. Khan, Fahad Shahbaz KhanarXiv 2024 · DOI

Abstract

Zero-Shot Learning (ZSL) aims to recognize objects from unseen classes by leveraging knowledge from seen classes and auxiliary semantic information. Traditional generative ZSL methods typically synthesize abstract visual features, which lack interpretability and often rely on expensive human-annotated attributes. We propose DIG-ZSL (Discriminative Image Generation for ZSL), a framework that shifts the paradigm toward generating realistic, discriminative images using pre-trained diffusion models. By optimizing "Discriminative Class Tokens" (DCTs) guided by a category-aware model, DIG-ZSL produces high-quality training samples for unseen categories. Our method sets new state-of-the-art benchmarks on standard datasets without requiring manual attribute labeling.

Introduction

The core challenge of Zero-Shot Learning is bridging the gap between seen and unseen categories. Most existing methods address this by synthesizing numerical visual features—abstract vectors that act as "black boxes." While effective, these features are difficult to interpret and scale poorly to complex scenes due to their reliance on human-annotated attributes (e.g., "has yellow wings").

Conceptual comparison between traditional feature generation (a) and the proposed image generation approach (b) for ZSL.

While recent text-to-image models like Stable Diffusion (SD) can generate realistic images from class names, these "vanilla" generations often lack the specific discriminative details necessary for training a high-performance classifier. DIG-ZSL addresses this "semantic gap" by turning a pre-trained diffusion model into a precision data generator that emphasizes category-defining traits.

Proposed Method: DIG-ZSL

DIG-ZSL is a three-stage framework designed to optimize the generation process for discriminative utility rather than just visual realism.

Overview of the DIG-ZSL framework, illustrating the Category Discrimination Model (a), the Discriminative Class Token learning process (b), and the final ZSL Classifier training (c).

1. Category Discrimination Model (CDM)

First, a "teacher" model is trained using only data from seen classes. This CDM learns to map visual features to a semantic space defined by CLIP text embeddings. It serves as the evaluator for the subsequent generation stage.

2. Discriminative Class Token (DCT) Learning

For each unseen class, we introduce a learnable token ($S_*$). We optimize the embedding of this token such that when Stable Diffusion uses the prompt "A photo of $S_*$ [class name]," the resulting image is correctly and confidently identified by the CDM. This ensures the generated images contain the specific visual cues that distinguish that class from others (e.g., the unique plumage of a specific bird species).

3. ZSL Classifier Training

Finally, a set of images is generated for all unseen classes using the optimized DCTs. These synthetic images, combined with real images from seen classes, are used to train a standard image classifier for the final ZSL task.

Experimental Results

We evaluated DIG-ZSL on four standard ZSL benchmarks: AWA2 (Animals with Attributes 2), CUB (Caltech-USCD Birds), FLO (Oxford Flowers), and SUN (Scene Attribute).

Performance Gains

DIG-ZSL demonstrated a significant performance leap over existing methods:

  • State-of-the-Art Benchmarks: It achieved 90.1% accuracy on AWA2 and 69.7% on CUB in the conventional ZSL setting.
  • Automated Scaling: On average, it outperformed previous state-of-the-art methods that do not use human annotations by 24.2% in Top-1 accuracy.
  • Generalized ZSL: In the more challenging Generalized ZSL setting (testing on both seen and unseen classes), DIG-ZSL consistently outperformed large-scale vision-language models like CLIP and CoOp.

Image Quality and Interpretability

Quantitative metrics (FID scores) confirmed that images generated via DCTs were of higher quality and better aligned with class descriptions than those from vanilla Stable Diffusion. Furthermore, because the model generates actual images, researchers can visually verify what the model "thinks" defines an unseen class, providing a level of interpretability impossible with feature-generation methods.

Conclusion and Future Work

DIG-ZSL moves ZSL away from abstract feature synthesis toward realistic, discriminative image generation. By bypassing the need for human-annotated attributes, it offers a more scalable path for real-world applications. While current challenges include the computational cost of high-resolution generation and the complexity of extremely fine-grained details, the success of the "discriminative token" approach suggests a promising direction for future generative architectures in zero-shot tasks.

Summary updated

BibTeX
@misc{fu2024discriminative,
  author = {Dingjie Fu and Wenjin Hou and Shiming Chen and Shuhuang Chen and Xinge You and Salman H. Khan and Fahad Shahbaz Khan},
  title = {{Discriminative Image Generation with Diffusion Models for Zero-Shot Learning}},
  year = {2024},
  eprint = {2412.17219},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.17219},
}
Figure