NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Image Inpainting by End-to-End Cascaded Refinement With Mask Awareness

Manyu Zhu, Dongliang He, Xin Li, Chao Li, Fu Li, Xiao Liu, Errui Ding, Zhaoxiang Zhang

Introduction

Image inpainting—the process of reconstructing missing or corrupted regions within an image—remains a significant challenge in computer vision. The primary difficulty lies in the arbitrary shapes and sizes of the missing regions, often referred to as "holes." While Deep Learning has advanced the field, traditional Convolutional Neural Networks (CNNs) suffer from a fundamental limitation: mask unawareness.

Standard CNNs apply fixed mathematical filters (kernels) uniformly across an image, regardless of whether a pixel contains valid data or is part of a hole. This leads to two critical issues. First, treating holes as valid pixels confuses the network, resulting in blurry boundaries and semantic inconsistencies. Second, standard Batch Normalization calculates statistics across the entire image, ignoring the fact that the statistical distribution of a hole differs significantly from that of a valid region. This "covariant shift" often introduces unwanted artifacts in the final output.

Methodology

To address these challenges, this research introduces a framework designed to be inherently mask-aware through three primary innovations: Mask-Aware Dynamic Filtering, Point-wise Normalization, and an End-to-End Cascaded Refinement architecture.

Mask-Aware Dynamic Filtering (MADF)

Unlike traditional convolutions that utilize learned but static kernels, MADF dynamically generates unique kernels for every convolution window. These kernels are derived from the specific features of the mask, allowing the model to adapt its receptive field and filtering logic based on the shape and location of the missing region. This flexibility enables the network to handle irregular holes more effectively than previous methods like Gated Convolutions (GConv), which merely weight features rather than adapting the filters themselves.

Point-wise Normalization (PN)

To resolve the issues associated with global normalization, the authors developed Point-wise Normalization (PN) for the decoding phase. PN adaptively assigns a unique scaling factor and bias to every individual pixel, conditioned on features from the preceding decoder stage. By treating normalization as a spatial problem, the model preserves the distinct statistical identities of hole versus non-hole regions, preventing the loss of fine semantic details.

End-to-End Cascaded Refinement

The architecture follows a multi-stage approach to progressively improve image quality. It begins with a Recovery Decoder that generates a coarse initial reconstruction. This is followed by multiple Refinement Decoders operating in parallel to sharpen the image. The system is trained using "incremental supervision," where reconstruction, perceptual, and style losses are applied at every stage. This ensures the model learns robust intermediate signals, avoiding the error propagation common in two-stage models that rely on separate edge-prediction steps.

Experimental Results

The proposed framework was evaluated against state-of-the-art methods, including PConv, GConv, and EdgeConnect, across three diverse datasets: Places2 (general scenes), CelebA (faces), and Paris StreetView (architecture).

Quantitative Performance

On the Places2 benchmark, the model achieved a PSNR of 26.11 dB, significantly outperforming PConv (25.30 dB) and GConv (23.57 dB). Similar improvements were noted in Structural Similarity (SSIM) and Frechet Inception Distance (FID), the latter of which measures the realism of the generated content.

Qualitative and User Studies

Visual analysis confirms that the cascaded refinement approach produces sharper edges and fewer "checkerboard" artifacts than its predecessors. In a blind A/B user study involving 20 volunteers, the results from this framework were preferred over 90% of the time when compared to traditional methods like PatchMatch and Contextual Attention.

Discussion and Limitations

While the model represents a significant step forward in mask-aware synthesis, it faces challenges in two specific scenarios:

  1. Extreme Data Loss: When more than 50% of an image is missing, the lack of surrounding context makes it difficult for the model to hallucinate a plausible replacement.
  2. Specialized Knowledge: The model lacks external "world knowledge," meaning it may fail to accurately reconstruct highly specific information such as unique logos, text, or complex brand symbols.

Conclusion

By integrating dynamic filtering with spatially-aware normalization and a cascaded refinement strategy, this framework effectively overcomes the "mask unawareness" of traditional CNNs. The result is a robust inpainting solution that maintains semantic consistency and visual sharpness across a wide variety of image types and hole shapes.

Summary updated

BibTeX
@article{zhu2021image,
  author = {Manyu Zhu and Dongliang He and Xin Li and Chao Li and Fu Li and Xiao Liu and Errui Ding and Zhaoxiang Zhang},
  title = {{Image Inpainting by End-to-End Cascaded Refinement With Mask Awareness}},
  journal = {IEEE Trans. Image Process.},
  year = {2021},
  url = {https://openreview.net/forum?id=8FXLYwGOAsvz},
}
Figure