vandit15/Class-balanced-loss-pytorch
A PyTorch implementation of a class-balanced loss function for training deep neural networks on imbalanced datasets.

This repository provides a PyTorch implementation of the class-balanced loss function introduced in the CVPR'19 paper by Cui et al. The loss addresses class imbalance in training data by weighting the loss inversely proportional to the effective number of samples per class, derived from the concept of effective number of samples that models data overlap in feature space. It serves as a drop-in replacement for standard cross-entropy loss in computer vision models trained on imbalanced datasets.