Prompt-Agnostic Adversarial Perturbation for Customized Diffusion Models

Diffusion models have revolutionized customized text-to-image generation, allowing for efficient synthesis of photos from personal data with textual descriptions. However, these advancements bring forth risks including privacy breaches and unauthorized replication of artworks. Previous researches primarily center around using prompt-specific methods to generate adversarial examples to protect personal images, yet the effectiveness of existing methods is hindered by constrained adaptability to different prompts. In this paper, we introduce a Prompt-Agnostic Adversarial Perturbation (PAP) method for customized diffusion models. PAP first models the prompt distribution using a Laplace Approximation, and then produces prompt-agnostic perturbations by maximizing a disturbance expectation based on the modeled distribution. This approach effectively tackles the prompt-agnostic attacks, leading to improved defense stability. Extensive experiments in face privacy and artistic style protection, demonstrate the superior generalization of PAP in comparison to existing techniques. Our project page is available at https://github.com/vancyland/Prompt-Agnostic-Adversarial-Perturbation-for-Customized-Diffusion-Models.github.io.

Paper

References (74)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer Q3Lh5/10 · confidence 4/52024-06-19

Summary

The paper presents Prompt-Agnostic Adversarial Perturbation (PAP), a method to enhance privacy and security in customized text-to-image diffusion models like Stable Diffusion. These models, while enabling high-quality image synthesis, pose risks of privacy breaches and unauthorized artwork usage. Existing adversarial methods, limited by their reliance on specific prompts, fail with unseen prompts. PAP addresses this by modeling the prompt distribution with a Laplace approximation, generating robust perturbations effective against diverse prompts. Experiments on datasets such as VGGFace2 and Wikiart show PAP's superior performance and robustness. This method provides a significant improvement in protecting images from unauthorized use and manipulation in diffusion models.

Strengths

1. I appreciate the idea of designing a prompt-agnostic adversarial perturbation for privacy protection. 2. The method is concise and paper organization is logical. 3. The formulas, tables, and figures in the paper are easy to follow.

Weaknesses

1. Although the motivation for designing a prompt-agnostic adversarial perturbation is reasonable, the method seems too complex. That is, maybe we can expand the prompt with LLM to get a lot of prompts (different scenes) containing the keyword. Then we can use all these prompts together as a set to calculate a gradient for adversarial attack at each iteration. 2. For definition 3.1, the assumption of Z = p(x0, c0) as a constant lacks evidence. Minor suggestion: 1. For tables 1, 2, 3, and 4, there are some left parentheses that have no space between the previous metric names.

Questions

Please see weakness

Rating

5

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

N/A

Reviewer nNzN7/10 · confidence 3/52024-07-11

Summary

This paper proposes a novel adversarial training method for text-to-image diffusion models, enhancing robustness against prompt-agnostic attacks. Specifically, the authors utilize prompts (embeddings) from a prompt distribution rather than a specific prompt for adversarial training. The proposed method is evaluated in the contexts of face privacy and artistic style protection.

Strengths

1. This paper aims to bridge the gap between prompt-specific protection and prompt-agnostic protection, which is essential for text-to-image diffusion models. 2. The proposed method is principled and effective. 3. The empirical evaluation is comprehensive and convincing.

Weaknesses

See Questions.

Questions

1. Is the proposed protection method robust against adversarial prompts? 2. Is it possible to demonstrate the connection between the test prompt and the prompt distribution used for training? Alternatively, can sampled embeddings from the prompt distribution be projected into natural language? Such studies would be beneficial for illustrating that the constructed prompt distribution adequately covers potential user prompts.

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors discussed the limitations in Appendix H.

Reviewer JLDf5/10 · confidence 4/52024-07-13

Summary

- This work is about a method to craft perturbation images to protect users/artists from personalized text to image diffusion methods (specifically DreamBooth and Textual inversion), that generalize better to unseen prompts than previous works. - The core algorithm is "Prompt-Agnostic Adversarial Perturbation" (PAP). Instead of crafting the perturbation with a fixed condition prompt, PAP model the prompt distribution as a Gaussian dist and sample prompt embedding from it during the perturbation crafting process. - The prompt distribution is modeled as a Gaussian using Laplace approximation. The mean is estimated by minimizing the diffusion loss starting from a reference prompt. The variance is approximated using a simplified formula based on the difference between the reference and estimated prompts, and their respective loss values. - Experiments show PAP outperforms previous prompt-specific methods on metrics like FID, CLIP similarity, and LPIPS across different datasets (CelebA-HQ, VGGFace2, Wikiart) and generalization to unseen test prompts. (after rebuttal) The authors addressed my main concerns by including results from newer methods with PAP, and clarifying the inconsistent implementation. Despite some issues regarding efficiency and application to more recent personalized techniques/model, I've increased my score from 4 to 5.

