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

Learning position-aware implicit neural network for real-world face inpainting

Bo ZhaoPattern Rcognition 2024

TL;DR

This paper introduces IN², a novel Implicit Neural Network designed for real-world face inpainting, tackling the challenge of arbitrary image shapes and resolutions. By explicitly modeling positional information and incorporating new architectural components like a Downsample Processing Block and Neighbor Hybrid Attention Block, IN² achieves superior results compared to existing methods, particularly in preserving fine facial details.

What Problem Does This Paper Address?

Traditional face inpainting models excel in ideal scenarios, typically with square, low-resolution images. However, when applied to real-world images that often have arbitrary aspect ratios and high resolutions, these models struggle significantly. This leads to visually unappealing results, especially in position-sensitive areas like the eyes and nose, indicating a fundamental limitation in their ability to process and understand spatial positional information across diverse image formats. The paper aims to bridge this gap by developing a model that can robustly handle these real-world constraints.

Methods

The core of the proposed solution is the Implicit Neural Inpainting Network (IN²), which leverages Implicit Neural Representations (INRs) to explicitly model position information. Key novel components include:

  • Downsample Processing Block (DPB): This block replaces standard downsampling operations in the encoder. It incorporates Fast Fourier Convolutions (FFC) and Channel Attention Blocks (CAB) to mitigate information loss during downsampling, especially in early encoding stages where the damaged area is still present.
  • Neighbor Hybrid Attention Block (NHAB): To overcome the limitations of window-based attention (which restricts input shapes), this block uses neighborhood attention for efficient feature processing. It also integrates a Channel Attention Block (CAB) to aggregate global information, aiming for superior facial structure learning.
  • Implicit Neural Pyramid Decoder (INPD): This decoder uses an implicit neural representation block to progressively upsample features. It employs a three-layer pyramid structure, with each layer operating on a different resolution, to bridge the gap between low-resolution features and high-resolution outputs while explicitly modeling positional information.
  • Adaptive Training Strategy (ATS): To further enhance robustness, the authors propose randomly cropping input images into irregular shapes during training, simulating real-world variations and improving the model's ability to handle diverse aspect ratios.

Datasets

The primary dataset used for training and evaluation is CelebA-HQ. The authors use free-form masks for inpainting, with masked areas typically ranging from 20% to 30% of the image.

Key Insights and Ideas

  • The critical role of explicit position modeling: The paper strongly argues that existing inpainting methods fail in real-world scenarios due to their implicit and weak modeling of positional information, especially when dealing with arbitrary shapes and resolutions.
  • INR as a powerful tool for face inpainting: By adapting INR, which has shown success in tasks like super-resolution, the authors demonstrate its potential for robust face inpainting, particularly for handling spatial variations.
  • Downsampling is a bottleneck: The authors identify that standard downsampling in encoders can lead to significant information loss, hindering performance on high-resolution inputs. Their DPB aims to address this.
  • Attention mechanisms need to be shape-agnostic: Traditional attention mechanisms can be restrictive. The NHAB offers a solution by being compatible with arbitrary image shapes.
  • Retraining alone isn't enough: Simply retraining existing models on arbitrary-shaped data doesn't solve the fundamental architectural limitations, as shown in their experiments.

Key Results

  • State-of-the-art performance: IN² achieves superior performance across various settings, including ideal (512px x 512px) and real-world scenarios with different aspect ratios and high resolutions (e.g., 768px x 1024px, 1024px x 768px, 1024px x 576px).
  • Quantitative improvements: The paper presents tables showing IN² outperforming SOTA methods like LaMa, MAT, and CoordFill in PSNR, SSIM, and LPIPS metrics. For instance, in the 1024x576 setting, IN² achieves a PSNR of 31.597, SSIM of 0.929, and LPIPS of 0.051, significantly better than others.
  • Qualitative superiority: Visual results (Figure 4 and 5) demonstrate IN²'s ability to produce more realistic and precise inpainting, especially in challenging areas like eyes and noses, where other methods exhibit artifacts or misalignment.
  • Efficiency: Despite its advanced capabilities, IN² shows competitive model size and inference time compared to other methods.

Limitations and Future Work

  • Limitations: The paper acknowledges that while their Adaptive Training Strategy is effective, the underlying model design is crucial for learning robust representations. Without the INR structure, even with the same training strategy, performance can drop. The authors also note that the bottleneck for further speed improvements lies in attention operations.
  • Future Work: The paper implicitly suggests that further research into more efficient attention mechanisms and potentially exploring other INR-based architectures could lead to even faster and more capable inpainting models. The success of their approach also opens avenues for applying similar position-aware INR techniques to other image manipulation tasks.

Summary updated

BibTeX
@inproceedings{zhao2024learning,
  author = {Bo Zhao},
  title = {{Learning position-aware implicit neural network for real-world face inpainting}},
  booktitle = {Pattern Rcognition},
  year = {2024},
  url = {https://openreview.net/forum?id=oZ0ODFSpNd},
}
Figure