Abstract
Image harmonization is the critical task of adjusting a foreground object's appearance to match the lighting, color, and style of a new background environment. Historically, progress in this field has been hindered by a lack of large-scale, high-quality training data. This paper introduces iHarmony4, a comprehensive dataset containing over 65,000 training pairs. By utilizing a "synthetic-to-real" generation strategy across four diverse sub-datasets—HCOCO, HAdobe5k, HFlickr, and Hday2night—the authors provide a robust benchmark for deep learning-based image harmonization.
Introduction
Image composition—pasting a foreground object from one image onto a background from another—is a fundamental operation in digital photo editing. However, discrepancies in lighting, color temperature, and saturation often result in unrealistic "copy-paste" artifacts. Image harmonization aims to resolve these inconsistencies. While deep learning offers a promising solution, it requires massive amounts of data. Manually creating ground-truth pairs where artists painstakingly harmonize composites is prohibitively expensive and slow. To overcome this, the authors propose a method to automatically generate large-scale datasets from existing real-world images.
Methodology: Synthetic-to-Real Generation
The core innovation lies in "reverse-engineering" synthetic composites. Instead of harmonizing a bad composite, the authors start with a real image (the ground truth) and intentionally mismatch the foreground to create a synthetic composite.
1. Foreground Segmentation
Foreground objects are identified using existing masks (in the case of COCO) or manual segmentation for other sets.
2. Foreground Adjustment
Two primary methods are used to alter the foreground's appearance:
- Color Transfer: For the HCOCO and HFlickr datasets, color statistics from a "reference" image of a similar category are transferred to the target foreground using four distinct parametric and non-parametric methods.
- Multi-Style/Illumination Overlay: For HAdobe5k and Hday2night, which contain multiple versions of the same scene, the foreground from one version (e.g., a different professional edit or time of day) is swapped into another. This creates a "real" composite with natural lighting inconsistencies.
3. Quality Control
To ensure data quality, a three-stage filtering process is applied: an aesthetics prediction model, a binary CNN classifier to detect unrealistic composites, and final human verification to remove nonsensical results (e.g., hue changes that do not represent lighting shifts).
Dataset Composition
The resulting iHarmony4 dataset is composed of four sub-datasets:
- HCOCO: The largest component, based on Microsoft COCO, featuring ~42,000 pairs.
- HAdobe5k: Based on the MIT-Adobe FiveK dataset, utilizing professional retouches to create stylistic mismatches (~21,000 pairs).
- HFlickr: A self-collected set of Flickr images to enhance category diversity (~8,000 pairs).
- Hday2night: Based on the Day2Night dataset, focusing on extreme illumination changes (e.g., midday vs. dusk) across 444 pairs.
Key Insights
- Algorithmic Diversity: By using four different color transfer categories, the authors prevent models from simply learning to invert a specific mathematical transformation, forcing them to learn general harmonization.
- Real-World Inconsistency: The use of multi-style datasets like Adobe5k provides a more realistic training signal than synthetic color shifts alone, as the mismatches stem from actual photographic variations.
- Semantic Filtering: The authors emphasize that harmonization should focus on environmental compatibility rather than changing an object's intrinsic color (e.g., changing a blue shirt to red). Manual filtering ensures the dataset remains focused on the former.
Results and Impact
iHarmony4 provides a total of 65,742 pairs of synthesized composites and their corresponding ground truths. By releasing this dataset publicly, the authors have established a standardized benchmark that allows for the fair comparison of different harmonization models, significantly accelerating research in the field.
Limitations and Future Work
Despite its scale, iHarmony4 faces challenges. In the COCO/Flickr sets, reference-based color transfer can sometimes produce unrealistic results if the reference object differs too much from the target. Additionally, the high-quality multi-style datasets (Adobe5k, day2night) are difficult to scale due to the requirement for perfectly aligned images. Future research may explore more advanced light simulation techniques or the integration of these datasets into generative adversarial networks (GANs) for enhanced editing capabilities.
Summary updated