Region Normalization for Image Inpainting

Tao Yu, Zongyu Guo, Xin Jin, Shilin Wu, Zhibo Chen, Weiping Li, Zhizheng Zhang, Sen Liu

Abstract

Standard feature normalization techniques often fail in image inpainting because they ignore the massive statistical difference between "clean" pixels and "corrupted" holes. This paper introduces Region Normalization (RN), which splits feature maps into corrupted and uncorrupted regions to normalize them independently, preventing training bottlenecks and producing significantly clearer, more realistic image reconstructions.

The Challenge of Spatial Inconsistency

In deep learning, Feature Normalization (FN)—such as Batch Normalization or Instance Normalization—is essential for network stability and training speed. It ensures that the mean and variance of data flowing through the network remain within a healthy range.

However, image inpainting presents a unique challenge: the input image is spatially inconsistent. It contains valid pixels (the original image) and corrupted pixels (the "holes" to be filled). When standard normalization is applied across the entire image, the extreme values of corrupted regions "pollute" the statistics of valid regions. This leads to a mean and variance shift, pushing valid features into the saturated, non-responsive zones of activation functions like ReLU or Sigmoid, resulting in vanishing gradients and blurry outputs.

Proposed Method: Region Normalization (RN)

To address this, the authors propose Region Normalization (RN). Instead of calculating a single mean and variance for the entire feature map, RN treats corrupted and uncorrupted areas as distinct entities, calculating statistics separately for $K$ regions (typically $K=2$).

Visualization of Region Normalization (RN) acting on a feature tensor, separating corrupted and uncorrupted regions.

The researchers developed two specific versions of RN to handle different stages of the network:

  1. Basic RN (RN-B): Applied in early encoder layers, it uses the original binary mask to explicitly separate pixels, solving the statistical shift problem at the input stage.
  2. Learnable RN (RN-L): In deeper layers, convolutions "smear" mask boundaries. RN-L uses an internal module to predict corrupted regions based on feature distributions and applies a global affine transformation to smoothly fuse reconstructed regions.

Key Insights: Avoiding the Saturation Trap

A critical insight of this work is that global normalization can actively hinder inpainting. By forcing the mean of the entire image to zero, the network inadvertently shifts "good" pixels into the flat, non-learning parts of activation functions. This is referred to as the "saturation trap."

Feature distributions relative to ReLU and Sigmoid activations, illustrating the 'saturation trap' caused by global normalization.

RN keeps these "good" pixels in the active part of the distribution. Furthermore, the paper recognizes that masks must evolve; in deep layers, corruption is a region of uncertainty rather than a simple hole. RN-L’s ability to detect these regions automatically handles the spatial blurring inherent in deep networks.

Experimental Results

The model was evaluated on the Places2 and CelebA datasets using irregular masks. RN was integrated into an EdgeConnect-based backbone, replacing standard Instance Normalization.

  • Quantitative Performance: On Places2, RN improved PSNR by 0.73 dB and SSIM by 0.017 over the baseline, consistently reducing $l_1$ loss across various mask sizes.
  • Qualitative Quality: Visually, RN produced significantly sharper results with better texture consistency and fewer boundary artifacts compared to state-of-the-art models like Partial Convolution (PC).
  • Versatility: RN is a "plug-and-play" module. The authors demonstrated that it could be dropped into other architectures, such as Gated Convolution, to provide performance boosts.

Conclusion

Region Normalization offers a simple yet effective solution to the statistical inconsistencies inherent in image inpainting. By normalizing corrupted and valid regions independently, it avoids the training bottlenecks of standard techniques. Future work may extend this approach to other spatially inconsistent tasks like object detection or semantic segmentation.

Summary updated

BibTeX
@inproceedings{yu2020region,
  author = {Tao Yu and Zongyu Guo and Xin Jin and Shilin Wu and Zhibo Chen and Weiping Li and Zhizheng Zhang and Sen Liu},
  title = {{Region Normalization for Image Inpainting}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i07.6967},
}
Figure