#513 · Primary category: Computer Vision

class-balanced-loss

cloud-tpu computer-vision cvpr cvpr2019 deep-learning fine-grained fine-grained-classification fine-grained-visual-categorization imagenet inaturalist tensorflow

Class-Balanced Loss Based on Effective Number of Samples. CVPR 2019

Project last updated:08/29/21

GitHub Stars

615

Forks

66

Contributors

1

License

MIT

Why we included this project

Class imbalance is a common headache when training image classifiers, and this repo is the reference implementation of the class-balanced loss from the CVPR 2019 paper of the same name. Instead of hand-tuning class weights, it reweights the loss by the effective number of samples per class, which gives a more principled handle on long-tailed datasets. The code includes runnable training and evaluation scripts for both standard and long-tailed CIFAR, plus a Cloud TPU pipeline for larger benchmarks like ImageNet and iNaturalist. Key implementation details, such as the loss weights and focal loss, are clearly annotated in the source, which makes it easy to port the approach into your own project. It is a focused reference codebase rather than a general framework, so plan to adapt the code rather than drop it in as a library.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category