SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.11633 · AAAI · 2023

Learning Context-Aware Classifier for Semantic Segmentation

Yixin Chen, Xiaojuan Qi, Jiaya Jia, Li Jiang, Zhuotao Tian, Jiequan Cui, Xin Lai, Shu Liu

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2303.11633.json · badge: /api/ran/2303.11633.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
tianzhuotao/CAC canonical (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
calculate_file_sha256 Ran
ran; our contract draft was wrong, not the code
tianzhuotao/CAC/.dev/gather_models.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zmhhmz/resfu, is pointer only (licence: NONE) · get_code("a669df2cd07c07bb")
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 zmhhmz/resfu, 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.

get_distill_loss Ran
ran on a synthesized input
tianzhuotao/CAC/mmseg/models/decode_heads/fcn_head_cac.py
code served (permissive licence) · get_code("b7bee1f53105ce4d")
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. 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 torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors with distinct dimensions
batch_size = 2
num_classes = 4
height = 3
width = 5

# pred: logits from model, shape (b, c, h, w)
pred = torch.randn(batch_size, num_classes, height, width)

# soft: soft predictions/teacher output, shape (b, c, h, w)
soft = torch.randn(batch_size, num_classes, height, width)

# target: ground truth labels, shape (b, h, w) with values in [0, num_classes) or 255 for ignore
target = torch.randint(0, num_classes, (batch_size, height, width))
# Add some ignore pixels (255)
target[0, 0, 0] = 255

# smoothness: float between 0 and 1
smoothness = 0.5

# eps: float for label smoothing
eps = 0.0

ARGS = {
    "pred": pred,
    "soft": soft,
    "target": target,
    "smoothness": smoothness,
    "eps": eps,
}
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_distill_loss Ran
ran on a synthesized input
tianzhuotao/CAC/mmseg/models/decode_heads/sep_aspp_head_cac.py
code served (permissive licence) · get_code("9bb368f79226af2c")
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. 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 torch.nn.functional as F

torch.manual_seed(0)

# Small tensor dimensions: batch=2, channels=4, height=3, width=5
batch_size = 2
num_classes = 4
height = 3
width = 5

# pred: logits from model, shape (b, c, h, w)
pred = torch.randn(batch_size, num_classes, height, width)

# soft: soft targets/teacher output, shape (b, c, h, w)
soft = torch.randn(batch_size, num_classes, height, width)

# target: ground truth labels, shape (b, h, w) with values in [0, num_classes) or 255 (ignore)
# Create a target with some valid classes and some ignore indices
target = torch.randint(0, num_classes, (batch_size, height, width)).long()
# Add some ignore indices (255)
target[0, 0, 0] = 255
target[1, 1, 1] = 255

# smoothness parameter
smoothness = 0.5

# eps parameter for label smoothing
eps = 0.0

ARGS = {
    "pred": pred,
    "soft": soft,
    "target": target,
    "smoothness": smoothness,
    "eps": eps,
}
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_final_iter Ran
ran, honoured the contract we drafted
tianzhuotao/CAC/.dev/gather_models.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zmhhmz/resfu, is pointer only (licence: NONE) · get_code("88d68650d669bb11")
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 zmhhmz/resfu, 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.

process_checkpoint Ran
ran; our contract draft was wrong, not the code
tianzhuotao/CAC/.dev/gather_models.py
code served (permissive licence) · get_code("aa74cd62302ed7c8")
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.

import torch
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a dummy checkpoint file to use as input
dummy_checkpoint = {
    'model_state_dict': {'layer1.weight': torch.randn(4, 3)},
    'optimizer': {'state': {}},
    'epoch': 5
}

in_file = os.path.join(temp_dir, 'checkpoint_input.pth')
torch.save(dummy_checkpoint, in_file)

out_file = os.path.join(temp_dir, 'checkpoint_output.pth')

ARGS = {
    'in_file': in_file,
    'out_file': out_file
}
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 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 4 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, 3 later) and 1 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_final_iter 13 other papers
6 dated earlier, 7 later
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2105.05409 (2021-05)
A Large-Scale Benchmark for Food Image Segmentation
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
and 10 more not named here
calculate_file_sha256 9 other papers
1 dated earlier, 8 later
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
2304.13428 (2023-04)
Compensation Learning in Semantic Segmentation
2309.14303 (2023-09)
Dataset Diffusion: Diffusion-based Synthetic Dataset Generation for Pixel-Level Semantic Segmentation
and 6 more not named here
process_checkpoint 2 other papers
1 dated earlier, 1 later
2105.15203 (2021-05)
SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers
2405.06228 (2024-05)
Context-Guided Spatial Feature Reconstruction for Efficient 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

Semantic segmentation is still a challenging task for parsing diverse contexts in different scenes, thus the fixed classifier might not be able to well address varying feature distributions during testing. Different from the mainstream literature where the efficacy of strong backbones and effective decoder heads has been well studied, in this paper, additional contextual hints are instead exploited via learning a context-aware classifier whose content is data-conditioned, decently adapting to different latent distributions. Since only the classifier is dynamically altered, our method is model-agnostic and can be easily applied to generic segmentation models. Notably, with only negligible additional parameters and +2% inference time, decent performance gain has been achieved on both small and large models with challenging benchmarks, manifesting substantial practical merits brought by our simple yet effective method. The implementation is available at https://github.com/tianzhuotao/CAC.

For agents

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

get_harvested_code_for_paper("2303.11633")
get_code_for_paper("2303.11633")
have("2303.11633")

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

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

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

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

Connect an agent — have() is free.