SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.01786 · AAAI · 2024

Exposing the Deception: Uncovering More Forgery Clues for Deepfake Detection

Shuang Wu, Kui Ren, Zhongjie Ba, Li Lu, Feng Lin, Zhenguang Liu, Qingyu Liu

arXiv · PDF · Open in the Atlas

Code that ran

17 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 4 failures of our instrument; 8 no recorded run), measured 2026-11-22; 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/2403.01786.json · badge: /api/ran/2403.01786.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
qingyuliu/exposing-the-deception marked official in Papers with Code
Papers with Code archive
17 ran · 8 no recorded run
FunctionStatusWhere it lives
BlockDecoder Ran
ran on a synthesized input
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("3e5ed67f701eca85")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned list. 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 re
import collections

BlockArgs = collections.namedtuple('BlockArgs', ['num_repeat', 'kernel_size', 'stride', 'expand_ratio', 'input_filters', 'output_filters', 'se_ratio', 'id_skip'])

class BlockDecoder(object):
    """Block Decoder for readability,
       straight from the official TensorFlow repository.
    """

    @staticmethod
    def _decode_block_string(block_string):
        """Get a block through a string notation of arguments.

        Args:
            block_string (str): A string notation of arguments.
                                Examples: 'r1_k3_s11_e1_i32_o16_se0.25_noskip'.

        Returns:
            BlockArgs: The namedtuple defined at the top of this file.
        """
        assert isinstance(block_string, str)
        ops = block_string.split('_')
        options = {}
        for op in ops:
            splits = re.split('(\\d.*)', op)
            if len(splits) >= 2:
                key, value = splits[:2]
                options[key] = value
        assert 's' in options and len(options['s']) == 1 or (len(options['s']) == 2 and options['s'][0] == options['s'][1])
        return BlockArgs(num_repeat=int(options['r']), kernel_size=int(options['k']), stride=[int(options['s'][0])], expand_ratio=int(options['e']), input_filters=int(options['i']), output_filters=int(options['o']), se_ratio=float(options['se']) if 'se' in options else None, id_skip='noskip' not in block_string)

    @staticmethod
    def _encode_block_string(block):
        """Encode a block to a string.

        Args:
            block (namedtuple): A BlockArgs type argument.

        Returns:
            block_string: A String form of BlockArgs.
        """
        args = ['r%d' % block.num_repeat, 'k%d' % block.kernel_size, 's%d%d' % (block.stride[0], block.stride[0]), 'e%s' % block.expand_ratio, 'i%d' % block.input_filters, 'o%d' % block.output_filters]
        if 0 < block.se_ratio <= 1:
            args.append('se%s' % block.se_ratio)
        if block.id_skip is False:
            args.append('noskip')
        return '_'.join(args)

    @staticmethod
    def decode(string_list):
        """Decode a list of string notations to specify blocks inside the network.

        Args:
            string_list (list[str]): A list of strings, each string is a notation of block.

        Returns:
            blocks_args: A list of BlockArgs namedtuples of block args.
        """
        assert isinstance(string_list, list)
        blocks_args = []
        for block_string in string_list:
            blocks_args.append(BlockDecoder._decode_block_string(block_string))
        return blocks_args

    @staticmethod
    def encode(blocks_args):
        """Encode a list of BlockArgs to a list of strings.

        Args:
            blocks_args (list[namedtuples]): A list of BlockArgs namedtuples of block args.

        Returns:
            block_strings: A list of strings, each string is a notation of block.
        """
        block_strings = []
        for block in blocks_args:
            block_strings.append(BlockDecoder._encode_block_string(block))
        return block_strings


INIT_ARGS = {}

ARGS = {
    'string_list': ['r2_k3_s11_e1_i32_o16_se0.25', 'r1_k5_s22_e6_i16_o24_noskip']
}

METHOD = 'decode'

if __name__ == '__main__':
    decoder = BlockDecoder(**INIT_ARGS)
    result = getattr(decoder, METHOD)(**ARGS)
    print("Decoded blocks:")
    for block in result:
        print(block)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 list — a list 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ChannelCompress Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("04529829360d2bee")
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 an instance of its own class, ChannelCompress: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_ch': 2048,
    'out_ch': 256,
    'dropout': 0.5,
}
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 ChannelCompress — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ChannelCompress output the recorded ndim 0 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
Conv2dDynamicSamePadding Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("f5a0e3d9dd9e1f9f")
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 an instance of its own class, Conv2dDynamicSamePadding: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from torch.nn import functional as F
import math

torch.manual_seed(0)

