NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

WeditGAN: Few-Shot Image Generation via Latent Space Relocation

Yuxuan Duan, Li Niu, Yan Hong, Liqing Zhang

Introduction

Generative Adversarial Networks (GANs), particularly architectures like StyleGAN, have achieved remarkable success in synthesizing high-resolution, photorealistic images. However, these models are notoriously data-hungry, typically requiring tens of thousands of images to learn a robust distribution. In many practical scenarios, we are faced with the challenge of Few-Shot Image Generation (FSIG), where only a handful of target images (e.g., 10 examples) are available. WeditGAN introduces a novel approach to this problem by shifting the focus from retraining model weights to relocating the latent space.

The Challenge of Few-Shot Generation

When training on extremely small datasets, standard GANs suffer from two primary failure modes: overfitting and mode collapse. Overfitting occurs when the discriminator memorizes the few training samples, forcing the generator to produce exact replicas of those images. Mode collapse results in a loss of diversity, where the generator ignores the rich variety of the source domain and converges on a single "average" representation of the target style.

Existing solutions often involve fine-tuning a pre-trained model. However, these methods struggle with a "fidelity-diversity dilemma." Strong regularization preserves diversity but fails to capture the target style (low fidelity), while weak regularization allows the model to capture the style but leads to collapsed diversity. WeditGAN bypasses this by keeping the generator's internal knowledge intact.

Methodology: Latent Space Relocation

The core insight behind WeditGAN is the observation that related domains—such as human faces and artistic sketches—share similar underlying manifolds in their latent spaces. Instead of altering the generator's weights to change how it interprets latent codes, WeditGAN learns to "relocate" the source distribution to the target domain within the intermediate latent space ($W+$).

Latent space relocation concept. WeditGAN shifts the source latent manifold to the target domain using a learned vector Δw, preserving the original structural diversity.

By learning a constant offset, $\Delta w$, the model transforms a source latent code into a target code: $w_{target} = w_{source} + \Delta w$. Because the generator remains fixed, the structural relationships and diversity present in the source domain (like pose, expression, and identity) are naturally preserved in the target domain. This minimalist approach updates only approximately 0.04% of the total generator parameters, significantly reducing the risk of overfitting.

Architecture and Regularization

The WeditGAN framework incorporates several key components to refine this relocation process. While a constant $\Delta w$ handles the primary domain shift, the authors introduce AlphaModules—tiny neural networks that predict image-specific intensity adjustments ($\alpha$). This allows the model to handle edge cases where a uniform shift might be too aggressive or insufficient.

The WeditGAN pipeline showing the fixed generator and the integration of the alpha-module.

To ensure that the learned shift only affects the "style" and not the "content," the authors employ Perpendicular Regularization (+perp). This constraint ensures that the $\Delta w$ vector is perpendicular to the variations in the source manifold, preventing unintended changes to attributes like gender or pose. Additionally, a feature-level contrastive loss (+CL) is used to align the source and target features, ensuring that the semantic meaning of the image is preserved across the domain shift.

Experimental Results

WeditGAN was evaluated across diverse source-to-target pairs, including FFHQ faces to sketches, babies, and various artistic styles (Modigliani, Raphael), as well as church-to-haunted house and car-to-wrecked car transitions. In all cases, the target dataset consisted of only 10 images.

Quantitatively, WeditGAN consistently outperformed state-of-the-art methods like CDC and RSSA. It achieved significantly lower Fréchet Inception Distance (FID) and Kernel Inception Distance (KID) scores, indicating higher fidelity to the target style. Simultaneously, it maintained high LPIPS scores, proving that it preserves the diversity of the source dataset far better than methods that fine-tune the generator weights. For instance, on the Sketch task, WeditGAN achieved an FID of 35.41, a marked improvement over previous benchmarks.

Conclusion

WeditGAN demonstrates that for few-shot adaptation between related domains, "editing" the latent space is more effective than retraining the generator. By freezing the generator and learning a simple relocation vector, the model achieves an optimal balance between style fidelity and structural diversity. This approach not only provides a robust solution for data-scarce environments but also allows a single model to function in both source and target domains simultaneously by simply toggling the learned offset.

Summary updated

BibTeX
@inproceedings{duan2024weditgan,
  author = {Yuxuan Duan and Li Niu and Yan Hong and Liqing Zhang},
  title = {{WeditGAN: Few-Shot Image Generation via Latent Space Relocation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i2.27932},
}
Figure