# Class-Wise Difficulty-Balanced Loss for Solving Class-Imbalance

arXiv: https://arxiv.org/abs/2010.01824 · HTML: https://mlsanity.com/paper/2010.01824/

## Key facts

- Cited by 23 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 5 Oct 2020.

## Built on by (most cited first, 23 of 23)

- [A Survey on Long-Tailed Visual Recognition](https://mlsanity.com/paper/2205.13775/) (2022)
- [Balancing Logit Variation for Long-tailed Semantic Segmentation](https://mlsanity.com/paper/2306.02061/) (2023)
- [Constructing Balance from Imbalance for Long-tailed Image Recognition](https://mlsanity.com/paper/2208.02567/) (2022)
- [Class-Difficulty Based Methods for Long-Tailed Visual Recognition](https://mlsanity.com/paper/2207.14499/) (2022)
- [Generalized Data Weighting via Class-level Gradient Manipulation](https://mlsanity.com/paper/2111.00056/) (2021)
- [Predicting and Enhancing the Fairness of DNNs with the Curvature of Perceptual Manifolds](https://mlsanity.com/paper/2303.12307/) (2023)
- [LCReg: Long-Tailed Image Classification with Latent Categories based Recognition](https://mlsanity.com/paper/2309.07186/) (2023)
- [Deep Imbalanced Regression via Hierarchical Classification Adjustment](https://mlsanity.com/paper/2310.17154/) (2023)
- [MILA: Memory-Based Instance-Level Adaptation for Cross-Domain Object Detection](https://mlsanity.com/paper/2309.01086/) (2023)
- [Data Optimization in Deep Learning: A Survey](https://mlsanity.com/paper/2310.16499/) (2023)
- [MSE Loss with Outlying Label for Imbalanced Classification](https://mlsanity.com/paper/2107.02393/) (2021)
- [Difficulty-Net: Learning to Predict Difficulty for Long-Tailed Recognition](https://mlsanity.com/paper/2209.02960/) (2022)
- [Pixel-wise Modulated Dice Loss for Medical Image Segmentation](https://mlsanity.com/paper/2506.15744/) (2025)
- [Data-Centric Long-Tailed Image Recognition](https://mlsanity.com/paper/2311.01744/) (2023)
- [Text-Guided Mixup Towards Long-Tailed Image Categorization](https://mlsanity.com/paper/2409.03583/) (2024)
- [A Survey on Small Sample Imbalance Problem: Metrics, Feature Analysis, and Solutions](https://mlsanity.com/paper/2504.14800/) (2025)
- [Compositional Attribute Imbalance in Vision Datasets](https://mlsanity.com/paper/2506.14418/) (2025)
- [Divide, Weight, and Route: Difficulty-Aware Optimization with Dynamic Expert Fusion for Long-tailed Recognition](https://mlsanity.com/paper/2508.19630/) (2025)
- [Mix from Failure: Confusion-Pairing Mixup for Long-Tailed Recognition](https://mlsanity.com/paper/2411.07621/) (2024)
- [Reducing Class Bias In Data-Balanced Datasets Through Hardness-Based Resampling](https://mlsanity.com/paper/2504.07031/) (2025)
- [Optimizing Class Distributions for Bias-Aware Multi-Class Learning](https://mlsanity.com/paper/2509.11588/) (2025)
- [NS-Pep: De novo Peptide Design with Non-Standard Amino Acids](https://mlsanity.com/paper/2510.03326/) (2025)
- [When Data Imbalance Helps: Robust Generalization Through Shortcut Saturation](https://mlsanity.com/paper/2607.10116/) (2026)

## Abstract (arXiv)

Class-imbalance is one of the major challenges in real world datasets, where a few classes (called majority classes) constitute much more data samples than the rest (called minority classes). Learning deep neural networks using such datasets leads to performances that are typically biased towards the majority classes. Most of the prior works try to solve class-imbalance by assigning more weights to the minority classes in various manners (e.g., data re-sampling, cost-sensitive learning). However, we argue that the number of available training data may not be always a good clue to determine the weighting strategy because some of the minority classes might be sufficiently represented even by a small number of training data. Overweighting samples of such classes can lead to drop in the model's overall performance. We claim that the 'difficulty' of a class as perceived by the model is more important to determine the weighting. In this light, we propose a novel loss function named Class-wise Difficulty-Balanced loss, or CDB loss, which dynamically distributes weights to each sample according to the difficulty of the class that the sample belongs to. Note that the assigned weights dynamically change as the 'difficulty' for the model may change with the learning progress. Extensive experiments are conducted on both image (artificially induced class-imbalanced MNIST, long-tailed CIFAR and ImageNet-LT) and video (EGTEA) datasets. The results show that CDB loss consistently outperforms the recently proposed loss functions on class-imbalanced datasets irrespective of the data type (i.e., video or image).
