Class imbalance is a common challenge in real-world recognition tasks, where the majority of classes have few samples, also known as tail classes. We address this challenge with the perspective of generalization and empirically find that the promising Sharpness-Aware Minimization (SAM) fails to address generalization issues under the class-imbalanced setting. Through investigating this specific type of task, we identify that its generalization bottleneck primarily lies in the severe overfitting for tail classes with limited training data. To overcome this bottleneck, we leverage class priors to restrict the generalization scope of the class-agnostic SAM and propose a class-aware smoothness optimization algorithm named Imbalanced-SAM (ImbSAM). With the guidance of class priors, our ImbSAM specifically improves generalization targeting tail classes. We also verify the efficacy of ImbSAM on two prototypical applications of class-imbalanced recognition: long-tailed classification and semi-supervised anomaly detection, where our ImbSAM demonstrates remarkable performance improvements for tail classes and anomaly. Our code implementation is available at https://github.com/cool-xuan/Imbalanced_SAM.
翻译:类别不平衡是现实世界识别任务中的常见挑战,其特征为多数类别样本稀少(即尾部类别)。我们从泛化角度应对这一挑战,并通过实验发现,在类别不平衡场景下,具有前景的锐度感知最小化(SAM)方法无法有效解决泛化问题。通过深入探究此类特定任务,我们识别出其泛化瓶颈主要源于尾部类别因训练数据有限而产生的严重过拟合。为克服该瓶颈,我们利用类别先验限制类别无关SAM的泛化范围,提出名为不平衡SAM(ImbSAM)的类别感知平滑优化算法。在类别先验的引导下,我们的ImbSAM针对尾部类别显著提升泛化性能。我们还在类别不平衡识别两类典型应用——长尾分类与半监督异常检测中验证了ImbSAM的有效性,实验表明ImbSAM在尾部类别与异常检测方面展现出显著的性能提升。代码实现已开源至https://github.com/cool-xuan/Imbalanced_SAM。