Table of Contents
Fetching ...

Shielded Diffusion: Generating Novel and Diverse Images using Sparse Repellency

Michael Kirchhof, James Thornton, Louis Béthune, Pierre Ablin, Eugene Ndiaye, Marco Cuturi

TL;DR

This paper addresses two key issues in diffusion-model-based image generation: lack of diversity and memorization of training data. It introduces SPELL, a training-free sparse repellency mechanism that modifies backward diffusion trajectories to repel generated outputs from a shielded reference set, with static or dynamic shielding across batches. Across multiple diffusion models and large-scale shield sets (including ImageNet-scale protection), SPELL yields substantially higher diversity with only modest impact on image quality metrics like FID and CLIP-adherence, and it enables shielded generation at scale. The work analyzes the sparsity and runtime of SPELL, compares it to related diversity-inducing methods, and discusses limitations and avenues for future improvement.

Abstract

The adoption of text-to-image diffusion models raises concerns over reliability, drawing scrutiny under the lens of various metrics like calibration, fairness, or compute efficiency. We focus in this work on two issues that arise when deploying these models: a lack of diversity when prompting images, and a tendency to recreate images from the training set. To solve both problems, we propose a method that coaxes the sampled trajectories of pretrained diffusion models to land on images that fall outside of a reference set. We achieve this by adding repellency terms to the diffusion SDE throughout the generation trajectory, which are triggered whenever the path is expected to land too closely to an image in the shielded reference set. Our method is sparse in the sense that these repellency terms are zero and inactive most of the time, and even more so towards the end of the generation trajectory. Our method, named SPELL for sparse repellency, can be used either with a static reference set that contains protected images, or dynamically, by updating the set at each timestep with the expected images concurrently generated within a batch, and with the images of previously generated batches. We show that adding SPELL to popular diffusion models improves their diversity while impacting their FID only marginally, and performs comparatively better than other recent training-free diversity methods. We also demonstrate how SPELL can ensure a shielded generation away from a very large set of protected images by considering all 1.2M images from ImageNet as the protected set.

Shielded Diffusion: Generating Novel and Diverse Images using Sparse Repellency

TL;DR

This paper addresses two key issues in diffusion-model-based image generation: lack of diversity and memorization of training data. It introduces SPELL, a training-free sparse repellency mechanism that modifies backward diffusion trajectories to repel generated outputs from a shielded reference set, with static or dynamic shielding across batches. Across multiple diffusion models and large-scale shield sets (including ImageNet-scale protection), SPELL yields substantially higher diversity with only modest impact on image quality metrics like FID and CLIP-adherence, and it enables shielded generation at scale. The work analyzes the sparsity and runtime of SPELL, compares it to related diversity-inducing methods, and discusses limitations and avenues for future improvement.

Abstract

The adoption of text-to-image diffusion models raises concerns over reliability, drawing scrutiny under the lens of various metrics like calibration, fairness, or compute efficiency. We focus in this work on two issues that arise when deploying these models: a lack of diversity when prompting images, and a tendency to recreate images from the training set. To solve both problems, we propose a method that coaxes the sampled trajectories of pretrained diffusion models to land on images that fall outside of a reference set. We achieve this by adding repellency terms to the diffusion SDE throughout the generation trajectory, which are triggered whenever the path is expected to land too closely to an image in the shielded reference set. Our method is sparse in the sense that these repellency terms are zero and inactive most of the time, and even more so towards the end of the generation trajectory. Our method, named SPELL for sparse repellency, can be used either with a static reference set that contains protected images, or dynamically, by updating the set at each timestep with the expected images concurrently generated within a batch, and with the images of previously generated batches. We show that adding SPELL to popular diffusion models improves their diversity while impacting their FID only marginally, and performs comparatively better than other recent training-free diversity methods. We also demonstrate how SPELL can ensure a shielded generation away from a very large set of protected images by considering all 1.2M images from ImageNet as the protected set.
Paper Structure (26 sections, 1 theorem, 20 equations, 37 figures, 5 tables, 1 algorithm)

This paper contains 26 sections, 1 theorem, 20 equations, 37 figures, 5 tables, 1 algorithm.

Key Result

Theorem 3.1

We consider $f:\mathbb{R}^d\to\mathbb{R}$ a twice differentiable function. The Jacobian of the map $\phi:x\mapsto \frac{\nabla f(x)}{\|\nabla f(x)\|}$ is given by

Figures (37)

  • Figure 1: SPELL interventions can change the diffusion trajectory of any pre-trained diffusion model by self-avoiding other images generated, in the same or previous batches (and also any other non-generated image). This makes SPELL achieve a higher diversity above, with prompts, and noise seeds as the base models. We provide more qualitative examples in \ref{['sec:examples_appendix']}.
  • Figure 2: (a) At time $t$, by computing $\mathbb{E}[\mathbf{X}_0 \mid\mathbf{X}_t=x_t]$, we detect that the trajectory is headed (in expectation) into the shield of radius $r$ centered around $z_2$. Our sparse repellency (SPELL) term depicted as a black arrow adds a correction when generating $x_{t-\Delta t}^{\,}$ to ensure that the trajectory is pushed out of the shield. This is again in the case in the next step, when starting from $x_{t- \Delta t}$. (b) In batched generation, the shields are dynamically recreated at every iteration around each trajectory's expected output. This prevents two elements in the batch, $x^{(1)}_t$ and $x^{(2)}_t$, from generating the same output. (c) Both approaches can be combined to yield a diverse set of images that won't fall into protected images and previously or concurrently generated images.
  • Figure 3: 200 samples generated with an unconditional DDPM diffusion model on the two moons toy dataset, with and without intra-batch SPELL with minimum shield radius of $r=0.075$. SPELL's shields lead to a blue-noise-like coverage of the distribution.
  • Figure 4: Latent Diffusion on CC12M. The three plots on the left highlight how the hyperparameters of diversity methods trade off image quality (x-axes) and diversity metrics (y-axes). SPELL provides a better trade-off than other concurrent approaches. In the rightmost plost, highlighting 2 quality metrics, SPELL also shines. IG is not visible on all plots as it strongly decreases image quality.
  • Figure 5: Repellency Strength
  • ...and 32 more figures

Theorems & Definitions (1)

  • Theorem 3.1