SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper · CVPR · 2023

FCC: Feature Clusters Compression for Long-Tailed Visual Recognition

Jian Li, Rui Song, Hao Xu, Daqian Shi, Xiaolei Diao, Jingwen Wang, Ziyao Meng

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, 0 violated it and 8 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; 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/Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper.json · badge: /api/ran/Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper.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
lijian16/FCC canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
lijian16/FCC/lib/core/evaluate.py
code served (permissive licence) · get_code("20991a2f2993c1e7")
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 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 torch
import numpy as np

torch.manual_seed(0)

# The function compares output and label element-wise, then computes accuracy
# output and label should be tensors or arrays that support:
# - equality comparison (==)
# - .sum() method
# - .shape[0] attribute

output = torch.tensor([0, 1, 2, 3])
label = torch.tensor([0, 1, 2, 0])

ARGS = {
    "output": output,
    "label": label,
}
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, ndim 1, 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
lijian16/FCC/lib/backbone/oltr_resnet.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.

equal_diff_compress Ran
ran on a synthesized input
lijian16/FCC/lib/fcc/fcc_functions.py
code served (permissive licence) · get_code("c794894a583564ce")
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 3, dtype family float, shape (2, 4, 3) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

n = 2
feature = torch.randn(2, 4, 3)  # batch_size=2, spatial dims 4x3
label = torch.tensor([0, 1])
num_classes = 3
gamma = 0.5

