RobustSwap: A Simple yet Robust Face Swapping Model against Attribute Leakage

Jaeseong Lee, Taewoo Kim, Sunghyun Park, Younggun Lee, Jaegul Choo · DOI

Abstract

Face swapping aims to transfer the identity of a source face onto a target face while preserving the target's attributes such as expression, pose, and lighting. A persistent challenge in this field is "attribute leakage," where source-specific traits like skin tone or hairstyle inadvertently bleed into the final result. We present RobustSwap, a high-fidelity model that leverages the latent space of a pre-trained StyleGAN and a novel 3D-aware partial landmark loss to mitigate these issues. RobustSwap achieves state-of-the-art performance on megapixel images and video sequences without the need for identity-labeled training data.

Introduction

The primary objective of face swapping is the seamless transplantation of a source's identity (defined by bone structure, eye shape, and nose geometry) onto a target image, while maintaining the target's attributes (lighting, background, expression, and head pose). Despite significant progress, current state-of-the-art models frequently suffer from source attribute leakage.

Attribute leakage typically manifests in two forms:

  1. Appearance Leakage: The swapped face inherits the source's skin color or hairstyle, leading to a "pasted-on" appearance that is inconsistent with the target's environment.
  2. Pose Leakage: The swapped face fails to replicate the target's exact expression or eye-gaze direction, often drifting toward the source's original pose.

RobustSwap addresses these challenges by identifying a "Goldilocks zone" within the generative model's latent space, ensuring sufficient identity injection without compromising the target's structural integrity.

Qualitative comparison showing RobustSwap's superior attribute preservation compared to FSLSD and MFIM.

Methodology

RobustSwap utilizes a pre-trained StyleGAN backbone, modified to allow for more precise control over the identity-attribute balance.

Latent Space Analysis ($F/W+$)

The authors conducted an extensive investigation into StyleGAN’s latent spaces to determine where different types of information are stored. They discovered that the $32 \times 32$ resolution feature map ($F_{32 \times 32}$) serves as the optimal anchor for target attributes. By utilizing this map from the target image and injecting source identity into subsequent layers ($w_{8+}$), the model achieves a balance that preserves target structure while allowing the source identity to manifest clearly.

3DMM and Partial Landmark Loss

To capture unique facial geometry, RobustSwap integrates a 3D Morphable Model (3DMM). It extracts "shape parameters" from the source and injects them into the identity embedding.

A key innovation is the Partial Landmark Loss. To ensure the swapped face adheres strictly to the target's expression, the authors employ a loss function based on 51 specific inner-facial landmarks. They generate a "ground truth" mesh by combining the target's pose and expression with the source's facial shape. This approach forces the model to respect the target's "how" (the expression) while adopting the source's "who" (the geometry).

Experiments and Results

The model was trained on the FFHQ dataset (70,000 images) without requiring identity labels. Evaluation was performed on CelebA-HQ for high-resolution ($1024 \times 1024$) images and FaceForensics++ (FF++) and CelebV-HQ for video sequences.

Quantitative Performance

RobustSwap outperformed major baselines (SimSwap, HifiFace, MFIM) across several key metrics:

  • Attribute Preservation: It achieved the lowest errors in Head Pose (0.014) and Eye Gazing (0.062).
  • Appearance Fidelity: Using a "Masked-L1" metric to measure skin and hair consistency, RobustSwap demonstrated minimal appearance leakage (0.038).
The relationship between feature map resolution and the trade-off between identity similarity and attribute discrepancy.

The $32 \times 32$ Sweet Spot

As shown in the quantitative analysis, the spatial resolution of the feature map is critical. At lower resolutions (e.g., $16 \times 16$), the target's pose information is insufficient. Conversely, at higher resolutions (e.g., $64 \times 64$), the source's identity cannot effectively override the target's features. The $32 \times 32$ resolution represents the optimal crossover point for maximizing both identity similarity and attribute preservation.

Conclusion

RobustSwap provides a simple yet effective framework for high-fidelity face swapping. By coordinating implicit generative power with explicit geometric constraints, it avoids the "uncanny valley" common in previous methods. Furthermore, the prevention of attribute leakage translates directly into improved temporal stability for video swaps, even though the model is not explicitly trained on video data. Future work may explore applying these latent space partitioning techniques to related tasks such as face reenactment and attribute editing.

Summary updated

BibTeX
@misc{lee2023robustswap,
  author = {Jaeseong Lee and Taewoo Kim and Sunghyun Park and Younggun Lee and Jaegul Choo},
  title = {{RobustSwap: A Simple yet Robust Face Swapping Model against Attribute Leakage}},
  year = {2023},
  eprint = {2303.15768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.15768},
}
Figure