《Decoupling Representation and Classifier》笔记

Paper:《Decoupling Representation and Classifier for Long-tailed Recognition》
Published at ICLR 2020
Keywords:Long-Tailed Image Recognition.

https://zhuanlan.zhihu.com/p/111518894

【概览】

  • 作者将分类网络分解为representation learning 和 classification 两部分,系统的研究了这两部分对于Long-tailed问题的影响。通过实验得到的两点发现是:
    • 数据不均衡问题不会影响高质量Representations的学习。即,random sampling策略往往会学到泛化性更好的representations;
    • 使用最简单的random sampling 来学习representations,然后只调整classifier的学习也可以作为一个strong baseline。
  • 具体地,作者首先使用不同的sampling策略(random sampling; class-balanced sampling; mixture of them )来训练representations,然后,研究了三种不同的方法来获得有balanced决策边界的classifier。分别为:使用class-balanced sampling来re-training线性分类器的参数;对学到的representations使用KNN进行分类;通过normalize classifier的weight来使得weight的尺度变得更加balanced,并添加了一个temperature参数来调节normalization的过程。

【Sampling策略】

  • 作者将三种Sampling策略统一为一个公式,即从类别 《Decoupling Representation and Classifier》笔记 中挑选一个样本的概率 《Decoupling Representation and Classifier》笔记 如公式1所示。其中, 《Decoupling Representation and Classifier》笔记 代表的是类别 《Decoupling Representation and Classifier》笔记 的样本数量, 《Decoupling Representation and Classifier》笔记 是类别数量, 《Decoupling Representation and Classifier》笔记 。若 《Decoupling Representation and Classifier》笔记 ,为random sampling,文中也称之为Instance-balanced sampling当 《Decoupling Representation and Classifier》笔记 的时候,为Class-balanced Samling;当 《Decoupling Representation and Classifier》笔记 时为Square-root Sampling
    《Decoupling Representation and Classifier》笔记 (公式1)
  • 最近也有工作是在训练前期使用random-sampling策略,后期使用class-balanced sampling。由此,作者提出了一个Softer版本的结合方式,Progressively-balanced Sampling。如公式2所示。其中, 《Decoupling Representation and Classifier》笔记 为当前训练的Epoch, 《Decoupling Representation and Classifier》笔记 为总的训练Epoch。
    《Decoupling Representation and Classifier》笔记 (公式2)

【Classifier的学习策略】

  • Classifier Re-training (cRT).
    • 固定住representations部分,随机初始化classifier的weight和bias参数,并使用class-balanced sampling在训练少量epoch。
  • Nearest Class Mean classifier (NCM).
    • 首先将training set里的每个类别计算feature representaitions的均值,然后在test set上执行最近邻查找。或者将mean features进行L2-Normalization之后,使用余弦距离或者欧氏距离计算相似度。作者指出,余弦相似度可以通过其本身的normalization特性来缓解weight imbalance的问题。
  • 《Decoupling Representation and Classifier》笔记-normalized classifier ( 《Decoupling Representation and Classifier》笔记-normalized).
    • 令 《Decoupling Representation and Classifier》笔记 ,其中, 《Decoupling Representation and Classifier》笔记 是类别 《Decoupling Representation and Classifier》笔记 的classifier权重。按照公式3对 《Decoupling Representation and Classifier》笔记 进行re-scale。其中, 《Decoupling Representation and Classifier》笔记 代表的是L2 Norm,当 《Decoupling Representation and Classifier》笔记 时,就是标准的L2-Normalization;当 《Decoupling Representation and Classifier》笔记 时,表示没有进行scaling操作。 《Decoupling Representation and Classifier》笔记 ,其值是通过cross-validation来选择的。
      《Decoupling Representation and Classifier》笔记 (公式3)
  • Learnable weight scaling (LWS).
    • 如果将公式3写为公式4的形式,我们可以将 《Decoupling Representation and Classifier》笔记 看作是一个可学习的参数,我们通过固定住representations和classifier两部分的weighs来只学习这个scaling factors。
      《Decoupling Representation and Classifier》笔记 (公式4)

【Experiments】

  • 为了更好地测试在训练期间每个类别样本数量对结果的影响,作者将类别集合分成三种情况。Many-shot (more than 100 images), Medium-shot (20100 images) and Few-shot (less than 20 images).
  • 图1展示的是ImageNet-LTwith ResNeXt-50上的指标。

《Decoupling Representation and Classifier》笔记

Figure 1: The performance of different classifiers for each split on ImageNet-LT with ResNeXt-50.

  • 其中,Joint代表的是传统的representations和classifier结合训练的策略。由此,作者的几点发现包括:
    • Sampling matters when training jointly. 可见,使用更好地sampling策略可以显著提高Joint的性能。疑惑的是,第一个Many的实验中,作者解释出现这种情况的原因是,模型高度偏向many-shot的类别,但是为什么这样就会导致acc高呢?感觉作者的解释不是很好。
    • 保持 representation frozen训练classifier要比finetune效果好。如图2所示。和一些SOTA的模型比较如图3所示。其他的实验结果及分析具体可参见paper。

《Decoupling Representation and Classifier》笔记

Figure 2.

《Decoupling Representation and Classifier》笔记

Figure 3.

【参考资料】

[1]. https://arxiv.org/abs/1910.0921