ARGS = {
    'n': n,
    'feature': feature,
    'label': label,
    'num_classes': num_classes,
    'gamma': gamma
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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
fcc Ran
ran on a synthesized input
lijian16/FCC/lib/fcc/fcc_functions.py
code served (permissive licence) · get_code("e4f35603fd8f8d03")
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 float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 minimal config class with the required attributes
class MinimalConfig:
    class FCC:
        C_TYPE = 'edc'
        GAMMA = 0.5
    
cfg = MinimalConfig()

# Create small tensors
feature = torch.randn(2, 4)  # batch_size=2, feature_dim=4
label = torch.tensor([0, 1])  # batch_size=2, num_classes=2
num_classes = 2

ARGS = {
    'feature': feature,
    'label': label,
    'num_classes': num_classes,
    'cfg': cfg,
}
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 float, shape (2, 4) — shape (2, 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
reduce_tensor Ran
ran on a synthesized input
lijian16/FCC/lib/core/function.py
code served (permissive licence) · get_code("75000f8601e0929d")
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 float, shape (2, 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.distributed as dist
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Mock dist.all_reduce and dist.reduce_op since we're not in a distributed setting
original_all_reduce = dist.all_reduce
original_reduce_op = dist.reduce_op

def mock_all_reduce(tensor, op=None):
    # In a real distributed setting, this would sync across processes
    # For testing, we just leave the tensor as-is
    pass

dist.all_reduce = mock_all_reduce
dist.reduce_op = Mock()
dist.reduce_op.SUM = Mock()

# Create test tensor
tensor = torch.randn(2, 4)

# Create world_size parameter
world_size = 4

ARGS = {
    "tensor": tensor,
    "world_size": world_size,
}
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 float, shape (2, 4) — shape (2, 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
res10 Ran
ran on a synthesized input
lijian16/FCC/lib/backbone/oltr_resnet.py
code served (permissive licence) · get_code("cd77b0f5ea846342")
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 ResNet. 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
import math

torch.manual_seed(0)

class ModulatedAttLayer(nn.Module):
    def __init__(self, in_channels):
        super(ModulatedAttLayer, self).__init__()
        self.in_channels = in_channels
    
    def forward(self, x):
        return x

class SimpleConfig:
    def __init__(self):
        self.resnet_depth = 10
        self.num_classes = 1000

cfg = SimpleConfig()

ARGS = {
    'cfg': cfg
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
res32_cifar Ran
ran on a synthesized input
lijian16/FCC/lib/backbone/resnet_cifar.py
code served (permissive licence) · get_code("4da6f52731511b02")
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 ResNet_Cifar. 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 = {
    'cfg': None,
    'pretrain': False,
    'pretrained_model': '',
    'last_layer_stride': 2,
}
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 ResNet_Cifar — a ResNet_Cifar output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet_Cifar 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
res50 Ran
ran on a synthesized input
lijian16/FCC/lib/backbone/resnet.py
code served (permissive licence) · get_code("110330294bf78ea2")
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 ResNet. 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)

# Create a minimal config dict
cfg = {
    'model_name': 'res50',
    'num_classes': 1000,
}

# Set pretrain and pretrained_model
pretrain = False
pretrained_model = ''

# Set last_layer_stride
last_layer_stride = 2

# Construct ARGS dictionary with all parameters
ARGS = {
    'cfg': cfg,
    'pretrain': pretrain,
    'pretrained_model': pretrained_model,
    'last_layer_stride': last_layer_stride,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
resnext50 Ran
ran on a synthesized input
lijian16/FCC/lib/backbone/resnext.py
code served (permissive licence) · get_code("bdb1deaaf5078648")
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 ResNext. 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
import math

torch.manual_seed(0)

# Create a minimal config class/dict for the cfg parameter
class MinimalConfig:
    def __init__(self):
        self.name = "test_config"
        self.num_classes = 1000

cfg = MinimalConfig()

# Parameters for resnext50
ARGS = {
    'cfg': cfg,
    'pretrain': False,
    'pretrained_model': '',
    'last_layer_stride': 2
}
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 ResNext — a ResNext output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNext 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
init_weights Not yet run
unverified (harvested, no recorded run)
lijian16/FCC/lib/backbone/oltr_resnet.py
code served (permissive licence) · get_code("4826cd3596c12660")
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, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 1 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
conv3x3 686 other papers
453 dated earlier, 139 later, 94 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
init_weights 5 other papers
4 dated earlier, 1 same year, order not determinable
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning
2004.03706 (2020-04)
Long-Tailed Recognition Using Class-Balanced Experts
2007.11978 (2020-07)
The Devil is in Classification: A Simple Framework for Long-tail Object Detection and Instance Segmentation
and 2 more not named here
accuracy 2 other papers
2 dated earlier
1912.02413 (2019-12)
BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning
reduce_tensor 1 other paper
1 dated earlier
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning
res10 1 other paper
1 dated earlier
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning
res32_cifar 1 other paper
1 dated earlier
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning
res50 1 other paper
1 dated earlier
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep Learning
resnext50 1 other paper
1 dated earlier
2001.01385 (2020-01)
Identifying and Compensating for Feature Deviation in Imbalanced Deep 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-23.

Repositories linked to this paper

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

Abstract

Deep Neural Networks (DNNs) are rather restrictive in long-tailed data, since they commonly exhibit an underrepresentation for minority classes. Various remedies have been proposed to tackle this problem from different perspectives, but they ignore the impact of the density of Backbone Features (BFs) on this issue. Through representation learning, DNNs can map BFs into dense clusters in feature space, while the features of minority classes often show sparse clusters. In practical applications, these features are discretely mapped or even cross the decision boundary resulting in misclassification. Inspired by this observation, we propose a simple and generic method, namely Feature Clusters Compression (FCC), to increase the density of BFs by compressing backbone feature clusters. The proposed FCC can be easily achieved by only multiplying original BFs by a scaling factor in training phase, which establishes a linear compression relationship between the original and multiplied features, and forces DNNs to map the former into denser clusters. In test phase, we directly feed original features without multiplying the factor to the classifier, such that BFs of test samples are mapped closer together and do not easily cross the decision boundary. Meanwhile, FCC can be friendly combined with existing long-tailed methods and further boost them. We apply FCC to numerous stateof-the-art methods and evaluate them on widely used longtailed benchmark datasets. Extensive experiments fully verify the effectiveness and generality of our method. Code is available at https://github.com/lijian16/FCC.

For agents

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

get_harvested_code_for_paper("Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper")
get_code_for_paper("Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper")
have("Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper")

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

curl https://syntology.ai/api/ran/Li_FCC_Feature_Clusters_Compression_for_Long-Tailed_Visual_Recognition_CVPR_2023_paper.json

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

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

Connect an agent — have() is free.