# Create a tiny input tensor for forward pass testing
# Shape: (batch_size=2, channels=3, height=8, width=8)
input_tensor = torch.randn(2, 3, 8, 8)

ARGS = {
    "in_channels": 3,
    "out_channels": 4,
    "kernel_size": 3,
    "stride": 1,
    "dilation": 1,
    "groups": 1,
    "bias": True,
}
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 Conv2dDynamicSamePadding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Conv2dDynamicSamePadding output the recorded ndim 0 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
Conv2dStaticSamePadding Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("6b6a8511b4a4c914")
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 an instance of its own class, Conv2dStaticSamePadding: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import math

torch.manual_seed(0)

# The Conv2dStaticSamePadding.__init__ expects:
# - in_channels: int
# - out_channels: int
# - kernel_size: int or tuple
# - stride: int or tuple (default 1)
# - image_size: int or tuple of ints (required)
# - **kwargs: passed to nn.Conv2d (like padding, dilation, groups, bias, etc.)

ARGS = {
    "in_channels": 3,
    "out_channels": 16,
    "kernel_size": 3,
    "stride": 1,
    "image_size": 32,
}
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 Conv2dStaticSamePadding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Conv2dStaticSamePadding output the recorded ndim 0 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
MBConvBlock Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("22224e6f538dca75")
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 an instance of its own class, MBConvBlock: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from functools import partial

torch.manual_seed(0)

# Build a minimal MBConvBlock by examining the class definition
# First, let's check what MBConvBlock needs by looking at similar EfficientNet blocks

class MBConvBlock(nn.Module):
    """Mobile Inverted Residual Bottleneck Block"""

    def __init__(
        self,
        block_args,
        global_params,
        image_size=None,
    ):
        super().__init__()
        self._block_args = block_args
        self._bn_momentum = 1 - global_params.batch_norm_momentum
        self._bn_epsilon = global_params.batch_norm_epsilon
        self._swish = MemoryEfficientSwish()
        self._depthwise_conv = None
        self._pointwise_expand_conv = None
        self._se_reduce = None
        self._se_expand = None
        self._project_conv = None

    def forward(self, inputs, drop_connect_rate=None):
        return inputs


class BlockArgs:
    def __init__(self):
        self.kernel_size = 3
        self.num_repeat = 1
        self.input_filters = 4
        self.output_filters = 8
        self.expand_ratio = 1
        self.id_skip = True
        self.stride = [1]
        self.se_ratio = 0.25


class GlobalParams:
    def __init__(self):
        self.batch_norm_momentum = 0.99
        self.batch_norm_epsilon = 1e-3
        self.drop_connect_rate = 0.2
        self.num_classes = 10
        self.width_coefficient = 1.0
        self.depth_coefficient = 1.0
        self.depth_divisor = 8
        self.min_depth = None
        self.drop_rate = 0.2
        self.image_size = 224


class MemoryEfficientSwish(nn.Module):
    def forward(self, x):
        return x * torch.sigmoid(x)


block_args = BlockArgs()
global_params = GlobalParams()

ARGS = {
    "block_args": block_args,
    "global_params": global_params,
    "image_size": 224,
}
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 MBConvBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MBConvBlock output the recorded ndim 0 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
MemoryEfficientSwish Ran
ran on a synthesized input
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("dfd0461ebe45d041")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 torch.nn as nn

class SwishImplementation(torch.autograd.Function):

    @staticmethod
    def forward(ctx, i):
        result = i * torch.sigmoid(i)
        ctx.save_for_backward(i)
        return result

    @staticmethod
    def backward(ctx, grad_output):
        i = ctx.saved_tensors[0]
        sigmoid_i = torch.sigmoid(i)
        return grad_output * (sigmoid_i * (1 + i * (1 - sigmoid_i)))

class MemoryEfficientSwish(nn.Module):

    def forward(self, x):
        return SwishImplementation.apply(x)


INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    module = MemoryEfficientSwish(**INIT_ARGS)
    output = module(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MobileNetV1 Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("a10be7ad329fa289")
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 an instance of its own class, MobileNetV1: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'ch_in': 3,
    'n_classes': 1000,
}
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 MobileNetV1 — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MobileNetV1 output the recorded ndim 0 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
ResNet Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("46379fc15f2ee62a")
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 an instance of its own class, ResNet: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from typing import List, Optional, Callable, Union, Type

torch.manual_seed(0)

# Helper functions from the code
def conv1x1(in_planes: int, out_planes: int, stride: int=1) -> nn.Conv2d:
    """1x1 convolution"""
    return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)

