SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.09079 · 2023

SSL-Cleanse: Trojan Detection and Mitigation in Self-Supervised Learning

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 1 failure of our instrument; 1 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/2303.09079.json · badge: /api/ran/2303.09079.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
ucf-ml-research/ssl-cleanse canonical (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
FunctionStatusWhere it lives
PCGrad Ran
ran on a synthesized input
ucf-ml-research/ssl-cleanse/detector/core/utils.py
code served (permissive licence) · get_code("832b608dd0de04f2")
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 3, dtype family float, shape (2, 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)

# atten_grad: tensor that will be indexed and modified
# Shape should be such that after view(shape) it makes sense
# The function indexes with sim < 0, modifies, then views to shape
atten_grad = torch.randn(8, 4)  # flattened before view

# ce_grad: tensor with same first dimensions as atten_grad for indexing
ce_grad = torch.randn(8, 4)

# sim: tensor used for comparison sim < 0
# Should have same first dimension as atten_grad for boolean indexing
sim = torch.randn(8)

# shape: target shape for final view operation
# Should be compatible with the size of atten_grad (product should be 32)
shape = (2, 4, 4)

ARGS = {
    "atten_grad": atten_grad,
    "ce_grad": ce_grad,
    "sim": sim,
    "shape": shape,
}
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 3, dtype family float, shape (2, 4, 4) — shape (2, 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
draw Ran
ran on a synthesized input
ucf-ml-research/ssl-cleanse/detector/core/utils.py
code served (permissive licence) · get_code("68cda5db67f7fd9b")
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, 3, 4, 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
import torchvision.transforms.functional as F

torch.manual_seed(0)

# Create small tensors with distinct sizes
# base: image tensor (batch=2, channels=3, height=4, width=5)
base = torch.randn(2, 3, 4, 5)

# mean: normalization mean (channels=3)
mean = torch.tensor([0.485, 0.456, 0.406])

# std: normalization std (channels=3)
std = torch.tensor([0.229, 0.224, 0.225])

# mask: binary mask same shape as base (batch=2, channels=3, height=4, width=5)
mask = torch.randint(0, 2, (2, 3, 4, 5)).float()

# delta: perturbation tensor same shape as base
delta = torch.randn(2, 3, 4, 5) * 0.1

ARGS = {
    "base": base,
    "mean": mean,
    "std": std,
    "mask": mask,
    "delta": delta,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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, 3, 4, 5) — shape (2, 3, 4, 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
get_head Ran
ran; our contract draft was wrong, not the code
ucf-ml-research/ssl-cleanse/detector/core/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.

get_model Not yet run
unverified (harvested, no recorded run)
ucf-ml-research/ssl-cleanse/detector/core/model.py
code served (permissive licence) · get_code("06ebbacf39d65124")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 1 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_head 4 other papers
3 dated earlier, 1 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
2105.10123 (2021-05)
Backdoor Attacks on Self-Supervised Learning
and 1 more not named here
PCGrad 1 other paper
1 dated earlier
2203.08392 (2022-03)
Patch-Fool: Are Vision Transformers Always Robust Against Adversarial Perturbations?
get_model 1 other paper
1 later
2408.08533 (2024-08)
Adv-SSL: Adversarial Self-Supervised Representation Learning with Theoretical Guarantees

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

Self-supervised learning (SSL) is a prevalent approach for encoding data representations. Using a pre-trained SSL image encoder and subsequently training a downstream classifier, impressive performance can be achieved on various tasks with very little labeled data. The growing adoption of SSL has led to an increase in security research on SSL encoders and associated Trojan attacks. Trojan attacks embedded in SSL encoders can operate covertly, spreading across multiple users and devices. The presence of backdoor behavior in Trojaned encoders can inadvertently be inherited by downstream classifiers, making it even more difficult to detect and mitigate the threat. Although current Trojan detection methods in supervised learning can potentially safeguard SSL downstream classifiers, identifying and addressing triggers in the SSL encoder before its widespread dissemination is a challenging task. This challenge arises because downstream tasks might be unknown, dataset labels may be unavailable, and the original unlabeled training dataset might be inaccessible during Trojan detection in SSL encoders. We introduce SSL-Cleanse as a solution to identify and mitigate backdoor threats in SSL encoders. We evaluated SSL-Cleanse on various datasets using 1200 encoders, achieving an average detection success rate of 82.2% on ImageNet-100. After mitigating backdoors, on average, backdoored encoders achieve 0.3% attack success rate without great accuracy loss, proving the effectiveness of SSL-Cleanse. The source code of SSL-Cleanse is available at https://github.com/UCF-ML-Research/SSL-Cleanse.

For agents

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

get_harvested_code_for_paper("2303.09079")
get_code_for_paper("2303.09079")
have("2303.09079")

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

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

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

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

Connect an agent — have() is free.