SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.01279 · 2019

Score-CAM: Score-Weighted Visual Explanations for Convolutional Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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 5 have no contract verdict; 4 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/1910.01279.json · badge: /api/ran/1910.01279.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
haofanwang/Score-CAM canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
matheushent/score-cam community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
tabayashi0117/Score-CAM reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
andreysorokin/scam-net community (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
FunctionStatusWhere it lives
energy_point_game Ran
ran on a synthesized input
haofanwang/Score-CAM/utils/energyPointGame.py
code served (permissive licence) · get_code("0eb6b543eedbb913")
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

torch.manual_seed(0)

# bbox is a tuple/list of 4 integers: (x1, y1, x2, y2)
bbox = (1, 1, 3, 3)

# saliency_map is a 2D tensor with shape (w, h)
# The function accesses saliency_map.shape and performs indexing and operations
saliency_map = torch.rand(5, 4)

ARGS = {
    "bbox": bbox,
    "saliency_map": saliency_map,
}
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
grid_display Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
matheushent/score-cam/utils/display.py
code served (permissive licence) · get_code("a6751790d12dd02d")
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 3, dtype family int, shape (12, 9, 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 numpy as np
import math

# Create a small batch of images as a 4D numpy array
# Shape: (batch_size, height, width, channels)
batch_size = 6
height = 4
width = 3
channels = 2

# Create sample image data
np.random.seed(0)
array = np.random.randint(0, 256, size=(batch_size, height, width, channels), dtype=np.uint8)

ARGS = {
    "array": array,
    "num_rows": None,
    "num_columns": None,
}
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 3, dtype family int, shape (12, 9, 2) — shape (12, 9, 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
heatmap_display Ran
ran on a synthesized input
matheushent/score-cam/utils/display.py
code served (permissive licence) · get_code("c54afa1ecb39fd2f")
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 3, dtype family int, shape (128, 96, 3) 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
import cv2

# Create a small heatmap
heatmap = np.random.rand(64, 64).astype(np.float32)

# Create a small original image in RGB format with shape (H, W, C)
original_image = np.random.rand(128, 96, 3).astype(np.float32)

# Define ARGS dict with all parameters for heatmap_display
ARGS = {
    "heatmap": heatmap,
    "original_image": original_image,
    "colormap": cv2.COLORMAP_JET,
    "image_weight": 0.7
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (128, 96, 3) — shape (128, 96, 3) 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
image_to_uint_255 Ran
ran on a synthesized input
matheushent/score-cam/utils/display.py
code served (permissive licence) · get_code("1ea162efebe64eb5")
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 2, dtype family int, shape (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 numpy as np

# Test case 1: uint8 image (already converted)
image_uint8 = np.array([[10, 20], [30, 40]], dtype=np.uint8)

# Test case 2: float image in [0, 1] range
image_0_1 = np.array([[0.2, 0.5], [0.8, 0.1]], dtype=np.float32)

# Test case 3: float image in [-1, 1] range
image_minus1_1 = np.array([[-0.5, 0.3], [0.7, -0.2]], dtype=np.float32)

# Test case 4: float image in [0, 255] range
image_0_255 = np.array([[50.5, 100.2], [200.8, 150.3]], dtype=np.float32)

# Use one of the test cases for the main ARGS
ARGS = {
    "image": image_0_1
}
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 2, dtype family int, shape (2, 2) — shape (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
masked_inputs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tabayashi0117/Score-CAM/scorecam/score_cam.py
code served (permissive licence) · get_code("d3ba787775c076f1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 4, 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 numpy as np
import torch

torch.manual_seed(0)

# We need to define resize_2d since it's called by upsample_and_normalise
def resize_2d(act_maps, size_hw):
    """Mock resize function that upsamples activation maps to target size."""
    from scipy.ndimage import zoom
    h_target, w_target = size_hw
    h_orig, w_orig, n = act_maps.shape
    zoom_factors = (h_target / h_orig, w_target / w_orig, 1)
    return zoom(act_maps, zoom_factors, order=1)

# Make resize_2d available in the global scope for the function to use
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'resize_2d', resize_2d)

# Create base_img: a small RGB image (H, W, C)
base_img = np.random.rand(8, 6, 3).astype(np.float32)

# Create act_maps: activation maps with shape (h, w, n)
# Small spatial dimensions, few channels
act_maps = np.random.rand(4, 3, 5).astype(np.float32)

# Target size for upsampling (H, W)
size_hw = (8, 6)

# Preprocess function that takes a batch and returns processed batch
def preprocess_fn(batch):
    # Simple preprocessing: normalize to [-1, 1]
    return (batch - 0.5) * 2

ARGS = {
    'base_img': base_img,
    'act_maps': act_maps,
    'size_hw': size_hw,
    'preprocess_fn': preprocess_fn
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — 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 — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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
normalize_activations Ran
ran on a synthesized input
matheushent/score-cam/utils/image.py
code served (permissive licence) · get_code("5444b8777b09ceb1")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 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 tensorflow as tf

# Create a small 4D tensor with shape (batch_size, K, H, W)
# batch_size=2, K=4, H=3, W=5 (distinct dimensions for probing)
tensor = tf.constant([
    [[[1.0, 2.0, 3.0, 4.0, 5.0],
      [6.0, 7.0, 8.0, 9.0, 10.0],
      [11.0, 12.0, 13.0, 14.0, 15.0]],
     [[16.0, 17.0, 18.0, 19.0, 20.0],
      [21.0, 22.0, 23.0, 24.0, 25.0],
      [26.0, 27.0, 28.0, 29.0, 30.0]],
     [[31.0, 32.0, 33.0, 34.0, 35.0],
      [36.0, 37.0, 38.0, 39.0, 40.0],
      [41.0, 42.0, 43.0, 44.0, 45.0]],
     [[46.0, 47.0, 48.0, 49.0, 50.0],
      [51.0, 52.0, 53.0, 54.0, 55.0],
      [56.0, 57.0, 58.0, 59.0, 60.0]]],
    [[[61.0, 62.0, 63.0, 64.0, 65.0],
      [66.0, 67.0, 68.0, 69.0, 70.0],
      [71.0, 72.0, 73.0, 74.0, 75.0]],
     [[76.0, 77.0, 78.0, 79.0, 80.0],
      [81.0, 82.0, 83.0, 84.0, 85.0],
      [86.0, 87.0, 88.0, 89.0, 90.0]],
     [[91.0, 92.0, 93.0, 94.0, 95.0],
      [96.0, 97.0, 98.0, 99.0, 100.0],
      [101.0, 102.0, 103.0, 104.0, 105.0]],
     [[106.0, 107.0, 108.0, 109.0, 110.0],
      [111.0, 112.0, 113.0, 114.0, 115.0],
      [116.0, 117.0, 118.0, 119.0, 120.0]]]
], dtype=tf.float32)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 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
resize_activations Ran
ran on a synthesized input
andreysorokin/scam-net/scam/utils.py
code served (permissive licence) · get_code("0092b2f7ee2b970b")
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 (5, 6, 8, 3) 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

# Create enhanced_model_output with shape (batch, height, width, channels)
# Using distinct sizes: batch=2, height=4, width=3, channels=5
enhanced_model_output = np.random.randn(2, 4, 3, 5).astype(np.float32)

# Create input_shape as a tuple (height, width) for the target resize dimensions
input_shape = (6, 8)

ARGS = {
    "enhanced_model_output": enhanced_model_output,
    "input_shape": input_shape,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage — 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 (5, 6, 8, 3) — shape (5, 6, 8, 3) 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
swin_reshape_transform Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from frgfm/torch-cam
pointer only · get_code("cd9e431963bd28ca")
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.

vit_reshape_transform Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from frgfm/torch-cam
pointer only · get_code("3e3e7c2d436361ca")
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.

ScoreCam Not yet run
unverified (harvested, no recorded run)
tabayashi0117/Score-CAM/scorecam/score_cam.py
code served (permissive licence) · get_code("8abe77c90e3bab0d")
How it ran

no invocation recorded.

normalize_activations Not yet run
unverified (harvested, no recorded run)
andreysorokin/scam-net/scam/utils.py
code served (permissive licence) · get_code("1b3ec8aff736ee84")
How it ran

no invocation recorded.

resize_activations Not yet run
unverified (harvested, no recorded run)
matheushent/score-cam/utils/image.py
code served (permissive licence) · get_code("f2f03a34ff27740f")
How it ran

no invocation recorded.

upsample_and_normalise Not yet run
unverified (harvested, no recorded run)
tabayashi0117/Score-CAM/scorecam/score_cam.py
code served (permissive licence) · get_code("a658de56603d3a9a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 10 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
swin_reshape_transform 5 other papers
4 dated earlier, 1 later
1512.04150 (2015-12)
Learning Deep Features for Discriminative Localization
1610.02391 (2016-10)
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
1710.11063 (2017-10)
Grad-CAM++: Improved Visual Explanations for Deep Convolutional Networks
and 2 more not named here
vit_reshape_transform 5 other papers
4 dated earlier, 1 later
1512.04150 (2015-12)
Learning Deep Features for Discriminative Localization
1610.02391 (2016-10)
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
1710.11063 (2017-10)
Grad-CAM++: Improved Visual Explanations for Deep Convolutional Networks
and 2 more not named here
grid_display 2 other papers
2 dated earlier · 1 only as an assembly brick
1610.02391 (2016-10)
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
1703.01365 (2017-03)
Axiomatic Attribution for Deep Networks

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

Recently, increasing attention has been drawn to the internal mechanisms of convolutional neural networks, and the reason why the network makes specific decisions. In this paper, we develop a novel post-hoc visual explanation method called Score-CAM based on class activation mapping. Unlike previous class activation mapping based approaches, Score-CAM gets rid of the dependence on gradients by obtaining the weight of each activation map through its forward passing score on target class, the final result is obtained by a linear combination of weights and activation maps. We demonstrate that Score-CAM achieves better visual performance and fairness for interpreting the decision making process. Our approach outperforms previous methods on both recognition and localization tasks, it also passes the sanity check. We also indicate its application as debugging tools. Official code has been released.

For agents

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

get_harvested_code_for_paper("1910.01279")
get_code_for_paper("1910.01279")
have("1910.01279")

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

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

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

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

Connect an agent — have() is free.