Abstract
Text-to-image diffusion models trained on massive, unfiltered internet datasets often internalize harmful concepts, including NSFW content and copyrighted styles. Existing erasure methods frequently suffer from "concept entanglement," where removing a target concept inadvertently degrades related benign concepts. We introduce a novel bilevel optimization framework that identifies and protects "adversarial concepts"—the specific vocabulary terms most sensitive to the erasure process. By dynamically safeguarding these vulnerable concepts, our approach achieves state-of-the-art performance in surgical concept removal while maintaining the integrity and visual quality of the remaining model.
Introduction
The rapid advancement of text-to-image diffusion models has been fueled by large-scale, often uncurated datasets. Consequently, these models can generate undesirable content such as violence, nudity, or specific artistic styles without authorization. While fine-tuning can be used to "erase" these concepts, the shared weights of the model lead to significant collateral damage. For instance, erasing "nudity" often degrades the model's ability to generate images of "women" or "people."
Previous attempts to mitigate this entanglement have relied on "neutral" anchors, such as the prompt "a photo," to stabilize the model's output. However, generic anchors fail to protect the specific regions of the latent space most affected by the erasure of a particular target.
Methodology: Adversarial Concept Preservation
The core of our approach is Adversarial Concept Preservation. We argue that the concepts most at risk during erasure are not generic neutral prompts, but rather those most semantically or visually related to the target. We propose a bilevel optimization framework to address this:
- Inner Loop (Adversarial Search): At each training step, the algorithm identifies the "adversarial concept"—the word in the model's vocabulary currently experiencing the greatest distortion due to the erasure of the target concept.
- Outer Loop (Surgical Erasure): The model weights are updated to erase the target concept while explicitly minimizing the change to the identified adversarial concept.
To handle the discrete nature of the vocabulary efficiently, we utilize the Gumbel-Softmax trick, allowing for a differentiable search across thousands of potential concepts.
As shown in the sensitivity spectrum, "neutral" concepts typically reside in the middle of the distribution. Protecting them does not safeguard the concepts most likely to suffer collateral damage. Our dynamic approach adapts as the model evolves during fine-tuning, ensuring the most vulnerable concepts are always protected.
Experiments and Results
We evaluated our method across three tasks: object erasure (using Imagenette), NSFW content removal (using the I2P dataset), and artistic style removal.
Object and Nudity Erasure
In object erasure tests, our method achieved a 98.6% Erasing Success Rate (ESR-1) while maintaining a 55.2% Preserving Success Rate (PSR-1), significantly outperforming baselines like Concept Ablation (CA), which only reached 44.2% PSR-1. For nudity erasure on the I2P dataset, we achieved the lowest Nudity Exposure Rate (NER) across all detection thresholds.
Image Quality
General image quality was assessed using the FID score on the COCO 30K dataset. Our method maintained the best FID score (15.52), indicating that the sanitized model's outputs remain visually consistent with the original model's quality. We also observed that without proper preservation, to-be-erased concepts often undergo "visual collapse," where they all converge toward a similar, non-descript background form.
Conclusion and Future Work
Adversarial Concept Preservation provides a robust mechanism for surgically removing undesirable content from diffusion models. By moving beyond static neutral anchors to a dynamic, adversarial protection scheme, we significantly reduce concept entanglement.
Future work will address current limitations, such as the dependence on a predefined vocabulary and the computational overhead of the inner-loop search. Potential improvements include expanding the search to multiple sensitive concepts simultaneously and exploring more complex divergence constraints to further harden models against degradation.
Summary updated