https://github.com/aalok-sathe/class-balanced-loss-pytorch

Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"

https://github.com/aalok-sathe/class-balanced-loss-pytorch

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"

Basic Info
  • Host: GitHub
  • Owner: aalok-sathe
  • License: mit
  • Default Branch: master
  • Size: 159 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Fork of vandit15/Class-balanced-loss-pytorch
Created almost 6 years ago · Last pushed almost 6 years ago

https://github.com/aalok-sathe/Class-balanced-loss-pytorch/blob/master/

# 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)

Owner

  • Name: Aalok | आलोक
  • Login: aalok-sathe
  • Kind: user
  • Location: Cambridge, MA
  • Company: @MIT Brain & Cognitive Sciences

interested in computation, cognition, and language. currently RA@ Evlab @mit BCS.

GitHub Events

Total
Last Year