Safe and Reliable Diffusion Models via Subspace Projection

Huiqiang Chen, Tianqing Zhu, Linlin Wang, Xin Yu, Longxiang Gao +1 more
3/21/2025
cs.CVcs.LG
diffusion-flow

No confident code implementation found for this paper.

Abstract

Large-scale text-to-image (T2I) diffusion models have revolutionized image generation, enabling the synthesis of highly detailed visuals from textual descriptions. However, these models may inadvertently generate inappropriate content, such as copyrighted works or offensive images.

Show full abstract

While existing methods attempt to eliminate specific unwanted concepts, they often fail to ensure complete removal, allowing the concept to reappear in subtle forms. For instance, a model may successfully avoid generating images in Van Gogh's style when explicitly prompted with 'Van Gogh', yet still reproduce his signature artwork when given the prompt 'Starry Night'. In this paper, we propose SAFER, a novel and efficient approach for thoroughly removing target concepts from diffusion models. At a high level, SAFER is inspired by the observed low-dimensional structure of the text embedding space. The method first identifies a concept-specific subspace $S_c$ associated with the target concept c. It then projects the prompt embeddings onto the complementary subspace of $S_c$, effectively erasing the concept from the generated images. Since concepts can be abstract and difficult to fully capture using natural language alone, we employ textual inversion to learn an optimized embedding of the target concept from a reference image. This enables more precise subspace estimation and enhances removal performance. Furthermore, we introduce a subspace expansion strategy to ensure comprehensive and robust concept erasure. Extensive experiments demonstrate that SAFER consistently and effectively erases unwanted concepts from diffusion models while preserving generation quality.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2025safe,
  title  = {Safe and Reliable Diffusion Models via Subspace Projection},
  author = {Huiqiang Chen and Tianqing Zhu and Linlin Wang and Xin Yu and Longxiang Gao and Wanlei Zhou},
  year   = {2025},
  eprint = {2503.16835},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.16835v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.16835.svg)](https://codeofpaper.com/paper/2503.16835)

Discussion