SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 136720346 · ECCV · 2022

Interpretable Image Classification with Differentiable Prototypes Assignment

Jacek Tabor, Dawid Rymarczyk, Bartosz Zieliński, Lukasz Struski, Micha Górszczak, Koryna Lewandowska

Open in the Atlas

Code that ran

10 of 15 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 6 have no contract verdict; 4 failures of our instrument; 5 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/136720346.json · badge: /api/ran/136720346.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
gmum/ProtoPool canonical (classifier label)
classifier basis: census
10 ran · 5 no recorded run
FunctionStatusWhere it lives
compute_layer_rf_info Ran
ran on a synthesized input
gmum/ProtoPool/utils.py
code served (permissive licence) · get_code("c2f4bd843f1e0e47")
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, ndim 1, 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 math

# Analyze the function:
# - layer_filter_size: int (used in math operations)
# - layer_stride: int (used in math operations)
# - layer_padding: str or int (checked against 'SAME' and 'VALID', or used as int)
# - previous_layer_rf_info: tuple/list with 4 elements [n_in, j_in, r_in, start_in]
#   where each element is a number (int or float)

# Create valid arguments for a typical CNN layer computation
# Using a simple case: 3x3 kernel, stride 1, SAME padding, starting from input layer

previous_layer_rf_info = [224, 1, 1, 0.5]  # n_in=224, j_in=1, r_in=1, start_in=0.5

