SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2001.06057 · 2020

A simple way to make neural networks robust against diverse image corruptions

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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 4 have no contract verdict; 3 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/2001.06057.json · badge: /api/ran/2001.06057.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
bethgelab/game-of-noise canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 1 no recorded run
FunctionStatusWhere it lives
BoolArg Ran
ran on a synthesized input
bethgelab/game-of-noise/utils.py
code served (permissive licence) · get_code("dde7b825268e867a")
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 bool, 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

torch.manual_seed(0)

ARGS = {
    'arg': 'true'
}
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 bool, 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
clipped_zoom Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from hendrycks/robustness
pointer only · get_code("5f0ee8450d2eac09")
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.

clipped_zoom Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from hendrycks/robustness
pointer only · get_code("466ca3cdf4524d82")
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.

get_noise_generator Ran
ran on a synthesized input
bethgelab/game-of-noise/Networks/generators.py
code served (permissive licence) · get_code("0dea3fe3ee98fc09")
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 NoiseResNet1x1Conv. 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)

class Args:
    def __init__(self):
        self.ng_type = '1x1'
        self.channels = 3
        self.custom_init_ng = True
        self.epsilon_generator = 0.1
        self.device = 'cpu'

ARGS = {
    'args': Args()
}
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 NoiseResNet1x1Conv — a NoiseResNet1x1Conv output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoiseResNet1x1Conv 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
setup_data_loader Ran
ran; our contract draft was wrong, not the code
bethgelab/game-of-noise/datasets.py
code served (permissive licence) · get_code("fa95daecdc6b29a8")
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 numpy as np
import os
import tempfile
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
from PIL import Image

torch.manual_seed(0)
np.random.seed(0)

# Create temporary directory structure for ImageNet
temp_dir = tempfile.mkdtemp()
datadir_clean = tempfile.mkdtemp()
datadir_sin = tempfile.mkdtemp()
imagenetc_path = tempfile.mkdtemp()

# Create minimal ImageNet train/val structure
train_dir = os.path.join(datadir_clean, 'train')
val_dir = os.path.join(datadir_clean, 'val')
os.makedirs(train_dir, exist_ok=True)
os.makedirs(val_dir, exist_ok=True)

# Create a few dummy class folders and images
for split_dir in [train_dir, val_dir]:
    for class_idx in range(2):
        class_dir = os.path.join(split_dir, f'class_{class_idx}')
        os.makedirs(class_dir, exist_ok=True)
        for img_idx in range(2):
            img = Image.new('RGB', (256, 256), color=(73, 109, 137))
            img.save(os.path.join(class_dir, f'img_{img_idx}.jpg'))

# Create SIN dataset structure
sin_train_dir = os.path.join(datadir_sin, 'train')
os.makedirs(sin_train_dir, exist_ok=True)
for class_idx in range(2):
    class_dir = os.path.join(sin_train_dir, f'class_{class_idx}')
    os.makedirs(class_dir, exist_ok=True)
    for img_idx in range(2):
        img = Image.new('RGB', (256, 256), color=(73, 109, 137))
        img.save(os.path.join(class_dir, f'img_{img_idx}.jpg'))

# Create ImageNet-C structure
for corruption_name in ['brightness', 'contrast', 'defocus_blur']:
    corruption_dir = os.path.join(imagenetc_path, corruption_name)
    for severity in range(1, 6):
        severity_dir = os.path.join(corruption_dir, str(severity))
        os.makedirs(severity_dir, exist_ok=True)
        for class_idx in range(2):
            class_dir = os.path.join(severity_dir, f'class_{class_idx}')
            os.makedirs(class_dir, exist_ok=True)
            for img_idx in range(2):
                img = Image.new('RGB', (256, 256), color=(73, 109, 137))
                img.save(os.path.join(class_dir, f'img_{img_idx}.jpg'))

class Args:
    def __init__(self):
        self.workers = 0
        self.batch_size = 2
        self.test_batch_size = 2
        self.sin_batch_size = 2
        self.test_subset_size = 2
        self.datadir_clean = datadir_clean
        self.datadir_sin = datadir_sin
        self.imagenetc_path = imagenetc_path + '/'
        self.arch = 'resnet50'

args = Args()

