Unifying Conditional and Unconditional Semantic Image Synthesis with OCO-GAN

Marlène Careil, Stéphane Lathuilière, Camille Couprie, Jakob Verbeek

Introduction

Generative Adversarial Networks (GANs) have traditionally evolved along two distinct trajectories: unconditional generation and conditional semantic image synthesis. Unconditional models, such as StyleGAN, focus on synthesizing high-fidelity images from random noise, leveraging vast amounts of unlabeled data. Conversely, conditional models focus on semantic image synthesis—generating realistic images from detailed label maps (blueprints). While the latter offers precise control, it is constrained by the high cost of pixel-perfect human annotations.

Despite their shared underlying goal of modeling the natural image distribution, these two tasks are typically treated in isolation. This separation results in a missed opportunity: unlabeled images contain structural priors that could benefit conditional models, while labeled images provide strong supervisory signals that could refine unconditional synthesis. OCO-GAN (Optionally COnditioned GAN) bridges this gap by introducing a unified framework capable of performing both tasks within a single architecture.

The OCO-GAN Framework

OCO-GAN utilizes a shared synthesis network to integrate the strengths of both conditional and unconditional learning. Unlike previous hybrid approaches that relied on multi-stage training or fixed pre-trained components, OCO-GAN is trained end-to-end, allowing the model to adapt its internal representations to satisfy both global realism and local semantic constraints.

Dual-Path Generator

The architecture features a shared synthesis backbone based on StyleMapGAN, which is fed by two distinct style networks:

  • Unconditional Path: Maps a latent noise vector to a spatial style map.
  • Conditional Path: Processes a semantic segmentation map (concatenated with noise) through downsampling layers to generate corresponding style maps.

These spatial style maps are used to modulate features within the shared synthesis network. By utilizing spatial style maps rather than global vectors, the model maintains better alignment between semantic labels and generated pixels, effectively handling the local constraints inherent in semantic maps.

U-Net Discriminator with Specialized Heads

The discriminator follows a U-Net architecture with two specialized output heads:

  1. Encoder Head: Outputs a global real/fake score for unconditional training samples.
  2. Decoder Head: Performs per-pixel classification. For real images, it predicts the semantic class; for generated images, it identifies pixels as "fake." This high-resolution feedback is critical for guiding the conditional synthesis process.

Joint Training and Synergy

OCO-GAN is trained using mixed batches of conditional and unconditional samples. This joint training strategy allows the unconditional data to act as a powerful regularizer. In scenarios where labeled data is scarce, the abundance of unlabeled images helps the model learn the general distribution of natural scenes, preventing the conditional branch from overfitting to a limited set of labels.

Experimental Results

The model was evaluated on several major benchmarks, including Cityscapes, COCO-Stuff, ADE20K, and CelebA-HQ, with a particular focus on limited-data and semi-supervised regimes.

Performance in Data-Scarce Regimes

OCO-GAN demonstrates significant advantages when labels are a bottleneck:

  • Limited Data: On the Cityscapes5K dataset, OCO-GAN achieved a Fréchet Inception Distance (FID) of 57.4. While specialized models like OASIS (47.7) achieve lower scores, OCO-GAN represents a massive improvement over standard unconditional models like StyleGAN2 (79.6) and shows the strength of the hybrid approach.
  • Semantic Accuracy: In semi-supervised settings (using only 500 labels for Cityscapes), OCO-GAN achieved an mIoU of 65.2. This performance significantly outperforms other hybrid baselines such as SB-GAN (50.2) and PSP (13.8).

Qualitative Quality

Qualitative evaluations indicate that OCO-GAN produces images with sharper details and superior structural consistency. The model exhibits a better grasp of geometric features, such as straighter building edges and more realistic vegetation textures, compared to models trained exclusively on labeled data.

Limitations and Future Directions

While OCO-GAN offers a robust unified framework, it faces certain trade-offs. The StyleMapGAN-based architecture is more computationally intensive than some specialized models, leading to slightly slower inference speeds. Additionally, the relative benefit of the unconditional branch tends to diminish as the volume of labeled data increases and the model reaches saturation.

Future work may involve extending this unified approach to other modalities, such as text-to-image synthesis or complex image editing tasks, where labeled data remains a significant constraint. By treating conditional and unconditional generation as a single, joint learning problem, OCO-GAN sets a new precedent for efficient and high-quality image synthesis.

Summary updated

BibTeX
@inproceedings{careil2022unifying,
  author = {Marlène Careil and Stéphane Lathuilière and Camille Couprie and Jakob Verbeek},
  title = {{Unifying Conditional and Unconditional Semantic Image Synthesis with OCO-GAN}},
  booktitle = {Workshops @ ECCV},
  year = {2022},
  doi = {10.1007/978-3-031-25063-7\_15},
}
Figure