Privacy Protection in Personalized Diffusion Models via Targeted Cross-Attention Adversarial Attack

Xide Xu, Muhammad Atif Butt, Sandesh Kamath, Bogdan Raducanu

TL;DR

This paper introduces CoPSAM, a novel adversarial attack that protects privacy in personalized text-to-image diffusion models by subtly manipulating cross-attention maps. CoPSAM effectively disrupts the model's ability to generate identifiable images from user-specific tokens, offering better privacy protection with less noise compared to existing methods.

What Problem Does This Paper Address?

Personalized text-to-image (T2I) diffusion models, like Stable Diffusion, have become incredibly popular for generating custom content. Users can fine-tune these models with just a few personal images to create unique concepts tied to specific tokens (e.g., "a photo of my dog, <dog-token>"). While powerful, this personalization introduces significant privacy risks. Malicious actors could exploit these models to generate deceptive "deepfakes" or misuse personalized content, potentially revealing sensitive information or impersonating individuals. Existing defense mechanisms often involve injecting imperceptible noise to disrupt the model's output, but they can be inefficient or struggle to maintain a balance between privacy and image quality, especially at low noise levels. This paper aims to address this by developing a more effective and efficient adversarial attack specifically designed to protect the privacy of personalized diffusion models.

Methods

The core of CoPSAM lies in its targeted approach: it focuses exclusively on the cross-attention layers of T2I diffusion models. These layers are crucial for aligning text prompts with image features during the generation process. The authors propose to disrupt this alignment by creating an imperceptible noise that, when added to training images, maximizes the discrepancy between the cross-attention maps generated for a user-specific token (e.g., <v>) and a general class-specific token (e.g., person or man/woman).

This is achieved by introducing a new loss component, cosine similarity loss ($L_{cos}$), into the standard reconstruction loss ($L_{rec}$) used for training diffusion models. The $L_{cos}$ term aims to minimize the cosine similarity between the attention maps of the user-specific token and the class-specific token. By pushing these attention maps apart, the model is discouraged from associating the user-specific token with specific facial features or other identifying characteristics. The adversarial perturbation is then generated using the Projected Gradient Descent (PGD) algorithm, optimizing a combined loss function: $L = (1 - \lambda) \cdot L_{rec} + \lambda \cdot L_{cos}$. The parameter $\lambda$ controls the balance between reconstruction fidelity and privacy protection.

Datasets

The paper uses the CelebA-HQ dataset for evaluation. This dataset is a high-resolution version of CelebA, containing over 10,000 celebrity identities and over 200,000 face images. For their experiments, the authors selected a curated subset of 8 subjects from CelebA-HQ, ensuring diversity in gender, ethnicity, and age. The images were downscaled to 512x512 resolution, which is compatible with the standard Stable Diffusion model. No new benchmarks were introduced; the evaluation was conducted on existing datasets.

Key Insights and Ideas

  • Targeting Cross-Attention is Key: The paper highlights that cross-attention layers are the most sensitive components for personalization in T2I diffusion models. Manipulating these layers directly offers a more efficient and effective way to disrupt identity preservation compared to attacking the entire model.
  • Discrepancy Maximization for Privacy: Instead of trying to completely erase a token's identity (which might lead to unusable images), CoPSAM focuses on creating a divergence between the user-specific token's attention and the general class token's attention. This subtle shift is enough to prevent the model from learning specific identity features.
  • Cosine Similarity as a Privacy Metric: The introduction of cosine similarity as a loss component is a novel way to quantify and minimize the alignment between different attention maps, directly contributing to privacy protection.
  • Efficiency at Low Noise Budgets: A significant finding is that CoPSAM achieves strong privacy protection even with very small noise budgets (e.g., $\eta = 4/255$), outperforming other methods that require higher noise levels. This is crucial for maintaining the imperceptible nature of the adversarial perturbations.

Key Results

  • Quantitative Performance: CoPSAM achieved the best scores across all evaluated metrics (ISM, FDFR, FID, SER-FIQ) when compared to existing methods like MIST, Anti-DreamBooth, and CAAT, particularly at a noise budget of $\eta = 8/255$. For instance, CoPSAM achieved an Identity Score Matching (ISM) of 0.4993 and a Fréchet Inception Distance (FID) of 126.67, indicating a significant disruption of identity and dissimilarity from original images.
  • Qualitative Performance: Visualizations show that CoPSAM effectively disrupts the attention maps, shifting focus away from key facial features. This results in generated images that are less recognizable and harder to attribute to the original individual, while still maintaining reasonable visual quality.
  • Superiority at Low Noise: CoPSAM demonstrates comparable or better privacy protection than other methods even when using significantly lower noise budgets. For example, at $\eta = 4/255$, CoPSAM's performance is comparable to other methods using $\eta = 8/255$.

Limitations and Future Work

  • Computational Cost: While CoPSAM targets only cross-attention layers, the adversarial attack generation process still involves iterative optimization, which can be computationally intensive.
  • Generalizability: The current evaluation is primarily on face images from CelebA-HQ. Future work could explore the effectiveness of CoPSAM on other types of personalized content and datasets.
  • Balancing Privacy and Utility: While CoPSAM aims to preserve visual information, there's always a trade-off. Further research could explore more sophisticated methods to fine-tune this balance, ensuring that the generated images remain useful for their intended purpose while still being private.
  • Adaptive Attacks: The paper focuses on a specific type of adversarial attack. Future work could investigate how CoPSAM might fare against more adaptive or sophisticated attacks designed to circumvent its defenses.

Summary updated

BibTeX
@inproceedings{xu2024privacy,
  author = {Xide Xu and Muhammad Atif Butt and Sandesh Kamath and Bogdan Raducanu},
  title = {{Privacy Protection in Personalized Diffusion Models via Targeted Cross-Attention Adversarial Attack}},
  booktitle = {SafeGenAi @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=bmzFH3QpbW},
}
Figure