Abstract
Video inpainting requires a delicate balance between propagating information from neighboring frames and hallucinating content in occluded regions. Existing approaches using 3D convolutions often suffer from spatial misalignment and blurriness, while flow-based methods are prone to ghosting artifacts due to imperfect flow estimation. We present the Progressive Temporal Feature Alignment Network (TSAM), a novel architecture that aligns feature maps from adjacent frames using optical flow before aggregation. By incorporating validity masking and a multi-scale progressive architecture, TSAM achieves state-of-the-art performance on benchmarks like FVI and DAVIS, producing sharp, temporally consistent results that outperform current baselines.
Introduction
Video inpainting—the task of filling in missing or corrupted regions in a video sequence—is essential for applications such as object removal and watermark restoration. The primary challenge lies in maintaining temporal consistency while ensuring spatial high-fidelity. Existing methods generally fall into three categories: 3D convolutions, which are efficient but often ignore motion dynamics; flow-based warping, which excels at alignment but fails when flow estimation is inaccurate; and attention mechanisms, which produce high-resolution results at a high computational cost.
The authors identify a critical gap in how information is borrowed from neighboring frames. To address this, they propose a method that accurately aligns features without being sabotaged by imperfect optical flow or spatial shifts.
Methodology: Temporal Shift-and-Align Module (TSAM)
The core innovation of this work is the Temporal Shift-and-Align Module (TSAM). Building upon the standard Temporal Shift Module (TSM), TSAM introduces a sophisticated alignment step to handle dynamic content:
- Feature Shifting: A portion of the feature channels from adjacent frames is shifted into the current timestamp to facilitate information exchange.
- Optical Flow Alignment: Shifted features are warped using optical flow to spatially align them with the current frame's features at the latent level, rather than the pixel level.
- Validity Masking: To mitigate errors from unreliable flow (e.g., in occluded areas), the model calculates a "validity mask" based on cycle consistency. This tells the network which warped pixels to trust and which to ignore.
- Progressive Architecture: These modules are integrated into a ResNet-based encoder-decoder. By applying alignment progressively from coarse to fine scales, the network captures both large-scale object motion and fine-grained textures.
The model is optimized using a combination of $L_1$ reconstruction loss, VGG-based perceptual loss, style loss, and a Temporal-Patch GAN discriminator to ensure realistic textures and smooth temporal transitions.
Experiments and Results
The model was evaluated on the FVI (Free-form Video Inpainting) and DAVIS datasets against three types of corruption: object masks, curve masks, and stationary masks.
Quantitative Performance
On the FVI dataset with curve masks, TSAM achieved a PSNR of 37.43, outperforming the next best baseline (36.84). It also demonstrated a significantly lower VFID (Video Frechet Inception Distance), indicating superior visual realism and temporal consistency.
Qualitative Analysis
Visual comparisons demonstrate that TSAM preserves sharp edges and fine details that baselines often distort. As shown in Figure 1, while methods like FGVC and FFVI exhibit ghosting or blurriness in complex regions (such as the fence in the road scene or the panda's fur), TSAM produces results that are nearly indistinguishable from the ground truth.
Conclusion
The Progressive Temporal Feature Alignment Network demonstrates that 3D convolutions and optical flow are complementary. By aligning features rather than pixels and utilizing validity masks to handle occlusions, TSAM effectively eliminates the ghosting and blurriness common in previous video inpainting methods. While the model currently relies on external flow completion during inference, future work may involve integrating end-to-end flow estimation to further streamline the pipeline.
Summary updated