SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.09770 · 2021

M2TR: Multi-modal Multi-scale Transformers for Deepfake Detection

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2104.09770.json · badge: /api/ran/2104.09770.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
wangjk666/PyDeepFakeDet community (classifier label)
classifier basis: plan_row
5 ran · 0 no recorded run
FunctionStatusWhere it lives
DCT_mat Ran
ran, honoured the contract we drafted
wangjk666/PyDeepFakeDet/PyDeepFakeDet/models/f3net.py
pointer only (licence: MIT); the stored copy get_code serves, from yyk-wew/F3Net, is pointer only (licence: NONE) · get_code("97170801bfeabdb7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yyk-wew/F3Net, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

attention Ran
ran; our contract draft was wrong, not the code
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection/M2TR/models/m2tr.py
code served (permissive licence) · get_code("087ffc0296348717")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for attention mechanism
# query shape: (batch=2, seq_len=3, dim=4)
query = torch.randn(2, 3, 4)

# key shape: (batch=2, seq_len=5, dim=4)
# Different seq_len to show key and query can differ
key = torch.randn(2, 5, 4)

# value shape: (batch=2, seq_len=5, dim=8)
# Different feature dim to show output will have dim=8
value = torch.randn(2, 5, 8)

ARGS = {
    "query": query,
    "key": key,
    "value": value,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
drop_connect Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection/M2TR/models/efficientnet.py
code served (permissive licence) · get_code("45eada2b88e70500")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small 4D tensor (batch_size=2, channels=4, height=3, width=3)
inputs = torch.randn(2, 4, 3, 3, dtype=torch.float32)

# Drop probability
p = 0.5

# Training mode flag
training = True

ARGS = {
    "inputs": inputs,
    "p": p,
    "training": training
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wangjk666/PyDeepFakeDet/PyDeepFakeDet/models/vit.py
code served (permissive licence) · get_code("971ae8d2d8313e30")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor for testing
# Shape: (batch_size=2, channels=4, height=3, width=3) - 4D tensor
x = torch.randn(2, 4, 3, 3)

ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": True,
    "scale_by_keep": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_filter Ran
ran on a synthesized input
wangjk666/PyDeepFakeDet/PyDeepFakeDet/models/f3net.py
code served (permissive licence) · get_code("e10d6bd8a13ae5dc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - start: integer used in comparison (i + j > end or i + j <= start)
# - end: integer used in comparison (i + j > end or i + j <= start)
# - size: integer used in range(size) for both dimensions
# The function creates a 2D list of floats based on diagonal filtering

ARGS = {
    "start": 2,
    "end": 5,
    "size": 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
norm_sigma Ran
ran, honoured the contract we drafted
wangjk666/PyDeepFakeDet/PyDeepFakeDet/models/f3net.py
pointer only (licence: MIT); the stored copy get_code serves, from yyk-wew/F3Net, is pointer only (licence: NONE) · get_code("22f1a0ed4d350586")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yyk-wew/F3Net, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

round_filters Ran
ran, honoured the contract we drafted
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection/M2TR/models/efficientnet.py
code served (permissive licence) · get_code("fea14f1f6c2644bf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class GlobalParams:
    def __init__(self, width_coefficient, depth_divisor, min_depth):
        self.width_coefficient = width_coefficient
        self.depth_divisor = depth_divisor
        self.min_depth = min_depth

global_params = GlobalParams(
    width_coefficient=1.2,
    depth_divisor=8,
    min_depth=16
)

ARGS = {
    "filters": 32,
    "global_params": global_params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
round_repeats Ran
ran, honoured the contract we drafted
wangjk666/PyDeepFakeDet/PyDeepFakeDet/models/efficientnet.py
pointer only (licence: MIT); the stored copy get_code serves, from Klassikcat/project-NEXTLab-CNN-EfficientNet, is pointer only (licence: NONE) · get_code("f93cb693ac8bb537")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Klassikcat/project-NEXTLab-CNN-EfficientNet, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

transforms_mask Ran
ran; our contract draft was wrong, not the code
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection/M2TR/datasets/utils.py
code served (permissive licence) · get_code("681a914bf36790de")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Compose. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import albumentations
import albumentations.pytorch

torch.manual_seed(0)

# The function takes mask_size as a parameter
# It uses it to create an Albumentations Compose pipeline that resizes to (mask_size, mask_size)
# and converts to tensor using ToTensorV2

mask_size = 64

ARGS = {
    "mask_size": mask_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
albumentations, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_augmentations_from_list Not yet run
unverified (harvested, no recorded run)
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection/M2TR/datasets/utils.py
code served (permissive licence) · get_code("50a33c8f97a28b13")
How it ran

no invocation recorded.

get_transformations Not yet run
unverified (harvested, no recorded run)
wangjk666/M2TR-Multi-modal-Multi-scale-Transformers-for-Deepfake-Detection/M2TR/datasets/utils.py
code served (permissive licence) · get_code("9443a182bc244501")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 5 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
drop_path 66 other papers
3 dated earlier, 61 later, 2 undated · 15 only as an assembly brick
1906.01502 (2019-06)
How multilingual is Multilingual BERT?
2011.10566 (2020-11)
Exploring Simple Siamese Representation Learning
2103.03230 (2021-03)
Barlow Twins: Self-Supervised Learning via Redundancy Reduction
and 63 more not named here
round_filters 31 other papers
12 dated earlier, 1 the same month, 18 later · 3 only as an assembly brick
1808.08127 (2018-08)
Recalibrating Fully Convolutional Networks with Spatial and Channel 'Squeeze &amp; Excitation' Blocks
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
1911.09070 (2019-11)
EfficientDet: Scalable and Efficient Object Detection
and 28 more not named here
round_repeats 30 other papers
12 dated earlier, 2 the same month, 16 later · 3 only as an assembly brick
1808.08127 (2018-08)
Recalibrating Fully Convolutional Networks with Spatial and Channel 'Squeeze &amp; Excitation' Blocks
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
1911.09070 (2019-11)
EfficientDet: Scalable and Efficient Object Detection
and 27 more not named here
drop_connect 15 other papers
9 dated earlier, 1 the same month, 5 later · 2 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
1911.09070 (2019-11)
EfficientDet: Scalable and Efficient Object Detection
1912.06218 (2019-12)
YOLACT++: Better Real-time Instance Segmentation
and 12 more not named here
DCT_mat 3 other papers
2 dated earlier, 1 later
1901.08971 (2019-01)
FaceForensics++: Learning to Detect Manipulated Facial Images
2007.09355 (2020-07)
Thinking in Frequency: Face Forgery Detection by Mining Frequency-aware Clues
2405.19707 (2024-05)
DeMamba: AI-Generated Video Detection on Million-Scale GenVideo Benchmark
norm_sigma 2 other papers
2 dated earlier
1901.08971 (2019-01)
FaceForensics++: Learning to Detect Manipulated Facial Images
2007.09355 (2020-07)
Thinking in Frequency: Face Forgery Detection by Mining Frequency-aware Clues

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The widespread dissemination of Deepfakes demands effective approaches that can detect perceptually convincing forged images. In this paper, we aim to capture the subtle manipulation artifacts at different scales using transformer models. In particular, we introduce a Multi-modal Multi-scale TRansformer (M2TR), which operates on patches of different sizes to detect local inconsistencies in images at different spatial levels. M2TR further learns to detect forgery artifacts in the frequency domain to complement RGB information through a carefully designed cross modality fusion block. In addition, to stimulate Deepfake detection research, we introduce a high-quality Deepfake dataset, SR-DF, which consists of 4,000 DeepFake videos generated by state-of-the-art face swapping and facial reenactment methods. We conduct extensive experiments to verify the effectiveness of the proposed method, which outperforms state-of-the-art Deepfake detection methods by clear margins.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2104.09770")
get_code_for_paper("2104.09770")
have("2104.09770")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2104.09770.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2104.09770.svg)](https://syntology.ai/paper/2104.09770)

Connect an agent — have() is free.