Source-linked AI summary
Adapt then Unlearn: Exploring Parameter Space Semantics for Unlearning in Generative Adversarial Networks
Piyush Tiwary, Atri Guha, Subhodip Panda, Prathosh A. P
TL;DR
The paper tackles unlearning undesired features from pre-trained GANs when the original training data are unavailable. It proposes a two-stage method that adapts to user-marked negative samples, then retrains on positive samples with parameter-space repulsion; its Bayesian analysis yields a contrastive-divergence-like objective for unlearning.
Problem
Unlearning undesired features from a pre-trained GAN is challenging when the training data used for pretraining are inaccessible.
Source: §1.2 · p. 2, §1.1 · p. 2Method
Adapt-then-Unlearn adapts the GAN to user-marked negative samples, then trains the original GAN on positive samples with a repulsion regularizer.
Source: §1.2 · p. 2Results
The Bayesian analysis shows that the regularized objective is contrastive-divergence-like, combining desired-distribution capture with separation from parameters associated with negative samples.
Source: §4 · pp. 8–9Takeaways & Limitations
The method is designed to unlearn features in high-fidelity GANs without significantly impacting other desirable features.
Source: §6 · p. 14The method requires users to identify or annotate negative samples, which can be challenging for subtle or complex features not readily annotated in standard datasets.
Source: §3.3 · p. 7
Abstract
from arXiv · showhide
Owing to the growing concerns about privacy and regulatory compliance, it is desirable to regulate the output of generative models. To that end, the objective of this work is to prevent the generation of outputs containing undesired features from a pre-trained Generative Adversarial Network (GAN) where the underlying training data set is inaccessible. Our approach is inspired by the observation that the parameter space of GANs exhibits meaningful directions that can be leveraged to suppress specific undesired features. However, such directions usually result in the degradation of the quality of generated samples. Our proposed two-stage method, known as 'Adapt-then-Unlearn,' excels at unlearning such undesirable features while also maintaining the quality of generated samples. In the initial stage, we adapt a pre-trained GAN on a set of negative samples (containing undesired features) provided by the user. Subsequently, we train the original pre-trained GAN using positive samples, along with a repulsion regularizer. This regularizer encourages the learned model parameters to move away from the parameters of the adapted model (first stage) while not degrading the generation quality. We provide theoretical insights into the proposed method. To the best of our knowledge, our approach stands as the first method addressing unlearning within the realm of high-fidelity GANs (such as StyleGAN). We validate the effectiveness of our method through comprehensive experiments, encompassing both class-level unlearning on the MNIST and AFHQ dataset and feature-level unlearning tasks on the CelebA-HQ dataset. Our code and implementation is available at: https://github.com/atriguha/Adapt_Unlearn.
1 Introduction
The paper addresses unlearning undesired features from pre-trained GANs when their training data are unavailable, while retaining desirable outputs. It proposes a two-stage, feedback-based method that uses parameter-space repulsion and reports a proof-of-concept on a mixture-of-Gaussians dataset.
1.1 Unlearning
- Unlearning must remove an undesired feature without harming previously acquired knowledge, and retraining from scratch is infeasible when the original training data are unavailable.The challenge can vary with the feature: the paper contrasts distinct MNIST classes with subtler, correlated CelebA features.Source: §1.1 · p. 2
1.2 Motivation and Contribution
- Adapt-then-Unlearn first adapts a pre-trained GAN to user-marked negative samples, then trains the original GAN on positive samples with a repulsion loss.The regularizer moves parameters away from those of the adapted generator while aiming to preserve sample quality.Source: §1.2 · p. 2
- Extrapolating along a parameter-space direction associated with negative samples can suppress them, but may deteriorate generated-image quality.The method instead combines adversarial training with repulsion from the adapted generator's parameters.Source: §1.2 · p. 3
- On the eight-center MoG example, the adapted generator produces negative modes, while the unlearned generator produces samples from the remaining modes.The figure illustrates unlearning two centers identified in the negative samples.Source: §1.2 · p. 3, Figure 1 · p. 3
- The method is designed for few-shot use, requiring only a very small amount of user-provided negative samples.The paper also reports testing class-level and feature-level unlearning across multiple datasets without compromising generated-sample quality.Source: §1.2 · p. 4
- The authors provide a Bayesian theoretical justification, showing that the regularization leads to a contrastive-divergence-like objective suited to unlearning.They describe the objective as balancing desired-distribution capture with repulsion from parameters associated with negative samples.Source: §1.2 · p. 4
2 Related Work
Prior machine-unlearning work addresses data deletion in supervised models, while existing GAN approaches have limitations for high-fidelity models and training-data access. The paper also draws on few-shot generative adaptation for its negative-sample stage.
2.1 Machine Unlearning
- Prior unlearning methods for supervised deep networks include scrubbing, fine-tuning filtered data, and pruning, but their generalization to high-fidelity GANs is unexplored.Retraining from scratch after removing unwanted data can be costly or infeasible for recursive requests.Source: §2.1 · p. 4
- Prior GAN methods primarily target DC-GANs; one StyleGAN approach assumes access to training samples and patches latent space, unlike this paper's parameter-space approach.The paper argues latent-space constraints may harm image quality and presents parameter-space semantics as unexplored for unlearning.Source: §2.1 · pp. 4–5
2.2 Few-Shot Generative Domain Adaptation
- Few-shot GAN adaptation methods use strategies including fine-tuning, restricted parameter updates, auxiliary networks, and latent-space optimization.The paper identifies negative-sample adaptation as a few-shot setting and uses EWC for that stage.Source: §2.2 · p. 5
3 Proposed Methodology
The method uses user-labeled positive and negative samples from a pre-trained GAN to define an unlearning target. It adapts toward negative samples, then retrains the original generator on positive samples while repelling its parameters from the adapted model.
3.1 Problem Formulation and Method Overview
- Users label generated samples as negative or positive, and unlearning aims for a generator that produces only positive samples.The two stages first adapt the generator to negative samples, then train the original generator on positive samples with repulsion from the adapted parameters.Source: §3.1 · pp. 5–6
3.2 Stage-1: Negative Adaptation
- Stage 1 adapts the pre-trained GAN to negative samples, using EWC to limit catastrophic forgetting when user-provided samples are few.The paper notes that negative-sample counts may be only tens or a few hundred.Source: §3.2 · p. 6
3.3 Stage-2: Unlearning
- Stage 2 trains the original GAN on positive samples with an adversarial term and repulsion loss that pushes parameters away from the negative-adapted parameters.The authors motivate this stage as a way to unlearn undesired features without the quality degradation that may accompany extrapolation alone.Source: §3.3 · pp. 6–7
3.4 Choice of Repulsion Loss
- The repulsion-loss choices are designed to move parameters away from θN; the paper says any function of ∥θ − θN∥2 with a global maximum at θN can serve this role.The paper relates its choice to repulsive interactions used to encourage diversity in deep ensembles.Source: §3.4 · p. 8
4 Theoretical Discussion
The theoretical analysis interprets the regularizer as part of a contrastive-divergence-like objective and relates parameter-space divergence to data-space divergence.
Theoretical Discussion
- Under a Bayesian setting with Laplace approximation, the optimal-discriminator objective combines adversarial learning and regularization in a contrastive-divergence-like form.It encourages capturing the pre-trained generator’s implicit distribution without negative-sample support while maximizing divergence from parameters that generate negative samples.Source: §4 · p. 8
- Assuming Gaussian parameter distributions, unlearning minimizes Jensen-Shannon divergence to the generator distribution without negative-sample support while maximizing divergence from negative-generating parameters.The two distributions compared in parameter space are the unlearning distribution and the distribution that leads to negative samples.Source: §4 · p. 9
- The repulsion regularizer moves the current parameter distribution away from the one responsible for undesired features, aligning with the stated unlearning objective.The passage notes that this behavior has also been shown to be crucial for unlearning in Bayesian settings.Source: §4 · p. 9
- For LNL2 or LEL2 repulsion, the corresponding data-space objectives upper-bound the parameter-space objectives; the argument uses the data-processing inequality.The passage says the result applies to KL and Hellinger divergence because both are f-divergences.Source: §4 · p. 9
5 Experiments and Results
Experiments test class-level and feature-level unlearning on MNIST, AFHQ, and CelebA-HQ, using PUL, FID, and Ret-FID to assess unlearning and generation quality. The authors report that LEL2 repulsion unlearns undesired features while maintaining sample quality, and outperforms the compared baselines in the reported settings.
5.1 Datasets
- The experiments cover class-level unlearning of MNIST digits and AFHQ animal classes, plus feature-level unlearning of Bangs, Hats, Bald, and Eyeglasses on CelebA-HQ.Class-level unlearning treats images as belonging to one class; feature-level unlearning allows multiple features in one image.Source: §5.1 · p. 9
5.2 Experimental Details
- A pre-trained classifier labels 1,000 generated samples as positive or negative for the two unlearning stages; the original dataset is used only for evaluation.The pre-trained GAN FIDs are 5.4 for MNIST, 8.1 for AFHQ, and 5.3 for CelebA-HQ.Source: §5.2 · p. 10, §5.3 · p. 11
5.3 Baselines and Evaluation Metrics
- Evaluation uses PUL for negative-sample reduction, FID for quality against the dataset without undesired samples, and Ret-FID against a GAN trained from scratch on the filtered dataset.Comparisons include repulsion-loss choices, extrapolation, classification-unlearning baselines, positive-sample adaptation baselines, and scratch training; results are means ± standard deviations across three runs.Source: §5.3 · pp. 10–11
5.4 Unlearning Results
- Across MNIST, AFHQ, and CelebA-HQ, LEL2 repulsion achieves PUL above 90% and stands out among methods with significant PUL.The reported comparison evaluates PUL, FID, and Ret-FID; the tables cover MNIST classes, AFHQ classes, and CelebA-HQ features.Source: §5.4 · pp. 11, 13, Table 1 · p. 12, Table 2 · p. 12
- On MNIST, LEL2 repulsion achieves PUL above 95% and the best FID and Ret-FID among compared methods; on AFHQ, the proposed method has the highest PUL while maintaining FID and Ret-FID.For AFHQ, PUL is highest for Cat unlearning and lowest for Dog unlearning.Source: §5.4 · pp. 12–13
- Extrapolation also reduces undesired samples but degrades generation quality more than repulsion; the reported FID drop is 6.88 points for extrapolation.For unlearning Hats, LEL2 repulsion drops FID by about 4.15 points, compared with 4.3 and 6.01 points for LNL2 repulsion.Source: §5.4 · p. 13
- For CelebA-HQ, extrapolation removes correlated female features when unlearning Bangs, whereas the proposed method unlearns Bangs while retaining other features.For AFHQ, the proposed method generates plausible images without artifacts, unlike extrapolation, which produces minor artifacts.Source: §5.4 · p. 13
5.5 Comparison with DC-GAN Baselines
- On MNIST with DC-GAN, the proposed method outperforms CUA and DRed across all metrics and scenarios, with significantly better Ret-FID than DRed.The authors also report that repulsion loss increases PUL by about 10.56% for Bangs and 9.72% for Hats; FID increases by 0.66 for Bangs and decreases by 0.21 for Hats.Source: §5.5 · pp. 13–14, Table 4 · p. 14, §5.6 · p. 14
6 Conclusion
The conclusion presents a two-stage method for unlearning features from high-fidelity GANs without access to their original training data, while aiming to preserve desirable features. It identifies toxicity and extension to other generative models as areas not addressed or left for future work.
6 Conclusion
- The method adapts a pre-trained GAN to negative samples, then uses positive samples and a repulsion regularizer to unlearn the undesired feature.The authors state that this can be done without significantly impacting other desirable features.Source: §6 · p. 14
- The study does not address toxicity because annotated datasets with explicit characteristics are unavailable.The authors note that explored features are subtle and interconnected, including hairstyles linked to gender and hats linked to accessories.Source: §6 · p. 14
- Applying the approach to iterative models such as diffusion models requires further study of parameter-space semantics and an effective negative-adaptation strategy.The authors identify rigorous theoretical guarantees as future work as well.Source: §6 · pp. 14–15
Broader Impact Statement
- The broader impact statement frames selective feature removal from pre-trained GANs without original training data as a way to refine deployed models that may generate problematic or biased content.It presents similar techniques for other generative models as potential future work.Source: Broader Impact Statement · p. 15
A Training Details
The appendix describes the GAN and classifier configurations, unlearning hyperparameters, and baseline implementations used in the experiments. Experiments ran on RTX-A6000 GPUs with 48 GB memory.
A Training Details
- Experiments ran on RTX-A6000 GPUs with 48 GB memory, and the authors provide code and implementation online.The code is identified as Adapt_Unlearn.Source: A Training Details · p. 20
A.1 Details of Pre-trained GAN
- The pre-trained GAN uses StyleGAN2, with images resized to 32×32 for MNIST and 256×256 for CelebA-HQ.Latent dimensions are 128 × 1 and 512 × 1, respectively; training lasts 2 × 10^5 epochs for MNIST and 3.6 × 10^5 for CelebA-HQ.Source: §A.1 · p. 20
A.2 Details of Pre-trained Classifiers
- Pre-trained classifiers provide positive and negative feedback samples and are also used to obtain evaluation metrics.MNIST uses LeNet, trained for 12 epochs with 99.07% test accuracy; CelebA-HQ uses ResNext50, trained for 10 epochs with 91.93% test accuracy.Source: §A.2 · p. 20
A.3 Unlearning Hyper-parameters
- The adaptation stage uses an EWC regularizer with λ = 5 × 10^8, while repulsion-loss hyperparameters are varied across experiments.γ is selected from 0.1, 1, and 10 for LIL2 repulsion; the excerpts specify ranges of 10 to 500 and 0.1 to 0.001 for other repulsion settings.Source: §A.3 · p. 20
A.4 Details of Baselines
- The classification baselines train the last 10 layers from scratch or pre-trained initialization, or fine-tune with ℓ1 weight regularization; CDC and RSSA code is used for few-shot adaptation.EU-k and CF-k use the respective last-layer strategies, while ℓ1-sparse fine-tunes on positive samples.Source: §A.4 · p. 21
B MNIST Qualitative Results
The MNIST qualitative results show that the proposed methods unlearn digits 1, 4, and 8, while the proposed method retains plausible image quality better than parameter-space extrapolation.
B MNIST Qualitative Results
- For unlearning digits 1, 4, and 8, the proposed method produces plausible image quality, whereas extrapolation unlearns at the expense of generated-image quality.Figure 4 displays the undesired classes in the top, second, and bottom rows, respectively.Source: B MNIST Qualitative Results · p. 21, Figure 4 · p. 21
C Proofs
The proofs connect the generator’s parameter-to-sample mapping with data-processing inequality and derive an objective involving the repulsion term. They also state a Gaussian-distribution interpretation of the Hellinger divergence.
C Proofs
- The derivation invokes the optimal discriminator and standard GAN results to substitute into an objective that includes Lrepulsion.Source: C Proofs · p. 21
- When pΘU follows a Gaussian distribution, the Hellinger divergence is described as a shifted negative Mahalanobis distance between distribution means.Source: C Proofs · p. 22
- The proof treats θ → Gθ(z) as a map from parameter space to generated samples and applies data-processing inequality.Source: C Proofs · p. 22
D Results with Curated Datasets
Curated dataset samples can be used for negative adaptation, with results comparable to using GAN-generated samples. The experiments cover class-level and feature-level unlearning across MNIST, AFHQ, and CelebA-HQ.
D Results with Curated Datasets
- Users can choose curated datasets when available, while GAN-generated-sample annotation avoids the need to create external datasets.Custom dataset creation can be challenging when the feature or class is subtle or complex.Source: D Results with Curated Datasets · p. 22
- The curated-sample experiments unlearn Class 8 on MNIST, Cat on AFHQ, and Bangs on CelebA-HQ.Negative adaptation uses samples labeled with the undesired feature, followed by retraining on the remaining samples.Source: D Results with Curated Datasets · pp. 22–23
- Curated samples achieve performance comparable to GAN-generated samples during negative adaptation.Table 6 compares PUL (↑), FID (↓), and Ret-FID (↓).Source: D Results with Curated Datasets · p. 23, Table 6 · p. 23
E Effect on other features after Unlearning
The proposed method limits changes to features other than the one being unlearned, while extrapolation often changes them substantially. The comparison uses percentage changes in feature occurrences before and after unlearning.
E Effect on other features after Unlearning
- The comparison generates 15,000 samples from each GAN and uses pretrained classifiers to measure feature occurrences before and after unlearning.A lower percentage change indicates better preservation of other features.Source: E Effect on other features after… · p. 23
- LEL2 repulsion produces the least change in most other features, whereas extrapolation often changes them substantially.For Bangs removal, extrapolation increases Male samples, while the proposed method makes only minor changes to that feature.Source: E Effect on other features after… · p. 23, Figure 5 · p. 24
F Visualization of Generated samples
The paper presents random samples generated before and after unlearning as qualitative views of generation quality across three datasets. It uses LEL2 repulsion for these visualizations because it performs best in most cases.
F Visualization of Generated samples
- The visualizations use LEL2 repulsion, which gives the best performance in most cases.Source: F Visualization of Generated samples · p. 24
- Figures 6–8 show random MNIST, AFHQ, and CelebA-HQ samples before and after unlearning as qualitative views of generation quality.Quantitative generation-quality results are reported separately in Section 5.4.Source: F Visualization of Generated samples · p. 24, Figure 6 · p. 25, Figure 7 · p. 25
Related papers
This paper cites
- Score-Based Generative Modeling through Stochastic Differential Equations2020
- Hierarchical Text-Conditional Image Generation with CLIP Latents2022
- Generative Modeling by Estimating Gradients of the Data Distribution2019
- Progressive Growing of GANs for Improved Quality, Stability, and Variation2017
- Analyzing and Improving the Image Quality of StyleGAN2019
- Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift2019