Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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"

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)