Strengths

- The paper is generally well-written, with consistent improvement on unseen prompts when compare with previous works. - PAP is simple and easy to use, not very costly to add on top of other protection method - The explanation of the method is easy to understand - The paper also includes performance under DiffPure, and the result under DiffPure seems to be positive - The supplementary is informative, with extensive evaluation

Weaknesses

The experimental evaluation need to be improved: - Apply PAP to other methods like AdvDM + PAP, not just Anti-DreamBooth ASPL, and other recent method such as Diff-Protect [1] to better demonstrate that PAP is a good plug in to the current methods. - Lacking a simple baseline of adding Gaussian noise to $c_N$ to show the value of approximating H. - Questionable metric choices, as using LAION aesthetic score for Celeb-HQ and VGGFace2 datasets is not well-justified for face images. And images generated from protected model often contain high-frequency and colorful patterns, which may lead to unreliable LAION aesthetic scores. - Also evaluation need to include identity score (as used in Anti-DreamBooth) for face datasets, which is crucial to ensure generated images don't contain user's identity. - A suggestion would be to add an assessment against recent encoder-based personalized techniques, such as InstantID [2], for a more comprehensive comparison.

Questions

- I wonder if PAP can help reduce the sensitivity to the initial prompt when crafting the perturbation between different domain. For example, when testing on human faces or artwork datasets like Wikiart, how would the performance change if in both dataset, $c_0$ is initialized with a very general term, such as an empty string "" - Pseudo code seems to be not consistent with the implementation. As in your provided implementation, $c_N$ will be recalculated every step in M, while the pseudo code $c_N$ is calculated only once at the start. I wonder if it could affect the performance of the method - Nitpick: L296 Typo BROSQUE. Table 4 need to have metrics such as FID, LPIPS to be more comprehensive

Rating

5

Confidence

4

Soundness

2

Presentation

3

Contribution

2

Limitations

Since PAP still build upon anti-dreambooth, 4-6 minutues A800 when crafting a set of images is still very impractical. Again, I want to see performance of PAP on top of more recent/efficient methods [1] Xue, Haotian, et al. "Toward effective protection against diffusion-based mimicry through score distillation." The Twelfth International Conference on Learning Representations. 2023. [2] Wang, Qixun, et al. "Instantid: Zero-shot identity-preserving generation in seconds." arXiv preprint arXiv:2401.07519 (2024).

Reviewer JLDf2024-08-10

Addressed my concerns

I appreciate the additional experiments and clarifications you provided. In general, the performance when applying PAP to recent methods seem to be positive, and the authors also provide the missing metrics. I have few comments: - Regarding Gaussian noise baseline, I notice the variance magnitude tested (1, 5, 10, 20) are quite high with a trend that the higher variance the worst. I wonder if the variance is smaller (0.1, 0.5) could yield improve performance. - I expect that PAP could help in term of initial prompt sensitivity when crafting protection on different domains (since the first step is approximating $c_n$). But the quality just slightly lower than the Clean version make me wonder that incorporate PAP could make the protection even more sensitive to the initial prompt (usually a string like "a photo of a person" for human face domain - which we both know that it is not optimal choice) - One additional question: For Stable Diffusion 2.x models, which incorporate masking in the text encoder (unlike the fixed 77 tokens cross attention in SD1.x), how does the PAP algorithm adapt to handle variable-length prompts? (Additional comments) - In my opinion, current protection methods still struggle against recent encoder-based personalization, since these personalized methods enable Unet to condition not only on the input latent (which usually OOD because of the added adversarial noise), but also the additional visual information from other encoder(s), so it can by pass the protection. To effectively protect against this threat, incorporating these encoder(s) into the protection mechanism could be a potential future work that you might try. - The community is moving towards more recent models, methods, and it's like a cat and mouse game. While PAP shows promising in improving protection on SD, I encourage the authors to continue working on and improving the method, particularly as new personalization techniques and new models emerge While I still have some concerns, the authors did clarify most of my questions and provide results for the missing experiments. I will raise my score to 5

Authorsrebuttal2024-08-11

Thanks for your feedback. We hope we can further address your concerns and engage in constructive discussions.

