Conditional GAN Architectures
What You'll Learn
You'll learn how to guide GANs to generate specific types of outputs by feeding conditioning information (like class labels) into both the generator and discriminator.
The Core Idea
Imagine asking an artist to "paint something" versus "paint a sunset." The second request is much more useful! Standard GANs generate random samples from noise, but Conditional GANs (cGANs) let you control what gets generated by providing additional information.
The key insight: both the generator and discriminator receive the same conditioning information alongside their normal inputs. The generator uses it to guide synthesis, and the discriminator learns to judge whether samples are both realistic and consistent with the condition.
How Conditioning Works
There are two main approaches:
Concatenation Method
You simply concatenate the conditioning information with the input:
- Generator: Concatenate the class label (often as a one-hot vector) with the noise vector
z - Discriminator: Concatenate the label with the image (spatially replicated across width/height if needed)
Think of it like adding an instruction card alongside your materials.
Projection Method
More sophisticated architectures (like in BigGAN) use projection:
- Embed the condition into a learned representation
- Project it into intermediate layers rather than just the input
- Often combined with conditional batch normalization
This is like weaving the instruction throughout the entire creative process, not just at the start.
Why This Matters
Conditional GANs let you:
- Generate images of specific classes (e.g., "generate a cat" not just "generate an animal")
- Control attributes (hair color, age, expression)
- Perform image-to-image translation tasks
Key Takeaway: Conditional GANs extend the basic GAN framework by feeding the same conditioning information (class labels, attributes, etc.) into both generator and discriminator, enabling controlled generation of specific output types.