Toward Spatially Unbiased Generative Models

Jooyoung Choi, Jungbeom Lee, Yonghyun Jeong, Sungroh Yoon · DOI

Abstract

State-of-the-art generative models, such as StyleGAN2, often exhibit "spatial bias," a phenomenon where the quality of generated content degrades significantly when features are shifted to positions or scales not encountered during training. This paper proposes Multi-Scale Positional Encoding (MS-PE) to address this limitation. By injecting explicit, learnable positional information at every resolution of the generator, MS-PE enables translation-equivariant image synthesis, improved GAN inversion, and the ability to extrapolate beyond training boundaries.

The Challenge of Spatial Bias

When trained on datasets of centered objects, such as the Flickr-Faces-HQ (FFHQ) dataset, GANs become highly specialized at rendering features in fixed locations. Attempting to shift the generation process—for instance, placing a face in a corner—often results in structural breakdown or "melting" artifacts.

This spatial bias stems from the architecture of Convolutional Neural Networks (CNNs). While theoretically translation-invariant, modern generators exploit "implicit positional encodings" provided by zero-padding at image boundaries and fixed constant tensors at the network's start. Because these cues are tied to absolute coordinates, the model fails to maintain structural integrity when content is moved relative to these fixed anchors. As illustrated in the comparison below, the baseline produces distorted results when translated (a), while MS-PE maintains structural integrity (b).

Comparison of translation robustness between baseline StyleGAN2 and MS-PE.

Multi-Scale Positional Encoding (MS-PE)

To overcome these implicit cues, the authors introduce Multi-Scale Positional Encoding (MS-PE). The method involves several key components:

  1. Explicit Positional Injection: 2D sinusoidal positional embeddings, similar to those in Transformer architectures, are injected at every scale of the generator.
  2. Scale-Specific Learning: At each layer $l$, the positional encoding $PE^l$ is added to the feature map and scaled by a learnable parameter $\gamma^l$. This allows the model to adaptively determine the necessary amount of positional information at different resolutions.
  3. Translation Equivariance: By manually shifting the input positional grid at inference time, users can control the location of generated content. The generator follows the explicit encoding, ensuring the output remains well-structured regardless of position.

Experimental Results

The researchers evaluated MS-PE across diverse datasets, including Color-MNIST, FFHQ, and LSUN Church.

  • Image Quality: On the FFHQ dataset, MS-PE achieved a Fréchet Inception Distance (FID) of 6.75, a notable improvement over the StyleGAN2 baseline of 7.21.
  • Structural Robustness: MS-PE maintains facial structure even when generating at resolutions higher than those seen during training (e.g., 512² for a model trained at 256²), whereas baseline models often produce distorted features.
  • GAN Inversion: In tasks requiring the reconstruction of real images from latent space, MS-PE successfully handles unaligned or zoomed faces. In contrast, baseline models frequently produce blurred or "ghostly" artifacts when the input deviates from the training distribution's alignment.
  • Diffusion Models: The technique was also successfully applied to Denoising Diffusion Probabilistic Models (DDPMs), allowing for the generation of digits at unseen positions in the Color-MNIST task.

Discussion and Future Directions

While MS-PE significantly improves global structural consistency, some challenges remain. The scale-variant nature of convolutional kernels means that extreme scaling can still lead to "awkward" fine details, as the kernels themselves are optimized for specific training resolutions.

Future work may explore training on unaligned datasets to further test the model's ability to learn robust representations without the crutch of dataset centering. Nonetheless, MS-PE represents a significant step toward more flexible and spatially aware generative modeling, enabling applications like panoramic extrapolation and robust image editing.

Summary updated

BibTeX
@inproceedings{choi2021toward,
  author = {Jooyoung Choi and Jungbeom Lee and Yonghyun Jeong and Sungroh Yoon},
  title = {{Toward Spatially Unbiased Generative Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01399},
}
Figure