Copy-and-Paste Networks for Deep Video Inpainting

Sungho Lee, Seoung Wug Oh, DaeYeun Won, Seon Joo KimICCV 2019 · DOI

Introduction

Video inpainting—the task of filling missing or corrupted regions in a video sequence—presents a unique challenge compared to its image-based counterpart. While image inpainting focuses on spatial plausibility, video inpainting requires strict temporal coherence. Inconsistencies between frames lead to distracting flickering or "ghosting" artifacts that break the visual illusion. Historically, solutions have been split between high-quality but computationally prohibitive optimization-based methods and faster deep learning models that often struggle with long-term consistency.

This paper introduces a novel deep neural network (DNN) framework that conceptualizes video inpainting as a "copy-and-paste" task. By leveraging information from distant reference frames, the proposed system achieves quality comparable to state-of-the-art optimization techniques while operating over 30 times faster.

Methodology: The Copy-and-Paste Framework

The architecture is composed of three specialized sub-networks designed to identify, extract, and integrate information across the temporal domain.

1. Alignment Network

To utilize information from other frames, the system must first establish spatial correspondence. Traditional optical flow often fails when large "holes" (missing regions) are present because local pixel gradients are destroyed. Instead, the authors employ an Alignment Network that estimates affine matrices to register reference frames to the target frame. This network is trained in a self-supervised manner, focusing exclusively on valid, non-hole pixels to ensure robustness against large occlusions.

2. Copy Network (Context Matching)

The core of the system is the Copy Network, which acts as a context-matching module. It calculates the similarity between the target frame and aligned reference frames within a high-dimensional feature space. A critical component here is the Masked Softmax mechanism. This ensures the network only "attends" to valid pixels in the reference frames, preventing it from erroneously copying data from holes in other frames.

3. Paste Network (Decoder)

The Paste Network serves as the decoder, taking the aggregated features from the Copy Network and the original target frame to generate the final output. For regions that remain occluded throughout the entire video, the decoder utilizes dilated convolutions to synthesize new content based on the surrounding spatial context.

Figure 1: The framework leverages reference frames to fill holes in a target frame. (a) illustrates object removal, while (b) shows the method applied to exposure correction by treating over-exposed areas as holes.

To maintain long-term consistency, the framework employs an iterative update strategy. Completed frames are added back into the pool of reference frames, and the video is processed in both forward and backward passes to maximize the flow of information.

Key Insights and Applications

A significant finding of this research is the robustness of affine transformations over optical flow for alignment in the presence of large holes. Furthermore, the authors demonstrate that the inpainting logic is highly versatile. Beyond simple object removal, the network can be used for video enhancement. By treating over-exposed or under-exposed regions as "holes," the network can "copy" correct exposure details from other frames where the lighting was more favorable.

Experimental Results

The proposed method was evaluated against the DAVIS 2017 dataset and compared to leading optimization-based approaches.

  • Computational Efficiency: The system is approximately 35 times faster than the leading optimization-based method, reducing processing time from 952 seconds to just 27 seconds per video.
  • Visual Quality: In a large-scale user study, the method's results were ranked nearly equal to state-of-the-art optimization methods and significantly outperformed previous deep learning architectures like VINet.
  • Downstream Utility: When applied to restoring road videos with poor exposure, the method improved lane detection accuracy from 46.69% to 83.00%, highlighting its potential for autonomous driving systems.

Conclusion and Future Work

While the Copy-and-Paste Network offers a significant leap in speed and consistency, challenges remain. The reliance on affine alignment may struggle with highly non-rigid motions, such as a person dancing. Additionally, regions that are never visible in the entire sequence must be "hallucinated" by the decoder, which can result in slightly softer textures compared to "copied" regions. Future research may focus on integrating more complex warping mechanisms and optimizing memory usage for larger temporal windows.

Summary updated

BibTeX
@inproceedings{lee2019copy,
  author = {Sungho Lee and Seoung Wug Oh and DaeYeun Won and Seon Joo Kim},
  title = {{Copy-and-Paste Networks for Deep Video Inpainting}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00451},
}
Figure