SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.07307 · ECCV · 2024

Dual-stage Hyperspectral Image Classification Model with Spectral Supertoken

Jie Wang, Tingfa Xu, Jianan Li, Huan Chen, Peifu Liu, Huiyan Bai

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 2 violated it and 0 have no contract verdict; 7 failures of our instrument; 1 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/2407.07307.json · badge: /api/ran/2407.07307.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
laprf/DSTC canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
calc_init_centroid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
laprf/DSTC/models/spectrum_pixel_clustering.py
code served (permissive licence) · get_code("f1e2c241d1477b22")
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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small batch of images
# Shape: (batch_size, channels, height, width)
# Using distinct sizes: batch=2, channels=3, height=8, width=10
images = torch.randn(2, 3, 8, 10)

# Number of superpixels in width and height directions
num_spixels_width = 4
num_spixels_height = 2

ARGS = {
    "images": images,
    "num_spixels_width": num_spixels_width,
    "num_spixels_height": num_spixels_height,
}
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 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
conv1x1 Ran
ran; our contract draft was wrong, not the code
laprf/DSTC/models/backbones/resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("2a80220dabcb742a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from medaitech/scrd4ad, 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
laprf/DSTC/models/backbones/resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("600ff2c45e0de056")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from medaitech/scrd4ad, 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.

eval_metrics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
laprf/DSTC/utils.py
code served (permissive licence) · get_code("3bbee3fdbaa9a49c")
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 confusion matrix for testing
# This is a 4x4 confusion matrix representing predictions vs ground truth
# for 4 classes
confusion_matrix = np.array([
    [45, 5, 2, 1],
    [3, 38, 4, 2],
    [2, 3, 42, 1],
    [1, 2, 1, 39]
], dtype=np.float32)

ARGS = {
    'confusion_matrix': confusion_matrix,
    'mode': 'ts'
}
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
gen_confusion_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
laprf/DSTC/utils.py
code served (permissive licence) · get_code("39211e5a81221984")
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 int, shape (3, 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 torch

torch.manual_seed(0)

# The function expects:
# - num_class: int, number of classes
# - img_predict: torch.Tensor, predicted class labels (1D or flattened)
# - img_label: torch.Tensor, ground truth class labels (1D or flattened)

# Create small tensors for testing
# img_predict and img_label should be 1D integer tensors
num_class = 3
batch_size = 6

# Create prediction tensor with class indices 0-2
img_predict = torch.tensor([0, 1, 2, 0, 1, 2], dtype=torch.long)

# Create label tensor with class indices 0-2 and one -1 (masked value)
img_label = torch.tensor([0, 1, 1, 2, 2, -1], dtype=torch.long)

ARGS = {
    "num_class": num_class,
    "img_predict": img_predict,
    "img_label": img_label,
}
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 int, shape (3, 3) — shape (3, 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
get_abs_indices Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
laprf/DSTC/models/spectrum_pixel_clustering.py
code served (permissive licence) · get_code("1734eddf367034e5")
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 int, shape (3, 72) 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 init_label_map tensor
# Shape: (batch_size, n_pixel)
# The values represent superpixel indices
b = 2
n_pixel = 4
init_label_map = torch.randint(0, 10, (b, n_pixel), dtype=torch.long)

# num_spixels_width is the width of the superpixel grid
num_spixels_width = 3

ARGS = {
    "init_label_map": init_label_map,
    "num_spixels_width": num_spixels_width,
}
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 int, shape (3, 72) — shape (3, 72) 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
map_to_color Ran
ran, violated the contract we drafted
laprf/DSTC/utils.py
code served (permissive licence) · get_code("f107a08f7755da7d")
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 int, shape (2, 2, 3, 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 test image as numpy array
# The function expects img to be convertible to int8
# Shape should be (height, width, channels) or similar
img = np.array([
    [[5, 3, 1], [2, 4, 0]],
    [[1, 2, 3], [4, 5, 6]]
], dtype=np.int32)

# Create an optional label array with same spatial dimensions as img
# label can contain -1 values which get special coloring
label = np.array([
    [0, -1],
    [1, 0]
], dtype=np.int32)

ARGS = {
    "img": img,
    "label": label
}
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 4, dtype family int, shape (2, 2, 3, 3) — shape (2, 2, 3, 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
pair Ran
ran, violated the contract we drafted
laprf/DSTC/models/VIT.py
code served (permissive licence) · get_code("6ba8cee9f5daea41")
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 tuple, ndim 1, dtype family int; 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 torch

torch.manual_seed(0)

# The function 'pair' takes a single parameter 't' and returns it as a tuple if it isn't already one
# We need to test both cases: when t is a tuple and when it's not

# Case 1: t is not a tuple (e.g., an integer, string, tensor, etc.)
t_not_tuple = 5

# Case 2: t is already a tuple
t_is_tuple = (3, 7)

# We'll use the non-tuple case as the primary test
ARGS = {
    "t": t_not_tuple
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — 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
shifted_window_attention Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
laprf/DSTC/models/backbones/swin.py
code served (permissive licence) · get_code("eaaf99334934adca")
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 4, dtype family float, shape (2, 8, 8, 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 torch.nn.functional as F
from torch import nn, Tensor

torch.manual_seed(0)

# Parameters
B, H, W, C = 2, 8, 8, 4
num_heads = 2
window_size = [4, 4]
shift_size = [2, 2]

# Input tensor: [N, H, W, C]
input_tensor = torch.randn(B, H, W, C)

# QKV weight: [in_dim, out_dim] where out_dim = 3 * C (for Q, K, V)
# Linear layer expects weight of shape [out_features, in_features]
qkv_weight = torch.randn(3 * C, C)

# Projection weight: [out_dim, out_dim] where out_dim = C
proj_weight = torch.randn(C, C)

# Relative position bias: should match attention matrix dimensions
# After reshaping, attention is (B*num_windows, num_heads, window_size[0]*window_size[1], window_size[0]*window_size[1])
# relative_position_bias should be broadcastable to this
relative_position_bias = torch.randn(num_heads, window_size[0] * window_size[1], window_size[0] * window_size[1])

# Optional biases
qkv_bias = torch.randn(3 * C)
proj_bias = torch.randn(C)

# Dropout parameters
attention_dropout = 0.1
dropout = 0.1

ARGS = {
    "input": input_tensor,
    "qkv_weight": qkv_weight,
    "proj_weight": proj_weight,
    "relative_position_bias": relative_position_bias,
    "window_size": window_size,
    "num_heads": num_heads,
    "shift_size": shift_size,
    "attention_dropout": attention_dropout,
    "dropout": dropout,
    "qkv_bias": qkv_bias,
    "proj_bias": proj_bias,
}
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 4, dtype family float, shape (2, 8, 8, 4) — shape (2, 8, 8, 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
resnet18 Not yet run
unverified (harvested, no recorded run)
laprf/DSTC/models/backbones/resnet.py
code served (permissive licence) · get_code("8ce3c48d2fc05746")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 4 the same month, 4 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
conv1x1 112 other papers
84 dated earlier, 2 the same month, 22 later, 4 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 109 more not named here
conv3x3 111 other papers
84 dated earlier, 2 the same month, 21 later, 4 same year, order not determinable · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 108 more not named here
pair 90 other papers
74 dated earlier, 1 the same month, 13 later, 1 same year, order not determinable, 1 undated · 8 only as an assembly brick
2004.13649 (2020-04)
Image Augmentation Is All You Need: Regularizing Deep Reinforcement Learning from Pixels
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2103.15691 (2021-03)
ViViT: A Video Vision Transformer
and 87 more not named here
resnet18 36 other papers
31 dated earlier, 1 the same month, 3 later, 1 same year, order not determinable
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
2002.09564 (2020-02)
Towards Robust and Reproducible Active Learning Using Neural Networks
2003.04297 (2020-03)
Improved Baselines with Momentum Contrastive Learning
and 33 more not named here
get_abs_indices 2 other papers
2 dated earlier
1807.10174 (2018-07)
Superpixel Sampling Networks
shifted_window_attention 1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows

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

Hyperspectral image classification, a task that assigns predefined classes to each pixel in a hyperspectral image of remote sensing scenes, often faces challenges due to the neglect of correlations between spectrally similar pixels. This oversight can lead to inaccurate edge definitions and difficulties in managing minor spectral variations in contiguous areas. To address these issues, we introduce the novel Dual-stage Spectral Supertoken Classifier (DSTC), inspired by superpixel concepts. DSTC employs spectrum-derivative-based pixel clustering to group pixels with similar spectral characteristics into spectral supertokens. By projecting the classification of these tokens onto the image space, we achieve pixellevel results that maintain regional classification consistency and precise boundary. Moreover, recognizing the diversity within tokens, we propose a class-proportion-based soft label. This label adaptively assigns weights to different categories based on their prevalence, effectively managing data distribution imbalances and enhancing classification performance. Comprehensive experiments on WHU-OHS, IP, KSC, and UP datasets corroborate the robust classification capabilities of DSTC and the effectiveness of its individual components. Code will be publicly available at https://github.com/laprf/DSTC.

For agents

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

get_harvested_code_for_paper("2407.07307")
get_code_for_paper("2407.07307")
have("2407.07307")

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

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

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

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

Connect an agent — have() is free.