https://github.com/vandit15/Class-balanced-loss-pytorch
Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"
https://github.com/vandit15/Class-balanced-loss-pytorch
computer-vision cvpr2019 deep-learning loss-functions pytorch
Last synced: 5 months ago
JSON representation
Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"
- Host: GitHub
- URL: https://github.com/vandit15/Class-balanced-loss-pytorch
- Owner: vandit15
- License: mit
- Created: 2019-08-31T07:34:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T05:57:18.000Z (over 1 year ago)
- Last Synced: 2024-08-04T03:12:00.152Z (about 1 year ago)
- Topics: computer-vision, cvpr2019, deep-learning, loss-functions, pytorch
- Language: Python
- Size: 157 KB
- Stars: 775
- Watchers: 11
- Forks: 120
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Class-balanced-loss-pytorch
Pytorch implementation of the paper
[Class-Balanced Loss Based on Effective Number of Samples](https://arxiv.org/abs/1901.05555) presented at CVPR'19.[Yin Cui](https://ycui.me/), Menglin Jia, [Tsung-Yi Lin](https://vision.cornell.edu/se3/people/tsung-yi-lin/)(Google Brain), [Yang Song](https://ai.google/research/people/author38270)(Google), [Serge Belongie](http://blogs.cornell.edu/techfaculty/serge-belongie/)
## Dependencies
- Python (>=3.6)
- Pytorch (>=1.2.0)## Review article of the paper
[Medium Article](https://medium.com/@vandit_15/handling-class-imbalanced-data-using-a-loss-specifically-made-for-it-6e58fd65ffab?source=friends_link&sk=ac09ea6061990ead2a2f90e3767ae91f)## How it works
It works on the principle of calculating effective number of samples for all classes which is defined as:

Thus, the loss function is defined as:

Visualisation for effective number of samples

## References
[official tensorflow implementation](https://github.com/richardaecn/class-balanced-loss)