Deep Blind Image Inpainting

Yang Liu, Jinshan Pan, Zhixun Su

TL;DR

This paper introduces an efficient deep learning approach for "blind" image inpainting, meaning it can restore missing image regions without knowing their exact locations beforehand. By employing a novel encoder-decoder architecture and a robust L1 loss function, their method significantly outperforms existing techniques in both quantitative metrics and visual quality, even handling complex text and arbitrary shapes.

What Problem Does This Paper Address?

Image inpainting, the task of filling in missing or corrupted parts of an image, is crucial for restoring damaged photos, removing unwanted objects, and more. Traditional inpainting methods often require knowing the precise location of the corrupted regions (non-blind inpainting). However, in many real-world scenarios, such as recovering old photographs with unknown damage, this information is unavailable. This paper tackles the more challenging problem of "blind" image inpainting, where the algorithm must infer both the missing content and its location. Existing blind inpainting methods struggle with arbitrary shapes and complex textures, often leaving noticeable artifacts.

Methods

The core of the proposed method is a deep convolutional neural network (CNN) designed with an encoder-decoder architecture, inspired by residual learning.

  • Encoder-Decoder Architecture: The network, named Net-D and Net-E, is designed to capture complementary image priors. Net-D acts as a decoder to extract high-dimensional features from low-dimensional input, while Net-E acts as an encoder to learn the underlying mapping for restoration. Skip connections, inspired by U-Net, are used to propagate low-level contextual information to higher semantic layers, aiding in detail preservation.
  • Residual Learning: The network learns to predict the residual (the missing information) rather than the entire clear image directly. This is a common technique in image restoration for better performance.
  • Pre-extracted Gradient Prior: To further enhance the recovery of structures and details, the algorithm incorporates horizontal and vertical image gradients as an additional input. These gradients help the network better understand edges and textures.
  • Robust L1 Loss Function: To combat the issue of outliers introduced by missing information, the authors opt for an L1 norm loss function instead of the more common L2 norm. This makes the training process more stable and leads to more accurate results, especially when dealing with significant missing regions.

The entire network is trained end-to-end, meaning all components are optimized simultaneously.

Datasets

  • Training Data: The authors generated a large training dataset by sampling 100,000 64x64 grayscale patches from 291 natural images. They augmented this with random scaling, rotation, and the addition of text and square masks to simulate corrupted regions.
  • Testing Data: For evaluation, they used four standard benchmark datasets: Set5, Set14, Urban100, and BSDS500. Masked test images were generated using the same text and square masks as the training data.

Key Insights and Ideas

  • Blind Inpainting is Harder: The paper highlights that directly restoring a clear image from a corrupted input without knowing the mask location is significantly more challenging than non-blind methods.
  • Encoder-Decoder for Priors: The encoder-decoder structure is effective for capturing rich, complementary image priors that are crucial for filling in missing information.
  • Gradients Aid Structure: Incorporating pre-extracted image gradients provides valuable structural information that helps the network recover fine details and sharp edges.
  • L1 Loss for Robustness: The L1 loss function is demonstrably more robust to outliers than the L2 loss in image inpainting, leading to fewer artifacts and better visual quality, especially in challenging scenarios.
  • End-to-End Training is Key: Training the entire network, including the gradient prior integration, in an end-to-end fashion optimizes all components for the specific task.

Key Results

  • Quantitative Performance: The proposed method achieves significantly higher PSNR and SSIM scores across all benchmark datasets compared to state-of-the-art blind and even non-blind inpainting methods. For example, on Set5, their method achieved a PSNR of 32.5173/SSIM of 0.9569, outperforming others by a notable margin.
  • Speed: The method is remarkably fast, with an average running time of only 0.03 seconds per image on a Set5 grayscale image (512x512 resolution) using an NVIDIA GTX 1080 Ti GPU, enabling real-time inpainting.
  • Qualitative Results: Visual comparisons show that the proposed method produces much cleaner images with fewer artifacts, particularly in recovering complex textures like text and arbitrary shapes, where other methods fail.

Limitations and Future Work

  • Struggles with Unique Structures: The authors acknowledge that their algorithm does not perform well when "special structures or details are corrupted." These unique elements, like a nose or mouse in an image, are difficult to recover without prior knowledge or more advanced techniques.
  • Future Direction: To address the limitation with unique structures, the authors suggest exploring adversarial learning algorithms.

Summary updated

BibTeX
@inproceedings{liu2017deep,
  author = {Yang Liu and Jinshan Pan and Zhixun Su},
  title = {{Deep Blind Image Inpainting}},
  booktitle = {IScIDE},
  year = {2017},
  doi = {10.1007/978-3-030-36189-1\_11},
}
Figure