ShieldDiff:通过强化学习抑制扩散模型的色情内容生成
ShieldDiff: Suppressing Sexual Content Generation from Diffusion Models through Reinforcement Learning
AI总结:
本研究提出ShieldDiff方法,通过含CLIP和裸露奖励的定制奖励函数强化学习微调扩散模型,有效抑制T2I模型的NSFW内容生成,同时保留图像质量,鲁棒性优于现有SOTA方法,可作为相关基准。
摘要:
随着生成式人工智能的发展,文本生成图像(T2I)模型已具备生成各类内容的能力。然而,生成内容无法被完全控制,T2I模型存在生成含不适内容的不安全图像的潜在风险。在本研究中,我们聚焦于消除T2I模型的NSFW(工作场所不宜)内容生成,同时保持生成图像的高质量,具体方式为通过优化精心设计的内容安全奖励函数,利用强化学习微调预训练扩散模型。所提方法利用由CLIP(对比语言-图像预训练)奖励和裸露内容奖励构成的定制化奖励函数,剔除预训练模型中存在的裸露内容,同时将对应语义保持在安全范围内。通过这种方式,由于不安全视觉表征在潜在空间中被消减,T2I模型对不安全对抗性提示具备鲁棒性。我们在不同数据集上开展了大量实验,结果证明所提方法可有效减少不安全内容生成,同时保留良性图像及由不安全提示生成图像的高保真度。我们与5种现有最先进(SOTA)方法进行了对比,在色情内容去除和图像质量保留方面取得了具有竞争力的性能。在鲁棒性方面,我们的方法在SOTA黑盒攻击模型下的表现优于同类方法。此外,我们构建的方法可作为具备语义相关安全对齐能力的反NSFW生成基准。
英文摘要:
With the advance of generative AI, the text-to-image (T2I) model has the ability to generate various contents. However, the generated contents cannot be fully controlled. There is a potential risk that T2I model can generate unsafe images with uncomfortable contents. In our work, we focus on eliminating the NSFW (not safe for work) content generation from T2I model while maintaining the high quality of generated images by fine-tuning the pre-trained diffusion model via reinforcement learning by optimizing the well-designed content-safe reward function. The proposed method leverages a customized reward function consisting of the CLIP (Contrastive Language-Image Pre-training) and nudity rewards to prune the nudity contents that adhere to the pret-rained model and keep the corresponding semantic meaning on the safe side. In this way, the T2I model is robust to unsafe adversarial prompts since unsafe visual representations are mitigated from latent space. Extensive experiments conducted on different datasets demonstrate the effectiveness of the proposed method in alleviating unsafe content generation while preserving the high-fidelity of benign images as well as images generated by unsafe prompts. We compare with five existing state-of-the-art (SOTA) methods and achieve competitive performance on sexual content removal and image quality retention. In terms of robustness, our method outperforms counterparts under the SOTA black-box attacking model. Furthermore, our constructed method can be a benchmark for anti-NSFW generation with semantically-relevant safe alignment.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。