Skip to main content
QUICK REVIEW

[Paper Review] BargainNet: Background-Guided Domain Translation for Image Harmonization

Wenyan Cong, Li Niu|arXiv (Cornell University)|Sep 19, 2020
Image Enhancement TechniquesComputer Science12 references5 citations
TL;DR

BargainNet proposes a novel background-guided domain translation framework for image harmonization, where a domain code extractor learns background-specific domain codes to guide foreground style translation via a U-Net generator. The method uses tailored triplet losses to ensure domain code accuracy, achieving state-of-the-art performance on iHarmony4 and enabling additional tasks like inharmony level prediction.

ABSTRACT

Image composition is a fundamental operation in image editing field. However, unharmonious foreground and background downgrade the quality of composite image. Image harmonization, which adjusts the foreground to improve the consistency, is an essential yet challenging task. Previous deep learning based methods mainly focus on directly learning the mapping from composite image to real image, while ignoring the crucial guidance role that background plays. In this work, with the assumption that the foreground needs to be translated to the same domain as background, we formulate image harmonization task as background-guided domain translation. Therefore, we propose an image harmonization network with a novel domain code extractor and well-tailored triplet losses, which could capture the background domain information to guide the foreground harmonization. Extensive experiments on the existing image harmonization benchmark demonstrate the effectiveness of our proposed method. Code is available at https://github.com/bcmi/BargainNet.

Motivation & Objective

  • To address the limitation of existing image harmonization methods that overlook the background's guiding role in style alignment.
  • To reformulate image harmonization as a background-guided domain translation problem, treating different capture conditions as distinct domains.
  • To design a domain code extractor that captures background domain information without interference from foreground content, using partial convolution.
  • To develop a novel training objective via well-tailored triplet losses that ensure domain codes represent true domain differences, not semantic layout.
  • To enable downstream applications such as background harmonization and inharmony level prediction through the extracted domain codes.

Proposed method

  • A domain code extractor based on partial convolution isolates background features to extract domain-specific codes, minimizing foreground leakage.
  • The background domain code is spatially upsampled and concatenated with the foreground mask to condition the U-Net generator for foreground translation.
  • A triplet loss is designed to pull the domain codes of background, real foreground, and harmonized foreground closer, while pushing the composite foreground code away.
  • The triplet loss enforces that: d(z_b, z_f) < d(z_b, z_f~), d(z_b, z_hat_f) < d(z_b, z_f~), and d(z_f, z_hat_f) < d(z_f, z_f~), among six total constraints.
  • The generator uses an attention-enhanced U-Net architecture to produce harmonized outputs conditioned on the concatenated foreground mask and background domain code.
  • The model is trained end-to-end on the iHarmony4 benchmark with adversarial and perceptual losses, alongside the proposed triplet loss.

Experimental results

Research questions

  • RQ1Can background domain information be effectively extracted and used to guide foreground style translation in image harmonization?
  • RQ2Does formulating image harmonization as background-guided domain translation lead to better visual and quantitative results than prior methods?
  • RQ3Can the extracted domain code be used to predict the inharmony level of a composite image?
  • RQ4How effective is the proposed triplet loss in ensuring that the domain code captures domain-specific characteristics rather than semantic layout?
  • RQ5Can the model be adapted for background harmonization by inverting the mask and code roles?

Key findings

  • The proposed method achieves state-of-the-art performance on the iHarmony4 benchmark, outperforming existing methods including DIH, S2AM, and DoveNet in both quantitative and qualitative evaluations.
  • The triplet loss significantly improves domain code quality, as evidenced by 95.6% of training triplets satisfying all six triplet constraints, compared to lower ratios in DoveNet.
  • User studies on 99 real composite images show that BargainNet is preferred over other deep learning methods in perceptual quality and realism.
  • The method enables background harmonization by inverting the mask and code roles, demonstrating generalization beyond foreground-only adjustment.
  • The Euclidean distance between foreground and background domain codes serves as a reliable inharmony level predictor, with higher distances indicating greater visual inconsistency.
  • The ablation study confirms that removing the triplet loss leads to less consistent harmonization, proving its necessity for effective domain code learning.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.