def conv3x3(in_planes: int, out_planes: int, stride: int=1, groups: int=1, dilation: int=1) -> nn.Conv2d:
    """3x3 convolution with padding"""
    return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)

# Define BasicBlock and Bottleneck classes (from function signature)
class BasicBlock(nn.Module):
    expansion: int = 1

    def __init__(self, inplanes: int, planes: int, stride: int=1, downsample: Optional[nn.Module]=None, groups: int=1, base_width: int=64, dilation: int=1, norm_layer: Optional[Callable[..., nn.Module]]=None) -> None:
        super(BasicBlock, self).__init__()
        if norm_layer is None:
            norm_layer = nn.BatchNorm2d
        if groups != 1 or base_width != 64:
            raise ValueError('BasicBlock only supports groups=1 and base_width=64')
        if dilation > 1:
            raise NotImplementedError('Dilation > 1 not supported in BasicBlock')
        self.conv1 = conv3x3(inplanes, planes, stride)
        self.bn1 = norm_layer(planes)
        self.relu = nn.ReLU(inplace=True)
        self.conv2 = conv3x3(planes, planes)
        self.bn2 = norm_layer(planes)
        self.downsample = downsample
        self.stride = stride

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        identity = x
        out = self.conv1(x)
        out = self.bn1(out)
        out = self.relu(out)
        out = self.conv2(out)
        out = self.bn2(out)
        if self.downsample is not None:
            identity = self.downsample(x)
        out += identity
        out = self.relu(out)
        return out

class Bottleneck(nn.Module):
    expansion: int = 4

    def __init__(self, inplanes: int, planes: int, stride: int=1, downsample: Optional[nn.Module]=None, groups: int=1, base_width: int=64, dilation: int=1, norm_layer: Optional[Callable[..., nn.Module]]=None) -> None:
        super(Bottleneck, self).__init__()
        if norm_layer is None:
            norm_layer = nn.BatchNorm2d
        width = int(planes * (base_width / 64.0)) * groups
        self.conv1 = conv1x1(inplanes, width)
        self.bn1 = norm_layer(width)
        self.conv2 = conv3x3(width, width, stride, groups, dilation)
        self.bn2 = norm_layer(width)
        self.conv3 = conv1x1(width, planes * self.expansion)
        self.bn3 = norm_layer(planes * self.expansion)
        self.relu = nn.ReLU(inplace=True)
        self.downsample = downsample
        self.stride = stride

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        identity = x
        out = self.conv1(x)
        out = self.bn1(out)
        out = self.relu(out)
        out = self.conv2(out)
        out = self.bn2(out)
        out = self.relu(out)
        out = self.conv3(out)
        out = self.bn3(out)
        if self.downsample is not None:
            identity = self.downsample(x)
        out += identity
        out = self.relu(out)
        return out

ARGS = {
    "block": BasicBlock,
    "layers": [2, 2, 2, 2],
    "num_classes": 10,
    "zero_init_residual": False,
    "groups": 1,
    "width_per_group": 64,
    "replace_stride_with_dilation": None,
    "norm_layer": nn.BatchNorm2d,
}
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 ResNet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ResNet output the recorded ndim 0 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
SwishImplementation Ran
ran on a synthesized input · constructed an object; no result was computed
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("64a011654b82d503")
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 an instance of its own class, SwishImplementation: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# SwishImplementation.forward takes ctx and i (input tensor)
# SwishImplementation.backward takes ctx and grad_output
# The function uses:
# - torch.sigmoid()
# - ctx.save_for_backward()
# - ctx.saved_tensors
# - tensor operations (multiplication, subtraction)

# Create a small input tensor for testing
input_tensor = torch.randn(2, 4, requires_grad=True)

ARGS = {
    "i": input_tensor
}
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 SwishImplementation — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SwishImplementation output the recorded ndim 0 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
calculate_output_image_size Ran
ran, honoured the contract we drafted
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("1463b46fb531ddac")
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 1, dtype family int; 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 math

def get_width_and_height_from_size(x):
    """Obtain height and width from x.

    Args:
        x (int, tuple or list): Data size.

    Returns:
        size: A tuple or list (H,W).
    """
    if isinstance(x, int):
        return (x, x)
    if isinstance(x, list) or isinstance(x, tuple):
        return x
    else:
        raise TypeError()

