All models

M2TR

Deepfake detector that combines multi-scale patch attention with frequency-domain features.

Image classification · 1,322 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 (71 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
18.6M
Operations
1,322
Framework
PyTorch
Recurrent
No
Published
ICMR 2022
Cited by
367 (as of 29 October 2026)
Authors
Junke Wang, Zuxuan Wu, Wenhao Ouyang and others
License
MIT
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
m18008
Graph hash
5c88edf9b024e332a2645ad41867ca6f8b5a4a37add222939f0d3d8e5c387b6a
Skeleton hash
039a14e5ca53216bc178850cc5b9442e14b7cc736e5ab29ffc59c356a698ade2
Architecture hash
14940ae224c64544583d09e9e67ce5f5ad280d9e764d88b4918ebe28f3730136
Diagram SHA-256
d8b6cc1b8d710728e258cba7d12e232259f9865576d2e61e2a839cce5d65017e
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

M2TR (Multi-modal Multi-scale TRansformer) is a Deepfake detector: it takes a face image and predicts whether it is real or fake. Its starting observation is that forgery traces vary in size: some, such as color mismatch, occur in small regions like the mouth corners, while others, such as visible boundaries, span almost the entire image.

Several convolutional layers first extract features from the image, a choice the paper makes for faster convergence and more stable training. The features then pass through a three-part block that is stacked four times. The multi-scale transformer splits the feature map into spatial patches of different sizes and calculates patch-wise self-attention in different heads. The frequency filter applies a 2D FFT, multiplies the spectrum by a learnable filter and returns to the spatial domain with an inverse FFT. A Cross Modality Fusion (CMF) block then fuses the RGB and frequency features with a query-key-value mechanism modeled on self-attention.

In the paper's experiments the backbone is Efficient-b4 pretrained on ImageNet and the inputs are face crops of 320 × 320. Besides the real/fake loss, training adds an auxiliary task that predicts the face region as a binary mask, and a contrastive loss that pulls features of pristine samples toward a feature center. The paper also introduces SR-DF, a dataset of 4,000 DeepFake videos generated with face swapping and facial reenactment methods.

Key idea. M2TR detects Deepfakes with a transformer that attends over patches of different sizes and fuses RGB features with frequency-domain features through a cross modality fusion block.

  • M2TR
  • Multi-modal Multi-scale Transformer
  • deepfake detection
  • face forgery detection
  • multi-scale transformer
  • frequency filter
  • SR-DF

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

Cite the paper

@misc{wang2022m2trmultimodalmultiscaletransformers,
      title={M2TR: Multi-modal Multi-scale Transformers for Deepfake Detection}, 
      author={Junke Wang and Zuxuan Wu and Wenhao Ouyang and Xintong Han and Jingjing Chen and Ser-Nam Lim and Yu-Gang Jiang},
      year={2022},
      eprint={2104.09770},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2104.09770}, 
}