SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_20108 · AAAI · 2022

Activation Modulation and Recalibration Scheme for Weakly Supervised Semantic Segmentation

Jie Wu, Jie Qin, Lujun Li, Xuefeng Xiao, Xingang Wang

Open in the Atlas

Code that ran

10 of 11 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 8 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/aaai_20108.json · badge: /api/ran/aaai_20108.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
jieqin-ai/AMR canonical (classifier label)
classifier basis: census
10 ran · 1 no recorded run
FunctionStatusWhere it lives
GaussProjection Ran
ran on a synthesized input
jieqin-ai/AMR/net/amm.py
code served (permissive licence) · get_code("7f88a22aec58cb37")
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 math

torch.manual_seed(0)

# GaussProjection takes three parameters: x, mean, and std
# x is used in arithmetic operations with mean and std, so it should be a tensor
# mean is used in arithmetic operations, should be a tensor or scalar
# std is used in arithmetic operations, should be a tensor or scalar

x = torch.randn(2, 4)
mean = torch.tensor(0.0)
std = torch.tensor(1.0)

ARGS = {
    "x": x,
    "mean": mean,
    "std": std
}
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
edge_to_affinity Ran
ran on a synthesized input
jieqin-ai/AMR/misc/indexing.py
code served (permissive licence) · get_code("d3b122efb6e32fed")
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 3, dtype family float, shape (2, 6, 3) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# The function expects:
# - edge: a tensor that will be reshaped to (batch_size, -1)
# - paths_indices: a list of indices (numpy arrays or tensors) with shape (batch_size, height, width)

# Create edge tensor
# The function reshapes it to (batch_size, -1), so we need a tensor with batch dimension
# Let's make it (2, 64) after reshape, which means before reshape it could be (2, 8, 8)
edge = torch.randn(2, 8, 8)

# Create paths_indices - a list of index tensors/arrays
# Each element should be an array of indices with shape (batch_size, height, width)
# The indices will be used to index into the flattened edge dimension (64)
# So indices should be in range [0, 64)

batch_size = 2
height = 4
width = 3

# Create 3 path index sets as numpy arrays
paths_indices = []
for _ in range(3):
    # Random indices in valid range [0, 64)
    indices = np.random.randint(0, 64, size=(batch_size, height, width))
    paths_indices.append(indices)

ARGS = {
    "edge": edge,
    "paths_indices": paths_indices
}
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 3, dtype family float, shape (2, 6, 3) — shape (2, 6, 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
gap2d Ran
ran; our contract draft was wrong, not the code
jieqin-ai/AMR/misc/torchutils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zhaozhengChen/LPCAM, is pointer only (licence: NONE) · get_code("b2dee97c33d89372")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zhaozhengChen/LPCAM, and GitHub detected no licence in that repository 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.

gap2d_pos Ran
ran on a synthesized input
jieqin-ai/AMR/misc/torchutils.py
code served (permissive licence) · get_code("31adf0646aa81dc5")
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)

# gap2d_pos expects:
# - x: a 4D tensor (batch_size, channels, height, width)
# - keepdims: boolean flag

# Create a small 4D tensor with batch=2, channels=4, height=3, width=5
x = torch.randn(2, 4, 3, 5)

