Source-linked AI summary

SimSwap: An Efficient Framework For High Fidelity Face Swapping

Renwang Chen, Xuanhong Chen, Bingbing Ni, Yanhao Ge

arXiv:2106.06340v1cs.CV

TL;DR

Face swapping must generalize across arbitrary identities while matching the source identity and retaining the target's attributes. SimSwap combines feature-level identity injection with weak feature matching, and reports better attribute preservation than previous methods alongside slightly weaker identity performance than FaceShifter.

  • Problem

    Face swapping requires generalizing to arbitrary faces, matching the source identity, and preserving the target's attributes.

    Source: §1 · p. 2
  • Method

    SimSwap injects source identity information into target features and uses Weak Feature Matching Loss to preserve target attributes.

    Source: §3 · p. 2, §3.2 · p. 3, §3.3 · p. 4
  • Results

    SimSwap preserves attributes better than previous methods, while its identity performance is slightly weaker than FaceShifter's.

    Source: §4.3 · p. 7, §5 · p. 8
  • Takeaways & Limitations

    The results highlight balancing identity modification with target-attribute preservation as an important consideration for SimSwap.

    Source: §4.3 · p. 7

    The original DeepFakes decoder incorporates a specific identity and therefore can only be applied to that identity.

    Source: §3.1 · p. 3

Abstract

from arXiv · show

We propose an efficient framework, called Simple Swap (SimSwap), aiming for generalized and high fidelity face swapping. In contrast to previous approaches that either lack the ability to generalize to arbitrary identity or fail to preserve attributes like facial expression and gaze direction, our framework is capable of transferring the identity of an arbitrary source face into an arbitrary target face while preserving the attributes of the target face. We overcome the above defects in the following two ways. First, we present the ID Injection Module (IIM) which transfers the identity information of the source face into the target face at feature level. By using this module, we extend the architecture of an identity-specific face swapping algorithm to a framework for arbitrary face swapping. Second, we propose the Weak Feature Matching Loss which efficiently helps our framework to preserve the facial attributes in an implicit way. Extensive experiments on wild faces demonstrate that our SimSwap is able to achieve competitive identity performance while preserving attributes better than previous state-of-the-art methods. The code is already available on github: https://github.com/neuralchen/SimSwap.

1 INTRODUCTION

SimSwap aims to swap arbitrary source and target identities while preserving target attributes. It introduces the ID Injection Module and Weak Feature Matching Loss to address generalization and attribute preservation.

1 INTRODUCTION

  • Face swapping must generalize to arbitrary faces, match the source identity, and retain the target’s attributes, including expression, posture, and lighting.Source: §1 · p. 2
  • Source-oriented methods [26] [27] are sensitive to source pose and lighting, while target-oriented methods [2] [20] often mismatch target expression or posture.Source: §1 · p. 2
  • The ID Injection Module embeds source identity in target-image features, removing decoder dependence on a specific identity and enabling arbitrary-identity swapping.The paper traces limited generalization in an identity-specific algorithm to identity information integrated into its decoder.Source: §1 · p. 2
  • Weak Feature Matching Loss aligns generated results with target inputs at high semantic level, implicitly preserving target attributes despite coupled identity and attribute features.The paper argues that explicitly matching every target attribute would be too complicated.Source: §1 · p. 2

2 RELATED WORK

Related work divides face swapping into source-oriented methods that operate at image level and target-oriented methods that modify target features. Both approaches face limitations in expression preservation or generalization.

  • Face-swapping methods are broadly divided into source-oriented approaches operating at image level and target-oriented approaches operating at feature level.Source-oriented methods work on the source face, whereas target-oriented methods work on the target face.Source: §2 · p. 2

Source-oriented Methods

  • Source-oriented methods transfer target attributes onto the source before blending, but 3D methods [27] struggle to reproduce expressions and source expression or posture can impair results.The early 3D method required manual intervention, while the automatic method was limited to identities in a specific face library. Nirkin et al. [27] used 3D data and Poisson blending; FSGAN [26] used reenactment followed by inpainting.Source: §2 · p. 2

