Skip to content

Bi-Erasing: A bidirectional framework for concept removal in diffusion modelsBi-Erasing: A Bidirectional Framework for Concept Removal in Diffusion Models

arXiv· arXiv:2512.13039· Hao Chen, Yiwei Wang, Songze LiSoutheast University; University of California, MercedIndexed by this site · 7 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors propose the diffusion model concept erasure framework Bi-Erasing, claiming that on I2P nudity erasure its Pre-ASR is 15.25%, lower than SDv1.5's 82.39%, while maintaining usability.

Threat modelThe defender fine-tunes Stable Diffusion to erase harmful concepts (nudity, celebrities, artistic styles); the attacker applies adversarial perturbations to text prompts per UnlearnDiffAtk, attempting to make the erased model regenerate the erased content, with robustness measured by ASR before and after the attack.

Questions
Concept erasure in diffusion models is mostly one-way suppression: it only pushes away harmful concepts and lacks positive guidance toward safe alternatives, which the authors claim leads to over-suppression, trajectory drift, and semantic collapse, and is easily bypassed by adversarial prompts.
Methods
Proposes Bi-Erasing: on the joint text-image representation, it introduces decoupled negative (suppressing harmful semantics) and positive (guiding toward safe substitutes) image branches, together with a CLIP semantic mask to filter the background, and uses dynamic weights to balance the bidirectional guidance; the trainable UNet is aligned to a push-pull objective constructed from a frozen reference UNet.
Experiments and results
On I2P nudity erasure, Bi-Erasing achieves Pre-ASR of 15.25% and Post-ASR of 62.71%, lower than most baselines but higher than SalUn (1.41%/11.27%), while SalUn's FID reaches 33.62; the authors claim this method achieves a better balance between erasure effectiveness and generation quality.
Limitations and future work
The authors state in the conclusion and Appendix A that selecting suitable guidance concepts for positive guidance remains a challenge. The experiments cover only nudity, celebrity, and artistic style erasure on SDv1.5, adversarial evaluation uses only UnlearnDiffAtk, and the paper does not report the erased model's robustness against entirely new attack methods.
Experimental setupBi-Erasing · I2P、COCO-10K et al. · ASR、FID et al.
Evaluated models
Bi-Erasing
Benchmarks
I2PCOCO-10KCelebrity erasure (1/10/100 celebrities)Artists erasure
Metrics
ASRFIDCLIP scoreNudeNet detection countsACCeACCsHcHa
AI summaryBi-Erasing is a bidirectional image-guided framework for concept removal in diffusion models that can perform concept suppression and safety enhancement simultaneously. The method is based on a joint representation of text prompts and corresponding images, using a negative branch to suppress harmful semantics and a positive branch to provide visual guidance for safe alternative content, with mask filtering to prevent interference from irrelevant content. Experiments show that Bi-Erasing outperforms baseline methods in balancing concept removal effectiveness and visual fidelity.