ARGS = {
    "x": x,
    "keepdims": False
}
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
pil_rescale Ran
ran on a synthesized input
jieqin-ai/AMR/misc/imutils.py
code served (permissive licence) · get_code("03816bd33ff47d91")
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 (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
from PIL import Image

# Create a small test image as a numpy array
# Using shape (4, 5, 3) for height=4, width=5, 3 channels (RGB)
img = np.random.randint(0, 256, size=(4, 5, 3), dtype=np.uint8)

# Define scale factor
scale = 1.5

# Define interpolation order (3 for bicubic, 0 for nearest)
order = 3

ARGS = {
    "img": img,
    "scale": scale,
    "order": order
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 (6, 8, 3) — shape (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
pil_resize Ran
ran on a synthesized input
jieqin-ai/AMR/misc/imutils.py
code served (permissive licence) · get_code("4e4bdca77f683cf7")
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 (20, 24, 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
from PIL import Image

# Create a small test image as a numpy array
# Image shape should be (height, width) or (height, width, channels)
img = np.random.randint(0, 256, size=(10, 12, 3), dtype=np.uint8)

# Define target size as (height, width)
size = (20, 24)

# Define interpolation order (0 for NEAREST, 3 for BICUBIC)
order = 3

ARGS = {
    "img": img,
    "size": size,
    "order": order
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 (20, 24, 3) — shape (20, 24, 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
random_resize_long Ran
ran on a synthesized input
jieqin-ai/AMR/misc/imutils.py
code served (permissive licence) · get_code("802a057433809fc1")
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 (15, 12, 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 random
import numpy as np
from PIL import Image

# Create a small test image as a numpy array (height=10, width=8, RGB channels)
test_img = np.random.randint(0, 256, size=(10, 8, 3), dtype=np.uint8)

ARGS = {
    "img": test_img,
    "min_long": 5,
    "max_long": 15
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 (15, 12, 3) — shape (15, 12, 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
split_dataset Ran
ran; our contract draft was wrong, not the code
jieqin-ai/AMR/misc/torchutils.py
code served (permissive licence) · get_code("8129bde610e5350b")
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 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
from torch.utils.data import Dataset

torch.manual_seed(0)

class SimpleDataset(Dataset):
    def __init__(self, size=10):
        self.size = size
        self.data = torch.randn(size, 4)
        self.labels = torch.randint(0, 2, (size,))
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return self.data[idx], self.labels[idx]

dataset = SimpleDataset(size=10)
n_splits = 3

ARGS = {
    'dataset': dataset,
    'n_splits': n_splits
}
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 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
to_one_hot Ran
ran on a synthesized input
jieqin-ai/AMR/misc/pyutils.py
code served (permissive licence) · get_code("fa36a8f1f0a5a428")
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 (3, 2, 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 a small sparse integer array
sparse_integers = np.array([[0, 1, 2], [1, 0, 2]], dtype=np.int32)

# Define arguments for the function
ARGS = {
    "sparse_integers": sparse_integers,
    "maximum_val": None,
    "dtype": np.bool_
}
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 float, shape (3, 2, 3) — shape (3, 2, 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
to_transition_matrix Ran
ran on a synthesized input
jieqin-ai/AMR/misc/indexing.py
code served (permissive licence) · get_code("2d78188bd6f7f6dc")
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 (4, 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 affinity matrix (4x4)
# This represents pairwise affinities between 4 items
affinity_dense = torch.tensor([
    [0.9, 0.3, 0.1, 0.2],
    [0.3, 0.8, 0.4, 0.1],
    [0.1, 0.4, 0.7, 0.5],
    [0.2, 0.1, 0.5, 0.85]
], dtype=torch.float32)

beta = 2.0

times = 3

ARGS = {
    "affinity_dense": affinity_dense,
    "beta": beta,
    "times": times
}
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 (4, 4) — shape (4, 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
affinity_sparse2dense Not yet run
unverified (harvested, no recorded run)
jieqin-ai/AMR/misc/indexing.py
code served (permissive licence) · get_code("40bf8abef0c6e4b2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 0 the same month, 1 later) and 2 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
gap2d 6 other papers
5 dated earlier, 1 later · 3 only as an assembly brick
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2103.01795 (2021-03)
Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation
2103.08896 (2021-03)
Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation
and 3 more not named here
split_dataset 3 other papers
2 dated earlier, 1 same year, order not determinable
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
2203.00962 (2022-03)
Class Re-Activation Maps for Weakly-Supervised Semantic Segmentation
affinity_sparse2dense 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
edge_to_affinity 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
pil_rescale 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
pil_resize 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
random_resize_long 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
to_one_hot 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation
to_transition_matrix 2 other papers
2 dated earlier
1904.05044 (2019-04)
Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations
2108.03852 (2021-08)
Complementary Patch for Weakly Supervised Semantic Segmentation

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

Image-level weakly supervised semantic segmentation (WSSS) is a fundamental yet challenging computer vision task facilitating scene understanding and automatic driving. Most existing methods resort to classification-based Class Activation Maps (CAMs) to play as the initial pseudo labels, which tend to focus on the discriminative image regions and lack customized characteristics for the segmentation task. To alleviate this issue, we propose a novel activation modulation and recalibration (AMR) scheme, which leverages a spotlight branch and a compensation branch to obtain weighted CAMs that can provide recalibration supervision and task-specific concepts. Specifically, an attention modulation module (AMM) is employed to rearrange the distribution of feature importance from the channel-spatial sequential perspective, which helps to explicitly model channelwise interdependencies and spatial encodings to adaptively modulate segmentation-oriented activation responses. Furthermore, we introduce a cross pseudo supervision for dual branches, which can be regarded as a semantic similar regularization to mutually refine two branches. Extensive experiments show that AMR establishes a new state-of-the-art performance on the PASCAL VOC 2012 dataset, surpassing not only current methods trained with the image-level of supervision but also some methods relying on stronger supervision, such as saliency label. Experiments also reveal that our scheme is plug-and-play and can be incorporated with other approaches to boost their performance. Our code is available at: https://github.com/jieqin-ai/AMR.

For agents

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

get_harvested_code_for_paper("aaai_20108")
get_code_for_paper("aaai_20108")
have("aaai_20108")

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

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

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

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

Connect an agent — have() is free.