Thank you for your valuable reply. We are glad to address the additional questions you've raised, and we hope our responses will further address your concerns and facilitate constructive discussions on the future work of PAP. > Q1: If the variance is smaller (0.1, 0.5) could yield improved performance. Firstly, within the tested variance range (1, 5, 10, 20), the performance trend is indeed a slight initial rise (from 1 to 5) followed by a decline (from 5 to 20). Additionally, to better address your concern, we have supplemented **Table R7** with control experiments using variances of 0.1 and 0.5 as you mentioned. **Table R7**: Simple Baseline of Adding Gaussian Noise | Variance | LPIPS(↑) | FDFR(↑) | ISM(↓) | BRISQUE(↑) | |----|-----|------|---------|------| | 0.1 | 0.66 | 0.62 | 0.41 | 30.98| | 0.5 | 0.66 | 0.63 | 0.39 | 31.74| | H | 0.70 | 0.67 | 0.34 | 35.02| > Q2: Incorporate PAP could make the protection even more sensitive to the initial prompt. Regarding the quality in **Table R5** being slightly lower than the Clean version, we note that these results used the same setup as described in the paper: 20 gradient descent steps starting from "" to obtain $c_N$. We plan to adapt our approach by dynamically tuning the learning rate and stepsize. Moreover, instead of using an empty string, further experiments are needed to identify a generic $c_0$ and optimization settings, thereby eliminating the need to manually select prompts for different tasks. > Q3: How does the PAP algorithm adapt to handle variable-length prompts? Currently, for SD2.x, our approach is to pad all prompts to a fixed length of 77 tokens for processing, consistent with our approach for SD1.x. Although this may not be the optimal solution, we adopted this strategy for the following reasons: 1. Prompt Length Sufficiency: In general, a length of 77 tokens is adequate to accommodate most prompts, as they rarely exceed this limit in practical applications. 2. Optimization Landscape Smoothness: Maintaining a consistent prompt length ensures a smoother optimization landscape, which is advantageous for solving the optimization problem effectively. Despite this approach's potential limitations, the results in **Figure R1** from the rebuttal.pdf demonstrate that our method still achieves satisfactory performance. > Additional comments1: Incorporating more encoders into the protection mechanism While the paper considers attacks using the VAE encoder, which is one of the most popular and widely used image encoders in SD, other encoders are worth considering for integration into the attack process. This could help enhance the generalizability of the proposed method. To this end, in our future work, we will further design attack strategies for image encoder-agnostic scenarios. Specifically, we will consider several of the most commonly used image encoders, and by integrating these encoders with our modeling of image feature distributions, we will sample and attack the feature distributions of images across various encoders. This will be further fused with our original PAP approach in the future. We anticipate that the above proposed **Prompt & Encoder-Agnostic Perturbation (PEAP)** method will be robust against various attack prompts and image encoders, aligning with our pursuit of image protection that better reflects real-world scenarios. > Additional comments2: Continue working on and improving the method, as new personalization techniques and new models emerge Thank you for your encouragement. We are aware of the rapid development in the field of customized generation, such as the InstantX series. We will continue to enhance PAP by experimenting with new personalization techniques and models, while also striving to improve the attack efficiency and reduce the computational cost of PAP. Finally, we sincerely appreciate your suggestions and encouragement for our work. We welcome further discussions on the ideas mentioned, and we are deeply grateful for your willingness to increase your score.

Authorsrebuttal2024-08-13

A gentle reminder

Dear Reviewer JLDf, We greatly appreciate your comprehensive review and valuable feedback. As noted in your recent response, we have addressed most of your concerns, and you kindly expressed your intention to raise the score. With the discussion deadline approaches, we respectfully remind you of your previous commitment to increase the score and sincerely request your final assessment. Best, Authors

Reviewer JA4c6/10 · confidence 4/52024-07-17

Summary

The authors propose a prompt-agnostic adversarial perturbation (PAP) method for customized diffusion models. They first use Laplace approximation to model the prompt distribution. Then they derive the attacks by maximizing the disturbance expectation. Extensive experiments on three datasets validate their performance.

Strengths

Experiments on three datasets. Interesting topic. Mathematical Proof.

Weaknesses

Potential semantic gap between the estimated prompts and natural language. Experiment Scope: only do experiments on SD 1-5.

Questions

1 This paper only mentions the time complexity of their approach in Line 226, but what are the time comparisons with baselines? 2 Only considering SD 1-5, however more versions of stable diffusion models and other diffusion models should also be considered. Could you please provide more results on other models to show the generalization of your approach? 3 The authors only show the average performance across 10 similar prompts. What is the performance of the trained prompts? 4 The authors use a Laplace to approximate the prompt distribution, but why is it a proper approximator? Additionally, in my point of view, the approximation is in the semantic space. However, the users will input natural language. Therefore, how to combat the domain gap is another concern.

Rating

6

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

Yes

Reviewer nNzN2024-08-11

Thank you for your response

Thank you to the authors for their efforts in addressing my concerns and conducting additional experiments. I will maintain my original rating.

Reviewer JA4c2024-08-14

Thanks for the rebuttal and parts of my concerns are addressed. I raise my score to 6.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC