SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.03047 · CVPR · 2021

Few-Shot Incremental Learning with Continually Evolved Classifiers

Chi Zhang, Yinghui Xu, Guosheng Lin, Nan Song, Yun Zheng

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 4 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2104.03047.json · badge: /api/ran/2104.03047.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
icoz69/cec-cvpr2021 community (classifier label)
classifier basis not recorded on the link
6 ran · 4 no recorded run
FunctionStatusWhere it lives
conv1x1 Ran
ran; our contract draft was wrong, not the code
icoz69/cec-cvpr2021/models/resnet18_encoder.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
icoz69/cec-cvpr2021/models/resnet18_encoder.py
code served (permissive licence) · get_code("160bb14bd76201b4")
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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
    "groups": 1,
    "dilation": 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
icoz69/cec-cvpr2021/models/resnet20_cifar.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.

get_base_dataloader Ran
ran on a synthesized input
icoz69/cec-cvpr2021/dataloader/data_utils.py
code served (permissive licence) · get_code("81798895701006f7")
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 torch
from torch.utils.data import Dataset

torch.manual_seed(0)

# Create minimal mock dataset classes
class MockCIFAR100(Dataset):
    def __init__(self, root, train=True, download=False, index=None, base_sess=False):
        self.root = root
        self.train = train
        self.index = index if index is not None else np.arange(10)
        self.base_sess = base_sess
        self.data = np.random.rand(50, 32, 32, 3).astype(np.uint8)
        self.targets = np.random.randint(0, len(self.index), 50)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return torch.from_numpy(self.data[idx]).float(), self.targets[idx]

class MockCUB200(Dataset):
    def __init__(self, root, train=True, index=None, base_sess=False):
        self.root = root
        self.train = train
        self.index = index if index is not None else np.arange(10)
        self.base_sess = base_sess
        self.data = np.random.rand(50, 64, 64, 3).astype(np.uint8)
        self.targets = np.random.randint(0, len(self.index), 50)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return torch.from_numpy(self.data[idx]).float(), self.targets[idx]

class MockMiniImageNet(Dataset):
    def __init__(self, root, train=True, index=None, base_sess=False):
        self.root = root
        self.train = train
        self.index = index if index is not None else np.arange(10)
        self.base_sess = base_sess
        self.data = np.random.rand(50, 84, 84, 3).astype(np.uint8)
        self.targets = np.random.randint(0, len(self.index), 50)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return torch.from_numpy(self.data[idx]).float(), self.targets[idx]

class MockDataset:
    CIFAR100 = MockCIFAR100
    CUB200 = MockCUB200
    MiniImageNet = MockMiniImageNet

class Args:
    def __init__(self):
        self.dataset = 'cifar100'
        self.base_class = 60
        self.dataroot = '/tmp/data'
        self.batch_size_base = 2
        self.test_batch_size = 2
        self.Dataset = MockDataset()

ARGS = {'args': Args()}
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 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
load_state_dict_from_url Ran
ran; our contract draft was wrong, not the code
icoz69/cec-cvpr2021/models/resnet18_encoder.py
code served (permissive licence) · get_code("422a6083ee9c106d")
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 torch
import os
import tempfile
import shutil

torch.manual_seed(0)

# Create a temporary directory for model caching
temp_model_dir = tempfile.mkdtemp()

# Create a minimal valid state dict file locally to simulate a cached model
dummy_state_dict = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
}

# Save the dummy state dict to a file with proper naming convention
# Format: filename-<hash>.pth where hash is SHA256
import hashlib
state_dict_bytes = torch.jit.trace(torch.nn.Identity(), torch.randn(1)).state_dict()
dummy_path = os.path.join(temp_model_dir, 'dummy_model-5c106cde.pth')
torch.save(dummy_state_dict, dummy_path)