Target-oriented Methods

  • Target-oriented methods modify target features, but identity-specific or weakly constrained approaches often fail to generalize or preserve target attributes; FaceShifter [20] produces high-fidelity results yet still mismatches expression.Korshunova et al. swap one identity, while DeepFakes is limited to two identities. Methods [24] [25] and IPGAN [2] often fail to preserve target expression or posture; FaceShifter [20] uses a two-stage framework and achieves state-of-the-art identity performance.Source: §2 · p. 2

3 METHOD

SimSwap extends an identity-specific face-swapping architecture to transfer an arbitrary source identity into a target face while preserving target attributes. It introduces an ID Injection Module and Weak Feature Matching Loss, with five components in its overall loss function.

3.1 Limitation of the DeepFakes

  • DeepFakes’ source-specific decoder embeds source identity in its weights, so it can be applied only to one specific identity.Its shared encoder extracts target features, and the source decoder converts them into an image with source identity and target attributes.Source: §3.1 · p. 3

3.2 Generalization to Arbitrary Identity

  • The ID Injection Module replaces target-feature identity with source identity, enabling arbitrary-identity swapping while the decoder restores the modified features.It extracts a source identity vector with a face-recognition network [8] and injects it using ID-Blocks, modified Residual Blocks [12] that use AdaIN [13] instead of Batch Normalization [14]; varied training identities leave the decoder unrelated to any specific identity. The framework uses identity and adversarial losses, with a patchGAN discriminator.Source: §3.2 · pp. 3–4, Figure 2 · p. 3

3.3 Preserving the Attributes of the Target

  • Weak Feature Matching Loss implicitly preserves target attributes by aligning generated output with the target at deep discriminator layers, avoiding explicit constraints for each attribute.The method omits shallow layers because their texture information could make the result resemble the target and hinder identity modification; deep features primarily represent semantic attributes.Source: §3.3 · p. 4

3.4 Overall Loss Function

  • SimSwap’s overall loss combines identity, reconstruction, adversarial, gradient-penalty, and Weak Feature Matching Loss terms.Reconstruction loss is set to zero when source and target identities differ; the method uses hinge adversarial loss, multi-scale discriminators for large postures, and gradient penalty to prevent discriminator gradient explosion.Source: §3.4 · p. 4

4 EXPERIMENTS

Experiments show that SimSwap transfers source identity while preserving target attributes, including under difficult face conditions. Comparisons and ablations indicate a balance between identity modification and attribute preservation.

4 EXPERIMENTS

  • The model trains on filtered, aligned VGGFace2 [6] images with a pretrained Arcface [8] recognizer, alternating same-identity and different-identity image-pair batches for more than 500 epochs.Images smaller than 250 × 250 are removed, and remaining faces are aligned and cropped to 224×224.Source: §4 · p. 4

4.1 Qualitative Face Swapping Results

  • Across held-out source and target faces, SimSwap transfers source identity while preserving target expression, gaze, posture, and lighting, including exaggerated expressions, face stripes, and large rotations.The qualitative experiment uses eight movie-scene targets and ten Internet sources, all excluded from training; source images need not have frontal posture or neutral expression.Source: §4.1 · pp. 4–5, Figure 3 · p. 5

4.2 Comparison with Other Methods

  • SimSwap produces plausible FaceForensics++ swaps with better attribute preservation than DeepFakes and FaceShifter [20], whose results show lighting/posture mismatch and expression/gaze mismatch, respectively.SimSwap’s identity performance is described as competitive.Source: §4.2 · pp. 5–6, Figure 4 · p. 6
  • Against FaceShifter [20] and FSGAN [26], SimSwap better preserves expression, gaze, and lighting, reproduces a narrowed-eye expression, and is less affected by source-image shadows.The comparisons also describe SimSwap as producing more convincing results and slightly better lighting than FaceShifter.Source: §4.2 · p. 6, Figure 5 · p. 6, Figure 6 · p. 7

