Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T05:57:18.000Z (7 months ago)
- Last Synced: 2024-04-20T17:00:33.786Z (5 months ago)
- Topics: computer-vision, cvpr2019, deep-learning, loss-functions, pytorch
- Language: Python
- Size: 157 KB
- Stars: 768
- Watchers: 11
- Forks: 121
- 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:
![alt-text](https://github.com/vandit15/Class-balanced-loss-pytorch/blob/master/samples.png)
Thus, the loss function is defined as:
![alt-text](https://github.com/vandit15/Class-balanced-loss-pytorch/blob/master/loss.png)
Visualisation for effective number of samples
![alt-text](https://github.com/vandit15/Class-balanced-loss-pytorch/blob/master/image.png "Visualisation for effective number of samples")
## References
[official tensorflow implementation](https://github.com/richardaecn/class-balanced-loss)