SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.08460 · NeurIPS · 2024

Trap-MID: Trapdoor-based Defense against Model Inversion Attacks

Shang-Tse Chen, Zhen-Ting Liu

arXiv · PDF · Open in the Atlas

Code that ran

20 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 5 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 14 failures of our instrument; 5 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/2411.08460.json · badge: /api/ran/2411.08460.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
ntuaislab/Trap-MID canonical (classifier label)
classifier basis: census
13 ran · 4 no recorded run
ntuaislab/trap-mid canonical (classifier label)
classifier basis: classifier_2025
7 ran · 1 no recorded run
FunctionStatusWhere it lives
BiDOLoss Ran
ran on a synthesized input · constructed an object; no result was computed
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("a884c93b164b0301")
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, BiDOLoss: 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 numpy as np

torch.manual_seed(0)

# Create minimal test data
batch_size = 2
input_dim = 4
n_classes = 3
hidden_dim = 5

# Create sample tensors
inputs = torch.randn(batch_size, input_dim)
labels = torch.tensor([0, 1])

# Create a simple hidden layer output
hiddens = [torch.randn(batch_size, hidden_dim)]

ARGS = {
    'n_classes': n_classes,
    'measure': 'HSIC',
    'ktype': 'linear',
    'lambda_xz': 0.05,
    'lambda_yz': 0.5,
    'sigma': 5
}
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 BiDOLoss — 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 BiDOLoss 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
blend Ran
ran, honoured the contract we drafted
ntuaislab/Trap-MID/engine.py
code served (permissive licence) · get_code("c6aa7f9bc9167818")
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 2, dtype family float, shape (2, 4) 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)

img = torch.randn(2, 4)
key = torch.randn(2, 4)
alpha = 0.5

ARGS = {
    "img": img,
    "key": key,
    "alpha": alpha,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
cifar10_ls_scheduler Ran
ran, honoured the contract we drafted
ntuaislab/Trap-MID/loss.py
code served (permissive licence) · get_code("35bbc328adf58afc")
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 float, ndim 0, dtype family float, 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)

# The function cifar10_ls_scheduler takes two parameters:
# - epoch: an integer representing the current epoch
# - n_epochs: an integer representing the total number of epochs

ARGS = {
    "epoch": 60,
    "n_epochs": 100
}
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 float, ndim 0, dtype family float, 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
coco_normalized_cca Ran
ran; our contract draft was wrong, not the code
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("82b9f22fb0cee711")
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 0, dtype family float, 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 numpy as np

torch.manual_seed(0)

# Create small test tensors
# x: shape (2, 4) - 2 samples, 4 dimensions
x = torch.randn(2, 4, dtype=torch.float32)

# y: shape (2, 3) - 2 samples, 3 dimensions (distinct from x's dimension)
y = torch.randn(2, 3, dtype=torch.float32)

# sigma: positive float for gaussian kernel bandwidth
sigma = 1.0

# ktype: string specifying kernel type
ktype = 'gaussian'

ARGS = {
    'x': x,
    'y': y,
    'sigma': sigma,
    'ktype': ktype
}
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 Tensor, ndim 0, dtype family float, 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
completion_network_loss Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/lomma/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from sutd-visual-computing-group/Re-thinking_MI, is pointer only (licence: NONE) · get_code("8ceea87fe22a6f64")
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 sutd-visual-computing-group/Re-thinking_MI, 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.

cross_entropy_loss Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/plgmi/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from ngoc-nguyen-0/LOKT_neurips2023, is pointer only (licence: NONE) · get_code("c808ba0601a877e8")
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 ngoc-nguyen-0/LOKT_neurips2023, 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.

custom_crop Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ntuaislab/Trap-MID/dataset.py
code served (permissive licence) · get_code("6a21e67f80fded5c")
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, 4, 4) 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=2, height=8, width=8, channels=4]
x = torch.randn(2, 8, 8, 4)

# Define crop parameters
crop_size = 4
offset_height = 2
offset_width = 1

ARGS = {
    "x": x,
    "crop_size": crop_size,
    "offset_height": offset_height,
    "offset_width": offset_width,
}
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, 4, 4) — shape (2, 4, 4, 4) 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
distmat Ran
ran; our contract draft was wrong, not the code
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("e114974d0f761dd9")
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 2, dtype family float, shape (2, 2) 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 2D tensor (batch_size=2, feature_dim=4)
X = torch.randn(2, 4)

