Abstract
Face swapping requires a delicate balance between preserving a source identity and accurately reflecting a target's expressions and poses. Traditional methods often struggle with this "fidelity vs. accuracy" trade-off, leading to blurry results or identity leakage. We present Face Transformer, a novel framework that leverages transformer architectures to establish semantic-aware correspondence. By explicitly mapping source identity features to target regions across multiple scales before generation, the model achieves superior fidelity in skin tones and facial details while maintaining the structural integrity of the target's performance.
Introduction
Face swapping—the process of transplanting one person's identity onto another's head—is a challenging task in computer vision. Existing methods generally fall into two categories: 3D-based methods and GAN-based methods. While 3D Morphable Models (3DMMs) handle poses well, they often suffer from low reconstruction accuracy and "uncanny valley" distortions. Conversely, GAN-based methods produce sharper images but frequently fail to preserve subtle identity details (like exact skin color) or struggle to maintain the target's specific structural attributes, such as a unique smirk.
The core bottleneck identified by the authors is the difficulty in finding a precise mapping between source pixels and target geometry. Face Transformer addresses this by using the global attention mechanism of transformers to build a comprehensive correspondence matrix, ensuring that identity features are placed exactly where they belong.
The Face Transformer Framework
The Face Transformer architecture is designed to move beyond the local processing limitations of standard Convolutional Neural Networks (CNNs). It consists of three primary components:
- Face Parsing Module: This module separates the "inner face" from the background and extracts semantic maps to identify key landmarks like eyes, nose, and mouth.
- Face Feature Transformation Module (FFTM): The heart of the system, the FFTM uses a Transformer to build a global correspondence matrix. Unlike CNNs, it understands long-range relationships, ensuring that a source eye is correctly mapped to the target eye socket regardless of head orientation.
- Face Generation Module (FGM): This generator progressively fuses transformed multi-scale features with the target's background and semantic information to synthesize the final high-resolution image.
To ensure high fidelity, the model processes features at three different scales using a VGG-19 backbone. This multi-scale approach allows the model to preserve fine-grained textures, such as skin pores and makeup, which are often lost in lower-resolution latent representations.
Experimental Results
The model was trained on the CelebA-HQ dataset and benchmarked against industry standards including DeepFakes, FaceSwap, and FaceShifter using the FaceForensics++ dataset.
Quantitative Performance
Face Transformer achieved the lowest (best) scores in identity (ID) verification distance (34.49 compared to 37.29 for the next best method) and shape similarity. Crucially, it significantly outperformed competitors in preserving target expressions, achieving an expression distance of 23.74 compared to 27.93 for FaceShifter.
Qualitative Comparison
Visual results demonstrate that Face Transformer provides much cleaner integration at the neck and hairline. One of its most striking capabilities is the preservation of the source's specific skin texture and color, even when the target lighting conditions differ significantly.
Discussion and Conclusion
By treating face swapping as a correspondence problem solvable via transformers, the authors have created a model that avoids the "hallucination" artifacts common in pure GAN approaches. While the model shows a slight paradox in 3D pose metrics—where its high-fidelity skin color preservation can actually confuse automated 3D estimators—the visual alignment remains highly accurate.
Future work may involve refining the semantic-aware correspondence to handle extreme occlusions, such as hands moving in front of the face, or more complex hair-to-face transitions. Overall, Face Transformer represents a significant step toward high-fidelity, identity-accurate digital face manipulation.
Summary updated