In order to mitigate the class imbalance problem, median frequency balancing Eigen and Fergus (2015) is used to reweight each class in the cross-entropy loss.
the rarer a class is in the training set, the larger weight it will get in the cross entropy loss.