ForceForget: Reinforcement Concept Removal for Enhancing Safety in Text-to-Image Models
About
With the advance of generative AI, the text-to-image (T2I) model has the ability to generate various contents. However, T2I models still can generate unsafe contents. To alleviate this issue, various concept erasing methods are proposed. However, existing methods tend to excessively erase unsafe concepts and suppress benign concepts contained in harmful prompts, which can negatively affect model utility. In this paper, we focus on eliminating unsafe content while maintaining model capability in safe semantic meaning interpretation by optimizing the concept erasing reward (CER) with reinforcement learning. To avoid overly content erasure, we introduce the Safe Adapter to project partial text embedding for efficient concept regulation in cross-attention layers. 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 compared with existing state-of-the-art (SOTA) concept erasing methods. In terms of robustness, our method outperforms counterparts against red-teaming tools. Moreover, we showcase the proposed approach is more effective in emerging image-to-image (I2I) scenarios compared with others. Lastly, we extend our method to erase general concepts, such as artistic styles and objects. Disclaimer: This paper includes discussions of sexually explicit content that may be offensive to certain readers. All images used in this work are synthesized or from public datasets.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Object Removal | Imagenette Other Classes v1 (test) | Accuracy80.1 | 40 | |
| Object Removal | Imagenette Erased Class v1 (test) | Accuracy0.6 | 40 | |
| Nudity Removal | DiffusionDB Explicit subset | Nudity Removal Rate100 | 12 | |
| Nudity Removal | Implicit sex-related prompts | Nudity Removal Rate100 | 12 | |
| Inappropriate Content Removal | I2P (test) | Hate9.5 | 12 | |
| Artistic Concept Erasing | Van Gogh Artistic Style | LS_e46 | 8 | |
| Image-to-Image Unsafe Content Erasing | I2I Nude Input | NRR96.4 | 6 | |
| Image-to-Image Unsafe Content Erasing | I2I Non-nude Input | NRR100 | 6 | |
| Artistic Concept Erasing | Kelly McKernan Artistic Style | LS_e Score40 | 6 |