ARGS = {
    "X": X
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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_block Ran
ran, honoured the contract we drafted
ntuaislab/Trap-MID/evolve.py
code served (permissive licence) · get_code("ad5dbf57f3ea2633")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned list, ndim 2, 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
from collections import namedtuple

torch.manual_seed(0)

# The function get_block takes in_channel, depth, num_units, and stride
# It returns a list of Bottleneck namedtuples

ARGS = {
    'in_channel': 64,
    'depth': 128,
    'num_units': 3,
    'stride': 2
}
Setup block drafted by
a language model, Claude Sonnet 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 list, ndim 2, 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
get_blocks Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/evolve.py
pointer only (licence: MIT); the stored copy get_code serves, from VladAndronik/face_swap, is pointer only (licence: NONE) · get_code("ea7941eb1ea8ffb2")
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 VladAndronik/face_swap, 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.

hsic_normalized_cca Ran
ran; our contract draft was wrong, not the code
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("7d2973af90a23c1f")
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 0, dtype family float, 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 numpy as np

torch.manual_seed(0)

# Create small tensors for x and y
# x: batch_size=2, features=4
x = torch.randn(2, 4, dtype=torch.float32)

# y: batch_size=2, features=3 (different from x to distinguish dimensions)
y = torch.randn(2, 3, dtype=torch.float32)

# sigma: scalar value for kernel bandwidth
sigma = 1.0

# ktype: kernel type
ktype = 'gaussian'

ARGS = {
    'x': x,
    'y': y,
    'sigma': sigma,
    'ktype': ktype
}
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 Tensor, ndim 0, dtype family float, 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
init_optimizer Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/utils.py
code served (permissive licence) · get_code("4fb95eae17ae047f")
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 torch.nn as nn

torch.manual_seed(0)

# Create a simple model with parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Define model_args dict with SGD optimizer and scheduler
model_args = {
    'optimizer': 'sgd',
    'lr': 0.01,
    'momentum': 0.9,
    'weight_decay': 1e-5,
    'scheduler': {
        'adjust_epochs': [10, 20],
        'gamma': 0.1
    }
}

# Get parameters from model
parameters = model.parameters()

ARGS = {
    'model_args': model_args,
    'parameters': parameters
}
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, 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
kernelmat Ran
ran; our contract draft was wrong, not the code
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("92265a82f9af90ae")
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 2, dtype family float, shape (2, 2) 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 numpy as np

torch.manual_seed(0)

# Create a small input tensor: shape (2, 4) meaning 2 samples, 4 dimensions
X = torch.randn(2, 4, dtype=torch.float32)

# Define ARGS dict with all parameters for kernelmat function
ARGS = {
    'X': X,
    'sigma': 1.0,
    'ktype': 'gaussian',
    'measure': 'HSIC'
}
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 Tensor, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) 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
ls_scheduler Ran
ran, honoured the contract we drafted
ntuaislab/Trap-MID/loss.py
code served (permissive licence) · get_code("96bb2d7d804b9cad")
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 float, ndim 0, dtype family float, 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 numpy as np

torch.manual_seed(0)

ARGS = {
    "epoch": 60,
    "n_epochs": 100
}
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 float, ndim 0, dtype family float, 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
make_layers Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/classify.py
code served (permissive licence) · get_code("d8ff7dc2584b42c8")
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. 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)

# cfg should be a list containing integers (channel counts) and 'M' (MaxPool markers)
cfg = [64, 'M', 128, 128, 'M', 256, 256, 'M']

batch_norm = False

ARGS = {
    'cfg': cfg,
    'batch_norm': batch_norm
}
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 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: none by the harness; any seed is in the setup block
max_margin_loss Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/plgmi/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from ngoc-nguyen-0/LOKT_neurips2023, is pointer only (licence: NONE) · get_code("342f31bfe572d0c8")
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 ngoc-nguyen-0/LOKT_neurips2023, 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.

mnist_ls_scheduler Ran
ran, honoured the contract we drafted
ntuaislab/Trap-MID/loss.py
code served (permissive licence) · get_code("2b7c170416d54959")
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 float, ndim 0, dtype family float, 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)

ARGS = {
    "epoch": 3,
    "n_epochs": 10,
}
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 float, ndim 0, dtype family float, 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
poincare_loss Ran
ran; our contract draft was wrong, not the code
ntuaislab/Trap-MID/plgmi/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from ngoc-nguyen-0/LOKT_neurips2023, is pointer only (licence: NONE) · get_code("b6e4cb9cdcdb7226")
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 ngoc-nguyen-0/LOKT_neurips2023, 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.

sigma_estimation Ran
ran; our contract draft was wrong, not the code
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("93214d3b236b1185")
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 float32, ndim 0, dtype family float, 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 numpy as np

torch.manual_seed(0)

# Create two small tensors with distinct sizes
# X: shape (2, 4) - 2 samples, 4 dimensions
# Y: shape (3, 4) - 3 samples, 4 dimensions
X = torch.randn(2, 4)
Y = torch.randn(3, 4)

ARGS = {
    "X": X,
    "Y": Y,
}
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 float32, ndim 0, dtype family float, 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
to_categorical Ran
ran; our contract draft was wrong, not the code
ntuaislab/trap-mid/loss.py
code served (permissive licence) · get_code("af8945c5f03a178f")
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 2, dtype family float, shape (4, 4) 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 batch of class indices
# y should be a 1D tensor of class indices
y = torch.tensor([0, 2, 1, 0], dtype=torch.long)

# num_classes should be an integer greater than the max index in y
num_classes = 4

ARGS = {
    "y": y,
    "num_classes": num_classes,
}
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 2, dtype family float, shape (4, 4) — shape (4, 4) 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
IR_50_64 Not yet run
unverified (harvested, no recorded run)
ntuaislab/Trap-MID/evolve.py
code served (permissive licence) · get_code("83508305e20056c9")
How it ran

