Intrinsic Image Harmonization

Zonghui Guo, Haiyong Zheng, Yufeng Jiang, Zhaorui Gu, Bing ZhengCVPR 2021

Abstract

Image harmonization aims to improve the realism of composite images by adjusting the foreground to match the background's appearance. Traditional methods often treat this as a direct pixel-to-pixel mapping, which can fail to capture complex lighting and material interactions. This paper introduces a novel approach based on intrinsic image decomposition, disentangling an image into reflectance and illumination components. By applying a material-consistency constraint to reflectance and a learned light-transfer mechanism to illumination, the proposed method achieves state-of-the-art performance on standard benchmarks and handles extreme lighting discrepancies more effectively than previous techniques.

Introduction

When an object is cut from one image and pasted into another, the resulting composite often appears unnatural. This "inharmony" typically arises from two distinct sources: incompatible surface properties (reflectance) and incompatible lighting environments (illumination). While existing deep learning methods attempt to solve this by directly manipulating RGB values, they often struggle with the subtle physical cues that the human visual system uses to detect fakes.

The core challenge lies in the fact that image harmonization is an ill-posed problem. A single pixel value can be the result of infinite combinations of light and material. This paper proposes to bridge computer vision and physical optics by explicitly modeling these intrinsic components, following the Retinex theory where an image $H$ is the product of reflectance $R$ and illumination $I$ ($H = R \cdot I$).

Methodology

The proposed architecture is an autoencoder-based framework designed for intrinsic disentanglement and separable harmonization.

  1. Intrinsic Disentanglement: The model decomposes the composite image into a reflectance map ($\hat{R}$) and an illumination map ($\hat{I}$).
  2. Separable Harmonization:
  3. Reflectance Consistency: Since an object's material properties should remain constant regardless of its environment, the model enforces a material-consistency penalty. This ensures the reflectance of the foreground stays stable while smoothing boundary artifacts.
  4. Light Transferer: To harmonize lighting, the authors use a "Light Learner" (MLP) to extract a low-dimensional "light code" from the background. This code captures color proportions and intensity. A "Light Transferer" then applies this background light code to the foreground's illumination map.
  5. Inharmony-Free Patch Relation Modeling: To guide the harmonization process, the model learns a feature space that is invariant to lighting. This allows it to identify similar materials across the scene (e.g., matching a dark blue foreground patch to a light blue background patch of the same material) to provide a reference for correction.
The proposed autoencoder-based architecture for intrinsic image harmonization, featuring disentanglement into reflectance and illumination components.

Datasets and Evaluation

The method was evaluated on two primary benchmarks:

  • iHarmony4: The standard dataset for image harmonization, comprising four sub-datasets: HCOCO, HAdobe5k, HFlickr, and Hday2night.
  • HVIDIT: A new dataset introduced by the authors to specifically evaluate illumination harmonization. It contains over 3,000 images across 276 scenes, curated to focus on light transfer without the interference of complex shadows.

Results and Discussion

The proposed method achieved state-of-the-art (SOTA) results across all iHarmony4 sub-datasets. Quantitatively, on the HCOCO dataset, the model reduced the foreground Mean Squared Error (fMSE) from 551.01 (DoveNet) to 416.38, representing a significant jump in accuracy.

Qualitatively, the model excels at handling extreme lighting shifts, such as moving an object from bright daylight into a sunset scene. Unlike previous methods that might leave the foreground looking "washed out" or incorrectly colored, this approach produces physically plausible results by correctly adjusting the illumination component while preserving material integrity.

Qualitative comparison of the proposed method against DoveNet and the original composite. The proposed method shows superior realism in matching foreground lighting to the background.

A user study with 60 participants further validated these results, with the proposed method receiving a Bradley-Terry (B-T) score of 1.735, significantly higher than DoveNet's 1.146.

Conclusion

By grounding image harmonization in the physical principles of intrinsic image decomposition, this work provides a more robust and interpretable framework for image compositing. The separation of material and lighting allows for more precise adjustments that align with human visual perception. While the model currently focuses on color and intensity, future work may address the synthesis of complex shadows and the reduction of the performance gap between learned and ground-truth guidance.

Summary updated

BibTeX
@inproceedings{guo2021intrinsic,
  author = {Zonghui Guo and Haiyong Zheng and Yufeng Jiang and Zhaorui Gu and Bing Zheng},
  title = {{Intrinsic Image Harmonization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01610},
}
Figure