All models

FaceShifter

AEI-Net, the face swapping generator of FaceShifter, from an unofficial PyTorch implementation.

Diffusion and generative · 899 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (28 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
482.3M
Operations
899
Framework
PyTorch
Recurrent
No
Published
2019
Cited by
562 (as of 30 November 2026)
Authors
Lingzhi Li, Jianmin Bao, Hao Yang and others
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m16618
Graph hash
b06ed29a29cd2e9fdd1637e0febff540c35bee8ff44e39172069faee8eb5006a
Skeleton hash
5c68a04d3004c7c7ba97f15375e17fcf167e8f40749feb8a72148b052208226c
Architecture hash
36af71a0f07e5954f221dd213e75eef959898f5392d49ad777085ee5957a7a7b
Diagram SHA-256
5c75762a411de2bb5166b69d9d02cbec57343284a9a42543d9297ecf9c1d6d0c
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

FaceShifter is a framework for face swapping, which means replacing the identity of the person in a target image with that of a person in a source image while keeping attributes such as head pose, facial expression, lighting and background. The paper's full pipeline has two networks, AEI-Net and HEAR-Net, and this model is AEI-Net alone, from an unofficial PyTorch implementation that leaves HEAR-Net out.

AEI-Net has three parts: an Identity Encoder, a Multi-level Attributes Encoder and a generator built from AAD layers. For the identity encoder, this implementation provides a pre-trained Arcface model. The attributes encoder represents the target's attributes as feature maps at several levels, where earlier methods compressed them into a single vector. The Adaptive Attentional Denormalization (AAD) layers of the generator use denormalization to integrate these features at multiple feature levels. Each AAD layer also has an attention mechanism that adaptively adjusts the effective regions of the identity embedding and the attributes embedding, so that they take part in synthesizing different parts of the face.

AEI-Net is trained adversarially, with an adversarial loss that pushes the output image to look realistic. When the source and target are the same image, training adds a pixel-level reconstruction loss. The paper states that, once trained, the model can be applied to new face pairs without subject-specific training.

Key idea. AEI-Net swaps faces by extracting multi-level attributes from the target face and integrating them with the source identity through Adaptive Attentional Denormalization layers in the generator.

  • FaceShifter
  • AEI-Net
  • Adaptive Embedding Integration Network
  • face swapping
  • face swap
  • AAD layers
  • Adaptive Attentional Denormalization
  • identity preservation

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{li2020faceshifterhighfidelityocclusion,
      title={FaceShifter: Towards High Fidelity And Occlusion Aware Face Swapping}, 
      author={Lingzhi Li and Jianmin Bao and Hao Yang and Dong Chen and Fang Wen},
      year={2020},
      eprint={1912.13457},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1912.13457}, 
}