SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.08335 · 2021

Trigger Hunting with a Topological Prior for Trojan Detection

arXiv · PDF · Open in the Atlas

Code that ran

3 of 10 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 3 have no contract verdict; 0 failures of our instrument; 7 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/2110.08335.json · badge: /api/ran/2110.08335.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
HuXiaoling/TopoTrigger canonical (classifier label)
classifier basis not recorded on the link
3 ran · 7 no recorded run
FunctionStatusWhere it lives
compute_dgm_force Ran
ran on a synthesized input
HuXiaoling/TopoTrigger/TDFMain.py
code served (permissive licence) · get_code("687666fb75913cea")
How it ran

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

import numpy as np
import math

# Create sample persistence diagrams
# lh_dgm: learned/hypothesis diagram - shape (n_points, 2) where each row is (birth, death)
# gt_dgm: ground truth diagram - shape (m_points, 2)

# Create a non-empty ground truth diagram with 3 points
gt_dgm = np.array([
    [0.1, 0.6],
    [0.2, 0.7],
    [0.3, 0.8]
], dtype=np.float32)

# Create a learned diagram with 5 points
lh_dgm = np.array([
    [0.05, 0.55],
    [0.15, 0.65],
    [0.25, 0.75],
    [0.35, 0.85],
    [0.4, 0.5]
], dtype=np.float32)

ARGS = {
    'lh_dgm': lh_dgm,
    'gt_dgm': gt_dgm,
    'pers_thresh': 0.0,
    'pers_thresh_perfect': 0.99,
    'do_return_perfect': False
}
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 tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
loadim Ran
ran on a synthesized input
HuXiaoling/TopoTrigger/extract_fv_color_v2r.py
code served (permissive licence) · get_code("e52968879d6b2cba")
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 (1, 3, 224, 224) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import tempfile
import os
from PIL import Image

# Create a temporary image file to use as input
temp_dir = tempfile.gettempdir()
temp_image_path = os.path.join(temp_dir, "test_image.png")

# Create a simple test image with dimensions larger than 224x224
# Make it 300x300x3 so cropping to 224x224 works
test_image = numpy.random.randint(0, 256, (300, 300, 3), dtype=numpy.uint8)
Image.fromarray(test_image).save(temp_image_path)

ARGS = {
    "fname": temp_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, skimage, 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 (1, 3, 224, 224) — shape (1, 3, 224, 224) 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_cols Ran
ran on a synthesized input
HuXiaoling/TopoTrigger/parse_r3v3r.py
code served (permissive licence) · get_code("42e022869b094e71")
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 torch
import numpy as np

torch.manual_seed(0)

# The function to_cols takes fvs (feature vectors) which is a list of dicts
# It extracts keys from the first dict, then transposes the data structure
# from a list of dicts to a dict of lists

# Create sample feature vector dicts
fv1 = {
    "feature_a": 1.5,
    "feature_b": 2.3,
    "feature_c": torch.tensor([0.1, 0.2, 0.3, 0.4]),
    "feature_d": "text_sample_1"
}

fv2 = {
    "feature_a": 3.7,
    "feature_b": 4.1,
    "feature_c": torch.tensor([0.5, 0.6, 0.7, 0.8]),
    "feature_d": "text_sample_2"
}

fvs = [fv1, fv2]

ARGS = {
    "fvs": fvs
}
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 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
compute_dgm_force Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/topo_efficient.py
code served (permissive licence) · get_code("6829ea1de70f7643")
How it ran

no invocation recorded.

compute_persistence_2DImg_1DHom_gt Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/TDFMain.py
code served (permissive licence) · get_code("46c3034bb8ac762d")
How it ran

no invocation recorded.

compute_persistence_2DImg_1DHom_lh Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/TDFMain.py
code served (permissive licence) · get_code("6bc84bb47a0fc39b")
How it ran

no invocation recorded.

extract_fv Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/extract_fv_color_v2r.py
code served (permissive licence) · get_code("a1601b0f2173c41c")
How it ran

no invocation recorded.

extract_fv Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/extract_fv_color_v2xy.py
code served (permissive licence) · get_code("de43ade8b746a8f3")
How it ran

no invocation recorded.

extract_fv Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/extract_fv_v17r.py
code served (permissive licence) · get_code("776ae6b2c1b02331")
How it ran

no invocation recorded.

getTopoLoss Not yet run
unverified (harvested, no recorded run)
HuXiaoling/TopoTrigger/topoloss.py
code served (permissive licence) · get_code("b0cfebcb03feb140")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Despite their success and popularity, deep neural networks (DNNs) are vulnerable when facing backdoor attacks. This impedes their wider adoption, especially in mission critical applications. This paper tackles the problem of Trojan detection, namely, identifying Trojaned models -- models trained with poisoned data. One popular approach is reverse engineering, i.e., recovering the triggers on a clean image by manipulating the model's prediction. One major challenge of reverse engineering approach is the enormous search space of triggers. To this end, we propose innovative priors such as diversity and topological simplicity to not only increase the chances of finding the appropriate triggers but also improve the quality of the found triggers. Moreover, by encouraging a diverse set of trigger candidates, our method can perform effectively in cases with unknown target labels. We demonstrate that these priors can significantly improve the quality of the recovered triggers, resulting in substantially improved Trojan detection accuracy as validated on both synthetic and publicly available TrojAI benchmarks.

For agents

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

get_harvested_code_for_paper("2110.08335")
get_code_for_paper("2110.08335")
have("2110.08335")

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

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

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

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

Connect an agent — have() is free.