All Projects → jiawei-ren → BalancedMetaSoftmax-Classification

jiawei-ren / BalancedMetaSoftmax-Classification

Licence: other
[NeurIPS 2020] Balanced Meta-Softmax for Long-Tailed Visual Recognition

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to BalancedMetaSoftmax-Classification

imbalanced-regression
[ICML 2021, Long Talk] Delving into Deep Imbalanced Regression
Stars: ✭ 425 (+300.94%)
Mutual labels:  imbalanced-learning, imbalanced-classification
machine-learning-imbalanced-data
Code repository for the online course Machine Learning with Imbalanced Data
Stars: ✭ 94 (-11.32%)
Mutual labels:  imbalanced-learning, imbalanced-classification
imbalanced-ensemble
Class-imbalanced / Long-tailed ensemble learning in Python. Modular, flexible, and extensible. | 模块化、灵活、易扩展的类别不平衡/长尾机器学习库
Stars: ✭ 199 (+87.74%)
Mutual labels:  imbalanced-learning, imbalanced-classification
ResLT
ResLT: Residual Learning for Long-tailed Recognition (TPAMI 2022)
Stars: ✭ 40 (-62.26%)
Mutual labels:  imbalanced-learning
Face.evolve.pytorch
🔥🔥High-Performance Face Recognition Library on PaddlePaddle & PyTorch🔥🔥
Stars: ✭ 2,719 (+2465.09%)
Mutual labels:  imbalanced-learning
geometric-smote
Implementation of the Geometric SMOTE over-sampling algorithm.
Stars: ✭ 20 (-81.13%)
Mutual labels:  imbalanced-learning
Awesome-of-Long-Tailed-Recognition
A curated list of long-tailed recognition resources.
Stars: ✭ 456 (+330.19%)
Mutual labels:  imbalanced-learning
well-classified-examples-are-underestimated
Code for the AAAI 2022 publication "Well-classified Examples are Underestimated in Classification with Deep Neural Networks"
Stars: ✭ 21 (-80.19%)
Mutual labels:  imbalanced-learning
Class-Imbalance
《机器学习之类别不平衡问题》文章代码
Stars: ✭ 37 (-65.09%)
Mutual labels:  imbalanced-learning
mesa
NeurIPS’20 | Build powerful ensemble class-imbalanced learning models via meta-knowledge-powered resampler. | 设计元知识驱动的采样器解决类别不平衡问题
Stars: ✭ 88 (-16.98%)
Mutual labels:  imbalanced-learning
Parametric-Contrastive-Learning
Parametric Contrastive Learning (ICCV2021)
Stars: ✭ 155 (+46.23%)
Mutual labels:  imbalanced-learning
undergraduate-dissertation
Final career project on PAC theory and imbalanced datasets
Stars: ✭ 18 (-83.02%)
Mutual labels:  imbalanced-learning

BalancedMetaSoftmax - Classification

Code for the paper "Balanced Meta-Softmax for Long-Tailed Visual Recognition" on long-tailed visual recognition datasets.

Balanced Meta-Softmax for Long-Tailed Visual Recognition
Jiawei Ren, Cunjun Yu, Shunan Sheng, Xiao Ma, Haiyu Zhao, Shuai Yi, Hongsheng Li
NeurIPS 2020

Snapshot

def balanced_softmax_loss(labels, logits, sample_per_class, reduction):
    """Compute the Balanced Softmax Loss between `logits` and the ground truth `labels`.
    Args:
      labels: A int tensor of size [batch].
      logits: A float tensor of size [batch, no_of_classes].
      sample_per_class: A int tensor of size [no of classes].
      reduction: string. One of "none", "mean", "sum"
    Returns:
      loss: A float tensor. Balanced Softmax Loss.
    """
    spc = sample_per_class.type_as(logits)
    spc = spc.unsqueeze(0).expand(logits.shape[0], -1)
    logits = logits + spc.log()
    loss = F.cross_entropy(input=logits, target=labels, reduction=reduction)
    return loss

Requirements

Training

End-to-end Training

  • Base model (Representation Learning)
python main.py --cfg ./config/CIFAR10_LT/softmax_imba200.yaml

Alternatively, you may download a pretrained model here and put it in the corresponding log folder.

  • Balanced Softmax
python main.py --cfg ./config/CIFAR10_LT/balanced_softmax_imba200.yaml

Decoupled Training

After obataining the base model, train the classifier with the following command:

  • Balanced Softmax
python main.py --cfg ./config/CIFAR10_LT/decouple_balanced_softmax_imba200.yaml
  • BALMS
python main.py --cfg ./config/CIFAR10_LT/balms_imba200.yaml

Evaluation

Model evaluation can be done using the following command:

python main.py --cfg ./config/CIFAR10_LT/balms_imba200.yaml --test

Experiment Results

The results could be slightly different from the results reported in the paper, since we originally used an internal repository for the experiments in the paper.

Dataset Backbone Method Accuracy download
CIFAR-10 (IF 200) ResNet-32 Softmax 74.0 model | log
CIFAR-10 (IF 200) ResNet-32 Balanced Softmax (end-to-end) 79.8 model | log
CIFAR-10 (IF 200) ResNet-32 Balanced Softmax (decouple) 81.8 model | log
CIFAR-10 (IF 200) ResNet-32 BALMS 82.2 model | log
CIFAR-100 (IF 200) ResNet-32 Softmax 41.2 model | log
CIFAR-100 (IF 200) ResNet-32 Balanced Softmax (end-to-end) 46.7 model | log
CIFAR-100 (IF 200) ResNet-32 Balanced Softmax (decouple) 47.2 model | log
CIFAR-100 (IF 200) ResNet-32 BALMS 48.0 model | log
ImageNet-LT ResNet-10 Softmax 34.8 model | log
ImageNet-LT ResNet-10 BALMS 41.6 model | log
Places-LT ResNet-152 Softmax 30.2 model | log
Places-LT ResNet-152 BALMS 38.3 model | log

Cite BALMS

@inproceedings{
    Ren2020balms,
    title={Balanced Meta-Softmax for Long-Tailed Visual Recognition},
    author={Jiawei Ren and Cunjun Yu and Shunan Sheng and Xiao Ma and Haiyu Zhao and Shuai Yi and Hongsheng Li},
    booktitle={Proceedings of Neural Information Processing Systems(NeurIPS)},
    month = {Dec},
    year={2020}
}

Instance Segmentation

For BALMS on instance segmentation, please try out this repo.

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].