Deep Image Compositing

He Zhang, Jianming Zhang, Federico Perazzi, Zhe Lin, Vishal M. Patel

Introduction

Image compositing—the process of extracting an object from one image and integrating it into another—is a cornerstone of digital image editing. Despite its ubiquity, achieving a realistic result remains challenging due to boundary artifacts and color contamination. Traditional high-quality workflows rely on image matting, which typically requires a manually created "trimap" to guide the extraction of fine details like hair. This human-intensive process limits the scalability of professional-grade automated compositing.

This paper introduces an end-to-end, fully automated framework for portrait background replacement. By leveraging a multi-stream fusion network and a self-taught data augmentation strategy, the proposed method eliminates the need for manual intervention while significantly reducing common issues like "halos" and color bleeding.

Methodology

The researchers propose a three-stage pipeline designed to optimize the final composited output rather than just the intermediate alpha matte.

1. Segmentation and Refinement

The process begins with a standard segmentation network to identify the subject. This is followed by a Mask Refinement Network that specifically targets the boundaries, producing a cleaner and more accurate initial mask than raw segmentation alone.

2. Multi-stream Fusion (MLF) Network

The core of the architecture is the MLF network, inspired by classical Laplacian pyramid blending. Unlike traditional approaches that concatenate foreground and background inputs early on, the MLF network utilizes two separate encoders. This dual-stream approach preserves the unique contextual information of both the foreground and the new background. Features are fused level-by-level in a decoder, allowing the model to simultaneously manage coarse structural blending and intricate edge details.

3. Self-taught Data Augmentation

To overcome the scarcity of high-quality training data, a "curriculum" learning approach was employed. The model was initially trained on "easy" cases (foregrounds on solid backgrounds) using existing matting datasets. It then generated more complex composites, which were used as "hard" samples for further refinement, effectively teaching the model to handle realistic, cluttered backgrounds.

Key Results

The proposed method was evaluated against state-of-the-art matting techniques, including Deep Image Matting (DIM) and Index-net.

Quantitative and Qualitative Performance

On the SynTest benchmark, the model achieved a PSNR of 19.34 dB, surpassing both Index-net (19.01 dB) and DIM (18.40 dB). Beyond metrics, the visual improvements are stark. The MLF network excels at preserving fine hair details and removing the thin, glowing "halos" often associated with automated cut-outs.

Qualitative comparison of the proposed method against state-of-the-art matting and blending techniques.

User Evaluation

In a study involving 44 participants, including professional Photoshop users, the proposed method was consistently ranked as the favorite. It achieved an average rank of 3.05 (where lower is better), outperforming all competing automated and semi-automated methods.

Conclusion and Future Work

By treating matting and blending as a unified, end-to-end task, this framework achieves professional-grade results without manual trimaps. However, the system's performance remains tied to the quality of the initial segmentation; if the primary network fails to detect a part of the subject, subsequent stages cannot recover it. Future research may focus on integrating global harmonization to better match the lighting and color temperature between the foreground and the new background, which remains an independent challenge in the field.

Summary updated

BibTeX
@inproceedings{zhang2021deep,
  author = {He Zhang and Jianming Zhang and Federico Perazzi and Zhe Lin and Vishal M. Patel},
  title = {{Deep Image Compositing}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2021},
  doi = {10.1109/wacv48630.2021.00041},
}
Figure