Extracting Training Data from Unconditional Diffusion Models

Yunhao Chen, Xingjun Ma, Difan Zou, Yu–Gang Jiang · DOI

TL;DR

This paper introduces a theoretical framework and a novel method called SIDE to extract training data from unconditional diffusion models, addressing a critical gap in current data extraction techniques. By proposing new metrics and a time-dependent classifier, they demonstrate SIDE's effectiveness in recovering training samples, highlighting potential privacy and copyright risks in widely used generative AI models.

What Problem Does This Paper Address?

Generative AI models, particularly diffusion probabilistic models (DPMs), are increasingly powerful but also raise concerns about memorizing and potentially leaking raw training data. This "data memorization" can lead to privacy breaches and copyright infringement. While previous research has explored this phenomenon, existing data extraction methods primarily work for conditional diffusion models. However, many real-world applications, like Stable Diffusion, are built upon unconditional diffusion models. This leaves a significant gap: how do we extract training data from these more fundamental, unconditional models? This paper aims to bridge this gap by providing a theoretical understanding of memorization in DPMs and developing a practical method for data extraction from unconditional models.

Methods

The authors propose a multi-pronged approach:

  • Memorization Metric: They introduce a theoretical metric, $M(D; \theta)$, to quantify the degree of memorization by measuring the overlap between the generated distribution and distributions centered around individual training data points. A lower score indicates more memorization.
  • Theoretical Framework for Conditional Memorization: They generalize the concept of "informative labels" beyond simple class labels to include any information that can group training samples. They theorize that conditioning on such informative labels (even random ones) leads to increased memorization by forcing the model to learn specific data features more effectively.
  • Surrogate condItional Data Extraction (SIDE): This is the core novel method. Since unconditional models lack explicit labels, SIDE constructs a "surrogate condition" using a classifier trained on the same data. This classifier is trained using a Time-Dependent Knowledge Distillation (TDKD) technique to create a time-dependent classifier that can guide the sampling process of the unconditional diffusion model. This guided sampling allows for the extraction of training data.
  • New Performance Metrics: To better evaluate data extraction, they introduce the Average Memorization Score (AMS) and Unique Memorization Score (UMS). These metrics go beyond simply finding similar images and aim to quantify the proportion and uniqueness of memorized samples across different similarity levels.

Datasets

The proposed SIDE method and its variants were evaluated on two datasets:

  • CelebA-HQ-Face-Identity (CelebA-HQ-FI): A dataset of 5478 images.
  • CelebA (subset): A dataset of 25,000 images.

The authors also mention using a synthetic dataset generated by the target diffusion model for training the time-dependent classifier.

Key Insights and Ideas

  • Informative Labels Drive Memorization: The paper provides a theoretical explanation for why conditioning on labels (even random ones) increases memorization. This is because informative labels help the model focus on specific features, making it more prone to overfitting and memorizing individual data points.
  • Unconditional Models Aren't Immune: Contrary to some prior assumptions, the research demonstrates that unconditional diffusion models can still memorize training data, and SIDE can effectively extract it.
  • Time-Dependent Guidance is Crucial: The success of SIDE hinges on a time-dependent classifier. Standard, time-independent classifiers perform significantly worse because diffusion models require accurate gradients across many timesteps, which only a time-dependent approach can provide.
  • New Metrics Reveal Nuances: AMS and UMS offer a more comprehensive view of memorization than previous metrics, capturing both the quantity and diversity of extracted samples.

Key Results

  • SIDE's Effectiveness: The SIDE method significantly outperforms a random baseline in extracting training data from unconditional diffusion models.
  • Performance Gains: On the CelebA-HQ-FI dataset, SIDE increased mid-level AMS by approximately 87% and mid-level UMS by 37%. For the larger CelebA-25000 dataset, SIDE dramatically improved AMS and UMS, especially for low and mid-similarity levels.
  • High Similarity Extraction: SIDE successfully extracts memorized data at high similarity levels from the CelebA-25000 dataset, a task previously considered infeasible for models trained on datasets of that scale.
  • Hyperparameter Sensitivity: The memorization score shows a clear sensitivity to the hyperparameter $\lambda$ in the SIDE method, increasing initially as the model becomes more conditional, then decreasing as it overfits the classifier's decision boundaries.

Limitations and Future Work

  • Classifier Dependence: The effectiveness of SIDE relies on training a classifier on the same data as the target diffusion model. If this classifier is unavailable or poorly trained, SIDE's performance may be impacted.
  • Computational Cost: Training a time-dependent classifier and generating a large number of samples for extraction can be computationally intensive.
  • Future Work: The authors hope their work will motivate further research into understanding the memorization mechanisms of diffusion models and developing more advanced data extraction techniques. They also suggest exploring implicit informative labels derived from cluster information or pre-trained feature extractors.

Summary updated

BibTeX
@misc{chen2024extracting,
  author = {Yunhao Chen and Xingjun Ma and Difan Zou and Yu–Gang Jiang},
  title = {{Extracting Training Data from Unconditional Diffusion Models}},
  year = {2024},
  eprint = {2406.12752},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.12752},
}
Figure