Semantic Image Inpainting with Multi-Stage Feature Reasoning Generative Adversarial Network

Guangyao Li, Liangfu Li, Yingdan Pu, Nan Wang, Xi Zhang2022 · DOI

TL;DR

This paper introduces MFR-GAN, a novel generative adversarial network for semantic image inpainting that tackles the challenge of repairing large missing regions. It achieves this through a multi-stage feature reasoning approach, dynamic partial convolutions for adaptive restoration, and a hybrid weighted merging strategy for improved feature fusion, leading to more realistic and semantically coherent results.

What Problem Does This Paper Address?

Image inpainting, the task of filling in missing or damaged parts of an image, has seen significant progress with deep learning. However, repairing large, irregular holes remains a significant challenge. Traditional methods struggle with semantic understanding, while existing deep learning approaches, particularly one-shot methods, often fail to generate convincing results for extensive missing areas due to insufficient contextual information. Progressive inpainting methods offer a solution by restoring images in stages, but they face issues like weakened pixel correlations as holes shrink, covariant shift from batch normalization, and the corruption of early generated signals over multiple iterations. This paper aims to address these limitations by proposing a more robust and effective multi-stage inpainting framework.

Methods

The proposed MFR-GAN framework is built upon several key innovations:

  • Multi-stage Feature Reasoning: The core idea is to progressively restore missing regions over multiple stages, allowing the model to learn from previously generated content.
  • Dynamic Partial Convolution: To adapt to the shrinking hole regions during progressive inpainting, this technique dynamically adjusts the restoration proportion. This helps maintain a stronger correlation between valid and invalid pixels.
  • Point-wise Normalization: To combat the covariant shift issue arising from different statistical characteristics of valid and invalid pixels, point-wise normalization is employed in the decoder. This method adaptively assigns scale and bias parameters to each feature point, effectively handling the discrepancies.
  • Hybrid Weighted Merging: This novel approach combines a "hard weight map" (derived from mask characteristics) and a "soft weight map" (learned from input and fused features). This strategy aims to effectively fuse feature maps from different stages, preventing gradient vanishing, preserving early generated information, and enhancing the model's reasoning capability.
  • Feature Generation Module: The generator utilizes two parallel encoders: one for attention-based texture synthesis and another for dilated convolutions to capture spatial features. These are then concatenated and fed into a decoder.
  • Attention Module: An attention mechanism is integrated to search for relevant textures in background regions and apply them to fill unknown areas, ensuring semantic meaningfulness.
  • Patch-GAN Discriminator: A Patch-GAN discriminator is used for adversarial training, focusing on local image patches to improve detail generation.

Datasets

The model was trained and evaluated on the following datasets:

  • Places2 Dataset: A large-scale dataset containing over 365 scenes, used for learning natural scene distributions.
  • CelebA Dataset: A dataset focused on face images.
  • Paris StreetView Dataset: A dataset commonly used for inpainting tasks, featuring complex urban scenes.

The paper also mentions using a mask dataset for testing.

Key Insights and Ideas

  • Progressive Inpainting is Crucial for Large Holes: The paper strongly advocates for a multi-stage approach to handle large missing regions, as one-shot methods are inherently limited by context.
  • Adaptive Restoration is Key: The dynamic partial convolution's ability to adjust the inpainting scope based on the mask ratio is a critical insight for maintaining pixel correlations throughout the progressive process.
  • Batch Normalization's Pitfalls: The paper highlights how standard batch normalization can be detrimental in progressive inpainting due to differing pixel statistics in valid and invalid regions, motivating the use of point-wise normalization.
  • Fusion Matters: The hybrid weighted merging strategy is a significant contribution, demonstrating that a learned, adaptive fusion of intermediate features is superior to simple averaging or no merging, especially for complex restorations.

Key Results

  • Qualitative Improvements: The proposed MFR-GAN generates visually more realistic and semantically coherent results compared to state-of-the-art methods like PConv, GConv, EdgeConnect, LBAM, and RFR-Net across Places2, CelebA, and Paris StreetView datasets. The results show better texture, structural consistency, and fewer artifacts, especially in complex scenes and large holes.
  • Quantitative Performance: The paper reports PSNR improvements of 0.3 dB to 1.2 dB compared to other methods on the Places2 dataset. For instance, with a hole ratio of (0.2, 0.3], the average PSNR achieved was 26.23 dB, with an SSIM of 0.922 and an FID of 12.79. Even for challenging large holes (0.5, 0.6] ratio, MFR-GAN produced a PSNR of 19.53 dB and SSIM of 0.669.
  • Ablation Studies: Experiments confirmed the effectiveness of dynamic partial convolution, hybrid weighted merging, and point-wise normalization, with each component contributing to improved performance.

Limitations and Future Work

  • Iterative Nature: While beneficial, the multi-stage approach inherently increases computation time compared to one-shot methods. The paper explores the effect of iteration numbers, suggesting that too many recursions can also lead to issues.
  • Dataset Specificity: While tested on diverse datasets, the model's performance on extremely novel or out-of-distribution scenes might require further investigation.
  • Future Work: The authors suggest that further research could explore more efficient architectures and potentially investigate the model's ability to handle even larger and more complex missing regions. The paper also implies that the learned adaptive scale and bias parameters from point-wise normalization could be further explored for other normalization-related challenges in deep learning.

Summary updated

BibTeX
@misc{li2022semantic,
  author = {Guangyao Li and Liangfu Li and Yingdan Pu and Nan Wang and Xi Zhang},
  title = {{Semantic Image Inpainting with Multi-Stage Feature Reasoning Generative Adversarial Network}},
  year = {2022},
  doi = {10.3390/s22082854},
}
Figure