Short-Term and Long-Term Context Aggregation Network for Video Inpainting

Ang Li, Shanshan Zhao, Xingjun Ma, Mingming Gong, Jianzhong Qi, Rui Zhang, Dacheng Tao, Ramamohanarao Kotagiri

Abstract

Video inpainting requires the synthesis of missing regions in a video sequence while maintaining both spatial plausibility and temporal coherence. This paper introduces a novel framework that simultaneously leverages short-term and long-term temporal information. By employing a Boundary-aware Short-term Context Aggregation (BSCA) module to handle local neighbor frames and a Dynamic Long-term Context Aggregation (DLCA) module to manage a memory bank of distant frames, the network achieves state-of-the-art results. The proposed method demonstrates high temporal consistency and significantly faster processing speeds compared to previous multi-stage techniques.

Addressing the Challenges of Video Inpainting

Video inpainting is a complex task because it must ensure that the filled regions do not flicker or appear disjointed over time. The authors identify two primary limitations in existing deep learning approaches:

  1. Inaccurate Short-term Aggregation: Many current methods rely on optical flow to warp neighboring frames into the missing region. However, because the target region contains no data, the estimated flow within that hole is often distorted, leading to blurry or warped artifacts in the final output.
  2. Ineffective Long-term Usage: Some methods only consider immediate neighbors, missing background information that might have been visible much earlier or later in the sequence. Other methods use a fixed set of distant frames, which may become irrelevant if there is significant camera or object motion.
Figure 1: Comparison of standard flow-based warping versus the proposed method's aggregation. Note how standard warping (fourth image) introduces artifacts that the proposed method (fifth image) avoids.

Methodology

The proposed network utilizes a recurrent encoder-decoder architecture that processes video frames sequentially. The core innovation lies in two specialized modules designed to aggregate context effectively:

Boundary-aware Short-term Context Aggregation (BSCA)

Instead of warping the entire reference frame using potentially unreliable flow, the BSCA module focuses on the boundary context—the area immediately surrounding the missing region. It uses optical flow to locate where this boundary exists in neighboring frames, aligns those local regions, and then employs an attention-based mechanism to aggregate the best features into the target frame. This process occurs at multiple scales during the encoding stage, ensuring that local, high-resolution consistency is maintained without the "hallucination" errors common in global flow-warping methods.

Dynamic Long-term Context Aggregation (DLCA)

During the decoding stage, the network maintains a dynamic "memory" of features from previously restored frames. Using a similarity-based algorithm, the network constantly updates this bank, discarding irrelevant frames and retaining those most similar in feature space to the current target. This allows the model to effectively "search" for and remember background details from much earlier in the video to fill current occlusions.

Experimental Results

The model was evaluated on the YouTube-VOS and DAVIS benchmarks using square, irregular, and object-based masks.

Quantitative Performance

The proposed model outperformed state-of-the-art baselines, including VINet, CPNet, and FGNet, across several metrics:

  • Visual Quality: Improved PSNR and SSIM scores.
  • Temporal Consistency: Lower Video Fréchet Inception Distance (VFID).
  • Efficiency: The model achieved a nearly 8x speedup over the multi-stage FGNet, processing YouTube-VOS videos in 35.4 seconds compared to FGNet's 276 seconds.

Qualitative Comparison

Visual evaluations demonstrate that the proposed method produces cleaner results with fewer artifacts than competing models. In a user study with 50 volunteers, the proposed model received significantly more "Rank 1" votes for visual quality and consistency.

Figure 6: Qualitative comparison between the proposed method and state-of-the-art baselines (CPNet, FGNet) on the DAVIS dataset. The proposed method (bottom row) more accurately restores complex structures and shadows.

Conclusion

By decoupling temporal aggregation into boundary-aware short-term alignment and dynamic long-term memory management, this framework addresses the fundamental weaknesses of flow-based video inpainting. The result is a highly efficient, single-stage network that produces temporally coherent and visually pleasing video restorations. Future work may involve optimizing the computational overhead of the underlying flow extraction and applying the dynamic update strategy to other video processing tasks.

Summary updated

BibTeX
@inproceedings{li2020short,
  author = {Ang Li and Shanshan Zhao and Xingjun Ma and Mingming Gong and Jianzhong Qi and Rui Zhang and Dacheng Tao and Ramamohanarao Kotagiri},
  title = {{Short-Term and Long-Term Context Aggregation Network for Video Inpainting}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58548-8\_42},
}
Figure