SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1710.11063 · 2017

Grad-CAM++: Improved Visual Explanations for Deep Convolutional Networks

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 0 have no contract verdict; 6 failures of our instrument; 1 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/1710.11063.json · badge: /api/ran/1710.11063.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
samson6460/tf.keras-gradcamplusplus 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
HollrayChan/gradcam-plus-plus reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
extract_feature_without_fliphor Ran
ran; our contract draft was wrong, not the code
HollrayChan/gradcam-plus-plus/main_gradcam.py
pointer only (licence: NONE) · get_code("c30f68b12bf6fb11")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HollrayChan/gradcam-plus-plus 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.

grad_cam Ran
ran; our contract draft was wrong, not the code
samson6460/tf.keras-gradcamplusplus/gradcam.py
code served (permissive licence) · get_code("5b31bf1776aa901d")
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 ndarray, ndim 2, dtype family float, shape (8, 8) 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 tensorflow as tf
from tensorflow.keras import Model, layers

# Build a minimal model with a named layer 'block5_conv3'
def build_test_model():
    inputs = tf.keras.Input(shape=(8, 8, 3))
    x = layers.Conv2D(16, 3, padding='same', name='block1_conv1')(inputs)
    x = layers.Conv2D(16, 3, padding='same', name='block2_conv1')(x)
    x = layers.Conv2D(16, 3, padding='same', name='block5_conv3')(x)
    x = layers.GlobalAveragePooling2D()(x)
    outputs = layers.Dense(5, activation='softmax')(x)
    model = Model(inputs=inputs, outputs=outputs)
    return model

# Create model
model = build_test_model()

# Create a test image (8x8x3)
img = np.random.randn(8, 8, 3).astype(np.float32)

# Label names for 5 classes
label_names = ['cat', 'dog', 'bird', 'fish', 'horse']

# Category ID (optional, will default to argmax if None)
category_id = 2

ARGS = {
    'model': model,
    'img': img,
    'layer_name': 'block5_conv3',
    'label_name': label_names,
    'category_id': category_id
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — 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 float, shape (8, 8) — shape (8, 8) 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
grad_cam_plus Ran
ran; our contract draft was wrong, not the code
samson6460/tf.keras-gradcamplusplus/gradcam.py
code served (permissive licence) · get_code("5bcbc2252f5d8000")
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 float, shape (8, 8) 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 tensorflow as tf
from tensorflow.keras import Model, layers

# Build a minimal model that satisfies the function's requirements
def create_minimal_model():
    """Create a small keras model with named layers."""
    inputs = layers.Input(shape=(32, 32, 3))
    
    # Add some convolutional blocks
    x = layers.Conv2D(8, 3, padding='same', name='block1_conv1')(inputs)
    x = layers.ReLU()(x)
    x = layers.MaxPooling2D(2)(x)
    
    x = layers.Conv2D(16, 3, padding='same', name='block2_conv1')(x)
    x = layers.ReLU()(x)
    x = layers.MaxPooling2D(2)(x)
    
    x = layers.Conv2D(32, 3, padding='same', name='block5_conv3')(x)
    x = layers.ReLU()(x)
    x = layers.GlobalAveragePooling2D()(x)
    
    outputs = layers.Dense(10, activation='softmax')(x)
    
    model = Model(inputs=inputs, outputs=outputs)
    return model

# Create the model
model = create_minimal_model()

# Create a dummy image (32x32x3)
img = np.random.randn(32, 32, 3).astype(np.float32)

# Create label names list
label_names = ['class_0', 'class_1', 'class_2', 'class_3', 'class_4', 
               'class_5', 'class_6', 'class_7', 'class_8', 'class_9']

# Define all arguments
ARGS = {
    'model': model,
    'img': img,
    'layer_name': 'block5_conv3',
    'label_name': label_names,
    'category_id': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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 float, shape (8, 8) — shape (8, 8) 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
preprocess_image Ran
ran; our contract draft was wrong, not the code
samson6460/tf.keras-gradcamplusplus/utils.py
code served (permissive licence) · get_code("c0284e95304e29bf")
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 float, shape (224, 224, 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 tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary image file for testing
temp_dir = tempfile.mkdtemp()
img_array = np.random.randint(0, 256, (224, 224, 3), dtype=np.uint8)
img = Image.fromarray(img_array)
img_path = os.path.join(temp_dir, "test_image.jpg")
img.save(img_path)

ARGS = {
    "img_path": img_path,
    "target_size": (224, 224)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, tensorflow — 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 float, shape (224, 224, 3) — shape (224, 224, 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.

show_imgwithheat Not yet run
unverified (harvested, no recorded run)
samson6460/tf.keras-gradcamplusplus/utils.py
code served (permissive licence) · get_code("abec4075f19dd646")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 4 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
2 dated earlier, 3 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
1908.01224 (2019-08)
Smooth Grad-CAM++: An Enhanced Inference Level Visualization Technique for Deep Convolutional Neural Network Models
and 2 more not named here
vit_reshape_transform 5 other papers
2 dated earlier, 3 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
1908.01224 (2019-08)
Smooth Grad-CAM++: An Enhanced Inference Level Visualization Technique for Deep Convolutional Neural Network Models
and 2 more not named here
grad_cam 1 other paper
1 dated earlier
1610.02391 (2016-10)
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization

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

Over the last decade, Convolutional Neural Network (CNN) models have been highly successful in solving complex vision problems. However, these deep models are perceived as "black box" methods considering the lack of understanding of their internal functioning. There has been a significant recent interest in developing explainable deep learning models, and this paper is an effort in this direction. Building on a recently proposed method called Grad-CAM, we propose a generalized method called Grad-CAM++ that can provide better visual explanations of CNN model predictions, in terms of better object localization as well as explaining occurrences of multiple object instances in a single image, when compared to state-of-the-art. We provide a mathematical derivation for the proposed method, which uses a weighted combination of the positive partial derivatives of the last convolutional layer feature maps with respect to a specific class score as weights to generate a visual explanation for the corresponding class label. Our extensive experiments and evaluations, both subjective and objective, on standard datasets showed that Grad-CAM++ provides promising human-interpretable visual explanations for a given CNN architecture across multiple tasks including classification, image caption generation and 3D action recognition; as well as in new settings such as knowledge distillation.

For agents

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

get_harvested_code_for_paper("1710.11063")
get_code_for_paper("1710.11063")
have("1710.11063")

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

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

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

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

Connect an agent — have() is free.