用外部模型引导扩散模型生成安全内容,不需微调。
Towards SFW sampling for diffusion models via external conditioning
- 引入外部多模态模型作为条件,修正生成轨迹避免不良内容。
- 在Stable Diffusion上测试,显著降低裸露/暴力内容生成率。
- 无需微调,兼容用户自定义不安全类别,适合实际部署。
基于分数的生成模型(SBM),即扩散模型,是当前图像合成的主流方法。尽管性能卓越,但近期被曝出易生成非安全内容(如暴力、非自愿裸露)。现有防护方法依赖模型自身知识,多数需微调。本文探索使用外部源实现安全输出,提出一种安全生成(SFW)采样器,通过条件轨迹修正步骤,利用多模态模型引导样本远离不良区域。结合对比语言-图像预训练(CLIP),支持用户自定义不安全类别,适应不同场景。在文本到图像扩散模型Stable Diffusion上的实验表明,该方法有效降低显性内容生成,且在独立NSFW检测器评估下与微调方法相当。同时评估了对图像质量的影响,修正过程代价极小,对无需修正的样本影响可忽略。研究验证了该采样器适用于对齐的扩散模型,并展示了模型无关条件化在防止不当图像生成中的潜力。
原文摘要 · Abstract (English)
Score-based generative models (SBM), also known as diffusion models, are the de facto state of the art for image synthesis. Despite their unparalleled performance, SBMs have recently been in the spotlight for being tricked into creating not-safe-for-work (NSFW) content, such as violent images and non-consensual nudity. Current approaches that prevent unsafe generation are based on the models' own knowledge, and the majority of them require fine-tuning. This article explores the use of external sources for ensuring safe outputs in SBMs. Our safe-for-work (SFW) sampler implements a Conditional Trajectory Correction step that guides the samples away from undesired regions in the ambient space using multimodal models as the source of conditioning. Furthermore, using Contrastive Language Image Pre-training (CLIP), our method admits user-defined NSFW classes, which can vary in different settings. Our experiments on the text-to-image SBM Stable Diffusion validate that the proposed SFW sampler effectively reduces the generation of explicit content while being competitive with other fine-tuning-based approaches, as assessed via independent NSFW detectors. Moreover, we evaluate the impact of the SFW sampler on image quality and show that the proposed correction scheme comes at a minor cost with negligible effect on samples not needing correction. Our study confirms the suitability of the SFW sampler towards aligned SBM models and the potential of using model-agnostic conditioning for the prevention of unwanted images.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。