DuMo: Dual Encoder Modulation Network for Precise Concept Erasure

Feng Han, Kai Chen, Chao Gong, Zhipeng Wei, Jingjing Chen, Yu-Gang Jiang

Abstract

Large-scale text-to-image (T2I) diffusion models have demonstrated remarkable generative capabilities but often inadvertently produce Not-Safe-For-Work (NSFW) content or infringe upon copyrighted artistic styles. Existing concept erasure methods typically fine-tune the model's backbone, which frequently results in the degradation of unrelated generative performance. This paper introduces DuMo (Dual encoder Modulation network), a novel framework that achieves precise concept erasure by targeting skip connections rather than the primary U-Net backbone. By utilizing an Eraser with PRior Knowledge (EPR) module and a Time-Layer MOdulation (TLMO) strategy, DuMo effectively removes target concepts while preserving the structural integrity and quality of non-target images.

Introduction

Text-to-image models like Stable Diffusion are trained on massive, often uncurated datasets, leading to the internal representation of sensitive or protected concepts. When researchers attempt to "erase" these concepts, the standard approach involves fine-tuning the weights of the U-Net backbone. However, the backbone is responsible for the fundamental low-frequency components and structural skeleton of an image. Modifying these weights often leads to a "collateral damage" effect: erasing a specific concept like "nudity" might inadvertently damage the model's ability to render a sunset or a clothed person, resulting in visual artifacts and a loss of fine detail.

The challenge lies in performing a "surgical" removal—eliminating the forbidden concept while leaving the rest of the model’s knowledge base untouched. DuMo addresses this by decoupling the erasure process from the generative backbone.

Methodology

DuMo introduces two primary technical innovations to achieve precise erasure without performance degradation:

1. Eraser with PRior Knowledge (EPR)

Instead of modifying the frozen backbone U-Net, DuMo employs a secondary, plug-and-play encoder. This module specifically targets the skip connection features of the U-Net. Research into diffusion architectures suggests that skip connections primarily carry high-frequency information related to style and detail, whereas the backbone handles the global structure. By intervening at the skip connections, the EPR module can "edit" the specific stylistic or conceptual details of an image without compromising the underlying structural skeleton. This approach allows the model to retain its original generative "memory" for unrelated tasks.

2. Time-Layer MOdulation (TLMO)

Concept erasure is not a uniform requirement across the entire denoising process. The authors observed that different layers and timesteps have varying sensitivities to different types of concepts. For instance, erasing a structural concept like "nudity" requires different intervention strengths than erasing a stylistic concept like "Van Gogh." TLMO introduces learnable factors that automatically scale the influence of the EPR module at each denoising step and within each U-Net layer. This dynamic scaling balances the strength of the erasure against the necessity of preserving the model's overall generative quality.

Experimental Setup

The researchers evaluated DuMo across three distinct tasks to test its versatility and precision:

  • Explicit Content Erasure: Evaluated using the I2P (Inappropriate Image Prompts) dataset, which contains 4,703 toxic prompts designed to trigger NSFW outputs.
  • Non-Target Preservation: Tested on COCO-30K to ensure that the erasure of specific concepts does not degrade the model's ability to generate high-quality, unrelated images. Performance was measured via FID (Fréchet Inception Distance) and CLIP scores.
  • Artistic and Identity Erasure: Tested using custom prompt sets for popular characters (e.g., Snoopy, Mickey Mouse) and famous artists (e.g., Van Gogh, Rembrandt, Warhol) to evaluate the removal of specific identities and styles.

Key Results

DuMo achieved state-of-the-art (SOTA) results across all benchmarks, demonstrating a superior balance between erasure and preservation:

  • NSFW Erasure: In Nudenet detection tests, DuMo resulted in only 34 detected nude parts, significantly outperforming previous SOTA methods such as SDD (41 detections) and ESD-u (121 detections).
  • Generative Quality: On the COCO-30K benchmark, DuMo maintained a high CLIP Score of 30.87 and a low FID of 2.06. These metrics confirm that the model's general generative capabilities remain intact after the erasure process.
  • Style Removal: For erasing specific artistic styles like Van Gogh and Rembrandt, DuMo achieved an average LPIPS_da of 0.387, surpassing the previous best (SPM at 0.299). Qualitative analysis showed that DuMo successfully removed the forbidden style while maintaining the original composition of the prompt better than competing methods.

Discussion and Insights

The success of DuMo highlights several critical insights for the field of AI safety and model editing. First, the "where" of the intervention matters as much as the "how." By shifting the focus from the U-Net backbone to skip connections, DuMo successfully decouples the what (the concept) from the how (the structural generation). Second, the trade-off between erasure and preservation is not static; the TLMO module demonstrates that adaptive, time-sensitive modulation is necessary to handle the diverse requirements of different concepts.

Limitations and Future Work

Despite its effectiveness, DuMo presents several avenues for future research:

  • Multi-Concept Scaling: While the framework can erase multiple concepts simultaneously (e.g., several cartoon characters), the potential for interference when scaling to hundreds of disparate concepts remains an open question.
  • Training Overhead: DuMo requires training an external module for each specific erasure task. While more effective than simple prompt filtering, it is more resource-intensive.
  • Inference Latency: The addition of a dual encoder during inference may impact speed, although modifications to skip connections are generally considered lightweight.

In conclusion, DuMo represents a significant step forward in precise concept erasure, offering a robust method for making large-scale T2I models safer and more compliant without sacrificing their creative power.

Summary updated

BibTeX
@inproceedings{han2025dumo,
  author = {Feng Han and Kai Chen and Chao Gong and Zhipeng Wei and Jingjing Chen and Yu-Gang Jiang},
  title = {{DuMo: Dual Encoder Modulation Network for Precise Concept Erasure}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i3.32343},
}
Figure