Class-Balanced Loss Based on Effective Number of Samples
By Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, Serge J. Belongie. 2019
3,183 citations recorded by the source corpus.
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.
Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Radiology, Nuclear Medicine and Imaging, Optimization & Training
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Quoc V. Le
- Jianfeng Gao
- Mohit Bansal
- Percy Liang
- Jiashi Feng
- Dacheng Tao
- Trevor Darrell
- Graham Neubig
In Computer Vision and Pattern Recognition
- Luc Van Gool
- Ming-Hsuan Yang
- Dacheng Tao
- Xiaogang Wang
- Trevor Darrell
- Jitendra Malik
- Bernt Schiele
- Alan L. Yuille
In Radiology, Nuclear Medicine and Imaging
In Optimization & Training
- Jiashi Feng
- Quoc V. Le
- Alan L. Yuille
- Ekin Dogus Cubuk
- Percy Liang
- Jinwoo Shin
- Barret Zoph
- Sung Ju Hwang
Citations in the corpus
- Simple Copy-Paste is a Strong Data Augmentation Method for Instance Segmentation (2020, methodology): “Modern approaches for addressing longtail data when training deep networks can be mainly divided into two groups: data re-sampling [41, 21, 62] and loss reweighting [30, 8, 3, 54, 37, 46].”
- Differential Privacy Has Disparate Impact on Model Accuracy (2019, background): “Other approaches to balancing accuracy across classes include oversampling [8], adversarial training [3] with a loss function that overweights the underrepresented group, cost-sensitive learning [9], and re-sampling [6].”
- FOSTER: Feature Boosting and Compression for Class-Incremental Learning (2022, background): “We get the scale factors γ1, γ2 trough the normalized effective number En [4] of each class, which can be seen as the summation of proportional series, where n equal to the number of instances and β is an adjustable hyperparameter”
- Imbalanced Continual Learning with Partitioning Reservoir Sampling (2020, methodology): “Data processing methods such as oversampling or undersampling [5,8,65] explicitly simulate the input balance, while cost-sensitive approaches [38,85,18] adjust the update via regularizing the objective.”
- Decoupling Representation and Classifier for Long-Tailed Recognition (2019, methodology): “We also compare to recent, carefully designed and more complex models, including approaches using memory ( e.g ., OLTR (Liu et al., 2019)) as well as more sophisticated losses (Cui et al., 2019).”
- Learning Adaptive Classifiers Synthesis for Generalized Few-Shot Learning (2019, background): “Directly training a system over all classes is prone to over-fit and can be biased towards the data-rich categories (Cui et al. 2019; Cao et al. 2019; Kang et al. 2020; Ye et al. 2020; Zhou et al. 2020).”
- WILDS: A Benchmark of in-the-Wild Distribution Shifts (2020, neutral): “Other methods for subpopulation shifts include more sophisticated reweighting methods (Cui et al., 2019); other DRO algorithms that do not make use of explicit domain information, instead relying on unsupervised clustering (Oren et al., 2019; Sohoni et al., 2020) or worst-case subpopulations across…”
- Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization (2019, methodology): “…of each group, This optimizes for a test distribution with uniform group frequencies and is analogous to the common upweighting technique for label shifts (Cui et al., 2019; Cao et al., 2019); intuitively, this attempts to equalize average and worst-group error by upweighting the minority groups.”
- Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss (2019, methodology): “We also found that with our re-weighting scheme and LDAM, we are less sensitive to early stopping than [10].”
- An Investigation of Why Overparameterization Exacerbates Spurious Correlations (2020, methodology): “Prior work on improving worst-group error focused on the underparameterized regime, with methods based on weighting/sampling (Shimodaira, 2000; Japkowicz & Stephen, 2002; Buda et al., 2018; Cui et al., 2019), distributionally robust optimization (DRO) (Ben-Tal et al.”
- Rethinking the Value of Labels for Improving Class-Imbalanced Learning (2020, methodology): “We select standard cross-entropy (CE) loss, Focal loss [32], class-balanced (CB) loss [11], re-weighting or re-sampling training schedule [7], and recently proposed LDAM-DRW [7] as stateof-the-art methods.”
- Addressing Class Imbalance in Federated Learning (2020, background): “…or the network structure, e.g., meta learning (Ling and Sheng 2008; Wang et al. 2020), model tuning (Pouyanfar et al. 2018), cost-sensitive learning (Cui et al. 2019; Wang, Ramanan, and Hebert 2017), and changing the loss function (Lin et al. 2017; Li, Liu, and Wang 2019; Luo et al. 2020).”
- Towards Fairness in Visual Recognition: Effective Strategies for Bias Mitigation (2019, neutral): “[8], cross-validating the hyperparameter on a validation set to β = 0.”
- Long-Tailed Classification by Keeping the Good and Removing the Bad Momentum Causal Effect (2020, neutral): “…encodes the natural inter-dependencies of classes — “TV” is indeed a good context for “controller” — any disrespect of it will hurt the feature representation learning [10], e.g. , re-weighting [13, 14] or re-sampling [15, 16] inevitably causes under-fitting to the head or over-fitting to the tail.”
- Exploring Balanced Feature Spaces for Representation Learning (2021, methodology): “, 2018) or the loss for each class (Cui et al., 2019; Khan et al., 2017; Cao et al., 2019; Khan et al., 2019) by reweighting.”
- Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression (2019, background): “There are also several loss functions for object detection, e.g., focal loss (Lin et al. 2017), class-balanced loss (Cui et al. 2019), balanced loss for classification and bounding box regression (Pang et al. 2019), and gradient flow balancing loss (Li, Liu, and Wang 2019).”
- Collaging Class-specific GANs for Semantic Image Synthesis (2021, methodology): “In order to tackle data imbalance issue we adopted the technique proposed in [5].”