CDCGen: Cross-Domain Conditional Generation via Normalizing Flows and Adversarial Training

Hari Prasanna Das, Ryan Tran, Japjot Singh, Yu-Wen Lin, Costas J. SpanosarXiv 2021

TL;DR

CDCGen is a generative framework that can produce labeled synthetic data for a "target" domain even when that domain has zero available labels. By using invertible normalizing flows to align a labeled source domain with an unlabeled target domain in a shared latent space, the model effectively "transfers" the ability to generate data conditioned on specific attributes.

What Problem Does This Paper Address?

In the world of deep learning, data is king, but labeled data is the emperor. While we have massive amounts of raw data (unlabeled), the process of labeling it is often prohibitively expensive or requires niche expertise.

Existing unsupervised domain translation methods (like CycleGAN) can turn a horse into a zebra, but they can't easily generate a specific type of zebra (e.g., one running left) if they haven't been given labels for those attributes in the zebra domain. The authors tackle a difficult question: How do you generate conditional synthetic data for a domain where you have no labels at all?

Their goal is to leverage a "label-rich" source domain to enable conditional synthesis in a "label-scarce" target domain, providing a way to create sophisticated data augmentations that go beyond simple rotations or color shifts.

Methods

The authors propose CDCGen, which combines the strengths of Normalizing Flows and Generative Adversarial Networks (GANs). The architecture consists of two main parts:

  1. Domain Alignment via Normalizing Flows:
    • Unlike standard GANs, Normalizing Flows are bijective (invertible) mappings. The authors use two separate flows ($F_s$ and $F_t$) to map the source and target domains into a shared latent space $Z$.
  2. Because flows are invertible, the model achieves exact cycle consistency by design. If you map an image from source to latent space and then back, you get the original image exactly—something GAN-based methods can only approximate.
  3. They use a hybrid loss: Maximum Likelihood Estimation (MLE) to train the flows and adversarial "critics" to ensure the latent distributions of both domains overlap perfectly.
  4. Conditional Synthesis in Latent Space:
    • To handle labels, they introduce a variant of the Auxiliary Classifier GAN (ACGAN).
  5. Instead of operating on raw images, an encoder maps source attributes (one-hot encodings) and random noise into the shared latent space.
  6. A critic and an auxiliary classifier then work to ensure these "encoded" attributes match the distribution of the real data in the latent space.
  7. Inference: To generate a specific digit in the unlabeled target domain, you simply feed the desired label into the encoder to get a latent vector, then pass that vector through the inverse flow of the target domain.

Datasets

The researchers evaluated CDCGen using two classic digit recognition benchmarks:

  • MNIST: The standard "source" domain, containing 60,000 labeled handwritten digits.
  • USPS: The "target" domain, containing 7,291 digits.
  • Setup: To simulate a real-world imbalance, they downsampled the training sets to 542 images per class and resized all images to 32x32. Crucially, the model was never shown the labels for the USPS dataset during training.

Key Insights and Ideas

  • The Invertibility Advantage: By using flows instead of standard convolutional encoders/decoders, the mapping between domains is mathematically guaranteed to be consistent. This prevents the "information loss" often seen in GAN-based translation.
  • Latent Space as a Bridge: The "aha moment" is performing conditioning in the latent space rather than the image space. Since the latent space is shared and aligned, a label learned from MNIST (source) automatically becomes applicable to USPS (target).
  • Entropy over Geometry: The authors argue that synthetic samples generated this way introduce more "entropy" into a dataset than standard augmentations (like flipping or cropping). This makes downstream models more robust because they are seeing new, stylistically consistent variations of the data.

Key Results

  • Successful Translation: The model successfully translated digits between MNIST and USPS while preserving the digit's identity (e.g., a slanted '4' in MNIST became a slanted '4' in the USPS style).
  • Zero-Label Generation: As shown in the paper's qualitative results (Figure 4), the model could generate a full grid of digits (0-9) in the target domain style, conditioned purely on labels it had only seen in the source domain.
  • Latent Clustering: t-SNE visualizations of the shared latent space showed distinct clusters for each digit class. Importantly, the source and target embeddings for the same digit overlapped significantly, proving that the adversarial alignment successfully forced the two domains into the same subspace.

Limitations and Future Work

  • Image Sharpness: The authors note that the generated samples are slightly blurry. This is a common characteristic of flow-based models, which tend to distribute probability mass across the entire space rather than focusing only on "sharp" realistic samples like GANs do.
  • Complexity of Features: While digits are a great proof of concept, the authors are currently working on scaling the framework to more complex data, such as facial attributes or energy consumption patterns.
  • Few-Shot Learning: Future iterations may explore "few-shot" scenarios where a tiny handful of labels are available in the target domain to further refine the alignment.

Summary updated

BibTeX
@misc{das2021cdcgen,
  author = {Hari Prasanna Das and Ryan Tran and Japjot Singh and Yu-Wen Lin and Costas J. Spanos},
  title = {{CDCGen: Cross-Domain Conditional Generation via Normalizing Flows and Adversarial Training}},
  year = {2021},
  eprint = {2108.11368},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.11368},
}
Figure