NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Unlearnable Examples for Diffusion Models: Protect Data from Unauthorized Exploitation

Zhengyue Zhao, Jinhao Duan, Xing Hu, Kaidi Xu, Chenan Wang, Rui Zhang, Zidong Du, Qi Guo, Yunji Chen

TL;DR

Generative diffusion models make it alarmingly easy to copy an artist’s style or clone personal photos without consent. This paper introduces Unlearnable Diffusion Perturbation (UDP) and an enhanced variant (EUDP), which inject imperceptible noise into images before publication. When a diffusion model attempts to train or fine-tune on these protected images, the training process is disrupted—rendering the resulting models incapable of generating high-quality replicas of the protected subjects or styles.

What Problem Does This Paper Address?

Text-to-image and personalized fine-tuning tools (like DreamBooth and Textual Inversion) allow anyone to replicate custom artistic styles or generate deepfakes using only a handful of scraped images. While “unlearnable examples”—subtle, imperceptible perturbations that prevent neural networks from learning useful representations—have been extensively studied for image classification, generating unlearnable examples for diffusion models presents unique challenges:

  1. Diffusion models learn across multi-step reverse stochastic processes rather than single-step classification losses.
  2. Directly poisoning images so that generative diffusion models fail to capture clean data distributions requires attacking the forward–reverse diffusion trajectory itself.

Methods

The authors frame data protection as a bi-level max-min optimization problem: the inner optimization updates the diffusion model parameters $\theta$ to minimize reconstruction loss, while the outer optimization searches for a bounded perturbation $\delta^u$ (constrained by an $L_\infty$ norm $\rho_u$) that maximizes this loss.

                    ┌───────────────────────────────┐
                    │  Original Image (x) + Noise δ │
                    └───────────────┬───────────────┘
                                    │ Forward diffusion
                                    ▼
       Inner Loop: Update θ  ◄── DDPM / LDM ──►  Outer Loop: Update δ
       (Minimize training loss)  Training Loss   (Maximize training loss via
                                                  timestep-weighted gradients)

The core contributions include:

  • Unlearnable Diffusion Perturbation (UDP): Alternates between updating the diffusion model weights for $K$ steps and updating sample-wise perturbations for $M$ steps via projected gradient ascent.
  • Enhanced UDP (EUDP): Refines timestep sampling by accounting for diffusion mechanics:
  • Decay Effect: Perturbations applied at $t = 0$ decay by $\sqrt{\bar{\alpha}_t}$ in the forward process, losing influence at higher timesteps.
  • Varying Step Importance: Adjacent diffusion steps introduce different amounts of noise, scaled by $\sqrt{\bar{\alpha}_{t-1} - \bar{\alpha}_t}$.

Instead of sampling timesteps uniformly ($t \sim \mathcal{U}(0, T)$), EUDP samples timesteps proportional to: $$P_{\text{EUDP}}(t) \propto \sqrt{\bar{\alpha}_t} \cdot \sqrt{\bar{\alpha}_{t-1} - \bar{\alpha}_t}$$ This concentrates adversarial updates on the timesteps where perturbations exert the highest impact.

Datasets

The authors evaluate their methods across both unconditional generation (trained from scratch) and personalized text-to-image fine-tuning:

  • CIFAR-10: Used for training Denoising Diffusion Probabilistic Models (DDPM) from scratch under full, partial, and class-wise protection settings.
  • DreamBooth Dataset: Used for subject/object protection against personalization attacks via Stable Diffusion (v1-4).
  • WikiArt: Selected paintings from artists (e.g., Claude Monet, Pablo Picasso, Vincent van Gogh) to test style mimicry and style transfer protection.

Key Insights and Ideas

  • Adversarial Noise Dilution: Because protective noise can only be added to original pixel/latent inputs ($t=0$), the diffusion forward process naturally drowns it out as $t \to T$. Weighting the attack toward lower-to-mid timesteps prevents the perturbation budget from being wasted on timesteps where original image information is already mostly destroyed.
  • Class-Selective Unlearnability: Protection can be targeted surgically. Protecting only specific classes in CIFAR-10 degrades generation quality for those classes while leaving unprotected classes largely unaffected.
  • Prompt Agnostic: Generating EUDP perturbations for text-to-image models does not require knowing the attacker's downstream prompt; optimizing directly against the diffusion denoising objective disrupts the underlying image distribution regardless of the text trigger used during fine-tuning.

Key Results

Quantitative Evaluation on CIFAR-10 (DDPM)

At a standard imperceptible noise budget ($\rho_u = 16/255$):

  • Clean Baseline: FID of 3.83, Precision 71.77%, Recall 54.13%.
  • AdvDM Baseline: FID increases to 34.01.
  • UDP (Ours): FID worsens to 56.52 (+66.19% over AdvDM).
  • EUDP (Ours): FID reaches 60.75 (+78.62% over AdvDM), while Precision and Recall plunge to 30.88% and 23.81%, respectively.
  • Increasing the noise scale to $32/255$ under EUDP pushes the FID to 112.67, severely corrupting the model's output distribution.

Protection Ratios and Class-Wise Protection

  • The unlearnable effect scales with the fraction of poisoned data: significant degradation begins once $\ge 50\%$ of the dataset contains EUDP noise.
  • When classes $0 \sim 1$ are protected, their generation FID spikes to 58.17 (vs. 8.55 clean), while unprotected classes ($2 \sim 9$) remain sharp at FID 7.81 (vs. 4.27 clean).

Qualitative Protection on Latent Diffusion (Stable Diffusion)

  • DreamBooth & Textual Inversion: Models fine-tuned on protected dog photos either collapse into low-contrast, blurred repetitions of training frames or lose all identifying features of the target subject.
  • Style Mimicry: Models fine-tuned on EUDP-protected artworks completely fail to imitate Picasso’s cubism or Van Gogh’s brushstrokes, generating generic, flat outputs instead.

Limitations and Future Work

  • Computational Expense: Solving bi-level max-min optimization loops across full diffusion trajectories requires substantial computation, precluding extensive hyperparameter sweeps.
  • Preprocessing Defenses: Standard natural perturbations provide partial mitigation; applying JPEG compression or Gaussian blur lowers the FID of EUDP-trained models from 60.75 to 27.61 and 41.88, respectively (though still far from the clean baseline of 3.83).
  • Cross-Model Transferability Gaps: While perturbations transfer well across closely related architectures (v1-1 and v1-5), the defensive effect noticeably weakens against significantly divergent checkpoints (e.g., Counterfeit-V2.5).

Summary updated

BibTeX
@inproceedings{zhao2024unlearnable,
  author = {Zhengyue Zhao and Jinhao Duan and Xing Hu and Kaidi Xu and Chenan Wang and Rui Zhang and Zidong Du and Qi Guo and Yunji Chen},
  title = {{Unlearnable Examples for Diffusion Models: Protect Data from Unauthorized Exploitation}},
  booktitle = {R2-FM @ ICLR},
  year = {2024},
  url = {https://openreview.net/forum?id=CHTRtLPYNF},
}
Figure