The long-tailed image classification task remains important in the development of deep neural networks as it explicitly deals with large imbalances in the class frequencies of the training data. While uncommon in engineered datasets, this imbalance is almost always present in real-world data. Previous approaches have shown that combining cross-entropy and contrastive learning can improve performance on the long-tailed task, but they do not explore the tradeoff between head and tail classes. We propose a novel class instance balanced loss (CIBL), which reweights the relative contributions of a cross-entropy and a contrastive loss as a function of the frequency of class instances in the training batch. This balancing favours the contrastive loss for more common classes, leading to a learned classifier with a more balanced performance across all class frequencies. Furthermore, increasing the relative weight on the contrastive head shifts performance from common (head) to rare (tail) classes, allowing the user to skew the performance towards these classes if desired. We also show that changing the linear classifier head with a cosine classifier yields a network that can be trained to similar performance in substantially fewer epochs. We obtain competitive results on both CIFAR-100-LT and ImageNet-LT.
翻译:长尾图像分类任务在深度神经网络的发展中仍然至关重要,因为它明确处理了训练数据中类别频率的严重不平衡。虽然在精心设计的数据集中不常见,但这种不平衡几乎总是存在于现实世界的数据中。先前的研究表明,结合交叉熵和对比学习可以提升长尾任务的性能,但未探究头部类别与尾部类别之间的权衡。我们提出了一种新颖的类别实例平衡损失(CIBL),该损失根据训练批次中类别实例的频率,重新调整交叉熵损失和对比损失的相对贡献。这种平衡机制更倾向于为常见类别使用对比损失,从而使得学习到的分类器在所有类别频率上均能实现更均衡的性能。此外,增加对比头的相对权重会将性能从常见(头部)类别转移至稀有(尾部)类别,允许用户根据需求偏向这些类别。我们还证明,将线性分类器头替换为余弦分类器后,网络可以在更少的训练周期内达到相似的性能。我们在CIFAR-100-LT和ImageNet-LT数据集上均取得了有竞争力的结果。