Training Matting Models Without Alpha Labels

Wenze Liu, Zixuan Ye, Hao Lu, Zhiguo Cao, Xiangyu Yue

Introduction

Image matting is the essential process of separating a foreground object from its background by estimating an "alpha matte" ($\alpha$), where each pixel represents the foreground's opacity. Unlike binary segmentation, matting must resolve sub-pixel details such as hair, fur, and semi-transparent textures. Historically, the primary bottleneck in deep image matting has been the scarcity of data; creating pixel-perfect alpha labels is incredibly labor-intensive. This has forced researchers to rely on synthetic composites, which often fail to generalize to real-world images due to a significant "domain gap."

This research introduces a novel training paradigm that eliminates the need for expensive, human-annotated alpha labels. Instead, it leverages coarse "trimaps"—rough annotations of foreground and background—combined with a sophisticated loss function to achieve high-quality results.

The Proposed Training Paradigm

The core innovation lies in shifting from full supervision (using fine labels) to a semi-supervised approach that uses semantic knowledge to fill in the gaps of coarse annotations. The model, based on the ViTMatte-S architecture, is supervised by two primary components:

  1. Known Loss ($L_{known}$): A standard L1 loss that supervises the model in regions where the trimap is certain (100% foreground or 100% background).
  2. Directional Distance Consistency (DDC) Loss: A novel rule-based prior that propagates alpha values into the uncertain "transition" regions of the trimap.
The proposed training paradigm (bottom) replaces the need for fine labels (top) with coarse labels and a DDC loss function.

Evolution of the DDC Loss

The authors arrived at the DDC loss by identifying and solving the limitations of traditional matting priors:

  • Affinity Loss: Standard nonlocal affinity matrices often suffer from a "braking effect," where the model fails to predict long-range details like long hair because the alpha values "get stuck" in a linear distribution.
  • Distance Consistency (DC) Loss: While DC loss captures finer details by forcing Euclidean distance consistency between image pixels and alpha values, it often introduces "texture noise" in solid foreground areas.
  • Directional Distance Consistency (DDC) Loss: By preserving the sign of the alpha distance (the direction of change), the DDC loss allows the model to propagate alpha values smoothly across boundaries while preventing internal image textures from leaking into the matte.
Visual comparison of different loss functions over training iterations. DDC loss (bottom row) successfully recovers intricate details like whiskers without the noise or "braking" seen in other methods.

Key Results and Insights

The researchers evaluated their method on two major natural matting datasets: AM-2K (animals) and P3M-10K (portraits). The results demonstrate that the "alpha-free" paradigm is remarkably competitive with fully supervised models:

  • Surpassing Human Accuracy: On the AM-2K dataset's Gradient (Grad) metric, which measures edge sharpness, the proposed method (14.98) actually outperformed the finely supervised baseline (16.04). In some instances, the model correctly identified transparency in chiffon fabrics that human annotators had incorrectly labeled as opaque.
  • Intricate Detail Recovery: Qualitative results show the model successfully recovering complex features like cat whiskers and fine human hair, despite never seeing a perfect label for these features during training.
  • Computational Efficiency: The DDC loss operates within a small local window ($11 \times 11$), adding negligible overhead to the training process.

Conclusion and Future Work

By combining deep semantic learning with physical priors, this method proves that high-quality matting does not require pixel-perfect supervision. While the model currently excels at portraits and animals, future work will focus on extending this label-free philosophy to fully transparent objects (like glass) and interactive matting tasks using simpler user inputs like scribbles or clicks.

Summary updated

BibTeX
@inproceedings{liu2025training,
  author = {Wenze Liu and Zixuan Ye and Hao Lu and Zhiguo Cao and Xiangyu Yue},
  title = {{Training Matting Models Without Alpha Labels}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i6.32597},
}
Figure