SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.04662 · ECCV · 2022

FOSTER: Feature Boosting and Compression for Class-Incremental Learning

Han-Jia Ye, De-Chuan Zhan, Da-Wei Zhou, Fu-Yun Wang

arXiv · PDF · Open in the Atlas

Code that ran

2 of 8 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 2 have no contract verdict; 0 failures of our instrument; 6 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/2204.04662.json · badge: /api/ran/2204.04662.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
G-U-N/ECCV22-FOSTER marked official in Papers with Code
Papers with Code archive
2 ran · 6 no recorded run
FunctionStatusWhere it lives
CifarResNet Ran
ran on a synthesized input
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("a2989710a793436e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn
from torch.nn import functional as F
import math

class BasicBlock(nn.Module):
    expansion = 1
    
    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(BasicBlock, self).__init__()
        self.conv_a = nn.Conv2d(inplanes, planes, kernel_size=3, stride=stride, padding=1, bias=False)
        self.bn_a = nn.BatchNorm2d(planes)
        self.conv_b = nn.Conv2d(planes, planes, kernel_size=3, stride=1, padding=1, bias=False)
        self.bn_b = nn.BatchNorm2d(planes)
        self.downsample = downsample
        self.stride = stride
    
    def forward(self, x):
        residual = x
        out = F.relu(self.bn_a(self.conv_a(x)), inplace=True)
        out = self.bn_b(self.conv_b(out))
        if self.downsample is not None:
            residual = self.downsample(x)
        out += residual
        out = F.relu(out, inplace=True)
        return out

class DownsampleA(nn.Module):

    def __init__(self, nIn, nOut, stride):
        super(DownsampleA, self).__init__()
        assert stride == 2
        self.avg = nn.AvgPool2d(kernel_size=1, stride=stride)

    def forward(self, x):
        x = self.avg(x)
        return torch.cat((x, x.mul(0)), 1)

class CifarResNet(nn.Module):

    def __init__(self, block, depth, channels=3):
        super(CifarResNet, self).__init__()
        assert (depth - 2) % 6 == 0, 'depth should be one of 20, 32, 44, 56, 110'
        layer_blocks = (depth - 2) // 6
        self.conv_1_3x3 = nn.Conv2d(channels, 16, kernel_size=3, stride=1, padding=1, bias=False)
        self.bn_1 = nn.BatchNorm2d(16)
        self.inplanes = 16
        self.stage_1 = self._make_layer(block, 16, layer_blocks, 1)
        self.stage_2 = self._make_layer(block, 32, layer_blocks, 2)
        self.stage_3 = self._make_layer(block, 64, layer_blocks, 2)
        self.avgpool = nn.AvgPool2d(8)
        self.out_dim = 64 * block.expansion
        self.fc = nn.Linear(64 * block.expansion, 10)
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
                m.weight.data.normal_(0, math.sqrt(2.0 / n))
            elif isinstance(m, nn.BatchNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()
            elif isinstance(m, nn.Linear):
                nn.init.kaiming_normal_(m.weight)
                m.bias.data.zero_()

    def _make_layer(self, block, planes, blocks, stride=1):
        downsample = None
        if stride != 1 or self.inplanes != planes * block.expansion:
            downsample = DownsampleA(self.inplanes, planes * block.expansion, stride)
        layers = []
        layers.append(block(self.inplanes, planes, stride, downsample))
        self.inplanes = planes * block.expansion
        for i in range(1, blocks):
            layers.append(block(self.inplanes, planes))
        return nn.Sequential(*layers)

    def forward(self, x):
        x = self.conv_1_3x3(x)
        x = F.relu(self.bn_1(x), inplace=True)
        x_1 = self.stage_1(x)
        x_2 = self.stage_2(x_1)
        x_3 = self.stage_3(x_2)
        pooled = self.avgpool(x_3)
        features = pooled.view(pooled.size(0), -1)
        return {'fmaps': [x_1, x_2, x_3], 'features': features}

    @property
    def last_conv(self):
        return self.stage_3[-1].conv_b

INIT_ARGS = {
    'block': BasicBlock,
    'depth': 20,
    'channels': 3,
}

ARGS = {
    'x': torch.randn(2, 3, 32, 32),
}

if __name__ == '__main__':
    model = CifarResNet(**INIT_ARGS)
    model.eval()
    output = model(**ARGS)
    print("Output keys:", output.keys())
    print("fmaps shapes:", [f.shape for f in output['fmaps']])
    print("features shape:", output['features'].shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
resnet32 Ran
ran on a synthesized input
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("dff6861d5062f441")
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 CifarResNet. 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
from torch.nn import functional as F
import math

torch.manual_seed(0)

class DownsampleA(nn.Module):
    def __init__(self, nIn, nOut, stride):
        super(DownsampleA, self).__init__()
        assert stride == 2
        self.avg = nn.AvgPool2d(kernel_size=1, stride=stride)

    def forward(self, x):
        x = self.avg(x)
        return torch.cat((x, x.mul(0)), 1)

class ResNetBasicblock(nn.Module):
    expansion = 1

    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(ResNetBasicblock, self).__init__()
        self.conv_a = nn.Conv2d(inplanes, planes, kernel_size=3, stride=stride, padding=1, bias=False)
        self.bn_a = nn.BatchNorm2d(planes)
        self.conv_b = nn.Conv2d(planes, planes, kernel_size=3, stride=1, padding=1, bias=False)
        self.bn_b = nn.BatchNorm2d(planes)
        self.downsample = downsample

    def forward(self, x):
        residual = x
        basicblock = self.conv_a(x)
        basicblock = self.bn_a(basicblock)
        basicblock = F.relu(basicblock, inplace=True)
        basicblock = self.conv_b(basicblock)
        basicblock = self.bn_b(basicblock)
        if self.downsample is not None:
            residual = self.downsample(x)
        return F.relu(residual + basicblock, inplace=True)

class CifarResNet(nn.Module):
    def __init__(self, block, depth, channels=3):
        super(CifarResNet, self).__init__()
        assert (depth - 2) % 6 == 0, 'depth should be one of 20, 32, 44, 56, 110'
        layer_blocks = (depth - 2) // 6
        self.conv_1_3x3 = nn.Conv2d(channels, 16, kernel_size=3, stride=1, padding=1, bias=False)
        self.bn_1 = nn.BatchNorm2d(16)
        self.inplanes = 16
        self.stage_1 = self._make_layer(block, 16, layer_blocks, 1)
        self.stage_2 = self._make_layer(block, 32, layer_blocks, 2)
        self.stage_3 = self._make_layer(block, 64, layer_blocks, 2)
        self.avgpool = nn.AvgPool2d(8)
        self.out_dim = 64 * block.expansion
        self.fc = nn.Linear(64 * block.expansion, 10)
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
                m.weight.data.normal_(0, math.sqrt(2.0 / n))
            elif isinstance(m, nn.BatchNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()
            elif isinstance(m, nn.Linear):
                nn.init.kaiming_normal_(m.weight)
                m.bias.data.zero_()

    def _make_layer(self, block, planes, blocks, stride=1):
        downsample = None
        if stride != 1 or self.inplanes != planes * block.expansion:
            downsample = DownsampleA(self.inplanes, planes * block.expansion, stride)
        layers = []
        layers.append(block(self.inplanes, planes, stride, downsample))
        self.inplanes = planes * block.expansion
        for i in range(1, blocks):
            layers.append(block(self.inplanes, planes))
        return nn.Sequential(*layers)

    def forward(self, x):
        x = self.conv_1_3x3(x)
        x = F.relu(self.bn_1(x), inplace=True)
        x_1 = self.stage_1(x)
        x_2 = self.stage_2(x_1)
        x_3 = self.stage_3(x_2)
        pooled = self.avgpool(x_3)
        features = pooled.view(pooled.size(0), -1)
        return {'fmaps': [x_1, x_2, x_3], 'features': features}

    @property
    def last_conv(self):
        return self.stage_3[-1].conv_b

def resnet32():
    """Constructs a ResNet-32 model for CIFAR-10."""
    model = CifarResNet(ResNetBasicblock, 32)
    return model

ARGS = {}
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 CifarResNet — a CifarResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CifarResNet 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
BaseLearner Not yet run
unverified (harvested, no recorded run)
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("1afda64d8a5c5708")
How it ran

no invocation recorded.

FOSTER Not yet run
unverified (harvested, no recorded run)
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("96a31524768b2656")
How it ran

no invocation recorded.

FOSTERNet Not yet run
unverified (harvested, no recorded run)
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("b0894f0cc1dd3e52")
How it ran

no invocation recorded.

ResNet Not yet run
unverified (harvested, no recorded run)
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("8af98f7f67a0fdda")
How it ran

no invocation recorded.

_resnet Not yet run
unverified (harvested, no recorded run)
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("67c778a4fecccfd5")
How it ran

no invocation recorded.

get_convnet Not yet run
unverified (harvested, no recorded run)
G-U-N/ECCV22-FOSTER/models/foster.py
code served (permissive licence) · get_code("4cad458166ad5417")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 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
_resnet
brick of this paper's assembly: helper
8 other papers
3 dated earlier, 5 later
2103.10211 (2021-03)
Space-Time Crop & Attend: Improving Cross-modal Video Representation Learning
2105.03245 (2021-05)
Adaptive Focus for Efficient Video Recognition
2107.02156 (2021-07)
Do Different Tracking Tasks Require Different Appearance Models?
and 5 more not named here
resnet32
brick of this paper's assembly: helper
2 other papers
2 later
2308.13305 (2023-08)
Dynamic Residual Classifier for Class Incremental Learning
2603.08426 (2026-03)
Grow, Assess, Compress: Adaptive Backbone Scaling for Memory-Efficient Class Incremental Learning
CifarResNet
brick of this paper's assembly: helper
1 other paper
1 later
2603.08426 (2026-03)
Grow, Assess, Compress: Adaptive Backbone Scaling for Memory-Efficient Class Incremental Learning
get_convnet
brick of this paper's assembly: helper
1 other paper
1 later
2308.13305 (2023-08)
Dynamic Residual Classifier for 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

The ability to learn new concepts continually is necessary in this ever-changing world. However, deep neural networks suffer from catastrophic forgetting when learning new categories. Many works have been proposed to alleviate this phenomenon, whereas most of them either fall into the stability-plasticity dilemma or take too much computation or storage overhead. Inspired by the gradient boosting algorithm to gradually fit the residuals between the target model and the previous ensemble model, we propose a novel two-stage learning paradigm FOSTER, empowering the model to learn new categories adaptively. Specifically, we first dynamically expand new modules to fit the residuals between the target and the output of the original model. Next, we remove redundant parameters and feature dimensions through an effective distillation strategy to maintain the single backbone model. We validate our method FOSTER on CIFAR-100 and ImageNet-100/1000 under different settings. Experimental results show that our method achieves state-ofthe-art performance. Code is available at https://github.com/G-U-N/ ECCV22-FOSTER.

For agents

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

get_harvested_code_for_paper("2204.04662")
get_code_for_paper("2204.04662")
have("2204.04662")

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

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

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

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

Connect an agent — have() is free.