Image Synthesis via Semantic Composition

Yi Wang, Lu Qi, Ying-Cong Chen, Xiangyu Zhang, Jiaya Jia

In the world of computer vision, generating a photorealistic image from a simple "paint-by-numbers" semantic layout is a classic inverse problem. While Generative Adversarial Networks (GANs) have made massive strides, they often struggle with global consistency—ensuring that a left eye matches a right eye, or that the texture of a tree canopy is consistent across different parts of a scene.

A new paper, "Image Synthesis via Semantic Composition," introduces SC-GAN, a framework that tackles this by moving away from treating semantic labels as isolated categories. Instead, it treats them as appearance-correlated regions, allowing the model to learn that "grass" and "trees" might share more in common than "grass" and "sky."

TL;DR

SC-GAN improves semantic image synthesis by encoding discrete labels into continuous "semantic vectors" that capture appearance correlations between different regions. These vectors drive a dynamic generator using spatially conditional convolutions and normalizations, resulting in state-of-the-art realism and global consistency with significantly fewer parameters than previous models.

What Problem Does This Paper Address?

Most existing semantic image synthesis methods (like SPADE or CC-FPSE) operate on the assumption that each semantic label (e.g., "car," "road," "building") should be processed independently. While effective, this ignores a fundamental truth: objects with different labels often share similar visual characteristics. For instance, the left and right eyes of a person are separate labels in a face mask, but they should look nearly identical in the final image.

Furthermore, existing "dynamic" methods that try to adapt convolutions to the input layout often suffer from massive computational overhead or fail to capture long-range dependencies. The authors aim to bridge this gap by explicitly modeling the relationship between different semantic regions based on their appearance similarity.

Methods

The authors propose a decoupled architecture consisting of two main components:

  1. Semantic Vector Generator (SVG): This module transforms the discrete, one-hot semantic layout into a set of multi-scale semantic vectors. Crucially, the SVG is trained to predict a coarse version of the ground truth image. This forces the resulting vectors to capture appearance information (color, texture) rather than just category labels.
  2. Semantic Render Generator (SRG): This is the main synthesis engine. It takes random noise and refines it into a high-resolution image, conditioned on the semantic vectors from the SVG.

The "secret sauce" lies in two novel operators within the SRG:

  • Spatially Conditional Convolution (SCC): Instead of learning a fixed set of weights, SCC uses the semantic vectors to linearly combine a small group of "expert" weight candidates. This allows the convolution kernels to vary across the image based on local appearance needs.
  • Spatially Conditional Normalization (SCN): Similar to SCC, this adapts the normalization layers (mean and variance) based on the semantic vectors, ensuring that style is applied consistently across correlated regions.
Figure 2. Framework of SC-GAN. SCB denotes the spatially conditional block. It is constructed by spatial conditional convolutions and normalizations, parameterized by semantic vectors V. Its design is given in Figure 4 and Section 3.2.

Datasets

The model was rigorously tested on four standard benchmarks for face and scene synthesis:

  • CelebAMask-HQ: High-resolution face images with detailed masks.
  • Cityscapes: Urban street scenes.
  • ADE20K: A diverse dataset of indoor and outdoor scenes.
  • COCO-Stuff: Complex scenes with a wide variety of "thing" and "stuff" categories.

Key Insights and Ideas

  • Continuous vs. Discrete: By mapping discrete labels to continuous semantic vectors, the model discovers that certain labels are "neighbors" in appearance space. Analysis showed that vectors for the left and right eyes had a cosine similarity of 0.999, explaining why the model is so good at maintaining symmetry.
  • Efficiency through Mixture-of-Experts: Rather than generating entirely new weights for every pixel (which is memory-intensive), SCC and SCN use a "mixture-of-experts" approach. By combining just a few shared weight candidates, the model achieves high flexibility with a much smaller footprint (66.2M parameters vs. 138.6M for CC-FPSE).
  • Decoupled Training: Training the SVG to predict a coarse image via maximum likelihood, while training the SRG via adversarial loss, allows the model to learn stable appearance representations that aren't purely dictated by the GAN's discriminator.

Key Results

SC-GAN consistently outperformed heavyweights like SPADE and CC-FPSE across both quantitative metrics and human evaluations.

  • Quantitative: On the CelebAMask-HQ dataset, SC-GAN achieved a Fréchet Inception Distance (FID) of 19.2, a massive improvement over SPADE’s 42.2. Lower FID indicates higher image quality and diversity.
  • Qualitative: The model produces noticeably sharper details and better global structure. For example, it can generate realistic reflections on water in scene tasks, a feat that requires understanding the relationship between the "water" region and the surrounding "trees" or "sky."
  • User Study: In head-to-head comparisons, users preferred SC-GAN results over SPADE results 76% of the time for face datasets.
Figure 1. Semantic image synthesis results of our method on face and scene datasets.

Limitations and Future Work

Despite its success, the authors note a few hurdles:

  • Geometric Cues: If a semantic layout is very simple (e.g., a flat block for a building), the model sometimes fails to recover complex 3D geometry like depth or perspective.
  • Symbiotic Bias: The model can sometimes learn "co-occurrence biases." For instance, if buildings in the training set often have plants nearby, the model might synthesize plant-like textures on a building facade even if the mask doesn't call for it.

Future work may involve using segmentation masks to further constrain the semantic vectors or incorporating extra modalities like depth maps to improve geometric accuracy.

For those interested in the implementation details, the authors have provided PyTorch-style pseudo-code for the SCC and SCN modules in the paper's appendix.

Summary updated

BibTeX
@inproceedings{wang2021image,
  author = {Yi Wang and Lu Qi and Ying-Cong Chen and Xiangyu Zhang and Jiaya Jia},
  title = {{Image Synthesis via Semantic Composition}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01349},
}
Figure