The Impact of Hole Geometry on Relative Robustness of In-Painting Networks: An Empirical Study

Masood S. Mortazavi, Ning YanarXiv 2020

TL;DR

This paper explores how the shape and orientation of "holes" used during training affect the robustness of image in-painting networks. The researchers demonstrate that training on simple axis-aligned rectangles leads to fragile models, while introducing random rotations or complex geometric shapes significantly improves a network's ability to generalize to unseen occlusion patterns.

What Problem Does This Paper Address?

Image in-painting—the task of filling in missing or masked regions of an image—is a staple of modern computer vision. While many architectures exist, they are often trained and tested on specific types of masks (e.g., just rectangles or specific irregular shapes).

The authors identify a critical gap: relative robustness. If you train a model to fill in rectangular holes, how well does it perform when faced with brushstrokes or complex object silhouettes? The paper investigates whether in-painting networks develop a "natural bias" toward their training hole distributions and how the underlying image dataset influences this sensitivity.

Methods

The authors employ an empirical approach, building a "train-test grid" to cross-compare performance across different hole geometries.

The Architecture

They utilize a U-Net style encoder-decoder network featuring:

  • Partial Convolutions: In the encoder, these ensure that the convolution operation only considers "valid" pixels, preventing the "hole" values from contaminating the early feature maps.
  • Core Complex: A central block of eight layers using dilated convolutions to increase the receptive field without increasing parameter count.
Figure 1. A typical neural in-painting architecture, in inference perspective.

Hole Geometry Distributions

The study compares four distinct Probability Distribution Functions (PDFs) for holes:

  1. Random Rectangles (RR): Simple axis-aligned boxes.
  2. Randomly Rotated Rectangles (R4): Rectangles at arbitrary angles.
  3. Random Geometric Shapes (RGS): Lines, circles, and curves.
  4. Random Flow-based Masks (RFOM): Complex shapes derived from video occlusion data.
Samples of the four hole geometry distributions: RR, R4, RGS, and RFOM.

Evaluation Framework

Beyond standard metrics ($L_1$ loss, PSNR, SSIM), the authors propose a "Holistic" Relative Robustness score. This heuristic combines normalized versions of these metrics to provide a single value representing how well a model generalizes across all test hole distributions.

Datasets

  • MIT Places: A large-scale dataset of diverse scenes. The authors used both the validation set (~36k images) for quick iterations and the full dataset (1.8M images) to confirm trends.
  • CUHK Celeb-A: A dataset of face images. Interestingly, the authors found Celeb-A to be a better "separator"—it revealed differences in model robustness more clearly than the Places dataset.

Key Insights and Ideas

  • The Alignment Trap (H2): Models trained only on axis-aligned rectangles (RR) are significantly less robust. The authors hypothesize that when hole edges align perfectly with square convolution kernels, the network learns "lazy" features that fail when edges are diagonal or curved.
  • Rotation is a "Cheap" Robustness Hack: Simply adding random rotations to rectangular masks (R4) makes a model nearly as robust as one trained on highly complex flow-based masks (RFOM). This suggests that edge orientation diversity is more important than the specific complexity of the shape.
  • Dataset Edge Distribution (H4): The ability of a dataset to differentiate model robustness correlates with its edge gradient distribution. Celeb-A, which has a more even distribution of edge directions, proved more effective at exposing model weaknesses than the Places dataset, which is dominated by horizontal and vertical lines (e.g., horizons, buildings).

Key Results

The "Holistic" robustness scores (where higher is better) clearly show the hierarchy of training strategies:

Training Distribution Holistic Score (Places) Holistic Score (Celeb-A)
RR (Rectangles) 2.10 2.17
R4 (Rotated) 2.86 2.90
RFOM (Flow-based) 2.99 2.97

Models trained on RR performed well only on RR tests but plummeted when tested on other shapes. In contrast, RFOM and R4 models maintained high performance across the board. The $L_1$ reconstruction error was found to be the most sensitive metric for detecting these robustness gaps.

Limitations and Future Work

  • Limited Hole Types: The study only looked at four distributions. Real-world occlusions (like text or specific object shapes) might present different challenges.
  • Loss Function Interaction: Preliminary results in the supplementary material suggest that changing the loss function (e.g., adding GAN-based discriminative losses) might alter the dominance order of robustness, a topic the authors mark for future study.
  • Regularization: The authors suggest exploring whether mixing different hole classes during a single training run could act as a superior form of regularization.
  • Adversarial Holes: A promising direction involves finding "adversarial" hole patterns specifically designed to break an in-painting system.

Summary updated

Abstract

In-painting networks use existing pixels to generate appropriate pixels to fill "holes" placed on parts of an image. A 2-D in-painting network's input usually consists of (1) a three-channel 2-D image, and (2) an additional channel for the "holes" to be in-painted in that image. In this paper, we study the robustness of a given in-painting neural network against variations in hole geometry distributions. We observe that the robustness of an in-painting network is dependent on the probability distribution function (PDF) of the hole geometry presented to it during its training even if the underlying image dataset used (in training and testing) does not alter. We develop an experimental methodology for testing and evaluating relative robustness of in-painting networks against four different kinds of hole geometry PDFs. We examine a number of hypothesis regarding (1) the natural bias of in-painting networks to the hole distribution used for their training, (2) the underlying dataset's ability to differentiate relative robustness as hole distributions vary in a train-test (cross-comparison) grid, and (3) the impact of the directional distribution of edges in the holes and in the image dataset. We present results for L1, PSNR and SSIM quality metrics and develop a specific measure of relative in-painting robustness to be used in cross-comparison grids based on these quality metrics. (One can incorporate other quality metrics in this relative measure.) The empirical work reported here is an initial step in a broader and deeper investigation of "filling the blank" neural networks' sensitivity, robustness and regularization with respect to hole "geometry" PDFs, and it suggests further research in this domain.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
PlacesRFOM-train\mathcal{R}-holistic (holistic relative robustness score)2.998training-hole-geometry=RFOM
Source quote
L345: RFOM-train │ 2.998 │ 2.97
CelebA · Celeb-ARFOM-train\mathcal{R}-holistic (holistic relative robustness score)2.97training-hole-geometry=RFOM
Source quote
L345: RFOM-train │ 2.998 │ 2.97
PlacesR4-train\mathcal{R}-holistic (holistic relative robustness score)2.86training-hole-geometry=R4
Source quote
L343: R4-train │ 2.86 │ 2.90
CelebA · Celeb-AR4-train\mathcal{R}-holistic (holistic relative robustness score)2.90training-hole-geometry=R4
Source quote
L343: R4-train │ 2.86 │ 2.90
PlacesRR-train\mathcal{R}-holistic (holistic relative robustness score)2.1training-hole-geometry=RR
Source quote
L342: RR-train │ 2.1 │ 2.17
CelebA · Celeb-ARR-train\mathcal{R}-holistic (holistic relative robustness score)2.17training-hole-geometry=RR
Source quote
L342: RR-train │ 2.1 │ 2.17
BibTeX
@misc{mortazavi2020impact,
  author = {Masood S. Mortazavi and Ning Yan},
  title = {{The Impact of Hole Geometry on Relative Robustness of In-Painting Networks: An Empirical Study}},
  year = {2020},
  eprint = {2003.02314},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2003.02314},
}
Figure