Bi-Erasing is a bidirectional image-guided framework for concept removal in diffusion models that can perform concept suppression and safety enhancement simultaneously. The method is based on a joint representation of text prompts and corresponding images, using a negative branch to suppress harmful semantics and a positive branch to provide visual guidance for safe alternative content, with mask filtering to prevent interference from irrelevant content. Experiments show that Bi-Erasing outperforms baseline methods in balancing concept removal effectiveness and visual fidelity.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that one-directional concept erasure struggles to balance erasure effectiveness and generation quality, and propose the bidirectional image-guided Bi-Erasing framework.

    Core problem: how concept erasure in diffusion models can effectively remove harmful concepts while maintaining generation quality and adversarial robustness.

    • Problem setting: Stable Diffusion-type text-to-image models may generate explicit or copyright-infringing content; concept erasure removes these semantics by fine-tuning the model, which the authors call the mainstream mitigation approach.
    • Shortcomings of existing methods: The authors state that most methods use one-directional suppression (negative guidance, attention suppression, adversarial unlearning, etc.), which has two problems: over-suppression pushes the denoising trajectory away from the natural image manifold, causing trajectory drift and semantic collapse; and the lack of constructive signals to fill the erased region produces "content voids" (hollow, desaturated, contextually incoherent regions). In addition, pure text supervision struggles to characterize complex visual concepts and can be bypassed by semantic ambiguity or adversarial prompts.
    • Core observation: The authors conducted preliminary experiments on ESD with three variants—negative-only, positive-only, and negative-positive (Table 2)—and state that one-directional erasure harms generation quality regardless of which images are used, whereas bidirectional guidance stabilizes the diffusion trajectory; Figure 2 shows that in ESD, ASR decreases monotonically with suppression strength η, while FID rises after η=1.0, which the authors call the critical point where over-suppression destroys benign semantics.
    • Proposed method: Bi-Erasing, which decouples cross-attention channels to simultaneously inject a negative image prior (the concept to be erased) and a positive image prior (a safe substitute), forming a "push-pull" dynamic, and adds a mask to filter background interference.
    • Threat model:
      • Defender's goal: the fine-tuned model no longer generates the target concepts (nudity, celebrities, artistic styles) while remaining usable for benign prompts.
      • Attacker's capability: adversarial perturbation of text prompts following UnlearnDiffAtk (Zhang et al., 2024b), attempting to make the erased model regenerate harmful content.
      • Victim system: erased Stable Diffusion v1.5.
      • Success criterion: the proportion of generated images detected by NudeNet before and after the attack (Pre-ASR / Post-ASR).
  2. What related research exists?

    Related work falls into three groups: T2I diffusion models, model-level concept erasure methods, and text-image collaborative erasure; the baselines are 8 erasure methods plus SDv1.5.

    T2I diffusion models

    • Rombach et al. (2022a)'s LDM—encodes prompts into embeddings with a CLIP text encoder and interacts with the U-Net via cross-attention to achieve text-controlled generation; it is the base architecture for concept erasure.
    • Ho et al. (2020), Song et al. (2020)—denoising diffusion probabilistic models and DDIM; the paper derives the conditional noise prediction objective of diffusion models from these (Equation 1).

    Model-level concept erasure: The paper divides mitigation strategies into three categories—data filtering, post-processing filtering, and model fine-tuning—and notes that open-source diffusion frameworks can often bypass post-processing filters. Representative model-level methods:

    • ESD (Gandikota et al., 2023)—uses a probabilistic suppression mechanism to push the generation distribution away from the target concept; UCE (Gandikota et al., 2024)—formulates erasure as image editing with safety constraints.
    • FMN (Zhang et al., 2024a)—suppresses attention activations associated with undesirable semantics; SPM (Lyu et al., 2024)—uses a semi-permeable adapter for non-invasive erasure.
    • SalUn (Fan et al., 2024)—uses gradient saliency to locate concept-related parameters and retrain them; AdvUnlearn (Zhang et al., 2024c)—adversarial optimization to enhance robustness; MACE (Lu et al., 2024)—uses closed-form LoRA fusion to handle multi-concept interference.

    Text-image collaborative erasure

    • Co-Erasing (Li et al., 2025a)—introduces decoupled attention branches with text and visual dual priors (Equations 2–4) to narrow the semantic gap between modalities. The paper notes that it still optimizes along only a single suppression direction, which may lead to over-forgetting or loss of benign semantics; this limitation directly motivates the bidirectional regularization design of Bi-Erasing.

    Baselines and benchmarks: The experiments compare ESD, Co-Erasing, UCE, SPM, SalUn, AdvUnlearn, FMN, MACE, and unerased SDv1.5, all using officially released configurations; safety erasure uses the I2P dataset and COCO-10K, general-domain erasure follows MACE's celebrity (1/10/100) and artist benchmarks, and adversarial robustness is evaluated following UnlearnDiffAtk.

    The authors position this paper as follows: existing methods are mostly one-directional (only suppressing or only retaining), whereas Bi-Erasing uses a bidirectional push-pull framework to simultaneously regularize removal and reconstruction, bridging this gap.

  3. How does the paper address this problem?

    Bi-Erasing uses decoupled negative/positive image branches to construct a push-pull objective, adds CLIP semantic masks and dynamic weights, and trains a learnable UNet to align with a frozen reference UNet.

    Overall idea: Building on text-image joint erasure, "suppressing harmful concepts" and "guiding safe alternatives" are split into two image branches optimized simultaneously, forming a push-pull dynamic; the framework is named Bi-Erasing.

    Problem setting and motivation

    • The authors formalize one-way erasure as a negative reconstruction loss containing only a "push" (Equation 5), and point out that its prediction formula is ϵ̂θ = ϵref_u + η(ϵref_u − ϵref_−) (Equation 6): as the suppression strength η increases, the prediction is pushed away from the neutral manifold, which the authors claim leads to gradient instability and trajectory drift.
    • Without a positive reconstruction signal, the model receives no guidance to fill the erased region, which the authors claim produces hollow, desaturated outputs.

    Mask-guided image preprocessing

    • A CLIP segmentation model is used offline to generate a semantic mask M ∈ [0,1]^(H×W); according to $ \tilde{I} = M \odot I + (1-M) \odot \bar{c} $, the background is replaced with the image mean color, keeping only the target region before sending it to the CLIP visual encoder.
    • Masks are generated from multiple text prompts: human/nudity-related concepts use ensemble prompts such as 'woman' and 'man', while ordinary objects or animals directly use the class name (e.g., 'cat', 'motorcycle') (Figure 8).
    • The masked negative image I_neg and positive image I_pos are passed through the frozen CLIP visual encoder E_img and projector P to obtain c_neg and c_pos, which are injected into the UNet's decoupled cross-attention processor.

    Bidirectional training objective

    • The frozen reference UNet (θ0) produces predictions ϵref_u, ϵref_neg, ϵref_pos under unconditional, c_neg, and c_pos respectively; a negative target $ \epsilon^{neg}_{tgt} = \epsilon^{ref}_u - \eta(\epsilon^{ref}_{neg} - \epsilon^{ref}_u) $ and a positive target ϵtgt_pos = ϵref_pos + ω(ϵref_pos − ϵref_u) are constructed, where η>0 and ω>0 are the bidirectional guidance strengths.
    • The trainable UNet (θ) fits both targets with an MSE loss, and the total objective is L = λ_neg·L_neg + λ_pos·L_pos.
    • In the training strategy, the push is applied first and the pull is gradually increased (dynamic weights); the authors claim this achieves more balanced bidirectional control.

    Algorithm flow and training details

    • Appendix Algorithm 1: each round samples I_neg and I_pos, applies masks, encodes, projects, queries θ0 to construct the bidirectional targets, computes the weighted loss and updates θ, iterating until T_max (the specific value is not stated in the paper).
    • Appendix B: training uses 2 RTX 4090 GPUs, learning rate 10^-5, converging in about 40 minutes; Figure 7 shows the training loss first rises then falls, essentially converging in the forward guidance stage and fluctuating in the reverse guidance stage.

    Success criteria and evaluation methods

    • Safety erasure: 4,703 images are generated on I2P, detection counts are tallied with NudeNet (threshold 0.5, 6 exposed categories), and CLIP scores are computed; usability uses FID and CLIP scores on COCO-10K; robustness perturbs prompts per UnlearnDiffAtk and compares ASR before and after attack.
    • General-domain erasure: celebrity erasure uses the GCD evaluator (OpenCV DNN face detector, face margin 0.2) to compute ACCe, ACCs, and their harmonic mean Hc, with 5 prompt templates and multiple seeds; artist erasure uses CLIPe, CLIPs, and their difference Ha.
  4. What experiments did the paper conduct?

    Compares 8 baselines on I2P nudity erasure and celebrity/artist erasure, and conducts ablations on training data size, weight strategy, and components.

    Experimental setup

    • Subject under test: the erasure methods are applied to SDv1.5; compared against ESD, Co-Erasing, UCE, SPM, SalUn, AdvUnlearn, FMN, MACE, and unerased SDv1.5, with each baseline using its officially released configuration.
    • Safety erasure: the target concept is nudity; 4,703 images are generated on I2P (with the random seeds provided by the fixed dataset), and NudeNet with a threshold of 0.5 counts detections across 6 exposure categories.
    • Usability: FID (cleanFID library) and CLIP score are computed on COCO-10K.
    • Robustness: adversarial perturbations are added to prompts following UnlearnDiffAtk, and Pre-ASR and Post-ASR are compared.
    • General-domain erasure: celebrity erasure is split into three tiers of 1/10/100 celebrities, with metrics ACCe, ACCs, Hc; artist erasure uses metrics CLIPe, CLIPs, Ha; this group of experiments integrates Bi-Erasing into MACE.
    • Parameters and ablation experiments: 500 images are generated with 5 nudity-related prompts, and ASR, CLIP, FID are measured; the number of training images is set to 10/50/100/200; the weight ratio ranges from 1:9 to 9:1, comparing fixed and dynamic weights.

    Main results

    Table 3 (I2P nudity erasure; detection counts are NudeNet counts; lower Total is better):

    Swipe horizontally to read the table

    MethodCoco-FID↓Coco-CLIP↑Total↓Pre-ASR%↓Post-ASR%↓
    SDv1.514.750.31550782.3995.77
    Ours18.460.3048015.2562.71
    Co-Erasing18.960.30810417.4670.65
    SPM17.480.3128154.9391.55
    SalUn33.620.287291.4111.27
    UCE17.10.30914421.8379.58
    FMN16.860.30854988.0397.89
    ESD18.180.30213020.4276.05
    • The authors state that SalUn has the lowest detection count and ASR, but with FID 33.62 and CLIP 0.287, its generation quality is poor; this method ranks second on most detection categories, and the authors state that it achieves the best balance between erasure effectiveness and generation quality.
    • Exception: this method's Post-ASR is 62.71%, i.e., more than 60% of attacks still succeed after adversarial perturbation; the authors do not explain this absolute value and only state that robustness is better than ESD, FMN, etc.
    • Based on Figure 4, the authors state that ESD and FMN still generate harmful images under attack, SalUn defends against attacks but its outputs are unrelated to the prompt, and AdvUnlearn produces style shift at the cost of defending against attacks, whereas this method maintains both defense and style consistency.

    General-domain erasure (Table 4)

    • Celebrity erasure: Bi+MACE's Hc on 1/10/100 celebrities is 0.971, 0.963, 0.954 respectively, all slightly higher than MACE (0.968, 0.963, 0.946); the main text states "retention accuracy above 0.95", but the table's ACCs are 0.937–0.944, inconsistent with that statement; the table takes precedence.
    • Artist erasure: Bi+MACE's Ha is 1.81, lower than MACE's 2.05; the authors acknowledge that this method is not optimal on this task but state that it improves over SD (Ha −0.68).
    • The authors state that this method can scale with MACE to erasing hundreds of concepts and preserves harmless concepts more stably.

    Parameter analysis

    • Number of training images (Figure 5, 500 images, 5 prompts): as images increase from 10 to 200, ASR drops from 0.436 to 0.18, and FID improves from 19.03 to 18.46; the main text states that CLIP "improves" from 28.25 to 26.75 (this metric is labeled as lower is better). The gain from 10→50 images is the largest, and 200 training images are ultimately chosen.
    • Weight strategy (Figure 6): fixed weight ratios from 1:9 to 9:1 are compared with dynamic weights; the authors state that dynamic weights outperform fixed weights in both FID and ASR at every ratio; the figure labels FID 18.5→18.4→18.2 and ASR 0.180 under dynamic weights (the horizontal axis is the weight ratio; the exact point-by-point correspondence is not clearly labeled in the figure).

    Other ablations and analyses

    • Component ablation (Table 5, 500 images): Text-only ASR 0.48; Text+BI 0.32; BI-only 0.90; BI+Mask 0.86; Full Method 0.18, CLIP 25.40, FID 18.46. The authors state that the text constraint is essential for semantic grounding and that the combination of the three components is optimal.
    • One-directional vs bidirectional preliminary experiment (Table 2, nudity erasure variants based on ESD): Neg–Pos has CLIP 28.20, ASR 0.57, FID 15.48; Negative-only has ASR 0.48 but CLIP 27.47; Positive-only has ASR 0.86; SD v1.5 has ASR 0.91. The authors state that the one-directional variants have poor generation quality and that the bidirectional approach achieves a better trade-off.
    • Suppression strength analysis (Figure 2, ESD): as η increases from 0.2 to 1.5, ASR decreases monotonically, and FID rises after η=1.0; the authors state that there is a critical point where over-suppression destroys benign semantics.
    • Training loss (Figure 7): under dynamic weights, the loss first rises and then falls; it basically converges in the forward guidance stage and fluctuates in the reverse guidance stage.
  5. What are some points that can be further explored?

    The authors only note that the selection of positive guidance concepts still requires research; the experiments cover three types of concepts on SDv1.5 and one adversarial attack.

    Limitations and future directions noted by the authors

    • Selection of positive guidance concepts: Both the conclusion and Appendix A state that identifying suitable guidance concepts for positive guidance remains a challenge and warrants further research. This is the only limitation explicitly stated in the paper.

    Scope of experimental coverage

    • Models tested: All erasure experiments are conducted on SDv1.5 (Section 4.1); the general-domain experiments integrate Bi-Erasing on MACE (Table 4); the paper does not report results on other versions of diffusion models.
    • Erased concepts: Safety erasure selects only the single concept of nudity (Section 4.2); the general domain covers 1/10/100 celebrities and artist styles (Table 4).
    • Adversarial evaluation: Robustness is evaluated only with one attack method, UnlearnDiffAtk (Section 4.2); the paper does not report resistance results against other adversarial prompt attacks.
    • Detection and evaluation: Nudity detection uses NudeNet (threshold 0.5), celebrities use the GCD evaluator (OpenCV DNN face detector), and artists use CLIP scores (Appendix B); all are automatic metrics, and the paper does not report human evaluation.
    • Training and inference configuration: Training uses 2 RTX 4090 GPUs, learning rate 10^-5, about 40 minutes; generation uses 50-step inference, 4 seconds per image (Appendix B); the paper does not report the specific values of η, ω, λ_neg, λ_pos, or T_max.
  6. Summarize the main content of the paper

    Bi-Erasing performs concept erasure with bidirectional image guidance, and the authors claim it balances erasure effectiveness, generation quality, and adversarial robustness on I2P nudity erasure.

    A defense paper on concept erasure in diffusion models, addressing the problem that the one-way suppression paradigm the authors describe struggles to balance erasure effectiveness and generation quality.

    • Problem: Existing erasure methods only push away harmful concepts and lack positive guidance toward safe alternatives; the authors claim this leads to over-suppression, trajectory drift, semantic collapse, and "hollow content", and that pure text supervision can be bypassed by adversarial prompts.
    • Method: Bi-Erasing injects a negative image prior (suppressing the target concept) and a positive image prior (guiding safe alternatives) into decoupled cross-attention, and a trainable UNet fits the push-pull targets constructed by a frozen reference UNet; CLIP semantic masks filter the background, and dynamic weights balance the bidirectional guidance.
    • Safety erasure results (Table 3, I2P nudity erasure): Pre-ASR 15.25%, Post-ASR 62.71%, NudeNet total detections 80, all lower than SDv1.5 (82.39%, 95.77%, 507) and most baselines such as ESD and FMN; SalUn has lower ASR (1.41%/11.27%) but its FID reaches 33.62, and the authors claim this method offers a better trade-off.
    • General-domain results (Table 4): Bi+MACE achieves Hc of 0.971/0.963/0.954 on 1/10/100 celebrity erasure, slightly higher than MACE; artist erasure Ha of 1.81 falls short of MACE's 2.05, and the authors acknowledge that this task does not reach the best performance.
    • Ablation (Table 5): The full method has ASR 0.18; removing text supervision (BI-only) raises it to 0.90, and the authors claim text grounding, bidirectional guidance, and masks are complementary.
    • Authors' conclusion: Bidirectional image guidance can balance erasure effectiveness, generation quality, and attack resistance; selecting suitable guidance concepts for positive guidance still requires research.

Related papers

Show 3 more papers
Read originalarxiv.org