Abstract
Most previous image matting methods require a roughly-specified trimap as input and estimate fractional alpha values for all pixels in the unknown region. In this paper, we argue that directly estimating the alpha matte from a coarse trimap is a major limitation, as it attempts to solve two inherently different problems simultaneously: identifying true blending pixels and estimating accurate alpha values. We propose AdaMatting, a new end-to-end framework that disentangles this problem into two sub-tasks: trimap adaptation and alpha estimation. Trimap adaptation is a pixel-wise classification problem that infers global structure, while alpha estimation is a regression problem calculating opacity. Our method separately handles these tasks within a single deep convolutional neural network (CNN). Extensive experiments show that AdaMatting has superior structure awareness and trimap fault-tolerance, achieving state-of-the-art performance on the Adobe Composition-1k dataset and the alphamatting.com benchmark.
Introduction
Image matting—the process of precisely extracting a foreground object along with its transparency (the "alpha matte")—is a classic ill-posed problem in computer vision. For every pixel in a standard RGB image, we have three known values but must solve for seven unknowns (foreground color, background color, and alpha). To constrain this, most algorithms require a trimap: a rough map where regions are labeled as definitely foreground, definitely background, or "unknown."
However, creating a perfect trimap is tedious. Most real-world trimaps are "coarse," meaning the "unknown" region is much larger than the actual semi-transparent boundary. The authors argue that previous deep learning methods fail because they try to estimate the alpha matte directly from these coarse trimaps. This forces a single network to solve two very different problems simultaneously: identifying which pixels in the "unknown" region are actually opaque vs. truly semi-transparent (classification), and calculating the exact fractional opacity for those pixels (regression).
The AdaMatting Framework
The core contribution is the AdaMatting architecture, which uses a "disentangled" multi-task approach to separate high-level semantic understanding from low-level pixel analysis.
Multi-task Autoencoder
The model features a shared encoder (based on ResNet-50) that feeds into two separate decoder branches:
- T-Decoder (Trimap Adaptation): This branch treats matting as a classification problem. It learns to refine the coarse input trimap into an "optimal" version by identifying the global structure of the object.
- A-Decoder (Alpha Estimation): This branch treats matting as a regression problem, focusing on low-level photometric cues to estimate initial alpha values.
Propagation Unit
To capture ultra-fine details such as individual strands of hair or thin spider webs, the authors introduce a recurrent unit powered by a Convolutional LSTM (ConvLSTM). It takes the image, the adapted trimap, and the initial alpha matte, and iteratively refines the results over three steps.
Task Uncertainty Loss
Rather than manually tuning the weight between the classification and regression losses, the authors use a dynamic weighting scheme based on "task uncertainty." This allows the model to automatically balance the importance of trimap accuracy versus alpha precision during training.
Experimental Results
The authors evaluated AdaMatting on two primary benchmarks, demonstrating remarkable robustness to low-quality or "noisy" input trimaps.
- Adobe Composition-1k: The model achieved a Sum of Absolute Differences (SAD) of 41.7 and a Mean Squared Error (MSE) of 0.010, significantly outperforming previous leaders like Deep Image Matting (DIM).
- alphamatting.com: At the time of publication, AdaMatting ranked 1st on the leaderboard across all commonly used metrics (SAD, MSE, and Gradient error).
Qualitative results show that by separating semantics from photometrics, the T-Decoder provides a "structural guide" that prevents the A-Decoder from getting lost in background noise. This allows the model to handle extreme cases, such as when a user provides a trimap where the entire image is marked "unknown."
Conclusion and Future Work
AdaMatting demonstrates that disentangling trimap adaptation from alpha estimation leads to superior structure awareness and fault tolerance. While the use of a recurrent Propagation Unit increases computational overhead, the gain in precision for fine structures is significant. Future research may explore adapting this disentangled approach for real-time video matting or moving toward completely trimap-free systems.
Summary updated