Bi-Erasing: A Bidirectional Framework for Concept Removal in Diffusion Models

Hao Chen, Yiwei Wang, Songze LiarXiv 2025 · DOI

Introduction

As text-to-image models like Stable Diffusion become mainstream, the risk of generating "Not Safe For Work" (NSFW) content, infringing on copyrights, or mimicking specific artists without permission has grown significantly. "Concept erasure" is the process of fine-tuning these models to "forget" these specific semantics. However, existing methods typically suffer from a unidirectional problem: they focus solely on suppression—telling the model to move away from a "bad" concept. This often leads to trajectory drift, where the denoising path enters "no man's land" in the latent space, causing semantic collapse and content voids. In such cases, the model generates distorted images or incoherent regions because it lacks guidance on what should replace the erased concept.

The Bi-Erasing Framework

To address these issues, we propose Bi-Erasing (Bidirectional Image-Guided Concept Erasure). This framework introduces a "push-pull" mechanism that simultaneously suppresses harmful concepts while providing explicit visual guidance for safe alternatives.

Bidirectional Image Guidance

Unlike previous methods that rely on ambiguous text prompts, Bi-Erasing uses pairs of images: a "negative" image representing the concept to be removed and a "positive" image representing a safe alternative. This creates a dynamic where the negative branch repels the model from unsafe semantics while the positive branch attracts it toward coherent, safe replacements. This bidirectional guidance acts as a regularizer; by providing a "safe" destination, the model doesn't have to guess where to go once the "unsafe" concept is removed.

Negative image guidance representing the concept to be removed.

Technical Innovations

  • Mask-Guided Preprocessing: Real-world training images are often cluttered. To prevent the model from accidentally erasing benign background elements (like trees or buildings) while targeting a specific concept, we use CLIP-based segmentation to create masks. These masks ensure the model focuses only on the specific pixels relevant to the target concept.
  • Dynamic Weighting & Decoupled Attention: The framework injects image priors into the UNet via decoupled cross-attention channels. A dynamic weighting mechanism adaptively balances the "push" and "pull" forces throughout training to maintain a stable trajectory and prevent the model from over-correcting.

Evaluation and Key Results

We evaluated Bi-Erasing across safety-related erasure (nudity), general-domain erasure (celebrity identities), and usability (COCO-10K).

  • Superior Erasure Efficacy: On the I2P (Inappropriate Image Prompts) dataset, Bi-Erasing achieved an Attack Success Rate (ASR) of 0.18, significantly lower than the 0.48 seen in text-only methods. This indicates a much more thorough removal of the target concept.
  • High Image Fidelity: Bi-Erasing maintained a much better FID score (18.46) compared to baselines like SalUn (33.62). This demonstrates that the bidirectional guidance prevents the quality degradation and "hollow" regions common in other erasure techniques.
  • Robustness to Attacks: The model proved significantly more resistant to adversarial prompt attacks, such as those from UnlearnDiffAtk. While baselines often "broke" and generated harmful content when faced with clever prompt engineering, Bi-Erasing remained stable.
  • Scalability: When integrated with frameworks like MACE, Bi-Erasing successfully erased up to 100 different celebrity identities while preserving over 95% accuracy for unrelated concepts, showing its potential for large-scale safety filtering.

Conclusion and Future Work

Bi-Erasing demonstrates that bidirectional guidance acts as a powerful regularizer for concept erasure. By providing a "safe" destination, the model avoids the "trajectory drift" that plagues purely suppressive methods. Future work will focus on automating the selection of "positive" anchors—perhaps using Large Language Models to suggest semantically coherent but safe alternatives—and reducing the computational overhead of image-guided training branches.

Summary updated

BibTeX
@misc{chen2025bi,
  author = {Hao Chen and Yiwei Wang and Songze Li},
  title = {{Bi-Erasing: A Bidirectional Framework for Concept Removal in Diffusion Models}},
  year = {2025},
  eprint = {2512.13039},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.13039},
}
Figure