Introduction
Image composition, the process of integrating an object from one image into another, is a fundamental task in digital image editing. However, composite images often appear unrealistic because the foreground object's lighting, color temperature, or saturation does not align with the background. This discrepancy necessitates image harmonization.
Traditional harmonization methods face two primary challenges. First, they typically assume a single inharmonious region and require a manually provided mask. In practice, composites often involve multiple objects from various sources, and precise masks are frequently unavailable. Second, most models operate as "black boxes," directly regressing RGB pixels. This approach lacks explainability and prevents users from fine-tuning the results. To address these issues, this paper introduces Semantic-guided Multi-Mask Image Harmonization (Sg-MMH), a framework designed to handle multiple perturbations across different semantic regions without requiring input masks.
Methodology
The proposed Sg-MMH framework shifts from direct pixel regression to a more interpretable "Operator Mask" (OM) approach. The system utilizes a U-Net-based encoder-decoder architecture to analyze the inharmonious input image.
Instead of predicting final colors, the decoder outputs six operator masks corresponding to the L, A, and B channels of the LAB color space. For each channel, the model predicts one mask for multiplication (simulating contrast and exposure) and one for addition (simulating brightness and color shifts). A dedicated Retoucher module then applies these linear operations to the input image. This process is transparent and allows for manual adjustment of mask intensities.
The model is trained using a combination of Charbonnier loss for pixel accuracy, LPIPS for perceptual consistency, and a Relativistic GAN loss with a patch discriminator to ensure fine-grained local realism. By leveraging semantic information during training, the model learns to automatically locate and correct different semantic regions (e.g., distinguishing between a person and a building) independently.
Datasets
To evaluate multi-mask harmonization, the authors introduced two new benchmarks: HScene and HLIP. These were created by applying diverse perturbations, such as Instagram filters and LAB shifts, to the ADE20K and Look Into Person (LIP) datasets.
HScene focuses on natural scenes with 150 semantic classes, while HLIP focuses on human-centric images with 19 classes. These datasets simulate complex scenarios where multiple parts of an image require distinct adjustments to achieve harmony.
Results and Discussion
The Sg-MMH (OMGAN) model significantly outperforms traditional RGB-regression baselines. On the HScene benchmark, it reduced the Mean Squared Error (MSE) from 141.75 to 94.00, while also improving PSNR and SSIM scores. Qualitative results demonstrate the model's ability to independently adjust multiple mismatched objects to match a common background. In a user study, Sg-MMH was preferred 36.7% of the time, a substantial margin over competing methods like DoveNet and RainNet.
Despite its success, the model has limitations. Its performance is dependent on the variety of perturbations seen during training. Additionally, the current linear operators cannot easily simulate complex effects like shadows or grain. Future work may involve decoupling operator masks further and integrating more complex parametric operators.
Conclusion
Sg-MMH represents a significant step forward in image harmonization by introducing a multi-mask, semantic-guided approach. By utilizing operator masks in the LAB color space, the framework provides an explainable and user-editable solution that eliminates the need for manual input masks while achieving state-of-the-art performance.
Summary updated