Skip to main content
QUICK REVIEW

[Paper Review] MAT: Mask-Aware Transformer for Large Hole Image Inpainting

Wenbo Li, Zhe Lin|arXiv (Cornell University)|Mar 29, 2022
Generative Adversarial Networks and Image SynthesisComputer Science25 citations
TL;DR

MAT presents a high-resolution, mask-aware transformer for large-hole image inpainting, featuring a novel multi-head contextual attention and a style modulation module to enable high-fidelity and pluralistic completions.

ABSTRACT

Recent studies have shown the importance of modeling long-range interactions in the inpainting problem. To achieve this goal, existing approaches exploit either standalone attention techniques or transformers, but usually under a low resolution in consideration of computational cost. In this paper, we present a novel transformer-based model for large hole inpainting, which unifies the merits of transformers and convolutions to efficiently process high-resolution images. We carefully design each component of our framework to guarantee the high fidelity and diversity of recovered images. Specifically, we customize an inpainting-oriented transformer block, where the attention module aggregates non-local information only from partial valid tokens, indicated by a dynamic mask. Extensive experiments demonstrate the state-of-the-art performance of the new model on multiple benchmark datasets. Code is released at https://github.com/fenglinglwb/MAT.

Motivation & Objective

  • Motivate improved long-range context modeling for large-hole inpainting beyond low-resolution approaches.
  • Design an inpainting-oriented transformer that can process high-resolution images efficiently.
  • Ensure training stability when handling large missing regions through architectural modifications.
  • Enable pluralistic generation to produce diverse plausible completions.
  • Incorporate a style manipulation module to controllably vary outputs while preserving realism.

Proposed method

  • Introduce a convolutional head to extract 1/8-sized feature tokens from masked images for efficiency.
  • Develop an adjusted transformer block that removes layer normalization and uses feature concatenation (fusion learning) instead of residual connections.
  • Propose Multi-Head Contextual Attention (MCA) that performs non-local attention using only valid tokens with a dynamic mask and shifted window schema.
  • Employ a dynamic mask updating strategy to progressively reveal and utilize valid tokens during attention propagation.
  • Incorporate a style manipulation module that modulates convolutional weights via image-conditioned and noise-derived styles to enable pluralistic outputs.
  • Utilize non-saturating adversarial loss, R1 regularization, and perceptual loss to train a high-fidelity generator without relying on per-pixel MAE/MSE losses.

Experimental results

Research questions

  • RQ1Can a transformer-based architecture directly process high-resolution images for large-hole inpainting while maintaining visual realism and semantic coherence?
  • RQ2Does a mask-driven, partial attention mechanism improve long-range context modeling compared to full attention on large missing regions?
  • RQ3Can architectural modifications (no layer norm, fusion learning) stabilize training with large masks and improve inpainting quality?
  • RQ4Does a style modulation module effectively produce diverse, plausible completions (pluralistic generation) without sacrificing realism?

Key findings

  • The full MAT model achieves state-of-the-art performance on Places and CelebA-HQ benchmarks for large-hole inpainting.
  • Ablation shows the full model outperforms variants across FID, P-IDS, and U-IDS on a Places-based evaluation with 256×256 inputs (FID 5.97, P-IDS 13.17, U-IDS 29.23).
  • Replacing transformers with convolutions degrades performance across all metrics, confirming the benefit of long-range context modeling.
  • The adjusted transformer block with fusion learning yields clear gains over conventional transformer blocks in inpainting stability and quality.
  • Multi-Head Contextual Attention (MCA) that uses a dynamic mask of valid tokens improves color consistency and reduces blurriness compared to full-attention variants.
  • The style manipulation module enables perceptually diverse completions, with ablated variants showing noticeable drops in P-IDS and U-IDS when removed.
  • High-resolution reconstruction within the MAT pipeline significantly improves results compared to low-resolution generation approaches.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.