TL;DR
This paper introduces a novel method for portrait style transfer that excels at generalizing across diverse artistic styles and domains, even when trained on a limited dataset. It achieves this by leveraging diffusion models with a new semantic adapter for robust correspondence matching and an AdaIN-Wavelet transform for balancing style and content preservation.
What Problem Does This Paper Address?
Portrait style transfer aims to apply the artistic style of a reference image to an input portrait while preserving the original person's identity and facial structure. Existing methods often struggle with domain generalization, meaning they perform poorly when transferring styles between vastly different types of images (e.g., from a photograph to a cartoon, or from one artistic style to another). This limitation arises from difficulties in establishing accurate semantic correspondences between the input and reference portraits, especially when their structures differ significantly. Furthermore, many methods tend to either over-stylize, losing the original content, or under-stylize, failing to capture the desired artistic flair.
Methods
The proposed method, Domain Generalizable Portrait Style Transfer (DGPST), builds upon diffusion models, specifically Stable Diffusion. Its core innovations include:
- Semantic-Aware Image Warping: To address the challenge of domain generalization, DGPST first establishes dense semantic correspondences between the input and reference portraits. This is achieved using a "semantic adapter" that leverages pre-trained diffusion models and a CLIP image encoder. This adapter learns to align semantic regions (like eyes, hair, skin) even across different domains. The learned correspondences are then used to warp the reference portrait, creating a "warped reference" that is semantically aligned with the input.
- AdaIN-Wavelet Transform for Latent Initialization: To balance content preservation and stylization, the method introduces a novel latent initialization strategy. Instead of directly using the input's latent representation (which tends to retain the original color tone), it uses DDIM inversion on the warped reference. To prevent blurriness from the warped reference losing fine details, it blends the low-frequency information of the warped reference's latent with the high-frequency information of the input's latent. This AdaIN-Wavelet transform ensures a better balance between capturing the desired style and preserving the input's structural integrity.
- Dual-Conditional Diffusion Model: The final image generation is handled by a dual-conditional diffusion model. This model incorporates:
- ControlNet: For structure guidance, it uses ControlNet to extract high-frequency information from the input image, ensuring structural fidelity.
- Style Adapter: For style guidance, it uses a style adapter that injects style information from the warped reference into the diffusion model's cross-attention layers.
Datasets
- CelebAMask-HQ: Used for training and evaluation. It contains 30K high-resolution portrait images with facial segmentation masks.
- FFHQ: Used for evaluation, comprising 70K high-quality human face images.
- AAHQ: Used for evaluation, containing approximately 25K high-quality artistic images with varied painting styles.
The model is trained solely on 28K images from CelebAMask-HQ, demonstrating its domain generalization capabilities.
Key Insights and Ideas
- Semantic Correspondence is Key for Generalization: The paper strongly emphasizes that robust, dense semantic correspondence is crucial for style transfer across diverse domains. Simply aligning general features isn't enough; precise alignment of facial regions is vital.
- Latent Initialization Dictates the Balance: The choice of initial latent representation significantly impacts the trade-off between style transfer and content preservation. The proposed AdaIN-Wavelet transform offers a principled way to navigate this trade-off.
- Diffusion Models as a Powerful Backbone: The work showcases the flexibility of diffusion models, not just for generation but also for tasks like semantic correspondence and controlled stylization through mechanisms like ControlNet and cross-attention.
Key Results
- Quantitative Performance: The method achieves competitive or superior results across metrics like Gram loss (style similarity), LPIPS (content preservation), and Identity Distance (identity preservation) compared to state-of-the-art methods, especially on mixed datasets. For instance, on a mixed dataset, it achieves the lowest Gram loss and outperforms others in LPIPS and ID.
- Qualitative Performance: The method produces high-quality, semantically aligned stylizations across various domains, including photos, cartoons, sketches, and animations. It effectively preserves facial identity and structural details while transferring artistic styles.
- Efficiency: The model achieves a reasonable inference time of 6.97 seconds for a 512x512 image, which is faster than several other diffusion-based methods, partly due to a reduced number of DDIM inversion steps.
Limitations and Future Work
- Limitations: The paper acknowledges that while the method is domain-generalizable, it is trained on a specific set of domains. Further exploration into even more extreme domain shifts might be beneficial. The reliance on pre-trained diffusion models means its capabilities are somewhat tied to the base model's understanding.
- Future Work: The authors suggest that their framework can be extended to other image editing tasks beyond portrait style transfer. The ability to control detail preservation through ControlNet conditioning scale is also highlighted as a promising avenue for further exploration.
Summary updated