DoveNet: Deep Image Harmonization via Domain Verification

Wenyan Cong, Jianfu Zhang, Li Niu, Liu Liu, Zhixin Ling, Weiyuan Li, Liqing Zhang

Abstract

Image harmonization is the process of adjusting the appearance of a foreground object to match a new background, ensuring visual consistency in image compositions. We present DoveNet, a deep learning framework featuring a novel Domain Verification Discriminator that treats foreground and background as distinct domains to be aligned. To support this task, we introduce iHarmony4, the first large-scale public dataset for image harmonization. Our experiments demonstrate that DoveNet significantly outperforms existing state-of-the-art methods both quantitatively and qualitatively.

Introduction

When an object is cut from one photograph and pasted into another, the resulting composite often appears unnatural. This "fake" look typically stems from inconsistencies in lighting, color temperature, and environmental conditions between the original source and the new background. Image harmonization aims to resolve these discrepancies by adjusting the foreground's appearance while preserving its identity and structure.

Historically, the field has faced two primary challenges: a lack of large-scale, high-quality training data and the difficulty of capturing the subtle relationship between a specific foreground and its surrounding environment. DoveNet addresses these issues through a specialized GAN architecture and the introduction of the iHarmony4 benchmark.

Methodology

DoveNet utilizes a Generative Adversarial Network (GAN) designed specifically for domain translation between image regions. The architecture consists of three main components: an attention-enhanced generator, a global discriminator, and a novel verification discriminator.

Attention-Enhanced Generator

The backbone of the generator is a U-Net architecture integrated with attention blocks. These blocks allow the network to focus its transformation capabilities on the foreground pixels that require adjustment, preventing unnecessary alterations to the background pixels which are already considered "correct."

Domain Verification Discriminator

The core innovation of DoveNet is the Domain Verification Discriminator ($D_v$). Unlike traditional discriminators that evaluate the realism of an entire image, $D_v$ specifically asks whether the foreground and background belong to the same visual domain. It employs partial convolutions to extract independent feature sets for the foreground and background. By calculating a similarity score between these features, the discriminator learns to identify mismatches in lighting and color. This forces the generator to translate the foreground into the background's specific domain.

The DoveNet architecture, featuring (a) the U-Net generator with attention blocks, (b) the global discriminator, and (c) the domain verification discriminator using partial convolutions.

The iHarmony4 Dataset

To overcome data scarcity, the authors developed iHarmony4, a massive benchmark containing 73,147 pairs of composite and real images. The dataset was created using a "de-harmonization" approach: high-quality real images were segmented, and the foreground objects were artificially altered using color transfer methods. This provided a "fake" input with a known, perfect ground truth for training.

iHarmony4 consists of four sub-datasets:

  • HCOCO: Derived from Microsoft COCO.
  • HAdobe5k: Based on the MIT-Adobe FiveK dataset of professionally retouched photos.
  • HFlickr: Images collected from Flickr across various categories.
  • Hday2night: Based on the Day2Night dataset, focusing on varying times of day and weather conditions.

Experimental Results

DoveNet was evaluated against existing state-of-the-art methods, including DIH and $S^2AM$.

Quantitative Performance

On the comprehensive iHarmony4 benchmark, DoveNet achieved a Mean Squared Error (MSE) of 52.36 and a Peak Signal-to-Noise Ratio (PSNR) of 34.75. This significantly outperformed the next best model, $S^2AM$, which recorded an MSE of 59.67 and a PSNR of 34.35. Ablation studies confirmed that the Domain Verification component was critical to these gains.

Qualitative Analysis

In a user study with 50 human raters, DoveNet achieved the highest Bradley-Terry (B-T) score of 1.437, indicating that its results were perceived as the most realistic. Visual comparisons show that DoveNet effectively matches the lighting and tone of the background while maintaining the integrity of the foreground object.

Qualitative comparison of DoveNet against other methods. DoveNet consistently produces results that more closely match the ground truth and background environment.

Conclusion

DoveNet represents a significant advancement in image harmonization by treating the problem as a domain verification task. By leveraging the large-scale iHarmony4 dataset and a specialized discriminator, the model achieves superior results in creating seamless image compositions. Future work may involve integrating semantic scene understanding to further refine the harmonization of complex lighting environments and testing the model on "wild" composites from diverse camera sources.

Summary updated

BibTeX
@inproceedings{cong2020dovenet,
  author = {Wenyan Cong and Jianfu Zhang and Li Niu and Liu Liu and Zhixin Ling and Weiyuan Li and Liqing Zhang},
  title = {{DoveNet: Deep Image Harmonization via Domain Verification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00842},
}
Figure