Abstract
Face swapping aims to seamlessly transfer a source facial identity onto a target while preserving target attributes such as pose and expression. Diffusion models, known for their superior generative capabilities, have recently shown promise in advancing face-swapping quality. This paper addresses two key challenges in diffusion-based face swapping: the prioritized preservation of identity over target attributes and the inherent conflict between identity and attribute conditioning. To tackle these issues, we introduce an identity-constrained attribute-tuning framework for face swapping that first ensures identity preservation and then fine-tunes for attribute alignment, achieved through a decoupled condition injection. We further enhance fidelity by incorporating identity and adversarial losses in a post-training refinement stage. Our proposed identity-constrained diffusion-based face-swapping model outperforms existing methods in both qualitative and quantitative evaluations, demonstrating superior identity similarity and attribute consistency, achieving a new state-of-the-art performance in high-fidelity face swapping.
Introduction: The Challenge of Condition Conflict
Face swapping involves transplanting a source person's identity onto a target image while maintaining the target's original pose, expression, and lighting. While Generative Adversarial Networks (GANs) have historically dominated this field, they often struggle with limited image quality and "mode collapse." Diffusion models have emerged as a high-fidelity alternative, yet they introduce a unique challenge: condition conflict.
When a model is conditioned on both a specific identity and a specific set of attributes simultaneously, these conditions often compete. Prioritizing the source identity can lead to a loss of the target's expression, while prioritizing attributes can result in a face that no longer resembles the source person. This "tug-of-war" often results in distorted faces or "identity leakage," where the model simply reproduces the source image instead of performing a swap.
Proposed Framework: Identity-Constrained Facial Conditioning
To resolve this conflict, researchers from CUHK and SenseTime propose a multi-stage training strategy that prioritizes identity preservation before aligning attributes. This approach narrows the solution space, ensuring the model establishes a stable representation of the source identity.
1. Identity-Oriented Tuning
In the first stage, the model is trained to generate faces based solely on identity conditions. This allows the model to learn the core features of the source person without the interference of varying expressions or poses.
2. ID-Constrained Attribute Tuning
Once identity is stabilized, the model is taught to incorporate target attributes. A key innovation here is decoupled condition injection. By using pairs of images of the same individual in different poses, the model is forced to extract identity from one image and attributes from another. This prevents the model from "cheating" by relying on a single reference image for both sets of information. Zero-initialized weights for the attribute fusion layer are used to prevent catastrophic forgetting of the identity features learned in Stage 1.
3. Post-Training Refinement
The final stage involves an end-to-end refinement phase. Explicit identity and adversarial losses are incorporated to polish fine details, ensuring the highest possible fidelity and realism in the final output.
Technical Implementation
The framework utilizes specialized encoders for different facial components:
- Identity: A combination of ArcFace for global identity and DINOv2 for fine-grained textures.
- Attributes: The feature encoder from SimSwap captures expressions and poses.
- Injection: Features are fused via an attention mechanism and injected into a Stable Diffusion 1.5 backbone using a GLIGEN-style adapter.
Experimental Results
The proposed model achieves state-of-the-art (SOTA) performance on the FFHQ benchmark, significantly outperforming both GAN-based and existing diffusion-based methods. It achieved a Frechet Inception Distance (FID) of 3.61, compared to 5.62 for the previous best diffusion model (REFace) and 13.74 for SimSwap.
In human evaluations involving 39 participants, the model was preferred over 50% of the time for fidelity and was the top choice for attribute consistency. Qualitatively, the model demonstrates robust generalization, excelling even in "stylized" face swapping, such as transferring real faces onto comic book characters.
Conclusion and Future Work
By decoupling identity and attribute conditioning through a constrained multi-stage process, this framework effectively resolves the inherent conflicts in diffusion-based face swapping. While the model currently achieves high fidelity, future work will focus on more granular control over lighting and face shape, as well as optimizing the computational efficiency of the diffusion sampling process. This decoupled injection strategy holds potential for broader applications in multi-condition image generation.
Summary updated