DataDream: Few-shot Guided Dataset Generation

Jae Myung Kim, Jessica Bader, Stephan Alaniz, Cordelia Schmid, Zeynep Akata · DOI

Abstract

DataDream is a novel framework designed to bridge the gap between generic text-to-image diffusion models and specific downstream classification tasks. By fine-tuning a pre-trained model on a small set of real images using Low-Rank Adaptation (LoRA), DataDream generates high-fidelity synthetic datasets that are "in-distribution" for the target task. This approach effectively addresses semantic ambiguity and fine-grained detail failures common in generic generative models. Evaluated across 10 benchmarks, DataDream achieves state-of-the-art performance in few-shot classification, demonstrating significant gains particularly in specialized domains.

Introduction: The Gap in Generative Training

While text-to-image models like Stable Diffusion can generate diverse visuals, their utility for training robust image classifiers is often limited by two primary hurdles:

  1. Semantic Ambiguity: Models may misinterpret prompts (e.g., generating the chemical element "iron" instead of a "clothes iron").
  2. Fine-Grained Failure: Generic models often overlook subtle features critical for distinguishing specific classes, such as the unique propeller configurations of rare aircraft.

Existing methods often rely on prompt engineering or image-to-image translation, which frequently fail to capture the true underlying distribution of the target data. DataDream overcomes these issues by directly adapting the generative model to the specific task.

The DataDream Framework

DataDream moves away from treating generative models as static "black boxes." Instead, it employs Low-Rank Adaptation (LoRA) to fine-tune both the U-Net (image generator) and the Text Encoder of a diffusion model using a handful of real images (e.g., 16 per class).

The DataDream architecture, showing LoRA adaptation of the Text Encoder and Diffusion U-Net, and the two training strategies: Per Dataset and Per Class.

The framework operates in three distinct stages:

  1. Adaptation: The model is fine-tuned using one of two strategies:
  2. DataDream_dset: A single set of weights is trained for the entire dataset, facilitating the learning of shared features.
  3. DataDream_cls: Separate weights are trained for each class, which is superior for capturing unique, fine-grained details.
  4. Generation: The adapted model generates a large synthetic dataset (e.g., 500 images per class) that is significantly more faithful to the target distribution.
  5. Classification: A CLIP-based classifier is fine-tuned using a combination of the original few-shot real images and the newly "dreamed" synthetic images.

Experimental Results and Insights

The authors evaluated DataDream on 10 diverse benchmarks, including general (ImageNet), fine-grained (FGVC Aircraft, Stanford Cars), and specialized (EuroSAT) datasets.

Qualitative comparison of synthetic images generated by different methods for 'clothes iron' (ImageNet) and 'DHC-3-800' (FGVC Aircraft). DataDream captures semantic context and fine-grained details better than baselines.

Key Findings:

  • State-of-the-Art Performance: DataDream outperformed existing few-shot methods on 7 out of 10 datasets. Notably, on the FGVC Aircraft dataset, it achieved a 47.4% point increase over the CLIP zero-shot baseline.
  • The Importance of the Text Encoder: Fine-tuning the text encoder alongside the U-Net is crucial. It allows the model to map class names more accurately to the visual features learned from the few-shot samples.
  • Fidelity over Generality: By omitting "preservation loss" (unlike personalization methods like DreamBooth), DataDream prioritizes mimicking the specific few-shot samples, leading to better alignment with the real data distribution.
  • Scalability: Performance continues to improve as the size of the synthetic dataset increases, suggesting that the model successfully distills essential information from limited real samples.

Limitations and Future Work

Despite its success, DataDream faces challenges in domains where the base model has little prior knowledge, such as satellite imagery (EuroSAT). Additionally, like all generative approaches, it risks propagating biases from the pre-trained model or the small sample set. Future research will focus on optimizing the selection of "representative" few-shot images to further enhance the diversity and utility of the generated data.

Summary updated

BibTeX
@inproceedings{kim2024datadream,
  author = {Jae Myung Kim and Jessica Bader and Stephan Alaniz and Cordelia Schmid and Zeynep Akata},
  title = {{DataDream: Few-shot Guided Dataset Generation}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73209-6\_15},
}
Figure