PD-GAN: Probabilistic Diverse GAN for Image Inpainting

Hongyu Liu, Ziyu Wan, Wei Huang, Yibing Song, Xintong Han, Jing Liao

PD-GAN: Probabilistic Diverse GAN for Image Inpainting

Abstract

Image inpainting is inherently ambiguous, yet most existing methods produce deterministic or poorly varied results. PD-GAN (Probabilistic Diverse GAN) introduces a generative approach that produces multiple, high-quality, and diverse completions for missing image regions. By leveraging a novel Spatially Probabilistic Diversity Normalization (SPDNorm) and a feature-based diversity loss, PD-GAN ensures boundary consistency while allowing for significant creative variation in the center of the hole.

Introduction

Traditional image inpainting often treats the task as a reconstruction problem, aiming for a single "ground truth" solution. However, real-world scenes are often ambiguous; a missing region behind an object could contain various plausible elements. Existing diverse inpainting methods, often based on Variational Autoencoders (VAEs), frequently face a trade-off between visual realism and diversity, often resulting in blurry outputs or nearly identical "diverse" samples. PD-GAN addresses this by reframing inpainting as a conditional generation task starting from random noise.

Methodology: SPDNorm and Perceptual Diversity

The core of PD-GAN is its departure from standard encoder-decoder architectures. Instead, it utilizes a GAN that generates images from a noise vector $z$, which is then modulated by the image context.

Spatially Probabilistic Diversity Normalization (SPDNorm)

To balance the need for seamless boundaries with the desire for central diversity, the authors propose SPDNorm. This module modulates hidden features using a coarse prediction $P$ and a mask $M$. It consists of two components:

  • Hard SPDNorm: Implements a spatial decay map where influence from the context is strongest at the hole's edges and weakens toward the center, where random noise has more influence.
  • Soft SPDNorm: A learned, adaptive mapping that dynamically adjusts diversity levels based on the semantic content of the image.
The PD-GAN architecture and its core SPDNorm components. (a) shows the overall pipeline, while (b-d) detail the ResBlock and the Hard/Soft normalization modules.

Perceptual Diversity Loss

To encourage meaningful variation, PD-GAN employs a Perceptual Diversity Loss ($L_{pdiv}$). Unlike standard diversity losses that operate on raw pixels—often leading to artifacts—$L_{pdiv}$ forces the high-level VGG features of different generated samples to be distinct. This ensures that diversity is semantic (e.g., changing a bench to a bush) rather than just a shift in pixel values.

Experimental Results

PD-GAN was evaluated on CelebA-HQ, Places2, and Paris Street View datasets using irregular masks.

Qualitative Performance

As shown in Figure 1, PD-GAN generates significantly more varied and realistic textures compared to prior state-of-the-art methods like PICNet. The model successfully captures different plausible structures for complex scenes, such as varying facial features or architectural details.

Qualitative comparison of diverse inpainting results across different datasets. PD-GAN (Ours) produces more realistic and perceptually diverse completions than PICNet.

Quantitative Metrics

On the Places2 dataset, PD-GAN achieved a PSNR of 29.20 and an FID of 19.98, outperforming PICNet (PSNR 28.38, FID 38.64). Diversity scores measured via LPIPS also showed PD-GAN consistently producing more varied outputs than CVAE and BicycleGAN. In human preference studies, PD-GAN's results were preferred in 83% of comparisons.

Conclusion and Future Work

PD-GAN demonstrates that diversity in inpainting can be effectively modeled as a spatial gradient of uncertainty. By starting from noise and applying spatially-aware normalization, the model achieves a superior balance of realism and variety. Future work may involve reducing the dependency on initial coarse priors and extending the SPDNorm framework to other conditional generation tasks like sketch-to-photo synthesis.

Summary updated

BibTeX
@inproceedings{liu2021pd,
  author = {Hongyu Liu and Ziyu Wan and Wei Huang and Yibing Song and Xintong Han and Jing Liao},
  title = {{PD-GAN: Probabilistic Diverse GAN for Image Inpainting}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00925},
}
Figure