One-Trimap Video Matting

Hongje Seong, Seoung Wug Oh, Brian Price, Euntai Kim, Joon-Young Lee

TL;DR

The One-Trimap Video Matting network (OTVM) enables high-quality, temporally stable video matting using only a single user-annotated trimap at the first frame. By jointly modeling trimap propagation and alpha prediction through a recurrent refinement loop, OTVM prevents error accumulation and outperforms previous decoupled methods by over 56% in mean squared error (MSE).

What Problem Does This Paper Address?

Video matting is the process of extracting a precise alpha matte ($\alpha$) to separate a foreground object from its background across a video sequence. Because this problem is highly ill-posed—solving for foreground, background, and alpha values simultaneously from just RGB data—traditional methods rely on a trimap. A trimap segments an image into known foreground, known background, and an "unknown" transition region (like hair or motion blur).

Recent deep learning approaches have attempted to scale this to video by decoupling the task into two independent stages:

  1. Propagating a user-provided trimap across all video frames using visual correspondence.
  2. Predicting the alpha matte frame-by-frame based on those propagated trimaps.
Fig. 1. The previous decoupled approach vs. Our joint modeling. (a) Previous video matting methods [52,65] have two decoupled stages: first generate all missing trimaps and then predict the alpha mattes given the trimaps. This approach does not have any interaction between trimap propagation and alpha matting. Since the trimap propagation with no understanding of alpha mattes is often not stable, they require multiple user-annotated trimaps to prevent drifting at trimap propagation. (b) In our OTVM, trimap propagation and alpha prediction modules interact each other and the refinement step updates the predictions from the two modules. Our trimap propagation module memorizes and utilizes all information (RGB, trimap, alpha, latent features) to propagate trimaps. It results in accurate and robust predictions, enabling us to perform one-trimap video matting.

However, this decoupled approach suffers from a fatal flaw: trimap drifting. As an object moves, regions labeled "unknown" in one frame might become solid foreground or background in the next (e.g., an eyelid closing). Purely visual propagation networks lack an understanding of the underlying alpha matte, causing errors to accumulate rapidly over time. To combat this, existing state-of-the-art methods require users to manually annotate multiple trimaps throughout a video, which is tedious and impractical.

Methods

OTVM solves the drifting problem by treating trimap propagation and alpha prediction as a joint, interdependent task. Instead of a linear pipeline, OTVM introduces a recurrent feedback loop that operates auto-regressively at each frame.

Fig. 3. Overall architecture of OTVM. Our trimap propagation network is inspired by space-time memory networks [39]. The network predicts a trimap based on the information from the previous frames and predictions that are embedded by the trimap memory encoder. From the given or generated trimap, we initially predict the alpha matte using our alpha prediction network inspired by [14]. Then we refine the generated trimap and predicted alpha matte via two light-weighted residual blocks. The refined trimap, alpha matte, and hidden features (dimension = 16) are fed to the trimap memory encoder so that they can be used for the next frames as a new memory. The framework is trained in an end-to-end manner. We further illustrate the details of each module in the supplementary material.

The architecture consists of three core components:

  1. Trimap Propagation Module: Inspired by Space-Time Memory (STM) networks, this module reads from a memory bank of past frames to predict the current frame's trimap.
  2. Alpha Prediction Module: Based on the FBA matting framework, this module takes the current RGB frame and the newly generated trimap to predict an initial alpha matte.
  3. Alpha-Trimap Refinement Module: A lightweight module consisting of two residual blocks. It takes the current RGB frame, the predicted trimap, the predicted alpha matte, and latent features from the alpha decoder to output a refined trimap, a refined alpha matte, and a 16-dimensional hidden feature map.

Crucially, the refined trimap, alpha matte, and hidden features are fed back into the trimap memory encoder. This ensures that the propagation module for the next frame benefits from the high-fidelity alpha information predicted in the current frame.

Stage-Wise Training

Because the modules are highly co-dependent, training the entire network from scratch leads to poor convergence. The authors design a 4-stage training strategy:

  • Stage 1: Train the alpha matting and trimap propagation modules separately using ground-truth data.
  • Stage 2: Freeze the propagation module; train the alpha and refinement modules together using noisy, propagated trimaps.
  • Stage 3: Freeze the alpha and refinement modules; activate and train the propagation module using losses from both the trimap and alpha predictions.
  • Stage 4: Fine-tune the entire network end-to-end on video datasets.

Datasets

The model leverages several datasets across its training stages:

  • Pretraining: ImageNet (backbone initialization), various image/video object segmentation datasets (PASCAL VOC, MS COCO, DAVIS, YouTube-VOS), and the Adobe Image Matting (AIM) dataset.
  • Evaluation & Fine-tuning: Evaluated on two recent video matting benchmarks:
  • VideoMatting108: Features long video sequences (averaging 850 frames) evaluated with narrow, medium, and wide trimap dilations.
  • Deep Video Matting (DVM): Consists of 248 composited test videos.

Key Insights and Ideas

  • Alpha Mattes Guide Better Trimaps: An alpha matte inherently contains richer, continuous information than a discrete, three-class trimap. By using the predicted alpha matte to update the trimap before the next propagation step, the network effectively self-corrects, halting the feedback loop of error accumulation.
  • The Power of Hidden Features: The 16-dimensional hidden feature map generated by the refinement module captures abstract semantic information that cannot be explicitly represented by a trimap or alpha matte alone. Visualizing these features via k-means clustering reveals that the network automatically learns to subdivide the "unknown" region into distinct structural levels and retains background context to aid future frames.
  • Decoupled Propagation is Fundamentally Flawed: Purely tracking pixels across frames fails for trimaps because the semantic meaning of a pixel's trimap label changes dynamically based on visibility and pose.

Key Results

OTVM achieves massive performance gains over state-of-the-art video matting models in the practical one-trimap setting (where only the very first frame is annotated):

  • VideoMatting108: OTVM improved the Mean Squared Error (MSE) by 56.7% compared to the previous best method (reproduced STM + FBA baseline).
  • Deep Video Matting (DVM): OTVM achieved a 56.4% improvement in MSE.
  • One Trimap vs. Full Trimaps: Remarkably, OTVM using only one initial trimap achieved comparable performance (SAD of 41.02) to the DVM framework utilizing full trimaps (SAD of 40.91), where every single frame was annotated.

Limitations and Future Work

The authors note that OTVM's performance is heavily reliant on the quality and content of the single user-provided trimap.

  • Lack of Object Information: If the first frame's trimap contains very little information about the target object, the propagation module struggles to initialize correctly.
  • Weak Foreground Signals: If the initial frame does not provide a strong, distinctive signal for the foreground object, the network can fail to track and matte the object accurately in subsequent, more challenging scenes.

Future work could explore integrating lightweight user interventions (like sparse scribbles) later in the video sequence to correct the model if it encounters extreme occlusions or scene cuts.

Summary updated

BibTeX
@inproceedings{seong2022one,
  author = {Hongje Seong and Seoung Wug Oh and Brian Price and Euntai Kim and Joon-Young Lee},
  title = {{One-Trimap Video Matting}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19818-2\_25},
}
Figure