SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · ijcai2022_0442 · IJCAI · 2022

Libra-CAM: An Activation-Based Attribution Based on the Linear Approximation of Deep Neural Nets and Threshold Calibration

Sungmin Han, Sangkyun Lee

Code that ran

7 of 12 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; 2 failures of our instrument; 5 no recorded run), measured 2026-11-24; 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/ijcai2022_0442.json · badge: /api/ran/ijcai2022_0442.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
sanglee/Libra-CAM canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
FunctionStatusWhere it lives
Get_blurred_img Ran
ran on a synthesized input
sanglee/Libra-CAM/cams/IGOS_utils_fig/IGOS_resnet.py
code served (permissive licence) · get_code("8969eddf35b67869")
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 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 cv2

# Create a small valid image (224x224x3 in uint8 format for cv2)
input_img = np.random.randint(0, 256, (240, 320, 3), dtype=np.uint8)

# Create a simple label (could be any format, not actually used by the function)
img_label = 0

# Create a minimal dummy model (not actually used by the function)
class DummyModel:
    pass

model = DummyModel()

# Define all arguments
ARGS = {
    'input_img': input_img,
    'img_label': img_label,
    'model': model,
    'resize_shape': (224, 224),
    'Gaussian_param': [51, 50],
    'Median_param': 11,
    'blur_type': 'Gaussian',
    'use_cuda': 0
}
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 tuple, ndim 4, 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
min_max Ran
ran on a synthesized input
sanglee/Libra-CAM/cams/relevance_cam_utils/LRP_util.py
code served (permissive licence) · get_code("6603bc530f1ca207")
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 2, dtype family float, shape (2, 4) 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)

# Create a small tensor for min_max to operate on
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sanglee/Libra-CAM/cams/relevance_cam_utils/LRP_util.py
code served (permissive licence) · get_code("8f036bac02d82603")
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 Tensor, ndim 4, dtype family float, shape (1, 3, 6, 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 torch

torch.manual_seed(0)

# Create a small RGB image as a numpy array
# The function expects an image in HWC format (Height, Width, Channels)
# Using distinct dimensions: height=6, width=8, channels=3 (RGB)
img = np.random.rand(6, 8, 3).astype(np.float32)

ARGS = {
    'img': img
}
Setup block drafted by
a language model, Claude Sonnet 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 Tensor, ndim 4, dtype family float, shape (1, 3, 6, 8) — shape (1, 3, 6, 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
topmaxPixel Ran
ran on a synthesized input
sanglee/Libra-CAM/cams/IGOS_utils_fig/IGOS_util_resnet.py
code served (permissive licence) · get_code("5e03776c7e7df2a6")
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. 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 small 2D numpy array to serve as HattMap
HattMap = np.random.rand(4, 3)

# Create thre_num as the number of top pixels to select
thre_num = 5

# Define ARGS dict with all parameters
ARGS = {
    "HattMap": HattMap,
    "thre_num": thre_num
}
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 tuple — a tuple 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
topmaxPixel_insertion Ran
ran on a synthesized input
sanglee/Libra-CAM/cams/IGOS_utils_fig/IGOS_util_resnet.py
code served (permissive licence) · get_code("52fecc33ec7730d4")
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. 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 small heatmap array with distinct dimensions
HattMap = np.random.rand(4, 3)

# Create a threshold number that's valid (less than total elements)
thre_num = 5

ARGS = {
    "HattMap": HattMap,
    "thre_num": thre_num,
}
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 tuple — a tuple 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
tv_norm Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sanglee/Libra-CAM/cams/IGOS_utils_fig/IGOS_util_resnet.py
code served (permissive licence) · get_code("a7a2aff7594d2b62")
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)

# Construct a valid input tensor
# The function expects input[0, 0, :] to be a 2D image
# So input should be shape (batch, channels, height, width)
# Using small distinct sizes: batch=1, channels=1, height=4, width=3
input_tensor = torch.randn(1, 1, 4, 3)

# tv_beta is a power parameter for the norm calculation
tv_beta = 2.0

ARGS = {
    "input": input_tensor,
    "tv_beta": tv_beta
}
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
z_norm Ran
ran on a synthesized input
sanglee/Libra-CAM/cams/relevance_cam_utils/LRP_util.py
code served (permissive licence) · get_code("7be02e147989074b")
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 2, dtype family float, shape (2, 4) 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)

# z_norm expects a tensor x with mean() and std() methods
# Create a small tensor with shape (2, 4)
x = torch.randn(2, 4)

ARGS = {
    'x': x
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
Integrated_Mask Not yet run
unverified (harvested, no recorded run)
sanglee/Libra-CAM/cams/IGOS_utils_fig/IGOS_resnet.py
code served (permissive licence) · get_code("0f1c2b2aedaf5d78")
How it ran

no invocation recorded.

Libra_cam Not yet run
unverified (harvested, no recorded run)
sanglee/Libra-CAM/cams/Libra_cam.py
code served (permissive licence) · get_code("7c4053fc92f37d49")
How it ran

no invocation recorded.

agf Not yet run
unverified (harvested, no recorded run)
sanglee/Libra-CAM/cams/Multi_cam.py
code served (permissive licence) · get_code("2f687d9b57373788")
How it ran

no invocation recorded.

get_igos Not yet run
unverified (harvested, no recorded run)
sanglee/Libra-CAM/cams/IGOS_utils_fig/IGOS_CAM_resnet.py
code served (permissive licence) · get_code("34ff9efce12452e2")
How it ran

no invocation recorded.

multi_CAM Not yet run
unverified (harvested, no recorded run)
sanglee/Libra-CAM/cams/Multi_cam.py
code served (permissive licence) · get_code("26c23e803e93f369")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 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
preprocess_image 2 other papers
2 dated earlier
1610.02391 (2016-10)
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
2008.02312 (2020-08)
Axiom-based Grad-CAM: Towards Accurate Visualization and Explanation of CNNs
tv_norm 2 other papers
2 dated earlier
1704.03296 (2017-04)
Interpretable Explanations of Black Boxes by Meaningful Perturbation
1903.03894 (2019-03)
GNNExplainer: Generating Explanations for Graph Neural 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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Universal application of AI has increased the need to explain why an AI model makes a specific decision in a human-understandable form. Among many related works, the class activation map (CAM)-based methods have been successful recently, creating input attribution based on the weighted sum of activation maps in convolutional neural networks. However, existing methods use channel-wise importance weights with specific architectural assumptions, relying on arbitrarily chosen attribution threshold values in their quality assessment: we think these can degrade the quality of attribution. In this paper, we propose Libra-CAM, a new CAM-style attribution method based on the best linear approximation of the layer (as a function) between the penultimate activation and the target-class score output. From the approximation, we derive the base formula of Libra-CAM, which is applied with multiple reference activations from a pre-built library. We construct Libra-CAM by averaging these base attribution maps, taking a threshold calibration procedure to optimize its attribution quality. Our experiments show that Libra-CAM can be computed in a reasonable time and is superior to the existing attribution methods in quantitative and qualitative attribution quality evaluations.

For agents

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

get_harvested_code_for_paper("ijcai2022_0442")
get_code_for_paper("ijcai2022_0442")
have("ijcai2022_0442")

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

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

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

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

Connect an agent — have() is free.