Few-shot Hybrid Domain Adaptation of Image Generators

Hengjia Li, Yang Liu, Linxuan Xia, Yuqi Lin, Tu Zheng, Zheng Yang, Wenxiao Wang, Xiaohui Zhong, Xiaobo Ren, Xiaofei He

TL;DR

The paper introduces Few-shot Hybrid Domain Adaptation (HDA), a new generative task that adapts a pre-trained image generator to merge multiple target domains (e.g., sketch + smile + baby) using only a few separate examples from each domain. By replacing traditional GAN discriminators with pre-trained vision encoders and a novel directional subspace loss, the method successfully synthesizes high-quality hybrid images in just three minutes without ever seeing a real example of the combined domain.

What Problem Does This Paper Address?

Conventional generative domain adaptation (DA) fine-tunes a pre-trained generator (like StyleGAN) to mimic a single target domain using only a few reference images. However, real-world applications often require combining multiple styles or attributes—such as generating a sketch of a smiling baby.

Figure 1: (Middle) Given a source generator (GS) pre-trained on a large-scale dataset, we propose to adapt it to the new target domain. (Left) Domain Adaptation adapts the generator from the source domain (human(sketch). The adapted model GT1 captures the target distribution using extremely few-shot references. (Right) Our newly introduced Hybrid Domain Adaptation aims to adapt to GT1∪T2∪T3 that generate images with integrated attributes from T1 (sketch), T2 (smile), and T3 (baby), given few-shot references from multiple individual domains.

Standard DA fails here for two reasons:

  1. Lack of Joint Data: It is incredibly difficult to collect training images that naturally contain the exact combination of all target attributes (the "hybrid domain").
  2. Discriminator Overfitting: Standard DA relies on an adversarial discriminator to distinguish real from fake. With only a few images, the discriminator easily overfits to the most prominent attribute, causing the generator to ignore the others.

To solve this, the authors introduce HDA, aiming to inject multiple domain-specific attributes into a single generator while preserving the core structural identity (pose, shape) of the source domain.

Methods

The authors discard the problematic discriminator entirely, opting for a discriminator-free framework guided by the geometry of pre-trained vision models.

Discriminator-free framework with directional subspace loss

1. Pre-trained Encoders as Implicit Classifiers

Instead of training a discriminator, the method leverages powerful, frozen image encoders (such as Swin Transformer and DINOv2) pre-trained on large datasets. These encoders naturally project different image domains into distinct, well-separated feature clusters, or subspaces.

2. Directional Subspace Loss

To guide the generator toward multiple target domains simultaneously, the authors propose a loss function split into two geometric components:

  • Distance Loss ($\mathcal{L}_{dist}$): This measures the distance between the generated image's embedding and the target domain subspaces. Minimizing this loss pulls the generator toward all target domains at once, effectively blending their attributes.
  • Direction Loss ($\mathcal{L}_{direct}$): Relying solely on distance can cause mode collapse, where different source images map to the exact same point in the target subspace, destroying diversity. The direction loss forces the optimization path to move perpendicularly from the source domain to the target subspaces. This preserves domain-invariant characteristics like facial structure and pose.

3. Encoder Ensemble

To prevent the generator from inheriting the specific semantic biases of a single vision model, the framework ensembles multiple distinct encoders (e.g., combining Swin and DINOv2).

Datasets

The authors evaluate their approach on face and architectural generation tasks:

  • Source Domain: Flickr-Faces-HQ (FFHQ) at $256 \times 256$ resolution.
  • Target Domains: 10-shot samples from individual datasets representing baby, sunglasses, sketch, and smile.
  • Generalization Testing: LSUN Church adapted to combinations of Van Gogh's house paintings and haunted houses.

Key Insights and Ideas

  • Exploiting Latent Geometry: Rather than trying to model a complex joint probability distribution for a hybrid domain, the paper treats domain adaptation as a geometric navigation problem within a frozen, highly linearly-separable embedding space.
  • The Power of Orthogonality: The "aha moment" of the paper is the use of a perpendicular trajectory constraint (the direction loss). By ensuring the generator changes only along the vector orthogonal to the target subspace, it acts as an elegant geometric regularizer that maintains cross-domain consistency without explicit structural penalties.
  • Inference-Time Efficiency: Prior hybrid methods (like DoRM) train separate models for every single domain and interpolate their weights at inference time, which causes model size to scale linearly with the number of domains. This method bakes all attributes into a single model, keeping the parameter count constant.

Key Results

The proposed method was compared against competitive baselines, including sequential adaptation, Domain Remodulation (DoRM), and Style-NADA.

Qualitative results on 10-shot HDA

Quantitative Performance

As shown in the paper's evaluations, the method achieves state-of-the-art results across three key metrics:

  • Semantic Similarity (CLIP-Score): For the smile-sunglasses hybrid domain, the method achieved a score of 25.65, significantly outperforming Style-NADA (20.23) and DoRM (18.99).
  • Image Fidelity (Inception Score): Consistently scored higher across all mixtures, indicating cleaner, less artifact-ridden generations.
  • Identity Preservation (ID Score): Maintained the highest structural consistency relative to the original source faces.

Computational Efficiency

Because it bypasses adversarial training, the model adapts incredibly fast. For a 10-domain hybrid task, the training time is just 3 minutes on a single GPU and requires only 24M parameters, whereas Style-NADA takes 30 minutes and balloons to 240M parameters.

Limitations and Future Work

The primary limitation acknowledged by the authors is the manual tuning of the domain coefficients ($\alpha_i$). These weights control the blending ratio of the target domains in the loss function. However, a mathematical weight of 0.5 does not always translate to an equal visual split of attributes due to the varying density and scale of different feature spaces.

The authors note that future work will focus on developing adaptive weighting mechanisms to automatically balance visual characteristics without empirical tuning.

Summary updated

BibTeX
@inproceedings{li2024few,
  author = {Hengjia Li and Yang Liu and Linxuan Xia and Yuqi Lin and Tu Zheng and Zheng Yang and Wenxiao Wang and Xiaohui Zhong and Xiaobo Ren and Xiaofei He},
  title = {{Few-shot Hybrid Domain Adaptation of Image Generators}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=FE2e8664Sl},
}
Figure