A Theoretical Analysis of the Learning Dynamics under Class Imbalance

Emanuele Francazi, Marco Baity-Jesi, Aurelien Lucchi
7/1/2022
43 citations
stat.MLcs.LG

Official code: EmanueleFrancazi/PCNGD-Algorithms (3 stars, Python, last commit 2025-02-22).

Abstract

Data imbalance is a common problem in machine learning that can have a critical effect on the performance of a model. Various solutions exist but their impact on the convergence of the learning dynamics is not understood.

Show full abstract

Here, we elucidate the significant negative impact of data imbalance on learning, showing that the learning curves for minority and majority classes follow sub-optimal trajectories when training with a gradient-based optimizer. This slowdown is related to the imbalance ratio and can be traced back to a competition between the optimization of different classes. Our main contribution is the analysis of the convergence of full-batch (GD) and stochastic gradient descent (SGD), and of variants that renormalize the contribution of each per-class gradient. We find that GD is not guaranteed to decrease the loss for each class but that this problem can be addressed by performing a per-class normalization of the gradient. With SGD, class imbalance has an additional effect on the direction of the gradients: the minority class suffers from a higher directional noise, which reduces the effectiveness of the per-class gradient normalization. Our findings not only allow us to understand the potential and limitations of strategies involving the per-class gradients, but also the reason for the effectiveness of previously used solutions for class imbalance such as oversampling.

View on arXivView PDF

Code Implementations(1)

Contains codes for performing simulations on (S)GD and some of their variants. See the README file for more details

31Python, ShellMay 19, 20221 years ago

Similar Papers

Cite this paper

@article{francazi2022theoretical,
  title  = {A Theoretical Analysis of the Learning Dynamics under Class Imbalance},
  author = {Emanuele Francazi and Marco Baity-Jesi and Aurelien Lucchi},
  year   = {2022},
  eprint = {2207.00391},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.00391v4},
  journal = {ICML 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.00391.svg)](https://codeofpaper.com/paper/2207.00391)

Discussion