ARGS = {
    'dataset': 'ImageNet',
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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
setup_imagenet_data_loader Ran
ran on a synthesized input
bethgelab/game-of-noise/datasets.py
code served (permissive licence) · get_code("4a1ab86a4b494c4f")
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 numpy as np
import tempfile
import os
from PIL import Image
from torchvision import datasets, transforms
from torch.utils.data import DataLoader

torch.manual_seed(0)
np.random.seed(0)

# Create temporary directories with minimal ImageFolder structure
tmpdir = tempfile.mkdtemp()
datadir_clean = tmpdir

# Create train and val directories
traindir = os.path.join(datadir_clean, 'train')
valdir = os.path.join(datadir_clean, 'val')
os.makedirs(traindir, exist_ok=True)
os.makedirs(valdir, exist_ok=True)

# Create a dummy class directory and images for training
train_class_dir = os.path.join(traindir, 'class0')
os.makedirs(train_class_dir, exist_ok=True)
for i in range(5):
    img = Image.new('RGB', (300, 300), color=(i*50, i*50, i*50))
    img.save(os.path.join(train_class_dir, f'img_{i}.jpg'))

# Create a dummy class directory and images for validation
val_class_dir = os.path.join(valdir, 'class0')
os.makedirs(val_class_dir, exist_ok=True)
for i in range(10):
    img = Image.new('RGB', (300, 300), color=(i*25, i*25, i*25))
    img.save(os.path.join(val_class_dir, f'img_{i}.jpg'))

# Create args object
class Args:
    def __init__(self):
        self.workers = 0
        self.datadir_clean = datadir_clean
        self.arch = 'resnet50'
        self.batch_size = 2
        self.test_batch_size = 2
        self.test_subset_size = 5

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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
setup_imagenetc_data_loader Ran
ran on a synthesized input
bethgelab/game-of-noise/datasets.py
code served (permissive licence) · get_code("0099f4dda5e182fb")
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 torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
from torchvision import transforms
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory structure to simulate ImageNetC
temp_dir = tempfile.mkdtemp()

# Create dummy ImageFolder structure for each corruption type and severity
corruption_types = ['brightness', 'contrast', 'defocus_blur', 'elastic_transform', 'fog', 'frost', 'gaussian_noise', 'glass_blur', 'impulse_noise', 'jpeg_compression', 'motion_blur', 'pixelate', 'shot_noise', 'snow', 'zoom_blur']

for corruption in corruption_types:
    for severity in range(1, 6):
        class_dir = os.path.join(temp_dir, corruption, str(severity), 'class_0')
        os.makedirs(class_dir, exist_ok=True)
        
        # Create a dummy image file (1x1 pixel PNG)
        import struct
        import zlib
        
        # Minimal PNG for 1x1 white pixel
        png_data = (
            b'\x89PNG\r\n\x1a\n'  # PNG signature
            b'\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x02\x00\x00\x00\x90wS\xde'  # IHDR chunk
            b'\x00\x00\x00\x0cIDAT\x08\x99c\xf8\x0f\x00\x00\x01\x01\x00\x05\xcc\xb6\x10'  # IDAT chunk
            b'\x00\x00\x00\x00IEND\xaeB`\x82'  # IEND chunk
        )
        
        img_path = os.path.join(class_dir, 'image_0.png')
        with open(img_path, 'wb') as f:
            f.write(png_data)

# Create a simple args object
class Args:
    def __init__(self):
        self.workers = 0
        self.imagenetc_path = temp_dir + '/'
        self.test_batch_size = 2

ARGS = {
    'args': Args()
}
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 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
load_imagenet_classifier Not yet run
unverified (harvested, no recorded run)
bethgelab/game-of-noise/Networks/classifiers.py
code served (permissive licence) · get_code("5041e68eb9b32180")
How it ran

no invocation recorded.

plasma_fractal Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from hendrycks/robustness
pointer only · get_code("3fe212e00cbe6fb3")
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. No invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
clipped_zoom 5 other papers
1 dated earlier, 4 later
1903.12261 (2019-03)
Benchmarking Neural Network Robustness to Common Corruptions and Perturbations
2110.13771 (2021-10)
AugMax: Adversarial Composition of Random Augmentations for Robust Training
2207.13916 (2022-07)
A Novel Data Augmentation Technique for Out-of-Distribution Sample Detection using Compounded Corruptions
and 2 more not named here
plasma_fractal 5 other papers
2 dated earlier, 3 later
1903.12261 (2019-03)
Benchmarking Neural Network Robustness to Common Corruptions and Perturbations
1906.02337 (2019-06)
MNIST-C: A Robustness Benchmark for Computer Vision
2110.13771 (2021-10)
AugMax: Adversarial Composition of Random Augmentations for Robust Training
and 2 more not named here
clipped_zoom 2 other papers
1 dated earlier, 1 later
1903.12261 (2019-03)
Benchmarking Neural Network Robustness to Common Corruptions and Perturbations
2508.12082 (2025-08)
Automated Model Evaluation for Object Detection via Prediction Consistency and Reliability
setup_data_loader 1 other paper
1 later
2006.12135 (2020-06)
Learning to Generate Noise for Multi-Attack Robustness

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

The human visual system is remarkably robust against a wide range of naturally occurring variations and corruptions like rain or snow. In contrast, the performance of modern image recognition models strongly degrades when evaluated on previously unseen corruptions. Here, we demonstrate that a simple but properly tuned training with additive Gaussian and Speckle noise generalizes surprisingly well to unseen corruptions, easily reaching the previous state of the art on the corruption benchmark ImageNet-C (with ResNet50) and on MNIST-C. We build on top of these strong baseline results and show that an adversarial training of the recognition model against uncorrelated worst-case noise distributions leads to an additional increase in performance. This regularization can be combined with previously proposed defense methods for further improvement.

For agents

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

get_harvested_code_for_paper("2001.06057")
get_code_for_paper("2001.06057")
have("2001.06057")

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

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

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

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

Connect an agent — have() is free.