SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.01056 · NeurIPS · 2023

Beyond Pretrained Features: Noisy Image Modeling Provides Adversarial Defense

Bohyung Han, Chang Xu, Zunzhi You, Daochang Liu

arXiv · PDF · Open in the Atlas

Code that ran

1 of 3 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; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 2 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/2302.01056.json · badge: /api/ran/2302.01056.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
youzunzhi/nim-advdef canonical (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
FunctionStatusWhere it lives
Block Ran
ran on a synthesized input · constructed an object; no result was computed
youzunzhi/nim-advdef/model/mae/nim_mae.py
code served (permissive licence) · get_code("b67feaa0c67281dc")
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, Block: 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 = {
    "dim": 4,
    "num_heads": 2,
    "mlp_ratio": 4.0,
    "qkv_bias": False,
    "drop": 0.0,
    "attn_drop": 0.0,
    "drop_path": 0.0,
    "act_layer": nn.GELU,
    "norm_layer": nn.LayerNorm,
}
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 Block — 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 Block 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
MaskedAutoencoderViT Not yet run
unverified (harvested, no recorded run)
youzunzhi/nim-advdef/model/mae/nim_mae.py
code served (permissive licence) · get_code("6bd6870abe55ea7d")
How it ran

no invocation recorded.

NIM_MAE_ViT Not yet run
unverified (harvested, no recorded run)
youzunzhi/nim-advdef/model/mae/nim_mae.py
code served (permissive licence) · get_code("a0a5b61f7188758a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 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
Block
brick of this paper's assembly: model
7 other papers
3 dated earlier, 4 later · 1 only as an assembly brick
2111.06377 (2021-11)
Masked Autoencoders Are Scalable Vision Learners
2204.01678 (2022-04)
MultiMAE: Multi-modal Multi-task Masked Autoencoders
2209.08956 (2022-09)
Panoramic Vision Transformer for Saliency Detection in 360 • Videos
and 4 more not named here

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

Recent advancements in masked image modeling (MIM) have made it a prevailing framework for self-supervised visual representation learning. The MIM pretrained models, like most deep neural network methods, remain vulnerable to adversarial attacks, limiting their practical application, and this issue has received little research attention. In this paper, we investigate how this powerful self-supervised learning paradigm can provide adversarial robustness to downstream classifiers. During the exploration, we find that noisy image modeling (NIM), a simple variant of MIM that adopts denoising as the pre-text task, reconstructs noisy images surprisingly well despite severe corruption. Motivated by this observation, we propose an adversarial defense method, referred to as De 3 , by exploiting the pretrained decoder for denoising. Through De 3 , NIM is able to enhance adversarial robustness beyond providing pretrained features. Furthermore, we incorporate a simple modification, sampling the noise scale hyperparameter from random distributions, and enable the defense to achieve a better and tunable trade-off between accuracy and robustness. Experimental results demonstrate that, in terms of adversarial robustness, NIM is superior to MIM thanks to its effective denoising capability. Moreover, the defense provided by NIM achieves performance on par with adversarial training while offering the extra tunability advantage. Source code and models are available at https://github.com/youzunzhi/NIM-AdvDef.

For agents

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

get_harvested_code_for_paper("2302.01056")
get_code_for_paper("2302.01056")
have("2302.01056")

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

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

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

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

Connect an agent — have() is free.