SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.10123 · 2021

Backdoor Attacks on Self-Supervised Learning

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2105.10123.json · badge: /api/ran/2105.10123.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
UMBCvision/SSL-Backdoor canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
buildLabelIndex Ran
ran; our contract draft was wrong, not the code
UMBCvision/SSL-Backdoor/rotnet/dataloader.py
pointer only (licence: MIT); the stored copy get_code serves, from valeoai/moca, is pointer only (licence: NOASSERTION) · get_code("57889d72f516d105")
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 valeoai/moca, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

contrastive_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
UMBCvision/SSL-Backdoor/byol/methods/contrastive.py
pointer only (licence: MIT); the stored copy get_code serves, from htdt/self-supervised, is pointer only (licence: NONE) · get_code("ba00312b3d5b70dc")
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 htdt/self-supervised, 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.

conv1x1 Ran
ran; our contract draft was wrong, not the code
UMBCvision/SSL-Backdoor/jigsaw/resnet.py
code served (permissive licence) · get_code("d9def42110729a85")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Conv2d. 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)

# The function conv1x1 takes in_planes, out_planes, and stride as parameters
# It returns an nn.Conv2d layer configured for 1x1 convolution
# We need to provide valid integer arguments for these parameters

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
UMBCvision/SSL-Backdoor/jigsaw/resnet.py
code served (permissive licence) · get_code("160bb14bd76201b4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Conv2d. 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_planes": 3,
    "out_planes": 64,
    "stride": 1,
    "groups": 1,
    "dilation": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
create_torch_dataloader Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from jsrdcht/SSL-Backdoor
pointer only · get_code("cf100d49bb98767a")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

default_loader Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
UMBCvision/SSL-Backdoor/rotnet/jgg_dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from NA-HMC/NA-HMC, is pointer only (licence: NONE) · get_code("7bf07d5f59aae36d")
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 NA-HMC/NA-HMC, 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.

getConfMatrixResults Ran
ran; our contract draft was wrong, not the code
UMBCvision/SSL-Backdoor/rotnet/utils.py
code served (permissive licence) · get_code("3d9a20721d1cb559")
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 dict. 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 numpy as np

# Construct a confusion matrix
# A confusion matrix is a square 2D array where:
# - rows represent ground truth classes
# - columns represent predicted classes
# - diagonal elements are correct predictions
# - off-diagonal elements are misclassifications

# Create a simple 2x2 confusion matrix (binary classification case)
# This will trigger the special case where num_valid == 2
matrix = np.array([
    [50, 10],    # Ground truth class 0: 50 correct, 10 misclassified as class 1
    [5, 45]      # Ground truth class 1: 5 misclassified as class 0, 45 correct
], dtype=np.float32)

ARGS = {
    'matrix': matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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_head Ran
ran; our contract draft was wrong, not the code
UMBCvision/SSL-Backdoor/byol/model.py
pointer only (licence: MIT); the stored copy get_code serves, from htdt/self-supervised, is pointer only (licence: NONE) · get_code("2d19f4f3143c2ccf")
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 htdt/self-supervised, 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.

pil_loader Ran
ran, honoured the contract we drafted
UMBCvision/SSL-Backdoor/rotnet/jgg_dataset.py
code served (permissive licence) · get_code("f321f54723433661")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Image. 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
from PIL import Image
import io
import os
import tempfile

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a simple RGB image and save it to a temporary file
img = Image.new('RGB', (10, 10), color=(73, 109, 137))
test_image_path = os.path.join(temp_dir, 'test_image.jpg')
img.save(test_image_path)

ARGS = {
    'path': test_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
predict_feature Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from jsrdcht/SSL-Backdoor
pointer only · get_code("8c3820f76db73254")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

rotate_img Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
UMBCvision/SSL-Backdoor/rotnet/dataloader.py
code served (permissive licence) · get_code("62681258109fb35d")
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 ndarray, ndim 3, dtype family int, shape (3, 4, 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 numpy as np

# Create a small test image: height=4, width=3, channels=2
img = np.random.randint(0, 256, size=(4, 3, 2), dtype=np.uint8)

# Test with rotation of 90 degrees
rot = 90

ARGS = {
    'img': img,
    'rot': rot
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (3, 4, 2) — shape (3, 4, 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
accimage_loader Not yet run
unverified (harvested, no recorded run)
UMBCvision/SSL-Backdoor/rotnet/jgg_dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from RobustBench/robustbench, is pointer only (licence: NOASSERTION) · get_code("404fb2b2daa1ae78")
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 RobustBench/robustbench, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

get_model Not yet run
unverified (harvested, no recorded run)
UMBCvision/SSL-Backdoor/byol/model.py
pointer only (licence: MIT); the stored copy get_code serves, from htdt/self-supervised, is pointer only (licence: NONE) · get_code("1d4261306685f800")
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 htdt/self-supervised, 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.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 11 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 3 the same month, 9 later) and 2 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
conv1x1 431 other papers
128 dated earlier, 3 the same month, 294 later, 5 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
conv3x3 312 other papers
77 dated earlier, 2 the same month, 229 later, 3 same year, order not determinable, 1 undated · 31 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
and 309 more not named here
pil_loader 66 other papers
12 dated earlier, 1 the same month, 53 later
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
1711.02512 (2017-11)
Fine-tuning CNN Image Retrieval with No Human Annotation
and 63 more not named here
accimage_loader 39 other papers
10 dated earlier, 29 later
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1711.02512 (2017-11)
Fine-tuning CNN Image Retrieval with No Human Annotation
1805.00907 (2018-05)
Glow: Graph Lowering Compiler Techniques for Neural Networks
and 36 more not named here
default_loader 28 other papers
4 dated earlier, 24 later
1907.02665 (2019-07)
Blind Image Quality Assessment Using A Deep Bilinear Convolutional Neural Network
2003.05033 (2020-03)
Generalized Energy Based Models
2003.13659 (2020-03)
Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
and 25 more not named here
buildLabelIndex 6 other papers
5 dated earlier, 1 later
1803.07728 (2018-03)
Unsupervised Representation Learning by Predicting Image Rotations
1804.09458 (2018-04)
Dynamic Few-Shot Visual Learning without Forgetting
1905.01102 (2019-05)
Generating Classification Weights with GNN Denoising Autoencoders for Few-Shot Learning
and 3 more not named here
get_head 4 other papers
2 dated earlier, 2 later · 2 only as an assembly brick
2002.05709 (2020-02)
A Simple Framework for Contrastive Learning of Visual Representations
2006.07733 (2020-06)
Bootstrap your own latent: A new approach to self-supervised Learning
2303.09079 (2023-03)
SSL-Cleanse: Trojan Detection and Mitigation in Self-Supervised Learning
and 1 more not named here
create_torch_dataloader 2 other papers
2 later
2108.00352 (2021-08)
BadEncoder: Backdoor Attacks to Pre-trained Encoders in Self-Supervised Learning
2210.07346 (2022-10)
An Embarrassingly Simple Backdoor Attack on Self-supervised Learning
get_model 2 other papers
2 dated earlier · 1 only as an assembly brick
2002.05709 (2020-02)
A Simple Framework for Contrastive Learning of Visual Representations
2006.07733 (2020-06)
Bootstrap your own latent: A new approach to self-supervised Learning
predict_feature 2 other papers
2 later
2108.00352 (2021-08)
BadEncoder: Backdoor Attacks to Pre-trained Encoders in Self-Supervised Learning
2210.07346 (2022-10)
An Embarrassingly Simple Backdoor Attack on Self-supervised Learning
contrastive_loss 1 other paper
1 dated earlier
2002.05709 (2020-02)
A Simple Framework for Contrastive Learning of Visual Representations

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

Repositories linked to this paper

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

Abstract

Large-scale unlabeled data has spurred recent progress in self-supervised learning methods that learn rich visual representations. State-of-the-art self-supervised methods for learning representations from images (e.g., MoCo, BYOL, MSF) use an inductive bias that random augmentations (e.g., random crops) of an image should produce similar embeddings. We show that such methods are vulnerable to backdoor attacks - where an attacker poisons a small part of the unlabeled data by adding a trigger (image patch chosen by the attacker) to the images. The model performance is good on clean test images, but the attacker can manipulate the decision of the model by showing the trigger at test time. Backdoor attacks have been studied extensively in supervised learning and to the best of our knowledge, we are the first to study them for self-supervised learning. Backdoor attacks are more practical in self-supervised learning, since the use of large unlabeled data makes data inspection to remove poisons prohibitive. We show that in our targeted attack, the attacker can produce many false positives for the target category by using the trigger at test time. We also propose a defense method based on knowledge distillation that succeeds in neutralizing the attack. Our code is available here: https://github.com/UMBCvision/SSL-Backdoor .

For agents

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

get_harvested_code_for_paper("2105.10123")
get_code_for_paper("2105.10123")
have("2105.10123")

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

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

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

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

Connect an agent — have() is free.