# Construct arguments for load_state_dict_from_url
# Since we can't do actual network downloads, we'll pass a fake URL
# The function will look for the file based on the URL's basename
ARGS = {
    'url': 'https://example.com/dummy_model-5c106cde.pth',
    'model_dir': temp_model_dir,
    'map_location': None,
    'progress': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
set_gpu Ran
ran, honoured the contract we drafted
icoz69/cec-cvpr2021/utils.py
code served (permissive licence) · get_code("8327880f0b76f9db")
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 os

class Args:
    def __init__(self, gpu):
        self.gpu = gpu

ARGS = {
    'args': Args(gpu='0,1')
}
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 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
count_acc Not yet run
unverified (harvested, no recorded run)
icoz69/cec-cvpr2021/utils.py
code served (permissive licence) · get_code("684d8ecbca8220ab")
How it ran

no invocation recorded.

get_dataloader Not yet run
unverified (harvested, no recorded run)
icoz69/cec-cvpr2021/dataloader/data_utils.py
code served (permissive licence) · get_code("94f4ef5cd72777fb")
How it ran

no invocation recorded.

replace_base_fc Not yet run
unverified (harvested, no recorded run)
icoz69/cec-cvpr2021/models/cec/helper.py
code served (permissive licence) · get_code("2731f5a37434f3af")
How it ran

no invocation recorded.

set_up_datasets Not yet run
unverified (harvested, no recorded run)
icoz69/cec-cvpr2021/dataloader/data_utils.py
code served (permissive licence) · get_code("a8b5b9fd3b5cade0")
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, 7 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 3 the same month, 7 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
285 dated earlier, 19 the same month, 376 later, 6 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
114 dated earlier, 13 the same month, 298 later, 5 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
conv3x3 312 other papers
66 dated earlier, 10 the same month, 232 later, 3 same year, order not determinable, 1 undated · 31 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
and 309 more not named here
count_acc 4 other papers
2 dated earlier, 2 later
1906.02944 (2019-06)
Learning Adaptive Classifiers Synthesis for Generalized Few-Shot Learning
2003.06777 (2020-03)
DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation
and 1 more not named here
load_state_dict_from_url 4 other papers
4 later
2208.00147 (2022-08)
Few-Shot Class-Incremental Learning from an Open-Set Perspective
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation
2404.02117 (2024-04)
Pre-trained Vision and Language Transformers Are Few-Shot Incremental Learners
and 1 more not named here
set_gpu 4 other papers
1 dated earlier, 3 later
2003.06777 (2020-03)
DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation
2404.02117 (2024-04)
Pre-trained Vision and Language Transformers Are Few-Shot Incremental Learners
and 1 more not named here
get_dataloader 2 other papers
2 later
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation
2405.17022 (2024-05)
Compositional Few-Shot Class-Incremental Learning

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Few-shot class-incremental learning (FSCIL) aims to design machine learning algorithms that can continually learn new concepts from a few data points, without forgetting knowledge of old classes. The difficulty lies in that limited data from new classes not only lead to significant overfitting issues but also exacerbate the notorious catastrophic forgetting problems. Moreover, as training data come in sequence in FSCIL, the learned classifier can only provide discriminative information in individual sessions, while FSCIL requires all classes to be involved for evaluation. In this paper, we address the FSCIL problem from two aspects. First, we adopt a simple but effective decoupled learning strategy of representations and classifiers that only the classifiers are updated in each incremental session, which avoids knowledge forgetting in the representations. By doing so, we demonstrate that a pre-trained backbone plus a nonparametric class mean classifier can beat state-of-the-art methods. Second, to make the classifiers learned on individual sessions applicable to all classes, we propose a Continually Evolved Classifier (CEC) that employs a graph model to propagate context information between classifiers for adaptation. To enable the learning of CEC, we design a pseudo incremental learning paradigm that episodically constructs a pseudo incremental learning task to optimize the graph parameters by sampling data from the base dataset. Experiments on three popular benchmark datasets, including CIFAR100, miniImageNet, and Caltech-USCD Birds-200-2011 (CUB200), show that our method significantly outperforms the baselines and sets new state-of-theart results with remarkable advantages.

For agents

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

get_harvested_code_for_paper("2104.03047")
get_code_for_paper("2104.03047")
have("2104.03047")

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

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

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

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

Connect an agent — have() is free.