In this paper, we propose the Generalized Parametric Contrastive Learning (GPaCo/PaCo) which works well on both imbalanced and balanced data. Based on theoretical analysis, we observe that supervised contrastive loss tends to bias high-frequency classes and thus increases the difficulty of imbalanced learning. We introduce a set of parametric class-wise learnable centers to rebalance from an optimization perspective. Further, we analyze our GPaCo/PaCo loss under a balanced setting. Our analysis demonstrates that GPaCo/PaCo can adaptively enhance the intensity of pushing samples of the same class close as more samples are pulled together with their corresponding centers and benefit hard example learning. Experiments on long-tailed benchmarks manifest the new state-of-the-art for long-tailed recognition. On full ImageNet, models from CNNs to vision transformers trained with GPaCo loss show better generalization performance and stronger robustness compared with MAE models. Moreover, GPaCo can be applied to the semantic segmentation task and obvious improvements are observed on the 4 most popular benchmarks. Our code is available at https://github.com/dvlab-research/Parametric-Contrastive-Learning.
翻译:在本文中,我们提出了通用参数对比学习(GPaCo/Paco)方案,该方案在不平衡和平衡的数据方面效果良好。根据理论分析,我们观察到,监督对比损失往往偏向高频类,从而增加不平衡学习的困难。我们从优化角度引入了一组从分类角度学得的参数中心,以便重新平衡。此外,我们在一个平衡的环境下分析我们的GPaCo/Paco损失。我们的分析表明,GPaCo/Paco能够适应性地提高同一类的推压样品强度,因为更多的样品与它们的相应中心一起拉动,并获益于硬性实例学习。长效基准实验显示了新的艺术状态,以便长期量化。在全成像网上,CNN的模型和受过GPaco损失培训的视觉变异器模型显示了更好的概括性表现和强健健性。此外,GPaco可应用于语系分解任务,在四种最受欢迎的基准上观察到明显的改进。我们的代码可在https://githhubub.com-daristrain-Ldrastrain-labs.