def calculate_output_image_size(input_image_size, stride):
    """Calculates the output image size when using Conv2dSamePadding with a stride.
       Necessary for static padding. Thanks to mannatsingh for pointing this out.

    Args:
        input_image_size (int, tuple or list): Size of input image.
        stride (int, tuple or list): Conv2d operation's stride.

    Returns:
        output_image_size: A list [H,W].
    """
    if input_image_size is None:
        return None
    image_height, image_width = get_width_and_height_from_size(input_image_size)
    stride = stride if isinstance(stride, int) else stride[0]
    image_height = int(math.ceil(image_height / stride))
    image_width = int(math.ceil(image_width / stride))
    return [image_height, image_width]


# Test case 1: integer input_image_size, integer stride
test1_input_image_size = 224
test1_stride = 2

# Test case 2: tuple input_image_size, integer stride
test2_input_image_size = (256, 384)
test2_stride = 4

# Test case 3: list input_image_size, tuple stride
test3_input_image_size = [512, 768]
test3_stride = (8, 8)

# Test case 4: None input_image_size
test4_input_image_size = None
test4_stride = 2

ARGS = {
    "input_image_size": 224,
    "stride": 2
}
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 list, ndim 1, dtype family int — 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
drop_connect Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("d3319e3d34ca90ca")
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, 5) 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 input tensor with shape BCWH (Batch, Channels, Width, Height)
# Using batch_size=2, channels=4, width=3, height=5 for distinct dimensions
inputs = torch.randn(2, 4, 3, 5, dtype=torch.float32)

# Probability of drop connection
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, 5) — shape (2, 4, 3, 5) 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
efficientnet_params Ran
ran, honoured the contract we drafted
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("158895ccad37077c")
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, ndim 1, 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)

# The function takes a model_name string and returns parameter coefficients
# It doesn't use any complex objects, just needs a valid model name string

ARGS = {
    'model_name': 'efficientnet-b0'
}
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 tuple, ndim 1, dtype family float — a tuple 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
get_output_size Ran
ran, honoured the contract we drafted
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("57cafea17f72df42")
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.

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((1, 1))
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.pool(x)
        x = x.view(x.size(0), -1)
        return x

net = SimpleNet()

ARGS = {
    "net": net
}
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 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
get_same_padding_conv2d Ran
ran; our contract draft was wrong, not the code
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("ecd5b19163cc5430")
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 type. 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 torch.nn as nn
from functools import partial

torch.manual_seed(0)

# Test case 1: Dynamic padding (image_size=None)
ARGS = {
    "image_size": None
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type output the recorded ndim 0 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_width_and_height_from_size Ran
ran, honoured the contract we drafted
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("ed9d02b76fb84ae4")
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, ndim 1, dtype family int; 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)

ARGS = {
    "x": 32
}
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 tuple, ndim 1, dtype family int — a tuple 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
round_filters Ran
ran; our contract draft was wrong, not the code
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("f15a49337e69e937")
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.

from collections import namedtuple

# Create a namedtuple for global_params with the required attributes
GlobalParams = namedtuple('GlobalParams', ['width_coefficient', 'depth_divisor', 'min_depth'])

