Introduction
Painterly image harmonization is the task of adjusting a photographic foreground object to match the artistic style of a background painting. This process is challenging because it requires a delicate balance: the foreground must adopt the background's stylistic elements—such as color, texture, and brushstrokes—without losing its own semantic content or structural integrity. Existing methods often struggle with this trade-off, either failing to stylize the object sufficiently or "over-painting" it until it becomes unrecognizable.
Methodology: The ProPIH Framework
The authors propose ProPIH, a progressive network designed to decompose the harmonization process into hierarchical stages. The underlying hypothesis is that style is not monolithic; it ranges from low-level attributes like global color distributions to high-level attributes like complex textures and distinct brushwork.
Dual-Branch Architecture
The ProPIH architecture consists of two primary components:
- Style Extraction Branch: Utilizing a pretrained VGG-19 encoder, this branch extracts multi-scale features from the background. At each of the four stages, Adaptive Instance Normalization (AdaIN) is used to align the foreground feature statistics with those of the background.
- Progressive Harmonization Branch: This branch fuses the stylized features from the top branch in a coarse-to-fine manner. It begins by adjusting low-level styles (color) and progressively incorporates higher-level stylistic details (texture).
Early-Exit Strategy
A key innovation of ProPIH is the early-exit strategy. Not every composite image requires the maximum level of stylization. For instance, a simple color adjustment might suffice for some backgrounds, while others demand heavy brushstroke textures. To handle this, a Gated Recurrent Unit (GRU) is integrated into the network to predict an "exit score" at each stage. If the score exceeds a threshold, the network terminates processing early, outputting the result from that stage. This prevents the introduction of artifacts and distortions that often occur in later, high-level stages.
Experimental Setup
To train and evaluate ProPIH, the researchers constructed a synthetic dataset using photographic objects from COCO and painterly backgrounds from WikiArt. To supervise the early-exit module, they manually annotated 5,000 training images with the "ideal" exit stage, providing a ground truth for optimal stylization levels where content preservation and style match are best balanced.
Results and Discussion
ProPIH demonstrates superior performance in both qualitative and quantitative evaluations compared to state-of-the-art style transfer and harmonization baselines.
Qualitative Analysis and Content Preservation
As shown in the progressive results, the model allows for a nuanced selection of stylization depth. In many cases, the third or fourth stage might introduce unwanted distortions (e.g., warping the structural lines of a laptop or the stripes of a zebra), whereas the early-exit mechanism correctly identifies a more suitable, earlier stage for the final output to maintain fidelity.
Quantitative Performance
- User Preference: In a large-scale user study evaluated via the Bradley-Terry model, ProPIH achieved a score of 0.917, significantly outperforming the previous state-of-the-art, PHDNet (0.474).
- Efficiency: The model is highly efficient, with an average inference time of 0.0067 seconds per image on a standard GPU. This makes it orders of magnitude faster than optimization-based or diffusion-based alternatives, enabling real-time applications.
Conclusion
ProPIH introduces a novel, interpretable approach to painterly image harmonization. By treating style as a hierarchy and implementing an early-exit strategy, the model effectively balances style transfer with content preservation. While the current reliance on manual annotations for exit stages presents a data-collection bottleneck, the framework sets a new standard for quality and efficiency in artistic image editing.
Summary updated