Abstract
Face swapping aims to transplant a source identity onto a target image while preserving the target's attributes such as pose, expression, and lighting. Traditional methods often suffer from unstable training and identity leakage. We present SelfSwapper, a framework that utilizes a self-supervised Shape Agnostic Masked AutoEncoder (SAMAE) to achieve high-fidelity results. By decoupling facial geometry from background information and employing random mesh scaling, SelfSwapper effectively handles significant shape discrepancies and eliminates identity leakage, setting a new state-of-the-art in identity preservation and realism.
Introduction
The task of face swapping is traditionally framed as a "seesaw game" between reconstruction loss (preserving target attributes) and identity loss (injecting source identity). Without ground truth for cross-identity swaps, this training process is inherently unstable, often leading to "identity leakage" where the result is an ambiguous blend of both individuals. Furthermore, existing models struggle with "volume mismatch"—the difficulty of mapping a source face onto a target head of a significantly different shape, often resulting in distorted or shrunken features.
Methods
SelfSwapper addresses these challenges by shifting to a self-supervised training regime based on self-reconstruction. The core architecture is the Shape Agnostic Masked AutoEncoder (SAMAE).
Shape Agnostic Masked AutoEncoder
Instead of swapping identities during training, the model learns to reconstruct an original image from its decomposed components. This provides a stable ground truth and clear gradients. To ensure this capability generalizes to cross-identity swaps, two key techniques are introduced:
- Perforation Confusion: To prevent the model from using the target's original jawline (visible in the background "hole") as a hint, the mask shape is randomly augmented. This forces the model to rely exclusively on the provided 3D mesh for facial contours.
- Random Mesh Scaling: The input 3D mesh is randomly scaled during training, teaching the model to be robust to varying head volumes and preventing artifacts when source and target shapes differ significantly.
Disentangled Albedo Condition
To ensure seamless integration of the swapped face, skin color and illumination are handled by a dedicated trainable encoder ($E_{skin}$). This separates the identity-carrying geometry from the environmental lighting and skin tone of the target.
Results
The model was trained on the FFHQ dataset and evaluated against several baselines (SimSwap, InfoSwap, etc.) using the CelebA-HQ dataset.
Quantitative Performance
SelfSwapper outperforms existing methods in key metrics:
- Identity Similarity: 0.578 (State-of-the-art)
- Identity Consistency: 0.628
- FID: 21.22 (Indicating superior image realism)
Qualitative Analysis
As shown in the figure below, SelfSwapper excels at preserving fine source traits (e.g., pupil color, facial hair) while perfectly matching target lighting and background shadows. It is particularly effective in "extreme" scenarios involving large pose gaps or drastic face shape differences.
Conclusion
SelfSwapper demonstrates that self-supervised learning via a Shape Agnostic Masked AutoEncoder provides a more stable and effective path for face swapping than traditional adversarial methods. While limited by the expressive capacity of current 3D Morphable Models, the framework establishes a new benchmark for identity preservation. Future work will explore the integration of generative priors from diffusion models to further enhance high-frequency detail.
Summary updated