no invocation recorded.

load_attri Not yet run
unverified (harvested, no recorded run)
ntuaislab/Trap-MID/lomma/dataloader.py
pointer only (licence: MIT); the stored copy get_code serves, from sutd-visual-computing-group/Re-thinking_MI, is pointer only (licence: NONE) · get_code("36a55c008abe5c4b")
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 sutd-visual-computing-group/Re-thinking_MI, 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. No invocation recorded.

noise_loss Not yet run
unverified (harvested, no recorded run)
ntuaislab/Trap-MID/lomma/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from sutd-visual-computing-group/Re-thinking_MI, is pointer only (licence: NONE) · get_code("45a9b6bf1ce41469")
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 sutd-visual-computing-group/Re-thinking_MI, 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. No invocation recorded.

prepare_results_dir Not yet run
unverified (harvested, no recorded run)
ntuaislab/trap-mid/plgmi/train_cgan.py
code served (permissive licence) · get_code("b1181f4abb871ade")
How it ran

no invocation recorded.

test Not yet run
unverified (harvested, no recorded run)
ntuaislab/Trap-MID/engine.py
code served (permissive licence) · get_code("26ebe515279a4189")
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, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 0 the same month, 7 later) and 14 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
get_block 27 other papers
23 dated earlier, 3 later, 1 same year, order not determinable
1804.07573 (2018-04)
MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices
1903.08527 (2019-03)
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set
1907.10830 (2019-07)
U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation
and 24 more not named here
get_blocks 16 other papers
14 dated earlier, 1 later, 1 same year, order not determinable
1804.07573 (2018-04)
MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices
1903.08527 (2019-03)
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set
1907.10830 (2019-07)
U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation
and 13 more not named here
sigma_estimation
brick of this paper's assembly: helper
11 other papers
7 dated earlier, 3 later, 1 same year, order not determinable
1908.01580 (2019-08)
The HSIC Bottleneck: Deep Learning without Back-Propagation
2106.01939 (2021-06)
Causal Effect Inference for Structured Treatments
2106.02734 (2021-06)
Revisiting Hilbert-Schmidt Information Bottleneck for Adversarial Robustness
and 8 more not named here
distmat
brick of this paper's assembly: helper
8 other papers
5 dated earlier, 3 later · 1 only as an assembly brick
1908.01580 (2019-08)
The HSIC Bottleneck: Deep Learning without Back-Propagation
2106.01939 (2021-06)
Causal Effect Inference for Structured Treatments
2106.02734 (2021-06)
Revisiting Hilbert-Schmidt Information Bottleneck for Adversarial Robustness
and 5 more not named here
completion_network_loss 4 other papers
3 dated earlier, 1 later
2010.04092 (2020-10)
Knowledge-Enriched Distributional Model Inversion Attacks
2207.12263 (2022-07)
SecretGen: Privacy Recovery on Pre-trained Models via Distribution Discrimination
2402.04013 (2024-02)
Privacy Leakage on DNNs: A Survey of Model Inversion Attacks and Defenses
and 1 more not named here
load_attri 2 other papers
1 dated earlier, 1 later
2010.04092 (2020-10)
Knowledge-Enriched Distributional Model Inversion Attacks
2509.20177 (2025-09)
Generative Model Inversion Through the Lens of the Manifold Hypothesis
make_layers 2 other papers
2 dated earlier
2206.05483 (2022-06)
Bilateral Dependency Optimization: Defending Against Model-inversion Attacks
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
noise_loss 2 other papers
1 dated earlier, 1 later
2010.04092 (2020-10)
Knowledge-Enriched Distributional Model Inversion Attacks
2509.20177 (2025-09)
Generative Model Inversion Through the Lens of the Manifold Hypothesis
cross_entropy_loss 1 other paper
1 dated earlier
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
max_margin_loss 1 other paper
1 dated earlier
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer
poincare_loss 1 other paper
1 dated earlier
2310.19342 (2023-10)
Label-Only Model Inversion Attacks via Knowledge Transfer

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

Model Inversion (MI) attacks pose a significant threat to the privacy of Deep Neural Networks by recovering training data distribution from well-trained models. While existing defenses often rely on regularization techniques to reduce information leakage, they remain vulnerable to recent attacks. In this paper, we propose the Trapdoor-based Model Inversion Defense (Trap-MID) to mislead MI attacks. A trapdoor is integrated into the model to predict a specific label when the input is injected with the corresponding trigger. Consequently, this trapdoor information serves as the "shortcut" for MI attacks, leading them to extract trapdoor triggers rather than private data. We provide theoretical insights into the impacts of trapdoor's effectiveness and naturalness on deceiving MI attacks. In addition, empirical experiments demonstrate the state-of-the-art defense performance of Trap-MID against various MI attacks without the requirements for extra data or large computational overhead. Our source code is publicly available at https://github.com/ntuaislab/Trap-MID.

For agents

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

get_harvested_code_for_paper("2411.08460")
get_code_for_paper("2411.08460")
have("2411.08460")

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

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

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

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

Connect an agent — have() is free.