Abstract
Image matting is a fundamental yet ill-posed computer vision task that requires estimating the precise opacity ($\alpha$) of foreground objects. Traditional deep learning methods typically rely on single-pass architectures that struggle with fine details and noisy trimaps. This paper introduces DiffusionMat, the first framework to model alpha matting as a sequential refinement process using diffusion models. By iteratively denoising a noisy trimap guided by the input image, DiffusionMat leverages generative priors to produce high-fidelity alpha mattes. The framework incorporates a specialized Correction Module and Alpha Reliability Propagation to ensure structural consistency and focus on transition regions. Experimental results demonstrate that DiffusionMat achieves new state-of-the-art performance on major benchmarks, including P3M-10K and Composition-1k, particularly in capturing complex textures and semi-transparent details.
Introduction
Image matting—the process of precisely extracting a foreground object by calculating the transparency of every pixel—is a classic "ill-posed" problem. For every pixel, we have one observation (the color) but must solve for three unknowns: the foreground color, the background color, and the opacity.
Traditional deep learning approaches typically use a trimap (a map labeling regions as definitely foreground, definitely background, or unknown) as a guide. However, these models usually perform "one-off" predictions. If the initial prediction misses a fine detail or misinterprets a complex texture, the model has no mechanism to "re-think" or refine its output. Furthermore, these models often struggle when the input trimap is imprecise or "noisy," leading to artifacts in the final alpha matte.
Methodology
DiffusionMat treats matting as a conditional image generation task. Instead of predicting the matte in one go, the model uses a diffusion process to iteratively denoise a representation of the alpha matte.
Key components include:
- Sequential Refinement: The process begins by injecting noise into a trimap. A pre-trained diffusion model then iteratively removes this noise, guided by the original image, to converge on a clean alpha matte.
- Correction Module ($C_\theta$): Since standard diffusion can be stochastic and drift away from the actual image structures, this learnable module adjusts the output at each denoising step. It ensures the evolving matte remains "faithful" to the textures and boundaries of the input image.
- Alpha Reliability Propagation (ARP): This module simplifies the learning task. It "locks in" the confident regions of the trimap (the known foreground and background) and forces the model to concentrate its refinement efforts solely on the "unknown" transition regions.
- Deterministic Denoising: By utilizing DDIM inversion, the authors ensure that the denoising trajectory is deterministic, allowing the model to consistently produce the same high-quality result for a given input.
Key Insights and Ideas
- The Generative Prior: A diffusion model trained on millions of alpha mattes "knows" what a natural matte looks like. This "prior knowledge" helps the model ignore background clutter that often confuses standard CNNs.
- Robustness to "Bad" Trimaps: Because the model is designed to handle noise, it is remarkably robust to inaccurate or "loose" trimaps. While other models might produce artifacts if a trimap includes too much background in the "unknown" zone, DiffusionMat uses its generative prior to correctly identify the object boundary.
- Perceptual Fidelity: By refining the matte over multiple steps, the model captures fine-grained details—like individual strands of hair or the semi-transparency of a glass—much more effectively than single-pass architectures.
Evaluation and Results
The model was evaluated on industry-standard benchmarks including P3M-10K, Human-2K, and Composition-1k. DiffusionMat achieved state-of-the-art (SOTA) performance across all tested datasets.
- P3M-10K: It achieved the lowest Connectivity (Conn) and Gradient (Grad) errors, which are the metrics most closely aligned with how humans perceive matting quality.
- Composition-1k: It outperformed the previous leader, MatteFormer, reducing the SAD (Sum of Absolute Differences) from 23.8 to 22.8.
- Qualitative Superiority: Visual comparisons show that DiffusionMat is significantly better at handling semi-transparent objects and complex backgrounds where other models fail to distinguish between the foreground and similar-looking background textures.
Limitations and Future Work
The primary trade-off for this increased accuracy is computational efficiency. Because DiffusionMat is iterative, it requires more processing time than single-pass models. Currently, it takes approximately 0.6 seconds to process a $512 \times 512$ image. While fast for a diffusion model, it is not yet suitable for real-time high-resolution video applications. Future research may focus on developing more efficient diffusion architectures or distilling the refinement process into fewer steps.
Summary updated