Skip to content
[NeurIPS 2019] Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss
Python
Branch: master
Clone or download
Latest commit 3193f05 Nov 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
models Upload code Sep 9, 2019
.gitignore
LICENSE Initial commit Jun 16, 2019
README.md Upload code Sep 9, 2019
cifar_train.py Upload code Sep 9, 2019
imbalance_cifar.py Upload code Sep 9, 2019
losses.py Fix focal Nov 13, 2019
utils.py Upload code Sep 9, 2019

README.md

Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss

Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, Tengyu Ma


This is the official implementation of LDAM-DRW in the paper Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss in PyTorch.

Dependency

The code is built with following libraries:

Dataset

  • Imbalanced CIFAR. The original data will be downloaded and converted by imbalancec_cifar.py.
  • The paper also reports results on Tiny ImageNet and iNaturalist 2018. We will update the code for those datasets later.

Training

We provide several training examples with this repo:

  • To train the ERM baseline on long-tailed imbalance with ratio of 100
python cifar_train.py --gpu 0 --imb_type exp --imb_factor 0.01 --loss_type CE --train_rule None
  • To train the LDAM Loss along with DRW training on long-tailed imbalance with ratio of 100
python cifar_train.py --gpu 0 --imb_type exp --imb_factor 0.01 --loss_type LDAM --train_rule DRW

Reference

If you find our paper and repo useful, please cite as

@inproceedings{cao2019learning,
  title={Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss},
  author={Cao, Kaidi and Wei, Colin and Gaidon, Adrien and Arechiga, Nikos and Ma, Tengyu},
  booktitle={Advances in Neural Information Processing Systems},
  year={2019}
}
You can’t perform that action at this time.