Separable Multi-Concept Erasure from Diffusion Models

Mengnan Zhao, Lihe Zhang, Tianhang Zheng, Yuqiu Kong, Baocai YinarXiv 2024

Abstract

Large-scale diffusion models, known for their impressive image generation capabilities, have raised concerns among researchers regarding social impacts, such as the imitation of copyrighted artistic styles. In response, existing approaches turn to machine unlearning techniques to eliminate unsafe concepts from pre-trained models. However, these methods compromise the generative performance and neglect the coupling among multi-concept erasures, as well as the concept restoration problem. To address these issues, we propose a Separable Multi-concept Eraser (SepME), which mainly includes two parts: the generation of concept-irrelevant representations and the weight decoupling. The former aims to avoid unlearning substantial information that is irrelevant to forgotten concepts. The latter separates optimizable model weights, making each weight increment correspond to a specific concept erasure without affecting generative performance on other concepts. Specifically, the weight increment for erasing a specified concept is formulated as a linear combination of solutions calculated based on other known undesirable concepts. Extensive experiments indicate the efficacy of our approach in eliminating concepts, preserving model performance, and offering flexibility in the erasure or recovery of various concepts.

Introduction

Large-scale diffusion models like Stable Diffusion are powerful tools for creative expression, yet they often inadvertently memorize copyrighted artistic styles or generate unsafe content. Machine Unlearning (MU) aims to "erase" these undesirable concepts from pre-trained models. However, current MU techniques face three major hurdles: collateral damage to unrelated "safe" images, entanglement where removing one concept interferes with another, and the "undo" problem, where restoration of an erased concept is nearly impossible without full retraining.

Methodology

The proposed SepME (Separable Multi-concept Eraser) framework introduces a modular approach to concept management through two primary innovations: G-CiRs and Weight Decoupling.

Overview of the SepME framework compared to previous methods. (a) shows the standard approach, (b) details the G-CiRs component, and (c) illustrates the modular SepME training and testing phases.

1. G-CiRs (Generation of Concept-irrelevant Representations)

To prevent the model from forgetting general knowledge, G-CiRs focuses the unlearning process strictly on the noise associated with the target concept. It employs a correlation loss to ensure that representations of the forgotten concept in the updated model are uncorrelated with the original. Momentum-based early stopping is used to halt the process before it degrades the model's broader generative capabilities.

2. Weight Decoupling (WD)

This component enables the "separable" nature of the framework. By treating weight updates ($\Delta\theta$) as a linear algebra problem, the authors identify specific layers in cross-attention modules (to_k and to_v) responsible for mapping text to images. Weight increments for specific concepts are formulated as linear combinations of solutions derived from other known concepts. This ensures that an update intended to erase "Concept A" has near-zero impact on "Concept B," allowing for modular erasure and easy restoration by simply subtracting the specific weight increment.

Experimental Results

The researchers evaluated SepME using Stable Diffusion (v1.4/1.5) across nine artistic styles (e.g., Van Gogh, Picasso) and nine object classes from the Imagenette dataset. Performance was measured using LPIPS for perceptual similarity and Classification Accuracy (ACC) to verify erasure efficacy.

Visual comparison of style erasure across different methods (ORI, FMN, ESD, AbConcept, and Ours). SepME (Ours) effectively removes the target style while preserving the content and quality of non-targeted styles.

Key Findings

  • Superior Specificity: SepME reduced target style accuracy to near 0% while maintaining high quality for non-targeted styles.
  • Modular Flexibility: Independent weight increments can be combined ($\Delta\theta_1 + \Delta\theta_2$) to erase multiple concepts simultaneously with minimal performance hits on unrelated concepts.
  • Efficiency: SepME requires significantly fewer parameter modifications than baselines. For instance, in Van Gogh erasure, SepME's weight deviation was 43.17, compared to 158.3 for AbConcept.
  • Restoration Capability: Because updates are decoupled, "restoring" a concept is as simple as subtracting its specific weight increment, moving toward flexible concept management rather than permanent deletion.

Conclusion

SepME provides a surgical and modular solution for concept erasure in diffusion models. By treating unlearning as a null space problem and focusing on concept-irrelevant representations, it achieves high specificity and allows for concept restoration. Future work will investigate adversarial robustness and the automation of concept-relevant layer discovery in larger architectures.

Summary updated

BibTeX
@misc{zhao2024separable,
  author = {Mengnan Zhao and Lihe Zhang and Tianhang Zheng and Yuqiu Kong and Baocai Yin},
  title = {{Separable Multi-Concept Erasure from Diffusion Models}},
  year = {2024},
  eprint = {2402.05947},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.05947},
}
Figure