SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.01187 · 2018

Bag of Tricks for Image Classification with Convolutional Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

11 of 15 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; 3 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 2 failures of our instrument; 4 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/1812.01187.json · badge: /api/ran/1812.01187.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
yangyucheng000/resnet_Ascend community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
PistonY/ResidualAttentionNetwork community (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
cinastanbean/Pytorch-Multi-Task-Multi-class-Classification extension (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
tyohei/chainerkfac extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
calculate_gain Ran
ran on a synthesized input
yangyucheng000/resnet_Ascend/src/resnet.py
code served (permissive licence) · get_code("82c48515ddda4614")
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 float, 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 math
import torch
import torch.nn as nn

torch.manual_seed(0)

# Test case 1: linear nonlinearity
ARGS_1 = {
    'nonlinearity': 'linear',
    'param': None
}

# Test case 2: tanh nonlinearity
ARGS_2 = {
    'nonlinearity': 'tanh',
    'param': None
}

# Test case 3: relu nonlinearity
ARGS_3 = {
    'nonlinearity': 'relu',
    'param': None
}

# Test case 4: leaky_relu with default param
ARGS_4 = {
    'nonlinearity': 'leaky_relu',
    'param': None
}

# Test case 5: leaky_relu with float param
ARGS_5 = {
    'nonlinearity': 'leaky_relu',
    'param': 0.2
}

# Test case 6: conv1d
ARGS_6 = {
    'nonlinearity': 'conv1d',
    'param': None
}

# Test case 7: sigmoid
ARGS_7 = {
    'nonlinearity': 'sigmoid',
    'param': None
}

# Use the simplest test case as the main ARGS
ARGS = {
    'nonlinearity': 'relu',
    'param': None
}
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 float, 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
cutout Ran
ran on a synthesized input
PistonY/ResidualAttentionNetwork/lib/piston_util.py
code served (permissive licence) · get_code("de47a57778dd152f")
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 function. 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

# Create a sample image as a numpy array with shape (height, width, channels)
sample_image = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8).astype(np.float32)

# Define the eraser function by calling cutout with default parameters
def cutout(p=0.5, s_l=0.02, s_h=0.4, r_1=0.3, r_2=1 / 0.3, v_l=0, v_h=255, pixel_level=False):
    def eraser(input_img):
        img_h, img_w, img_c = input_img.shape
        p_1 = np.random.rand()
        if p_1 > p:
            return input_img
        while True:
            s = np.random.uniform(s_l, s_h) * img_h * img_w
            r = np.random.uniform(r_1, r_2)
            w = int(np.sqrt(s / r))
            h = int(np.sqrt(s * r))
            left = np.random.randint(0, img_w)
            top = np.random.randint(0, img_h)
            if left + w <= img_w and top + h <= img_h:
                break
        if pixel_level:
            c = np.random.uniform(v_l, v_h, (h, w, img_c))
        else:
            c = np.random.uniform(v_l, v_h)
        input_img[top:top + h, left:left + w, :] = c
        return input_img
    return eraser

ARGS = {
    'p': 0.5,
    's_l': 0.02,
    's_h': 0.4,
    'r_1': 0.3,
    'r_2': 1 / 0.3,
    'v_l': 0,
    'v_h': 255,
    'pixel_level': 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
extract Ran
ran; our contract draft was wrong, not the code
tyohei/chainerkfac/chainerkfac/optimizers/kfac.py
code served (permissive licence) · get_code("b4e26744ad9e217a")
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 list. 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)

# blocks: a list/dict-like structure that can be indexed
# The function accesses blocks[index], so it needs to support indexing
blocks = [
    [np.array([1.0, 2.0, 3.0, 4.0]), np.array([5.0, 6.0, 7.0, 8.0])],
    [np.array([9.0, 10.0, 11.0, 12.0])],
    [np.array([13.0, 14.0, 15.0, 16.0]), np.array([17.0, 18.0, 19.0, 20.0]), np.array([21.0, 22.0, 23.0, 24.0])]
]

# indices: a list of lists of indices
# The function iterates over indices, then over local_indices, then over index values
indices = [
    [0, 1],
    [2],
    [0, 2]
]

# extractor: a callable that takes blocks[index] and returns an iterable of arrays
# The function calls extractor(blocks[index]) and iterates over the result
def extractor(block):
    # block is one element from blocks, which is a list of arrays
    # Return the arrays as-is (or could process them)
    return block

ARGS = {
    "blocks": blocks,
    "indices": indices,
    "extractor": extractor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
format_time Ran
ran on a synthesized input
PistonY/ResidualAttentionNetwork/lib/piston_util.py
code served (permissive licence) · get_code("e83a42da4ac207cc")
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 str. 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.

from datetime import timedelta

prev_time = timedelta(hours=0, minutes=0, seconds=0)
cur_time = timedelta(hours=1, minutes=23, seconds=45)

ARGS = {
    "prev_time": prev_time,
    "cur_time": cur_time,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_dict_key Ran
ran; our contract draft was wrong, not the code
cinastanbean/Pytorch-Multi-Task-Multi-class-Classification/src/main_mtmc_resnet.py
pointer only (licence: NONE) · get_code("b8d5814ad4631b08")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinastanbean/Pytorch-Multi-Task-Multi-class-Classification 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_ems Ran
ran on a synthesized input
PistonY/ResidualAttentionNetwork/kaggle/utils.py
code served (permissive licence) · get_code("7d86840aa94ec126")
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 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
import torch.nn as nn

torch.manual_seed(0)

# Create simple callable modules that take trans as input and return a scalar or tensor
class SimpleNet(nn.Module):
    def __init__(self, output_size=1):
        super().__init__()
        self.output_size = output_size
        self.linear = nn.Linear(4, output_size)
    
    def forward(self, x):
        # x is trans, expected to be a tensor
        return self.linear(x).sum()

# Create instances of the net modules
net_module_1 = SimpleNet(output_size=1)
net_module_2 = SimpleNet(output_size=1)
net_module_3 = SimpleNet(output_size=1)

net = [net_module_1, net_module_2, net_module_3]

# Create a small tensor for trans (batch=2, features=4)
trans = torch.randn(2, 4)

# Create rate list with matching length to net
rate = [0.5, 0.3, 0.2]

ARGS = {
    "net": net,
    "trans": trans,
    "rate": rate
}
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 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
get_liner_lr Ran
ran on a synthesized input
yangyucheng000/resnet_Ascend/gpu_resnet_benchmark.py
code served (permissive licence) · get_code("11d835e45631ea6b")
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 1, dtype family float, shape (1000,) 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

ARGS = {
    "lr_init": 0.0001,
    "lr_end": 0.00001,
    "lr_max": 0.001,
    "warmup_epochs": 2,
    "total_epochs": 10,
    "steps_per_epoch": 100,
}
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 1, dtype family float, shape (1000,) — shape (1000,) 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_top5_acc Ran
ran, honoured the contract we drafted
yangyucheng000/resnet_Ascend/postprocess.py
code served (permissive licence) · get_code("52a9653519e980d2")
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 int, ndim 0, dtype family int, 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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - top5_arg: an iterable of top-5 predictions (likely lists/tensors of 5 class indices)
# - gt_class: an iterable of ground truth class indices
# - The function checks if gt (a single value) is in top5 (a collection)
# - It zips these together, so they should have the same length

# Create small batch of top-5 predictions (batch size 2, each with 5 top classes)
top5_predictions = [
    [0, 1, 2, 3, 4],      # batch item 0: top 5 class indices
    [2, 3, 4, 1, 0]       # batch item 1: top 5 class indices
]

# Create ground truth labels (batch size 2)
ground_truth = [1, 4]  # gt for item 0 is 1, gt for item 1 is 4

ARGS = {
    "top5_arg": top5_predictions,
    "gt_class": ground_truth
}
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 int, ndim 0, dtype family int, 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
kaiming_normal Ran
ran on a synthesized input
yangyucheng000/resnet_Ascend/src/resnet.py
code served (permissive licence) · get_code("f0a6216664197738")
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 4, dtype family float, shape (4, 3, 2, 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 math
import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Define ARGS dict with all parameters for kaiming_normal
ARGS = {
    'inputs_shape': (4, 3, 2, 2),  # [out_channels, in_channels, height, width] for conv2d
    'a': 0.01,                      # negative slope for leaky_relu
    'mode': 'fan_in',               # fan calculation mode
    'nonlinearity': 'leaky_relu'    # activation function type
}
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 4, dtype family float, shape (4, 3, 2, 2) — shape (4, 3, 2, 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
round_filters Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from seermer/TensorFlow2-EfficientNetV2
pointer only · get_code("e60387e9529f63ff")
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.

round_repeats Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from seermer/TensorFlow2-EfficientNetV2
pointer only · get_code("1a9d7e65e0a9fbc9")
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.

cout_confmatrix_tofile Not yet run
unverified (harvested, no recorded run)
cinastanbean/Pytorch-Multi-Task-Multi-class-Classification/src/main_mtmc_resnet.py
pointer only (licence: NONE) · get_code("38093779943ae353")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinastanbean/Pytorch-Multi-Task-Multi-class-Classification 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.

rescale Not yet run
unverified (harvested, no recorded run)
PistonY/ResidualAttentionNetwork/lib/piston_util.py
code served (permissive licence) · get_code("237abd0c98440417")
How it ran

no invocation recorded.

show_predict_info Not yet run
unverified (harvested, no recorded run)
yangyucheng000/resnet_Ascend/infer.py
code served (permissive licence) · get_code("c5cd33786bbc32f6")
How it ran

no invocation recorded.

slmc_validate Not yet run
unverified (harvested, no recorded run)
cinastanbean/Pytorch-Multi-Task-Multi-class-Classification/src/main_mtmc_resnet.py
pointer only (licence: NONE) · get_code("bb26e0be1ece15c0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, cinastanbean/Pytorch-Multi-Task-Multi-class-Classification 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 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 6 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 6 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.

FunctionAlso present inEarliest-datedOthers named
get_top5_acc 3 other papers
2 dated earlier, 1 later
1605.07146 (2016-05)
Wide Residual Networks
1611.05431 (2016-11)
Aggregated Residual Transformations for Deep Neural Networks
1911.11907 (2019-11)
GhostNet: More Features from Cheap Operations
calculate_gain 2 other papers
2 later
2104.09124 (2021-04)
DisCo: Remedy Self-supervised Learning on Lightweight Models with Distilled Contrastive Learning
2106.02898 (2021-06)
Dynamic Resolution Network
kaiming_normal 2 other papers
2 later
2104.09124 (2021-04)
DisCo: Remedy Self-supervised Learning on Lightweight Models with Distilled Contrastive Learning
2106.02898 (2021-06)
Dynamic Resolution Network
round_filters 2 other papers
2 later
1911.11907 (2019-11)
GhostNet: More Features from Cheap Operations
2104.00298 (2021-04)
EfficientNetV2: Smaller Models and Faster Training
round_repeats 2 other papers
2 later
1911.11907 (2019-11)
GhostNet: More Features from Cheap Operations
2104.00298 (2021-04)
EfficientNetV2: Smaller Models and Faster Training
extract 1 other paper
1 later
2002.06015 (2020-02)
Scalable and Practical Natural Gradient for Large-Scale Deep Learning

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

Much of the recent progress made in image classification research can be credited to training procedure refinements, such as changes in data augmentations and optimization methods. In the literature, however, most refinements are either briefly mentioned as implementation details or only visible in source code. In this paper, we will examine a collection of such refinements and empirically evaluate their impact on the final model accuracy through ablation study. We will show that, by combining these refinements together, we are able to improve various CNN models significantly. For example, we raise ResNet-50's top-1 validation accuracy from 75.3% to 79.29% on ImageNet. We will also demonstrate that improvement on image classification accuracy leads to better transfer learning performance in other application domains such as object detection and semantic segmentation.

For agents

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

get_harvested_code_for_paper("1812.01187")
get_code_for_paper("1812.01187")
have("1812.01187")

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

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

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

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

Connect an agent — have() is free.