SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.17409 · CVPR · 2024

Neural Clustering based Visual Representation Learning

Yi Yang, Xia Li, Wenguan Wang, Guikun Chen

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 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/2403.17409.json · badge: /api/ran/2403.17409.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
guikunchen/fec canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
aggregate_masks Ran
ran, honoured the contract we drafted
guikunchen/fec/cluster_visualize.py
code served (permissive licence) · get_code("81660a718d852b93")
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 (1, 4, 224, 224) 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
from sklearn.cluster import KMeans

torch.manual_seed(0)

# Construct mask_layers
# mask_layers[0][0]: array of shape (56*56,) with values in range [0, 56*56)
# mask_layers[1][0]: array of shape (28*28,) with values in range [0, 28*28)
# mask_layers[2][0]: array of shape (7*7,) with values in range [0, 7*7)
# mask_layers[2][1]: tensor of shape (7*7, feature_dim) for kmeans

import numpy as np

# Create mask_layers[0][0]: mapping 56x56 patches to their parent 56x56 clusters (identity)
mask_layer_0_0 = np.arange(56 * 56)

# Create mask_layers[1][0]: mapping 28x28 patches to their parent 56x56 clusters
mask_layer_1_0 = np.repeat(np.arange(56 * 56 // 4), 4)[:28*28]

# Create mask_layers[2][0]: mapping 7x7 patches to their parent 28x28 clusters
mask_layer_2_0 = np.repeat(np.arange(28 * 28 // 16), 16)[:7*7]

# Create mask_layers[2][1]: features for kmeans clustering (7x7 patches with feature dim 4)
mask_layer_2_1 = torch.randn(7 * 7, 4)

mask_layers = [
    (mask_layer_0_0, None),
    (mask_layer_1_0, None),
    (mask_layer_2_0, mask_layer_2_1)
]

ARGS = {
    "mask_layers": mask_layers,
    "num_k": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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, 4, 224, 224) — shape (1, 4, 224, 224) 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_num_layer_layer_wise Ran
ran, honoured the contract we drafted
guikunchen/fec/detection/mmcv_custom/layer_decay_optimizer_constructor.py
code served (permissive licence) · get_code("aa8d49041d9f8442")
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 int, ndim 0, dtype family int, 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
import torch.nn as nn

torch.manual_seed(0)

# The function get_num_layer_layer_wise takes two parameters:
# 1. var_name: a string representing a variable name in a backbone model
# 2. num_max_layer: an integer with default value 12

# Let's create valid test cases for var_name that exercise different branches

ARGS = {
    'var_name': 'backbone.cls_token',
    'num_max_layer': 12
}
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 int, ndim 0, dtype family int, 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_num_layer_stage_wise Ran
ran, honoured the contract we drafted
guikunchen/fec/detection/mmcv_custom/layer_decay_optimizer_constructor.py
code served (permissive licence) · get_code("be134d6ef63b5192")
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 int, ndim 0, dtype family int, 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
import torch.nn as nn

torch.manual_seed(0)

# The function takes two parameters: var_name (string) and num_max_layer (int)
# It doesn't actually use the objects themselves, just string matching and integer arithmetic
# So we can pass simple test values

ARGS = {
    'var_name': 'backbone.stages.1.conv',
    'num_max_layer': 4
}
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 int, ndim 0, dtype family int, 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
pairwise_cos_sim Ran
ran; our contract draft was wrong, not the code
guikunchen/fec/cluster_visualize.py
code served (permissive licence) · get_code("548053a14e52b92d")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 5) 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

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# x1: [B=2, M=3, D=4]
# x2: [B=2, N=5, D=4]
x1 = torch.randn(2, 3, 4)
x2 = torch.randn(2, 5, 4)

ARGS = {
    "x1": x1,
    "x2": x2,
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 5) — shape (2, 3, 5) 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
pairwise_cos_sim Ran
ran; our contract draft was wrong, not the code
guikunchen/fec/models/fec.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from IRMVLab/DVLO, is pointer only (licence: NONE) · get_code("db1ef09456179a68")
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 IRMVLab/DVLO, 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.

validate Not yet run
unverified (harvested, no recorded run)
guikunchen/fec/validate.py
code served (permissive licence) · get_code("0fc8219dc215c3b1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 0 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
get_num_layer_stage_wise 4 other papers
3 dated earlier, 1 the same month
2301.03580 (2023-01)
Designing BERT for Convolutional Networks: Sparse and Hierarchical Masked Modeling
2302.06052 (2023-02)
CEDNet: A Cascade Encoder-Decoder Network for Dense Prediction
2312.10758 (2023-12)
SHaRPose: Sparse High-Resolution Representation for Human Pose Estimation
and 1 more not named here
get_num_layer_layer_wise 3 other papers
3 dated earlier
2301.03580 (2023-01)
Designing BERT for Convolutional Networks: Sparse and Hierarchical Masked Modeling
2302.06052 (2023-02)
CEDNet: A Cascade Encoder-Decoder Network for Dense Prediction
2312.10758 (2023-12)
SHaRPose: Sparse High-Resolution Representation for Human Pose Estimation
pairwise_cos_sim 1 other paper
1 the same month
2403.18274 (2024-03)
DVLO: Deep Visual-LiDAR Odometry with Local-to-Global Feature Fusion and Bi-Directional Structure Alignment
pairwise_cos_sim 1 other paper
1 dated earlier
2303.01494 (2023-03)
Image as Set of Points

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

We investigate a fundamental aspect of machine vision: the measurement of features, by revisiting clustering, one of the most classic approaches in machine learning and data analysis. Existing visual feature extractors, including Conv-Nets, ViTs, and MLPs, represent an image as rectangular regions. Though prevalent, such a grid-style paradigm is built upon engineering practice and lacks explicit modeling of data distribution. In this work, we propose feature extraction with clustering (FEC), a conceptually elegant yet surprisingly ad-hoc interpretable neural clustering framework, which views feature extraction as a process of selecting representatives from data and thus automatically captures the underlying data distribution. Given an image, FEC alternates between grouping pixels into individual clusters to abstract representatives and updating the deep features of pixels with current representatives. Such an iterative working mechanism is implemented in the form of several neural layers and the final representatives can be used for downstream tasks. The cluster assignments across layers, which can be viewed and inspected by humans, make the forward process of FEC fully transparent and empower it with promising ad-hoc interpretability. Extensive experiments on various visual recognition models and tasks verify the effectiveness, generality, and interpretability of FEC. We expect this work will provoke a rethink of the current de facto grid-style paradigm.

For agents

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

get_harvested_code_for_paper("2403.17409")
get_code_for_paper("2403.17409")
have("2403.17409")

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

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

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

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

Connect an agent — have() is free.