ARGS = {
    "layer_filter_size": 3,
    "layer_stride": 1,
    "layer_padding": "SAME",
    "previous_layer_rf_info": previous_layer_rf_info
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
compute_rf_protoL_at_spatial_location Ran
ran on a synthesized input
gmum/ProtoPool/utils.py
code served (permissive licence) · get_code("44240d6a58cd6e24")
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, 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
import numpy as np

# Analyze the function to understand what's needed:
# - img_size: an integer representing image dimension
# - height_index: an integer for height position
# - width_index: an integer for width position
# - protoL_rf_info: a tuple/list with 4 elements [n, j, r, start]
#   where n is number of prototypes in each dimension
#   j is the stride/jump between prototype centers
#   r is the receptive field size
#   start is the starting offset

# Create valid arguments
img_size = 224  # typical image size

# For protoL_rf_info, we need reasonable values:
# n should be > height_index and > width_index for assertions to pass
n = 8  # grid of 8x8 prototypes
j = 4  # stride of 4 between prototype centers
r = 15  # receptive field size of 15
start = 1  # starting offset of 1

protoL_rf_info = [n, j, r, start]

# height_index and width_index must be < n
height_index = 3
width_index = 2

ARGS = {
    "img_size": img_size,
    "height_index": height_index,
    "width_index": width_index,
    "protoL_rf_info": protoL_rf_info
}
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, ndim 1, dtype family int — a list 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
compute_rf_prototype Ran
ran on a synthesized input
gmum/ProtoPool/utils.py
code served (permissive licence) · get_code("988c042bac56f793")
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, 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

ARGS = {
    "img_size": 224,
    "prototype_patch_index": [0, 2, 3],
    "protoL_rf_info": [5, 16, 32, 8]
}
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 list, ndim 1, dtype family int — a list 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
conv1x1 Ran
ran; our contract draft was wrong, not the code
gmum/ProtoPool/resnet_features.py
code served (permissive licence) · get_code("d9def42110729a85")
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 Conv2d. 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 as nn

torch.manual_seed(0)

# The function conv1x1 takes in_planes, out_planes, and stride as parameters
# It returns an nn.Conv2d layer configured for 1x1 convolution
# We need to provide valid integer arguments for these parameters

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
gmum/ProtoPool/resnet_features.py
pointer only (licence: MIT); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
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 lixiaotong97/DSU, 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.

draw_graph_as_tree Ran
ran on a synthesized input
gmum/ProtoPool/common_visualization.py
code served (permissive licence) · get_code("a690bf99a02c4fe2")
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
import networkx as nx

# Create small matrices m0 and m1
# m0 and m1 should have shape (num_targets, num_sources)
# where num_sources are intermediate nodes and num_targets are all nodes (sources + leaves)
num_sources = 3
num_targets = 6
m0 = np.random.rand(num_targets, num_sources)
m1 = np.random.rand(num_targets, num_sources)

# Create labels for all nodes
labels = [f"node_{i}" for i in range(num_targets)]

# Define arguments
ARGS = {
    "m0": m0,
    "m1": m1,
    "labels": labels,
    "t_binary": 0.5,
    "pos_type": "top-down",
    "root": 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, networkx, 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
hierarchy_pos Ran
ran on a synthesized input
gmum/ProtoPool/common_visualization.py
code served (permissive licence) · get_code("f5bfc4f32495e3f3")
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 dict. 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 networkx as nx

# Create a simple tree graph using NetworkX
G = nx.Graph()
G.add_edges_from([
    ('A', 'B'),
    ('A', 'C'),
    ('B', 'D'),
    ('B', 'E'),
    ('C', 'F')
])

root = 'A'

levels = None

width = 1.0

height = 1.0

ARGS = {
    'G': G,
    'root': root,
    'levels': levels,
    'width': width,
    'height': height
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
prepare_binary Ran
ran on a synthesized input
gmum/ProtoPool/common_visualization.py
code served (permissive licence) · get_code("0ec6f71c01f9afc6")
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 3, 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 matplotlib.pyplot as plt

# Create small test matrices
# m0 and m1 should have shape (n_rows, n_sources)
# The function iterates over columns (sources) and finds argmax of each column
m0 = np.random.rand(5, 3).astype(np.float32)
m1 = np.random.rand(5, 3).astype(np.float32)

# t_binary is a parameter but not used in the function body
t_binary = None

ARGS = {
    "m0": m0,
    "m1": m1,
    "t_binary": t_binary,
    "plot": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
vgg11_bn_features Ran
ran; our contract draft was wrong, not the code
gmum/ProtoPool/vgg_features.py
code served (permissive licence) · get_code("f80fd95528cbadc0")
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 VGG_features. 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 as nn

torch.manual_seed(0)

ARGS = {
    'pretrained': 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 VGG_features — a VGG_features output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a VGG_features 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
vgg13_features Ran
ran; our contract draft was wrong, not the code
gmum/ProtoPool/vgg_features.py
code served (permissive licence) · get_code("15e9e467f0e328d1")
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 VGG_features. 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 as nn

torch.manual_seed(0)

ARGS = {
    'pretrained': 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 VGG_features — a VGG_features output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a VGG_features 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
densenet121_features Not yet run
unverified (harvested, no recorded run)
gmum/ProtoPool/densenet_features.py
code served (permissive licence) · get_code("d5149ec5f0e567e9")
How it ran

no invocation recorded.

densenet169_features Not yet run
unverified (harvested, no recorded run)
gmum/ProtoPool/densenet_features.py
code served (permissive licence) · get_code("cf20cbc234ba341a")
How it ran

no invocation recorded.

densenet201_features Not yet run
unverified (harvested, no recorded run)
gmum/ProtoPool/densenet_features.py
code served (permissive licence) · get_code("3803a12204298d72")
How it ran

no invocation recorded.

resnet18_features Not yet run
unverified (harvested, no recorded run)
gmum/ProtoPool/resnet_features.py
code served (permissive licence) · get_code("6c37035a3ae3d79c")
How it ran

no invocation recorded.

vgg11_features Not yet run
unverified (harvested, no recorded run)
gmum/ProtoPool/vgg_features.py
code served (permissive licence) · get_code("82ea1f1bdcfa7b9e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 12 are also present in other papers whose code we hold (12 with at least one paper dated earlier, 0 the same month, 8 later) and 3 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
conv3x3 686 other papers
363 dated earlier, 234 later, 89 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
conv1x1 431 other papers
168 dated earlier, 195 later, 67 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
densenet169_features 4 other papers
3 dated earlier, 1 later
1902.03368 (2019-02)
Skin Lesion Analysis Toward Melanoma Detection 2018: A Challenge Hosted by the International Skin Imaging Collaboration (ISIC)
2108.10612 (2021-08)
ProtoMIL: Multiple Instance Learning with Prototypical Parts for Whole-Slide Image Classification
2111.15000 (2021-11)
Deformable ProtoPNet: An Interpretable Image Classifier Using Deformable Prototypes
and 1 more not named here
densenet201_features 4 other papers
3 dated earlier, 1 later
1902.03368 (2019-02)
Skin Lesion Analysis Toward Melanoma Detection 2018: A Challenge Hosted by the International Skin Imaging Collaboration (ISIC)
2108.10612 (2021-08)
ProtoMIL: Multiple Instance Learning with Prototypical Parts for Whole-Slide Image Classification
2111.15000 (2021-11)
Deformable ProtoPNet: An Interpretable Image Classifier Using Deformable Prototypes
and 1 more not named here
resnet18_features 3 other papers
2 dated earlier, 1 later
1902.03368 (2019-02)
Skin Lesion Analysis Toward Melanoma Detection 2018: A Challenge Hosted by the International Skin Imaging Collaboration (ISIC)
2111.15000 (2021-11)
Deformable ProtoPNet: An Interpretable Image Classifier Using Deformable Prototypes
2403.14349 (2024-03)
On the Concept Trustworthiness in Concept Bottleneck Models
densenet121_features 2 other papers
2 dated earlier
1902.03368 (2019-02)
Skin Lesion Analysis Toward Melanoma Detection 2018: A Challenge Hosted by the International Skin Imaging Collaboration (ISIC)
2108.10612 (2021-08)
ProtoMIL: Multiple Instance Learning with Prototypical Parts for Whole-Slide Image Classification
vgg11_bn_features 2 other papers
1 dated earlier, 1 later
2108.10612 (2021-08)
ProtoMIL: Multiple Instance Learning with Prototypical Parts for Whole-Slide Image Classification
2403.14349 (2024-03)
On the Concept Trustworthiness in Concept Bottleneck Models
vgg11_features 2 other papers
1 dated earlier, 1 later
2108.10612 (2021-08)
ProtoMIL: Multiple Instance Learning with Prototypical Parts for Whole-Slide Image Classification
2403.14349 (2024-03)
On the Concept Trustworthiness in Concept Bottleneck Models
vgg13_features 2 other papers
1 dated earlier, 1 later
2108.10612 (2021-08)
ProtoMIL: Multiple Instance Learning with Prototypical Parts for Whole-Slide Image Classification
2403.14349 (2024-03)
On the Concept Trustworthiness in Concept Bottleneck Models
compute_layer_rf_info 1 other paper
1 dated earlier
1606.00915 (2016-06)
DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs
compute_rf_protoL_at_spatial_location 1 other paper
1 dated earlier
1906.10651 (2019-06)
Interpretable Image Recognition with Hierarchical Prototypes
compute_rf_prototype 1 other paper
1 dated earlier
1906.10651 (2019-06)
Interpretable Image Recognition with Hierarchical Prototypes

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

Existing prototypical-based models address the black-box nature of deep learning. However, they are sub-optimal as they often assume separate prototypes for each class, require multi-step optimization, make decisions based on prototype absence (so-called negative reasoning process), and derive vague prototypes. To address those shortcomings, we introduce ProtoPool, an interpretable prototype-based model with positive reasoning and three main novelties. Firstly, we reuse prototypes in classes, which significantly decreases their number. Secondly, we allow automatic, fully differentiable assignment of prototypes to classes, which substantially simplifies the training process. Finally, we propose a new focal similarity function that contrasts the prototype from the background and consequently concentrates on more salient visual features. We show that ProtoPool obtains state-of-the-art accuracy on the CUB-200-2011 and the Stanford Cars datasets, substantially reducing the number of prototypes. We provide a theoretical analysis of the method and a user study to show that our prototypes capture more salient features than those obtained with competitive methods. We made the code available at https://github.com/gmum/ProtoPool.

For agents

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

get_harvested_code_for_paper("136720346")
get_code_for_paper("136720346")
have("136720346")

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

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

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

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

Connect an agent — have() is free.