Highly Efficient Natural Image Matting

Yijie Zhong, Bo Li, Lv Tang, Hao Tang, Shouhong Ding

Abstract

Natural image matting is a fundamental task in computer vision, yet it remains computationally expensive and often requires manual trimap inputs. This paper introduces a "trimap-free" and extremely lightweight framework that achieves state-of-the-art performance using only 344k parameters—approximately 1% of the size of traditional large-scale models. By decoupling the task into a two-stage "Classification then Regression" pipeline and employing a novel efficient attention mechanism, the proposed method enables high-quality matting on resource-constrained mobile devices without sacrificing accuracy.

Introduction

Image matting involves the precise extraction of a foreground object from an image, particularly in semi-transparent regions like hair or fur. This is a "highly ill-posed" problem as it requires solving for three unknowns (foreground color, background color, and alpha transparency) per pixel from a single observed color value. Traditional deep-learning approaches suffer from two main drawbacks: a heavy reliance on manually drawn "trimaps" and excessive model sizes that preclude deployment on smartphones or low-power hardware. This work addresses these bottlenecks by proposing a fully automated, lightweight architecture.

Methodology

The researchers propose a two-stage framework that replaces manual trimaps with automated semantic understanding. This "Classification then Regression" approach allows for specialized, smaller sub-networks.

The proposed two-stage framework architecture consisting of a Segmentation Network (SN) and a Matting Refine Network (MRN).

1. Segmentation Network (SN)

The SN acts as a classifier, identifying broad regions: foreground, background, and "unknown" transition areas. It utilizes a Cross-level Fusion Module (CFM) to merge high-level semantic data with low-level structural details using channel-wise attention.

2. Matting Refine Network (MRN)

The MRN serves as a regressor, focusing exclusively on the "unknown" regions identified by the SN to calculate precise alpha values. This stage leverages an Efficient Non-Local Attention (ENA) mechanism, which optimizes standard attention by splitting it into long-range sampling and short-range direct calculations, maintaining texture detail while reducing computational overhead.

Architectural Innovations

The framework's efficiency is driven by several key components:

  • OCBlock (Octave Block): A lightweight backbone combining depthwise convolutions with Octave Convolutions (OctConv). It processes high- and low-frequency spatial information separately, reducing redundancy and power consumption.
  • Efficient Non-Local Attention (ENA): By being selective about long-range dependencies, ENA avoids the quadratic complexity of standard non-local blocks while preserving fine details.

Experiments and Results

The model was evaluated on the Adobe Composition-1k and Distinctions-646 benchmarks. Training data synthesis utilized backgrounds from MS COCO and PASCAL VOC to ensure robustness.

Comparison of SAD vs. FLOPs across various matting methods. The proposed model (Ours) achieves competitive accuracy with a fraction of the computational cost.

The results highlight an unprecedented efficiency-to-performance ratio:

  • Extreme Compression: With only 344k parameters, the model is 99% smaller than popular models like DIM (130M parameters).
  • Computational Speed: It requires only 0.93G FLOPs, significantly lower than GCA (89G) or DIM (443G).
  • Performance: The model outperformed other trimap-free methods, achieving a SAD (Sum of Absolute Difference) of 19.59 on Composition-1k, compared to 44.01 for the much larger HAttMatting.

Conclusion

This work demonstrates that high-quality image matting does not require massive parameter counts. By separating semantic classification from fine-grained regression and optimizing attention mechanisms, the authors achieve state-of-the-art results for automated matting. While still slightly behind the most complex trimap-based models in raw accuracy, this framework sets a new standard for efficient, mobile-ready computer vision. Future work may extend these lightweight modules to real-time video segmentation and depth estimation.

Summary updated

BibTeX
@inproceedings{zhong2021highly,
  author = {Yijie Zhong and Bo Li and Lv Tang and Hao Tang and Shouhong Ding},
  title = {{Highly Efficient Natural Image Matting}},
  booktitle = {BMVC},
  year = {2021},
  url = {https://openreview.net/forum?id=Vdp2wxqUcg},
}
Figure