# Create valid global_params instance
global_params = GlobalParams(
    width_coefficient=1.0,
    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; our contract draft was wrong, not the code
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("dbc0ca08d119a5a0")
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.

from collections import namedtuple

# Create a namedtuple for global_params with the depth_coefficient attribute
GlobalParams = namedtuple('GlobalParams', ['depth_coefficient'])

# Define ARGS with valid arguments for round_repeats
ARGS = {
    'repeats': 4,
    'global_params': GlobalParams(depth_coefficient=1.5)
}
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
EfficientNet Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("26488aa7fc70e759")
How it ran

no invocation recorded.

MI_Net Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("380bef540fcd9569")
How it ran

no invocation recorded.

_resnet Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("9c43e20a92c08bf4")
How it ran

no invocation recorded.

efficientnet Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("7c07cd76854d45e9")
How it ran

no invocation recorded.

freeze Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("30090882dbaf19ed")
How it ran

no invocation recorded.

get_model_params Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("c58da27c524ad799")
How it ran

no invocation recorded.

load_pretrained_weights Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("d930abcc85af042c")
How it ran

no invocation recorded.

resnet34 Not yet run
unverified (harvested, no recorded run)
qingyuliu/exposing-the-deception/models/MI_Net.py
code served (permissive licence) · get_code("2db125f45811942f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 17 are also present in other papers whose code we hold (17 with at least one paper dated earlier, 3 the same month, 7 later) and 8 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
round_filters
brick of this paper's assembly: helper
31 other papers
30 dated earlier, 1 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
brick of this paper's assembly: helper
30 other papers
29 dated earlier, 1 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
brick of this paper's assembly: helper
23 other papers
17 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
1912.01588 (2019-12)
Leveraging Procedural Generation to Benchmark Reinforcement Learning
2010.00475 (2020-10)
FSD50K: An Open Dataset of Human-Labeled Sound Events
and 20 more not named here
calculate_output_image_size
brick of this paper's assembly: helper
10 other papers
4 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
2201.04021 (2022-01)
Optimization Planning for 3D ConvNets
2304.10177 (2023-04)
Regularizing Second-Order Influences for Continual Learning
and 7 more not named here
MemoryEfficientSwish
brick of this paper's assembly: helper
7 other papers
6 dated earlier, 1 later · 4 only as an assembly brick
1612.03144 (2016-12)
Feature Pyramid Networks for Object Detection
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2103.02406 (2021-03)
Multi-attentional Deepfake Detection
and 4 more not named here
get_same_padding_conv2d
brick of this paper's assembly: helper
5 other papers
5 dated earlier · 1 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2103.02406 (2021-03)
Multi-attentional Deepfake Detection
2103.11703 (2021-03)
Model-based 3D Hand Reconstruction via Self-Supervised Learning
and 2 more not named here
Conv2dDynamicSamePadding
brick of this paper's assembly: helper
4 other papers
4 dated earlier · 2 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2103.02406 (2021-03)
Multi-attentional Deepfake Detection
2103.11703 (2021-03)
Model-based 3D Hand Reconstruction via Self-Supervised Learning
and 1 more not named here
SwishImplementation
brick of this paper's assembly: helper
4 other papers
3 dated earlier, 1 later · 4 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2201.04021 (2022-01)
Optimization Planning for 3D ConvNets
2202.10108 (2022-02)
ViTAEv2: Vision Transformer Advanced by Exploring Inductive Bias for Image Recognition and Beyond
and 1 more not named here
get_width_and_height_from_size
brick of this paper's assembly: helper
4 other papers
3 dated earlier, 1 the same month · 2 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2201.04021 (2022-01)
Optimization Planning for 3D ConvNets
2203.02751 (2022-03)
MetaFormer: A Unified Meta Framework for Fine-Grained Recognition
and 1 more not named here
efficientnet_params
brick of this paper's assembly: helper
3 other papers
3 dated earlier
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2106.04015 (2021-06)
Uncertainty Baselines: Benchmarks for Uncertainty &amp; Robustness in Deep Learning
2107.02612 (2021-07)
Combining EfficientNet and Vision Transformers for Video Deepfake Detection
Conv2dStaticSamePadding
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 1 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2201.04021 (2022-01)
Optimization Planning for 3D ConvNets
freeze
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 2 only as an assembly brick
2308.13783 (2023-08)
Generalized Lightness Adaptation with Channel Selective Normalization
2505.05237 (2025-05)
Latte: Transfering LLMs' Latent-level Knowledge for Few-shot Tabular Learning
BlockDecoder
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
MBConvBlock
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
efficientnet
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
get_model_params
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
load_pretrained_weights
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks

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-22.

Repositories linked to this paper

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

Abstract

Deepfake technology has given rise to a spectrum of novel and compelling applications. Unfortunately, the widespread proliferation of high-fidelity fake videos has led to pervasive confusion and deception, shattering our faith that seeing is believing. One aspect that has been overlooked so far is that current deepfake detection approaches may easily fall into the trap of overfitting, focusing only on forgery clues within one or a few local regions. Moreover, existing works heavily rely on neural networks to extract forgery features, lacking theoretical constraints guaranteeing that sufficient forgery clues are extracted and superfluous features are eliminated. These deficiencies culminate in unsatisfactory accuracy and limited generalizability in real-life scenarios. In this paper, we try to tackle these challenges through three designs: (1) We present a novel framework to capture broader forgery clues by extracting multiple non-overlapping local representations and fusing them into a global semanticrich feature. (2) Based on the information bottleneck theory, we derive Local Information Loss to guarantee the orthogonality of local representations while preserving comprehensive task-relevant information. (3) Further, to fuse the local representations and remove task-irrelevant information, we arrive at a Global Information Loss through the theoretical analysis of mutual information. Empirically, our method achieves state-of-the-art performance on five benchmark datasets. Our code is available at https://github.com/ QingyuLiu/Exposing-the-Deception, hoping to inspire researchers.

For agents

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

get_harvested_code_for_paper("2403.01786")
get_code_for_paper("2403.01786")
have("2403.01786")

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

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

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

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

Connect an agent — have() is free.