Abstract: This paper proposes a novel deep learning-based video object matting method that can achieve temporally coherent matting results. Its key component is an attention-based temporal aggregation module that maximizes image matting networks' strength for video matting networks. This module computes temporal correlations for pixels adjacent to each other along the time axis in feature space, which is robust against motion noises. We also design a novel loss term to train the attention weights, which drastically boosts the video matting performance. Besides, we show how to effectively solve the trimap generation problem by fine-tuning a state-of-the-art video object segmentation network with a sparse set of user-annotated keyframes. To facilitate video matting and trimap generation networks' training, we construct a large-scale video matting dataset with 80 training and 28 validation foreground video clips with ground-truth alpha mattes. Experimental results show that our method can generate high-quality alpha mattes for various videos featuring appearance change, occlusion, and fast motion.
Introduction
Video object matting is the process of estimating the precise per-pixel opacity (the "alpha matte") of a foreground object across a video sequence. Unlike simple binary segmentation, matting must account for semi-transparent details like hair, smoke, or motion blur.
The primary challenge in video matting is temporal coherence. If a video is processed frame-by-frame using standard image matting tools, the results often "flicker" or jitter because the model makes slightly different errors in each frame. Previous attempts to fix this relied on optical flow to track pixels over time, but optical flow is notoriously brittle when dealing with transparency, thin structures, or rapid movement. This research introduces a novel deep-learning framework that produces flicker-free video matting by using an attention-based temporal aggregation module (TAM) and a massive new dataset, VideoMatting108.
Methodology
The proposed framework consists of two main stages: trimap generation and video matting.
Temporal Aggregation Module (TAM)
Instead of using error-prone optical flow, the TAM uses an attention mechanism to look at adjacent frames ($t-1$ and $t+1$) to help predict the matte for the current frame ($t$). It computes "temporal affinity" values in a high-dimensional feature space, which is more robust to noise than looking at raw pixel colors. By computing affinities in feature space rather than pixel space, the model can "find" corresponding parts of an object even when the motion is complex or the pixels are semi-transparent.
Target Affinity Loss ($L_{af}$)
To ensure the attention mechanism actually learns useful temporal relationships, the authors designed a specific loss term. This term supervises the attention weights using the ground-truth alpha mattes, forcing the model to assign higher weights to pixels that truly correspond to each other across time. This direct supervision drastically improves the model's ability to handle "narrow" trimaps where the unknown region is very thin.
STM-based Trimap Generation
Matting usually requires a "trimap" (a map labeling pixels as foreground, background, or unknown). The authors fine-tune a Space-Time Memory (STM) network—originally for video segmentation—to propagate a few user-annotated keyframes across the entire video. This allows for a practical workflow where only 3–5 user-annotated frames are needed for a 200-frame clip.
VideoMatting108 Dataset
The authors identified a major bottleneck: existing video matting datasets were too small for robust training. They introduced VideoMatting108, featuring 108 high-quality foreground video clips (80 for training, 28 for validation). All clips are in 1080p resolution and include challenging elements like fur, hair, and semi-transparent objects, extracted from green-screen footage using professional tools.
Key Results
The method was tested against state-of-the-art image matting models (GCA, IndexNet, DIM) adapted for video. On the VideoMatting108 validation set, the proposed method (GCA+TAM) consistently outperformed baselines across all metrics. Notably, it achieved significantly lower dtSSD (a metric for temporal instability), proving the results are much smoother.
Visual results show a dramatic reduction in "white blobs" and flickering artifacts in complex areas like a lion's mane or a dancer's moving limbs. The attention-guided approach effectively maintains detail across frames even during fast motion.
Conclusion
By shifting from optical flow to feature-space attention and introducing a large-scale dataset, this method achieves state-of-the-art temporal coherence in video matting. While the system still relies on a trimap-based workflow requiring some initial human intervention, the STM-based propagation makes it practical for real-world applications. Future work may explore weakly supervised video matting to further reduce the need for expensive ground-truth data.
Summary updated