Detecting, Explaining, and Mitigating Memorization in Diffusion Models
About
Recent breakthroughs in diffusion models have exhibited exceptional image-generation capabilities. However, studies show that some outputs are merely replications of training data. Such replications present potential legal challenges for model owners, especially when the generated content contains proprietary information. In this work, we introduce a straightforward yet effective method for detecting memorized prompts by inspecting the magnitude of text-conditional predictions. Our proposed method seamlessly integrates without disrupting sampling algorithms, and delivers high accuracy even at the first generation step, with a single generation per prompt. Building on our detection strategy, we unveil an explainable approach that shows the contribution of individual words or tokens to memorization. This offers an interactive medium for users to adjust their prompts. Moreover, we propose two strategies i.e., to mitigate memorization by leveraging the magnitude of text-conditional predictions, either through minimization during inference or filtering during training. These proposed strategies effectively counteract memorization while maintaining high-generation quality. Code is available at https://github.com/YuxinWenRick/diffusion_memorization.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Memorization Detection | Stable Diffusion V1.4 | AUC0.9977 | 28 | |
| Memorization Detection | SD 2.1 | AUC0.9967 | 24 | |
| Text-to-Image Generation | Pokémon | CLIP Score31.5 | 21 | |
| Text-to-Image Generation | LAION-Art | SSCD0.74 | 18 | |
| Text-to-Image Generation | CelebA-HQ | SSCD0.74 | 18 | |
| Memorization Detection | SD LAION Lexica COCO-2017 GPT-4 1000 prompts 1.4 (Evaluation) | AUC0.9983 | 16 | |
| Text-to-Image Generation | Webster 500 Memorized Prompts 2023 v1.4 (430 with available target images) | SSCD (Target)0.4187 | 13 | |
| Memorization mitigation | Stable Diffusion 1.4 | Memorization Rate46.2 | 13 | |
| Text-conditional image generation | LAION-10k | CLIP Score0.293 | 10 | |
| Memorization Detection | Stable Diffusion 1.5 | AUC (All Steps)99.76 | 9 |