CcGAN: Continuous Conditional Generative Adversarial Networks for Image Generation

Xin Ding, Yongwei Wang, Zuheng Xu, William J. Welch, Z. Jane Wang

Generating a "cat" or a "dog" with a GAN is a solved problem. But what if you want to generate a chair rotated at exactly 42.5 degrees, or a human face at age 27? Most Conditional GANs (cGANs) are built for categorical labels—discrete buckets that don't capture the smooth, ordinal nature of the real world.

In this ICLR 2021 paper, researchers from the University of British Columbia introduce CcGAN (Continuous Conditional GAN), the first generative model specifically designed for image generation conditioned on continuous, scalar "regression labels."

TL;DR

CcGAN extends conditional image generation to continuous variables (like age or rotation angle) by training on "vicinal" samples—images with labels near the target value. This approach overcomes data sparsity at specific label points and enables the model to generate high-quality, diverse images with smooth transitions across the entire label range.

What Problem Does This Paper Address?

Standard conditional GANs rely on Empirical Risk Minimization (ERM). This works fine when you have thousands of images for a "dog" class. However, regression labels (continuous numbers) present two fundamental problems:

  1. The Sparse Label Problem: Because labels are continuous, you might have only one real image for "age 27.4," or even zero. ERM fails when the sample size for a specific condition is near zero.
  2. The Encoding Problem: Conventional cGANs use one-hot encoding for labels. You cannot one-hot encode an infinite set of real numbers.

The naive fix is binning: grouping ages 20–30 into one class. But as the authors show, this leads to "mode collapse" (the GAN only learns one type of face for that whole decade) and "jerky" transitions where the model doesn't understand the relationship between neighboring bins.

Methods

The authors solve these problems through a framework called Vicinal Risk Minimization (VRM). The core assumption is intuitive: an image of a 15-year-old should look very similar to an image of a 16-year-old.

1. Vicinal Discriminator Losses

Instead of telling the Discriminator "this image belongs exactly to label $y$," CcGAN uses two new loss functions based on the surrounding label space:

Hard and Soft Vicinity
  • Hard Vicinal Discriminator Loss (HVDL): The Discriminator looks at all real images within a strict, small window ($\pm \kappa$) of the target label.
  • Soft Vicinal Discriminator Loss (SVDL): The Discriminator considers all images but weights them using a Gaussian kernel based on their distance from the target label, creating a smooth decay curve.

2. Generator Regularization

To help the Generator interpolate between unseen labels, the authors add Gaussian noise to the labels during training. This forces the Generator to learn a continuous mapping rather than just memorizing the specific labels present in the training set.

3. Novel Label Input

To handle scalar inputs without one-hot encoding, they propose a new architecture:

  • Generator: The scalar label is added element-wise to the feature map of the first linear layer.
  • Discriminator: The label is projected into a latent space via an extra linear layer and then incorporated using label projection.

Datasets

The authors evaluated CcGAN on three distinct tasks:

  • Circular 2-D Gaussians: A synthetic "sanity check" where the model must generate points along a circle based on an angle.
  • RC-49 (New Benchmark): The authors created this dataset by rendering 49 different 3D chair models at 899 yaw angles, providing a massive, fine-grained continuous label space.
  • UTKFace: A real-world dataset of human faces labeled by age (ranging from 1 to 60 years).

Key Insights and Results

CcGAN significantly outperformed standard "binned" cGANs across all metrics, proving that the "vicinity" of a label provides the necessary supervision to fill in the gaps where data is missing.

  • Visual Quality: On the RC-49 chair dataset, CcGAN achieved an Intra-FID of 0.515, compared to 1.720 for the binned cGAN. Lower FID means the generated images are much closer to the distribution of real images.
  • Diversity: CcGAN showed much higher entropy in the types of objects it generated, avoiding the mode collapse that plagued the binned models.
  • Smooth Interpolation: CcGAN is explicitly designed to sacrifice a tiny bit of "label exactness" in exchange for much higher visual quality and diversity.
UTKFace Generation Results

As seen in the UTKFace results above, CcGAN produces human faces that age smoothly year-by-year. In contrast, the baseline cGAN often produces identical faces for different ages within the same bin, failing to capture the continuous nature of aging.

Limitations and Future Work

  • Hyperparameter Tuning: The performance of CcGAN depends heavily on choosing the right "vicinity" size ($\kappa$ or $\nu$). If the window is too small, you're back to the sparse data problem; if it's too large, the labels become "blurry" and the model loses precision.
  • Label Consistency Trade-off: While CcGAN produces better images, the "Label Score" (how well the generated image matches the requested label) is sometimes slightly worse than a binned cGAN.
  • Future Directions: The authors suggest that future work could involve automated methods for selecting these vicinity hyperparameters and applying the technique to more complex, multi-dimensional continuous conditions (like 3D pose).

Summary updated

BibTeX
@inproceedings{ding2021ccgan,
  author = {Xin Ding and Yongwei Wang and Zuheng Xu and William J. Welch and Z. Jane Wang},
  title = {{CcGAN: Continuous Conditional Generative Adversarial Networks for Image Generation}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=R-HgOKDA3BI},
}
Figure