Learning Modulated Transformation in GANs

Ceyuan Yang, Qihang Zhang, Yinghao Xu, Jiapeng Zhu, Yujun Shen, Bo Dai

TL;DR

The Modulated Transformation Module (MTM) is a plug-and-play component that allows Generative Adversarial Networks (GANs) to move beyond fixed convolutional grids by predicting instance-specific spatial offsets. By modulating these geometric "warps" with the latent code, MTM enables state-of-the-art generators to handle complex, unaligned data—like moving humans or diverse ImageNet objects—resulting in massive quality boosts, including a 36% FID improvement on the challenging TaiChi dataset.

The Problem: The Rigidity of Regular Convolutions

Standard style-based generators, such as the widely used StyleGAN architecture, are masters of synthesizing texture and color. However, they often stumble when faced with "geometric noise" or high spatial variance. This limitation stems from the fact that regular convolutions sample features from a fixed, rigid grid. While style modulation techniques (like AdaIN) can change the intensity or magnitude of features, they cannot change where the convolutional kernel looks.

This rigidity is perfectly fine for well-aligned datasets like human faces (e.g., FFHQ), where eyes, noses, and mouths consistently appear in roughly the same spatial locations. However, it fails on "unaligned" data—think of ImageNet’s diverse object categories or the TaiChi dataset, where humans appear in wildly different poses, scales, and positions. To compensate for this lack of spatial flexibility, standard GANs are forced to "brute force" geometry through many layers, which is highly inefficient and frequently leads to structural artifacts.

Methods: The Modulated Transformation Module (MTM)

To address this, the authors introduce the Modulated Transformation Module (MTM). Inspired by Deformable Convolutions (DCN) but redesigned specifically for the generative setting, MTM provides the generator with an additional degree of freedom to handle geometric deformation.

Comparison of regular convolution and the proposed Modulated Transformation Module (MTM).

The module operates through a few key mechanisms:

  1. Predicting Offsets: Instead of applying a standard convolution on a fixed grid, MTM first predicts a set of spatial offsets ($\Delta p$) for each location in the feature map.
  2. Latent Modulation: Crucially, these offsets are not just predicted from the previous feature map; they are explicitly conditioned on the latent code ($z$). This means the specific geometric "warp" applied to the image is directly tied to the unique identity or style being generated.
  3. Variable Sampling: The convolution operation then samples the input feature map at these variable locations, utilizing bilinear interpolation for fractional coordinates. This allows the model to explicitly model deformations, rotations, and translations.
  4. Plug-and-Play Integration: MTM is designed to seamlessly replace standard convolutions in existing architectures like StyleGAN2, StyleGAN3, and EG3D without requiring complex hyper-parameter tuning.

Key Insights and Discoveries

  • "Where" vs. "What": Traditional GANs modulate the "what" (feature magnitude). MTM modulates the "where" (spatial location). This separation of concerns allows the model to learn geometry much more efficiently.
  • Low-Res is Key: Through extensive ablation studies, the authors discovered that MTM is most effective when applied to low-resolution layers. These early layers define the global spatial layout (the "skeleton" of the image), while high-resolution layers focus on fine-grained textures where a rigid grid remains perfectly adequate.
  • The "Blob" Discovery: In a fascinating visualization experiment, the authors disabled the learned offsets after training. The resulting images collapsed into generic "blobs." This proves that the model learns to generate a simple base shape and then uses MTM to explicitly warp that shape into complex poses and structures.
  • Efficiency: Despite the added spatial flexibility, MTM adds negligible parameter overhead and only a slight increase (~1.2x) in training time.

Key Results and Datasets

The researchers evaluated MTM across several challenging benchmarks, spanning 2D image generation, 3D-aware synthesis, and video generation. The quantitative gains are significant across the board.

Qualitative results of the MTM-enhanced generator across various datasets.
  • TaiChi (2D): On this highly unaligned dataset of human movements, MTM improved the FID of StyleGAN3 from 21.36 to 13.60.
  • ImageNet: It boosted StyleGAN2 performance from 21.14 to 19.16 FID on ImageNet-128 (1,000 diverse categories).
  • Video Generation: On the YouTube Driving dataset, MTM helped achieve a massive jump in video quality, reducing FID from 19.2 to 10.3.
  • Robustness: The authors demonstrated that MTM outperforms baselines even when those baselines are trained for twice as many iterations, proving the architectural advantage isn't just a matter of "training longer."

Limitations and Future Work

While highly effective, the current work focuses exclusively on Generative Adversarial Networks (GANs). The authors note that they haven't yet explored how this modulated transformation might benefit other popular architectures, such as Diffusion Models or Auto-regressive models. Furthermore, while effective on ImageNet-128, the module's performance on massive-scale text-to-image tasks—which often require much larger backbone networks—remains an open and exciting question for future research.

Summary updated

BibTeX
@inproceedings{yang2023learning,
  author = {Ceyuan Yang and Qihang Zhang and Yinghao Xu and Jiapeng Zhu and Yujun Shen and Bo Dai},
  title = {{Learning Modulated Transformation in GANs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=h8vJVABiBP},
}
Figure