TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/Class-Balanced Loss Based on Effective Number of Samples

Class-Balanced Loss Based on Effective Number of Samples

Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang song, Serge Belongie

2019-01-16CVPR 2019 6Image ClassificationLong-tail Learning
PaperPDFCodeCodeCodeCodeCodeCode(official)CodeCodeCodeCodeCode

Abstract

With the rapid increase of large-scale, real-world datasets, it becomes critical to address the problem of long-tailed data distribution (i.e., a few classes account for most of the data, while most classes are under-represented). Existing solutions typically adopt class re-balancing strategies such as re-sampling and re-weighting based on the number of observations for each class. In this work, we argue that as the number of samples increases, the additional benefit of a newly added data point will diminish. We introduce a novel theoretical framework to measure data overlap by associating with each sample a small neighboring region rather than a single point. The effective number of samples is defined as the volume of samples and can be calculated by a simple formula $(1-\beta^{n})/(1-\beta)$, where $n$ is the number of samples and $\beta \in [0,1)$ is a hyperparameter. We design a re-weighting scheme that uses the effective number of samples for each class to re-balance the loss, thereby yielding a class-balanced loss. Comprehensive experiments are conducted on artificially induced long-tailed CIFAR datasets and large-scale datasets including ImageNet and iNaturalist. Our results show that when trained with the proposed class-balanced loss, the network is able to achieve significant performance gains on long-tailed datasets.

Results

TaskDatasetMetricValueModel
Image ClassificationCIFAR-10-LT (ρ=10)Error Rate12.9Class-balanced Focal Loss
Image ClassificationCIFAR-10-LT (ρ=10)Error Rate13.46Class-balanced Reweighting
Image ClassificationCOCO-MLTAverage mAP49.06CB Loss(ResNet-50)
Image ClassificationCIFAR-100-LT (ρ=100)Error Rate61.68Cross-Entropy (CE)
Image ClassificationVOC-MLTAverage mAP75.24CB Focal(ResNet-50)
Image ClassificationEGTEAAverage Precision63.39CB Loss
Image ClassificationEGTEAAverage Recall63.26CB Loss
Few-Shot Image ClassificationCIFAR-10-LT (ρ=10)Error Rate12.9Class-balanced Focal Loss
Few-Shot Image ClassificationCIFAR-10-LT (ρ=10)Error Rate13.46Class-balanced Reweighting
Few-Shot Image ClassificationCOCO-MLTAverage mAP49.06CB Loss(ResNet-50)
Few-Shot Image ClassificationCIFAR-100-LT (ρ=100)Error Rate61.68Cross-Entropy (CE)
Few-Shot Image ClassificationVOC-MLTAverage mAP75.24CB Focal(ResNet-50)
Few-Shot Image ClassificationEGTEAAverage Precision63.39CB Loss
Few-Shot Image ClassificationEGTEAAverage Recall63.26CB Loss
Generalized Few-Shot ClassificationCIFAR-10-LT (ρ=10)Error Rate12.9Class-balanced Focal Loss
Generalized Few-Shot ClassificationCIFAR-10-LT (ρ=10)Error Rate13.46Class-balanced Reweighting
Generalized Few-Shot ClassificationCOCO-MLTAverage mAP49.06CB Loss(ResNet-50)
Generalized Few-Shot ClassificationCIFAR-100-LT (ρ=100)Error Rate61.68Cross-Entropy (CE)
Generalized Few-Shot ClassificationVOC-MLTAverage mAP75.24CB Focal(ResNet-50)
Generalized Few-Shot ClassificationEGTEAAverage Precision63.39CB Loss
Generalized Few-Shot ClassificationEGTEAAverage Recall63.26CB Loss
Long-tail LearningCIFAR-10-LT (ρ=10)Error Rate12.9Class-balanced Focal Loss
Long-tail LearningCIFAR-10-LT (ρ=10)Error Rate13.46Class-balanced Reweighting
Long-tail LearningCOCO-MLTAverage mAP49.06CB Loss(ResNet-50)
Long-tail LearningCIFAR-100-LT (ρ=100)Error Rate61.68Cross-Entropy (CE)
Long-tail LearningVOC-MLTAverage mAP75.24CB Focal(ResNet-50)
Long-tail LearningEGTEAAverage Precision63.39CB Loss
Long-tail LearningEGTEAAverage Recall63.26CB Loss
Generalized Few-Shot LearningCIFAR-10-LT (ρ=10)Error Rate12.9Class-balanced Focal Loss
Generalized Few-Shot LearningCIFAR-10-LT (ρ=10)Error Rate13.46Class-balanced Reweighting
Generalized Few-Shot LearningCOCO-MLTAverage mAP49.06CB Loss(ResNet-50)
Generalized Few-Shot LearningCIFAR-100-LT (ρ=100)Error Rate61.68Cross-Entropy (CE)
Generalized Few-Shot LearningVOC-MLTAverage mAP75.24CB Focal(ResNet-50)
Generalized Few-Shot LearningEGTEAAverage Precision63.39CB Loss
Generalized Few-Shot LearningEGTEAAverage Recall63.26CB Loss

Related Papers

Automatic Classification and Segmentation of Tunnel Cracks Based on Deep Learning and Visual Explanations2025-07-18Adversarial attacks to image classification systems using evolutionary algorithms2025-07-17Efficient Adaptation of Pre-trained Vision Transformer underpinned by Approximately Orthogonal Fine-Tuning Strategy2025-07-17Federated Learning for Commercial Image Sources2025-07-17MUPAX: Multidimensional Problem Agnostic eXplainable AI2025-07-17Hashed Watermark as a Filter: Defeating Forging and Overwriting Attacks in Weight-based Neural Network Watermarking2025-07-15Transferring Styles for Reduced Texture Bias and Improved Robustness in Semantic Segmentation Networks2025-07-14FedGSCA: Medical Federated Learning with Global Sample Selector and Client Adaptive Adjuster under Label Noise2025-07-13