4.3 Analysis of SimSwap

  • SimSwap is slightly behind FaceShifter [20] in identity performance but preserves attributes better; on CelebAMask-HQ, it achieves relatively high ID retrieval with medium Reconstruction Loss.The FaceForensics++ analysis uses ID retrieval and posture L2 distance; the CelebAMask-HQ analysis measures Identity Loss and Reconstruction Loss.Source: §4.3 · pp. 7–8, Table 1 · p. 7, Figure 7 · p. 7
  • On CelebAMask-HQ, no Feature Matching term yields the highest ID retrieval but also the highest Reconstruction Loss, while SimSwap balances relatively high ID retrieval with medium Reconstruction Loss.The original and partial Feature Matching variants have lower ID retrieval than SimSwap; the analysis also describes tuning identity weight and Feature Matching layers to adjust the balance.Source: §4.3 · pp. 7–8, Figure 7 · p. 7
  • Visual ablations show original Feature Matching weakens identity modification, no Feature Matching gives the strongest identity change but loses target attributes, and Weak Feature Matching balances both.Increasing identity weight has limited visual influence when the Feature Matching term is unchanged.Source: Figure 8 · p. 8, §4.3 · p. 8
  • SimSwap-wFM-id+ can overfit Identity Loss and introduce source-face hair, so the authors choose SimSwap for more stable results.Although its Identity Loss is smaller, ID retrieval and visual appearance indicate that SimSwap-nFM has better identity performance.Source: §4.3 · p. 8, Figure 9 · p. 8

5 CONCLUSION

SimSwap is an efficient framework for generalized, high-fidelity face swapping. Its ID Injection Module transfers identity information at feature level, while Weak Feature Matching Loss supports attribute preservation.

  • SimSwap is an efficient framework for generalized, high-fidelity face swapping.The conclusion reports visually appealing results.Source: §5 · p. 8
  • The ID Injection Module transfers identity information at feature level and extends identity-specific face swapping to arbitrary face swapping.Source: §5 · p. 8
  • Weak Feature Matching Loss supports attribute preservation, which the authors report is better than previous methods.The conclusion also reports visually appealing results.Source: §5 · p. 8

A ADDITIONAL COMPARISON WITH DEEPFAKES

The section presents an additional comparison with DeepFakes on FaceForensics++.

A ADDITIONAL COMPARISON WITH DEEPFAKES

B VIDEO RESULTS

SimSwap provides five face-swapping videos and reports better results than DeepFakes [7] on FaceForensics++ [31], despite not training on the source and target faces.

B VIDEO RESULTS

  • SimSwap provides five face-swapping videos named s_X_t_Y.avi, with X denoting the source identity and Y the target identity.The source image appears at the upper left and the target image at the bottom left; the videos are available on the GitHub project.Source: B VIDEO RESULTS · pp. 9–10
  • Despite no training on the source and target faces, SimSwap produces better results than DeepFakes [7] on FaceForensics++ [31].Figure 10 presents more comparison results.Source: Figure 10 · p. 10

C ADDITIONAL RESULTS FOR SIMSWAP

Additional face matrices show SimSwap generating high-fidelity results for male and female identities, including fictional characters, and decent results for faces with exaggerated expressions.

C ADDITIONAL RESULTS FOR SIMSWAP

  • Male and female face matrices show high-fidelity swaps, including results for fictional identities.The fictional identities appear in rows 1 and 7 of the male matrix and rows 4 and 7 of the female matrix.Source: C ADDITIONAL RESULTS FOR SIMSWAP · p. 10, Figure 11 · p. 11, Figure 12 · p. 12
  • For faces with exaggerated expressions, SimSwap still generates decent face-swapping results.Some identities in the expression face matrix have exaggerated expressions.Source: Figure 13 · p. 13
Loading 2106.06340v1…