Generate To Adapt: Aligning Domains using Generative Adversarial Networks

Swami Sankaranarayanan, Yogesh Balaji, Carlos D. Castillo, Rama Chellappa

TL;DR

"Generate To Adapt" introduces a novel unsupervised domain adaptation framework that uses Generative Adversarial Networks (GANs) to align source and target distributions in a shared feature space. By forcing a feature encoder to produce embeddings that can generate realistic, class-consistent source-like images, the model effectively bridges the domain gap without requiring any target-domain labels.

What Problem Does This Paper Address?

Deep learning models are notoriously sensitive to "domain shift." A classifier trained on synthetic CAD models often fails when deployed on real-world photographs, and a model trained on one digit dataset (like MNIST) might struggle with another (like SVHN). While labeled data for the "source" domain might be plentiful, labeling "target" data is expensive and time-consuming.

The authors tackle Unsupervised Domain Adaptation (UDA): how can we leverage a large amount of unlabeled target data to make a source-trained model perform well in the target domain? The core challenge is finding a way to map both source and target images into a joint feature space where their distributions overlap, allowing a single classifier to work for both.

Methods

The authors propose a "symbiotic" architecture consisting of four components:

  1. Encoder ($F$): Extracts features from input images.
  2. Classifier ($C$): Predicts class labels from the features.
  3. Generator ($G$): Attempts to reconstruct a realistic source-like image from the features.
  4. Discriminator ($D$): A multi-task network that decides if an image is real or generated and predicts its class (an Auxiliary Classifier GAN or AC-GAN setup).
Figure 1: Illustration of the proposed approach. In the training phase, our pipeline consists of two parallel streams - (1) Stream 1: classification branch where F-C networks are updated using supervised classification loss and (2) Stream 2: adversarial branch which is a Auxiliary Classifier GAN (ACGAN) framework (G-D pair). F-G-D networks are updated so that both source and target embeddings produce source-like images. Note: The auxiliary classifier in ACGAN uses only the source domain labels, and is needed to ensure that class-consistent images are generated (e.g) embedding of digit 3 generates an image that looks like 3. In the test phase, we remove Stream 2, and classification is performed using the F-C pair

The training happens in two parallel streams:

  • Stream 1 (Supervised): Source images pass through $F$ and $C$ to minimize standard classification loss.
  • Stream 2 (Adversarial): This is the "Generate To Adapt" core. The encoder $F$ produces embeddings for both source and target images. The generator $G$ uses these embeddings to create "source-like" images. The discriminator $D$ tries to distinguish these from real source images.

Crucially, the encoder $F$ is updated using gradients from the discriminator. To "fool" the discriminator, $F$ must learn to produce target embeddings that reside in the same manifold as source embeddings, effectively aligning the two domains in feature space.

Datasets

The authors evaluated their method across three distinct regimes of difficulty:

  • DIGITS: MNIST, USPS, and SVHN. These represent low domain shift and simple data distributions.
  • OFFICE: A standard benchmark for moderate domain shift featuring 31 object classes across three domains: Amazon (product images), Webcam (low-res), and DSLR (high-res).
  • Synthetic to Real: Adapting from CAD models to the PASCAL VOC dataset, representing a high domain gap.
  • VISDA Challenge: A large-scale benchmark for synthetic-to-real adaptation.

Key Insights and Ideas

  • GAN as a Gradient Source: Unlike previous methods that use GANs to generate new training data (data augmentation), this approach uses the GAN framework to provide rich gradient information directly to the feature extractor.
  • Reconstruction for Alignment: By requiring that target features be "decodable" into source-like images, the model forces the encoder to discard domain-specific noise and retain only the core semantic features necessary for reconstruction and classification.
  • Robustness to Poor Generation: Interestingly, the method works even when the generator fails to produce high-quality images (e.g., in the complex OFFICE dataset). As long as the generator performs a basic "style transfer," it provides enough signal to align the feature distributions.
  • The Role of the Auxiliary Classifier: The ablation study highlights that the auxiliary classifier in the discriminator is vital. It ensures that the mapping is class-consistent, preventing "mode collapse" where target features for different classes might otherwise clump together.

Key Results

The proposed method achieved state-of-the-art (SOTA) results across nearly all tested benchmarks at the time of publication:

  • SVHN $\rightarrow$ MNIST: The model improved accuracy from a "source-only" baseline of 60.3% to a staggering 92.4%, outperforming competitors like DRCN and ADDA.
  • OFFICE Dataset: The method achieved an average accuracy of 86.5% across all transfer tasks (A $\rightarrow$ W, D $\rightarrow$ W, etc.), consistently beating other deep adaptation methods like JAN and RevGrad.
Table 2: Accuracy (mean ± std%) values on the OFFICE dataset for the standard protocol for unsupervised domain adapta- tion [6]. Results are reported as an average over 5 independent runs. The best numbers are indicated in bold and the second best are underlined. −denotes unreported results. A: Amazon, W: Webcam, D: DSLR
  • Synthetic to Real: On the challenging CAD $\rightarrow$ PASCAL task, the method reached 50.4% accuracy, a significant jump from the 38.1% baseline.
Table 3: Accuracy (mean ± std%) values over five indepen- dent runs on the Synthetic to real setting. The best numbers are indicated in bold.

Qualitatively, t-SNE visualizations (Figure 2 in the paper) clearly show that after adaptation, the target data clusters much more cleanly and overlaps significantly with the source data compared to the non-adapted version.

Figure 2: TSNE visualization of SVHN →MNIST adapta- tion. In (a), the source data shown in red is classified well into distinct clusters but the target data is clustered poorly. On applying the proposed approach, as shown in (b), both the source and target distributions are brought closer in a class consistent manner.

Limitations and Future Work

  • GAN Instability: Like all GAN-based methods, training can be sensitive to hyperparameters and prone to instability, though the authors note their approach is relatively robust.
  • Reliance on Pre-training: For complex datasets like OFFICE, the encoder $F$ requires initialization with pre-trained models (like ResNet-50) to perform well.
  • Future Directions: The authors suggest extending this framework to even more challenging domains, such as RGB-D object recognition and medical imaging, where domain shift is a major hurdle.

Summary updated

BibTeX
@inproceedings{sankaranarayanan2018generate,
  author = {Swami Sankaranarayanan and Yogesh Balaji and Carlos D. Castillo and Rama Chellappa},
  title = {{Generate To Adapt: Aligning Domains using Generative Adversarial Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00887},
}
Figure