Learning Spatial Pyramid Attentive Pooling in Image Synthesis and Image-to-Image Translation

Wei Sun, Tianfu WuarXiv 2019 · arXiv

Introduction

Generative Adversarial Networks (GANs) have set new standards in image synthesis, yet they often struggle to balance fine-grained details with global structural coherence. Traditional convolutional layers are limited by their local receptive fields, making it difficult for models to capture multi-scale context effectively. While techniques like Atrous Spatial Pyramid Pooling (ASPP) have addressed similar issues in semantic segmentation, their direct application to generative tasks remains suboptimal. This paper introduces Spatial Pyramid Attentive Pooling (SPAP), a plug-and-play architectural unit designed to enhance GAN generators by integrating multi-scale feature extraction with a novel cascade attention mechanism.

The SPAP Architecture

The core innovation of this work is the SPAP module, which replaces standard pooling or concatenation layers to better manage multi-scale information. The module consists of three primary components:

  1. Atrous (Dilated) Convolutions: By employing parallel layers with varying dilation rates, the network expands its receptive field without increasing parameter count or sacrificing spatial resolution. This allows the model to simultaneously process local features (e.g., facial landmarks) and global structures (e.g., head shape).
  2. Cascade Attention Mechanism: Unlike standard ASPP, which simply concatenates multi-scale features, SPAP utilizes an "Attentive Fuse" block. This block processes features in a sequence—typically coarse-to-fine—using learned spatial attention maps to dynamically weight the importance of information from different scales.
  3. Residual Connections: A learnable residual connection blends the attentive features back into the original input, ensuring training stability and preserving essential low-level information.
The SPAP architecture integrates atrous convolutions with a cascade attention mechanism (Attentive Fuse) to refine multi-scale features.

Experimental Evaluation

The effectiveness of SPAP was evaluated across diverse generative tasks, including unconditional image synthesis on CelebA-HQ and image-to-image translation on datasets such as Cityscapes, Maps, and Horse ↔ Zebra.

Quantitative results demonstrate significant improvements:

  • CelebA-HQ: Integrating SPAP into a standard DCGAN architecture reduced the Frechet Inception Distance (FID) from 25.42 to 18.47, indicating a substantial gain in image realism.
  • Cityscapes (Labels → Photo): SPAP achieved a pixel accuracy of 0.73, significantly outperforming the CycleGAN baseline (0.52) and the SCAN model (0.64).

Key Insights: Visualizing Attention

A critical finding of this research is the importance of the attention cascade order. The authors found that a coarse-to-fine processing order—starting with large dilation rates and moving to smaller ones—yields the best results for image synthesis. This suggests that the model benefits from establishing a global "skeleton" before refining local details.

Visualizing the learned attention maps provides intuitive evidence of this process. At coarse levels (high dilation), the model's attention is distributed across the background and general boundaries. As the cascade progresses to finer levels (low dilation), the attention focuses sharply on high-contrast features like eyes, mouth, and facial contours.

Learned attention maps in SPAP demonstrate a coarse-to-fine progression, shifting focus from global structure to fine-grained facial features.

Conclusion

Spatial Pyramid Attentive Pooling (SPAP) offers a powerful, lightweight architectural enhancement for GANs. By enabling generators to learn "where" and "at what scale" to focus, SPAP achieves state-of-the-art performance in both synthesis and translation tasks. Future work may involve integrating SPAP into high-resolution architectures like StyleGAN or extending its multi-scale context capabilities to video synthesis.

Summary updated

Abstract

Image synthesis and image-to-image translation are two important generative learning tasks. Remarkable progress has been made by learning Generative Adversarial Networks (GANs)~\cite{goodfellow2014generative} and cycle-consistent GANs (CycleGANs)~\cite{zhu2017unpaired} respectively. This paper presents a method of learning Spatial Pyramid Attentive Pooling (SPAP) which is a novel architectural unit and can be easily integrated into both generators and discriminators in GANs and CycleGANs. The proposed SPAP integrates Atrous spatial pyramid~\cite{chen2018deeplab}, a proposed cascade attention mechanism and residual connections~\cite{he2016deep}. It leverages the advantages of the three components to facilitate effective end-to-end generative learning: (i) the capability of fusing multi-scale information by ASPP; (ii) the capability of capturing relative importance between both spatial locations (especially multi-scale context) or feature channels by attention; (iii) the capability of preserving information and enhancing optimization feasibility by residual connections. Coarse-to-fine and fine-to-coarse SPAP are studied and intriguing attention maps are observed in both tasks. In experiments, the proposed SPAP is tested in GANs on the Celeba-HQ-128 dataset~\cite{karras2017progressive}, and tested in CycleGANs on the Image-to-Image translation datasets including the Cityscape dataset~\cite{cordts2016cityscapes}, Facade and Aerial Maps dataset~\cite{zhu2017unpaired}, both obtaining better performance.
BibTeX
@misc{sun2019learning,
  author = {Wei Sun and Tianfu Wu},
  title = {{Learning Spatial Pyramid Attentive Pooling in Image Synthesis and Image-to-Image Translation}},
  year = {2019},
  eprint = {1901.06322},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1901.06322},
}
Figure