Rethinking Spatially-Adaptive Normalization

Zhentao Tan, Dongdong Chen, Qi Chu, Menglei Chai, Jing Liao, Mingming He, Lu Yuan, Nenghai YuarXiv 2020

Introduction

Semantic image synthesis—the process of generating photo-realistic images from semantic label maps—has seen significant advancements with the introduction of Spatially-Adaptive Normalization (SPADE). However, while SPADE achieves high-quality results, it introduces substantial computational overhead. This research investigates the underlying mechanisms of SPADE and proposes a more efficient alternative: Class-Adaptive Normalization (CLADE). By recognizing that semantic-awareness, rather than complex spatial adaptiveness, is the primary driver of performance, CLADE reduces computational costs by orders of magnitude while maintaining state-of-the-art image quality.

The Problem: Computational Overhead in SPADE

Standard normalization layers, such as Batch Normalization or Instance Normalization, often struggle with semantic image synthesis because they tend to "wash away" semantic information in uniform regions of the input mask. SPADE addressed this by using a sub-network to learn pixel-specific transformation parameters ($\gamma$ and $\beta$) directly from the input mask.

While effective, this approach is computationally expensive. The sub-networks required to calculate these parameters for every pixel significantly increase the model's parameter count and slow down inference. In typical implementations, the extra overhead can exceed 230% in terms of floating-point operations (FLOPs), posing a major hurdle for real-time applications or resource-constrained environments.

Proposed Method: Class-Adaptive Normalization (CLADE)

The authors propose CLADE based on the observation that spatial adaptiveness in SPADE is largely redundant. In a trained SPADE model, the learned parameters for pixels belonging to the same semantic class (e.g., all pixels labeled "sky") are remarkably similar.

How CLADE works: 1. Parameter Bank: Instead of generating parameters via a convolutional network, CLADE maintains a lookup table (a "bank") of learnable $\gamma$ and $\beta$ values for every possible semantic class. 2. Guided Sampling: For a given input mask, the model samples the corresponding parameters from the bank based on the class label of each pixel. 3. Efficiency: By replacing a two-layer convolutional sub-network with a simple lookup and assignment operation, the computational footprint of the normalization layer is nearly eliminated.

Key Insights: The Redundancy of Spatial Adaptiveness

The core innovation of this work stems from visualizing the intermediate parameters of SPADE. The researchers found that the $\gamma$ and $\beta$ values were essentially uniform within semantic regions, suggesting that the expensive pixel-wise calculation was redundant.

Visualization of learned parameters $\gamma$ and $\beta$ in SPADE, demonstrating that values are largely uniform within semantic regions (e.g., Sky vs. Field).

This visualization confirms that "semantic-awareness"—knowing what a pixel represents—is the critical factor for high-quality synthesis, whereas knowing the exact spatial coordinates is less vital. CLADE preserves this semantic-awareness while discarding the unnecessary spatial overhead.

Experimental Results

CLADE was evaluated across four major benchmarks: ADE20k, ADE20k-outdoor, COCO-Stuff, and Cityscapes. The results demonstrate that CLADE performs on par with SPADE in terms of visual fidelity while offering massive efficiency gains.

Qualitative results of semantic image synthesis across various datasets, showing that CLADE maintains high fidelity and diversity.

Performance and Efficiency Metrics

  • Fidelity: On the COCO-Stuff dataset, CLADE achieved an mIoU of 35.19, nearly identical to SPADE’s 35.44. User studies also showed no significant preference between images generated by either method.
  • Computational Gains: For the ADE20k generator, SPADE adds a 234.73% overhead in FLOPs, whereas CLADE adds only 0.07%.
  • Parameter Count: SPADE increases parameters by 39.21%, while CLADE’s overhead is a mere 4.57%.
  • Inference Speed: Real-world testing showed a 2x runtime speedup for the CLADE-based generator compared to its SPADE counterpart.

Conclusion and Future Work

CLADE demonstrates that rethinking fundamental components like normalization can lead to massive efficiency gains without sacrificing performance. By shifting from pixel-wise modulation to class-based modulation, the authors have made high-quality semantic image synthesis significantly more accessible.

Future research may focus on refining boundary effects, as SPADE’s convolutional nature provides a slight variation at object edges that CLADE’s uniform approach currently lacks. Additionally, further exploration into handling fine-grained textures within a single class could further bridge the gap between efficiency and absolute photorealism.

Summary updated

BibTeX
@misc{tan2020rethinking,
  author = {Zhentao Tan and Dongdong Chen and Qi Chu and Menglei Chai and Jing Liao and Mingming He and Lu Yuan and Nenghai Yu},
  title = {{Rethinking Spatially-Adaptive Normalization}},
  year = {2020},
  eprint = {2004.02867},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.02867},
}
Figure