DynaGAN: Dynamic Few-shot Adaptation of GANs to Multiple Domains

Seongtae Kim, Kyoungkook Kang, Geonung Kim, Seung-Hwan Baek, Sunghyun Cho

Introduction

Generative Adversarial Networks (GANs), such as StyleGAN2, have demonstrated an unparalleled ability to synthesize hyper-realistic images. However, these models typically require thousands of training samples to master a specific domain. Few-shot domain adaptation has emerged as a solution, allowing a pretrained model (e.g., trained on human faces) to be fine-tuned to a data-scarce target domain (e.g., oil paintings) using only a handful of images.

Despite its promise, current few-shot adaptation techniques are largely limited to one-to-one mappings. Adapting a single generator to multiple distinct styles currently requires training and storing a separate model for each domain. This approach is computationally expensive and fails to leverage the shared structural knowledge common across related domains. DynaGAN addresses these limitations by introducing a framework that enables a single GAN to adapt to multiple target domains simultaneously while maintaining high synthesis quality and model efficiency.

Methodology

DynaGAN departs from the traditional fine-tuning paradigm by introducing a lightweight adaptation module that modulates a fixed, pretrained generator.

1. The Adaptation Hyper-network

Instead of directly updating the weights of the source GAN, DynaGAN employs a small auxiliary hyper-network. This network receives a "domain condition vector"—a unique identifier for the target style—and predicts the necessary weight modulations to transform the source output into the target domain. This architecture allows a single model to store the knowledge of multiple domains within the parameters of the hyper-network.

2. Rank-1 Tensor Decomposition

Predicting full weight updates for high-resolution GANs is memory-prohibitive. To ensure the hyper-network remains lightweight, the authors utilize rank-1 decomposition. Rather than generating a massive 4D convolutional weight tensor, the hyper-network predicts three small 1D vectors. The outer product of these vectors forms the weight update, significantly reducing the parameter count while retaining sufficient expressive power.

3. Weight Modulation Strategies

The framework applies two distinct types of changes to the generator layers:

  • Filter-wise Scaling ($\delta$): Adjusts the importance of existing features.
  • Residual Weight Addition ($\Delta\phi$): Introduces new stylistic features not present in the source model.

4. Contrastive-Adaptation Loss

To prevent the model from producing a generic "average" of all target styles, DynaGAN utilizes a specialized loss function based on CLIP (Contrastive Language-Image Pre-training) embeddings. This loss encourages the generator to produce images that are closely aligned with the specific target domain while remaining distinct from other domains in the multi-task setup.

Experimental Evaluation

The researchers evaluated DynaGAN across three diverse multi-domain scenarios using source models pretrained on FFHQ (human faces) and AFHQ Cat:

  • Cat-to-Dogs: Adapting a cat generator to five different dog breeds.
  • Cat-to-Animals: Adapting to ten wild animal species (e.g., fox, lion, tiger).
  • Real-to-Artificial Faces: Adapting a human face generator to nine artistic styles, including sketches, museum portraits (MetFace), and Ukiyo-e prints.

Key Results and Insights

Quantitative and Qualitative Performance

DynaGAN demonstrates significant improvements over existing few-shot methods. In the "Cat-to-animals" task, DynaGAN achieved a Fréchet Inception Distance (FID) of 38.37, vastly outperforming the previous state-of-the-art method, FS-ada, which scored 80.80. Qualitatively, DynaGAN avoids the structural deformations and "melted" artifacts common in baseline models when performing complex transformations, such as converting feline features to canine features.

Preservation of Latent Semantics

A critical advantage of DynaGAN is that it preserves the semantic properties of the original latent space. Because the underlying generator weights are modulated rather than replaced, users can still apply latent space editing tools (like StyleCLIP or InterfaceGAN) to the adapted model. This allows for the manipulation of pose, age, or expression even after the subject has been transformed into a different domain, such as a statue or a cartoon.

Efficiency and Interpolation

DynaGAN is highly efficient, requiring approximately 40M parameters to manage ten domains, compared to the 300M+ parameters required by traditional one-to-one adaptation methods. Furthermore, because the domain condition is a continuous vector, the model can perform smooth interpolations between domains, effectively morphing an image across multiple styles in a single transition.

Discussion and Limitations

While DynaGAN represents a significant step forward, it faces challenges when the "domain gap" between the source and target is extreme. For instance, adapting a human face generator to a non-humanoid animal often fails because the source model lacks the necessary underlying structural knowledge. Additionally, in one-shot scenarios, the model may overfit to specific details of the single target image (e.g., assuming all "statues" must wear the glasses present in the target image).

Future research may focus on bridging larger domain gaps and developing automated methods for discovering shared features across even more diverse datasets.

Summary updated

Abstract

Few-shot domain adaptation to multiple domains aims to learn a complex image distribution across multiple domains from a few training images. A na\"ive solution here is to train a separate model for each domain using few-shot domain adaptation methods. Unfortunately, this approach mandates linearly-scaled computational resources both in memory and computation time and, more importantly, such separate models cannot exploit the shared knowledge between target domains. In this paper, we propose DynaGAN, a novel few-shot domain-adaptation method for multiple target domains. DynaGAN has an adaptation module, which is a hyper-network that dynamically adapts a pretrained GAN model into the multiple target domains. Hence, we can fully exploit the shared knowledge across target domains and avoid the linearly-scaled computational requirements. As it is still computationally challenging to adapt a large-size GAN model, we design our adaptation module light-weight using the rank-1 tensor decomposition. Lastly, we propose a contrastive-adaptation loss suitable for multi-domain few-shot adaptation. We validate the effectiveness of our method through extensive qualitative and quantitative evaluations.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Cat-to-dogsDynaGANFID55.08Image Generation · few-shot
Source quote
L391: \multirow{3}{*}{DynaGAN} │ FID │ \downarrow │ 55.08 │ 38.37 │ 97.23
Cat-to-dogsMTG-extFID55.84Image Generation · few-shot
Source quote
L388: \multirow{3}{*}{MTG-ext} │ FID │ \downarrow │ 55.84 │ 89.21 │ 104.59
Cat-to-animalsDynaGANFID38.37Image Generation · few-shot
Source quote
L391: \multirow{3}{*}{DynaGAN} │ FID │ \downarrow │ 55.08 │ 38.37 │ 97.23
Cat-to-animalsFS-adaFID80.80Image Generation · few-shot
Source quote
L382: \multirow{3}{*}{FS-ada} │ FID │ \downarrow │ 73.29 │ 80.80 │ 148.13
Real-to-artificial facesDynaGANFID97.23Image Generation · few-shot
Source quote
L391: \multirow{3}{*}{DynaGAN} │ FID │ \downarrow │ 55.08 │ 38.37 │ 97.23
Real-to-artificial facesMTG-extFID104.59Image Generation · few-shot
Source quote
L388: \multirow{3}{*}{MTG-ext} │ FID │ \downarrow │ 55.84 │ 89.21 │ 104.59
BibTeX
@inproceedings{kim2022dynagan,
  author = {Seongtae Kim and Kyoungkook Kang and Geonung Kim and Seung-Hwan Baek and Sunghyun Cho},
  title = {{DynaGAN: Dynamic Few-shot Adaptation of GANs to Multiple Domains}},
  booktitle = {SIGGRAPH Asia},
  year = {2022},
  doi = {10.1145/3550469.3555416},
}
Figure