PID: Prompt-Independent Data Protection Against Latent Diffusion Models

Ang Li, Yichuan Mo, Mingjie Li, Yisen Wang

Abstract

The rapid advancement of Latent Diffusion Models (LDMs) has facilitated high-fidelity image generation but also introduced significant privacy risks through unauthorized personalization techniques like DreamBooth and LoRA. Existing adversarial defenses against such mimicry often rely on "prompt consistency," where the protector must anticipate the specific text prompts used by an attacker. This paper introduces Prompt-Independent Defense (PID), a framework that shifts the defensive focus from the text-conditioned UNet to the visual encoder. By manipulating the latent distribution statistics—specifically the mean and log-variance—PID provides a robust, computationally efficient shield that maintains effectiveness regardless of the attacker's prompt choice.

1. Introduction

Latent Diffusion Models (LDMs), such as Stable Diffusion, have democratized high-quality image synthesis. However, the ability to fine-tune these models on a small set of images allows for "personalization," which can be exploited to generate unauthorized likenesses or deepfakes. Current defensive strategies typically involve adding adversarial perturbations to images to disrupt the fine-tuning process.

A critical vulnerability in these defenses is their reliance on prompt-dependent optimization. Most methods optimize perturbations based on a specific anchor prompt (e.g., "a photo of [sks] person"). If an attacker deviates from this specific string during fine-tuning, the protective effect often collapses. This paper addresses this "prompt mismatch" vulnerability by proposing a prompt-independent approach.

2. The Prompt-Dependency Problem

Existing data protection methods like AdvDM and ASPL assume a level of prompt consistency that rarely exists in real-world adversarial scenarios. Empirical evidence shows that when an attacker uses a prompt slightly different from the one used to generate the defense (e.g., changing "a photo of" to "a DSLR portrait of"), the effectiveness of the protection drops by over 30% as measured by Fréchet Inception Distance (FID). Because these perturbations are entangled with the text-processing components of the LDM, they fail to generalize across diverse textual contexts.

3. Proposed Method: PID

To overcome the limitations of prompt-dependent methods, the authors propose PID (Prompt-Independent Defense). The core insight is to target the visual encoder (the Variational Autoencoder or VAE) rather than the text-conditioned UNet. The visual encoder processes the raw pixels into a latent representation before any text prompt is introduced, making it an ideal target for prompt-agnostic protection.

3.1 Latent Distribution Manipulation

PID optimizes perturbations by targeting the two primary statistics of the encoder's output: the mean ($\mu$) and the variance ($\sigma^2$). The authors introduce a specific loss function, $L_{add-log}$, designed to:

  1. Maximize Mean Displacement: This introduces texture-level noise that confuses the model's reconstruction capabilities.
  2. Maximize Log-Variance: By drastically increasing the variance in the latent space, the defense effectively "blinds" the model, preventing it from capturing the core structural concepts (such as facial features) of the protected images.

3.2 Computational Efficiency

Because PID only requires back-propagation through the relatively small visual encoder rather than the massive UNet architecture, it is significantly more efficient. PID can be implemented on consumer-grade hardware with as little as 5GB of VRAM, representing an 80% reduction in memory requirements compared to state-of-the-art methods that often require 24GB.

4. Experimental Results

The researchers evaluated PID using the CelebA-HQ and VGGFACE2 datasets against Stable Diffusion v1.5 and v2.1.

4.1 Defensive Robustness

In scenarios involving mismatched prompts, PID significantly outperformed existing methods. On Stable Diffusion v1.5, PID maintained a Face Detection Score (FDS) of 0.254, whereas the next best method, ASPL, rose to 0.370 (where lower scores indicate better protection). Visually, images generated from PID-protected data were often reduced to unrecognizable colorful noise, while competing methods still allowed for the generation of recognizable human features.

4.2 Transferability and Resilience

PID demonstrated high cross-model transferability; protections crafted for one version of Stable Diffusion remained effective against others. Furthermore, the method showed superior resilience to common image purification techniques, including cropping, smoothing, and denoising, compared to prompt-dependent alternatives.

5. Conclusion and Future Work

PID represents a significant advancement in personal data protection against AI mimicry by removing the need for prompt anticipation. By targeting the visual encoder's latent distribution, it provides a robust and accessible defense for everyday users.

Despite its strengths, PID's effectiveness can be degraded by heavy JPEG compression, a common challenge for all adversarial perturbations. Future research will focus on enhancing the robustness of prompt-independent perturbations against aggressive compression and evolving generative architectures.

Summary updated

BibTeX
@inproceedings{li2024pid,
  author = {Ang Li and Yichuan Mo and Mingjie Li and Yisen Wang},
  title = {{PID: Prompt-Independent Data Protection Against Latent Diffusion Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=1N7pjXKkx8},
}
Figure