深度学习论文笔记(增量学习)——Learning a Unified Classifier Incrementally via Rebalancing

前言

我将看过的增量学习论文建了一个github库,方便各位阅读地址

主要工作

类别不平衡导致增量学习出现灾难性遗忘,本论文设计了一种loss函数,以抵抗类别不平衡造成的负面影响。

本论文提出的算法需要 e x a m p l a r examplar examplar


算法介绍

论文将类别不平衡对增量学习的影响分为三个部分

  1. Imbalanced Magnitudes:新类别权重向量的模大于旧类别,如上节所示
  2. Deviation:出现灾难性遗忘
  3. Ambiguities:新类别的权重向量与旧类别相似,模型容易将旧类别数据划分为新类别

为了解决上述问题,论文通过如下三个步骤来构建最终的loss函数,以消除类别不平衡造成的影响。

  1. Cosine Normalization(抵抗Imbalanced Magnitudes)
  2. Less-Forget Constraint(抵抗Deviation)
  3. Inter-Class Separation(抵抗Ambiguities)

对应关系如下图:
在这里插入图片描述

符号约定

符号名含义
f ( x ) f(x) f(x)特征提取器的输出
f ‾ ( x ) \overline{f}(x) f(x)特征提取器的输出L2归一化后的结果
θ i \theta_i θi全连接层分类器中,第 i i i类对应的1*n维权重向量
θ ‾ i \overline{\theta}_i θi全连接层分类器中,第 i i i类对应的1*n维权重向量L2归一化后的结果
b i b_i bi全连接层分类器中,第 i i i类对应的偏置
p i ( x ) p_i(x) pi(x) i i i类的概率
< θ i , f ( x ) > <\theta_i,f(x)> <θi,f(x)> < θ i , f ( x ) > = θ i ∗ f ( x ) <\theta_i,f(x)>=\theta_i*f(x) <θi,f(x)>=θif(x)

Cosine Normalization

在CIFAR100上使用iCaRL,分类器权重的L2范式以及偏置( b b b)值可视化的结果如下图:
在这里插入图片描述
从上图至少可知,类别不平衡会导致分类器出现两个问题

  1. 新类别权重向量的L2范式大于旧类别权重向量
  2. 新类别的偏置(参数 b b b)基本大于0,旧类别的偏置(参数 b b b)基本小于0

上述两个问题可能导致分类器出现分类偏好


个人疑问
实验一:在Large Scale Incremental Learning一文中,去除掉分类器的偏置项(参数 b b b)后,分类器的准确率有所上升
实验二:去除上述两个影响后,分类器的准确率有所提升(请查看Ablation Study部分)。
上述两个实验,都是给出准确率,但是抵抗分类偏好,不应该给出混淆矩阵吗?

回答
一个简单的步骤,例如去除偏置项、L2归一化只是在一定程度上抵抗分类偏好,其混淆矩阵仍可能显示分类器有分类偏好。采取某些步骤后,模型的准确率大幅上升,意味着误分为新类别的数据被分类器正确分类,在一定程度上说明该步骤可以抵抗分类偏好


为了解决上述两个问题,论文做了两个工作

  1. 对每个类别的权重向量使用L2归一化,这样所有类别的权重向量的L2范式均为1
  2. 去除偏置

如果将特征提取器的输出也进行L2归一化,经过softmax层处理后的结果如下:
在这里插入图片描述

η \eta η是一个可学习参数,其存在对于分类而言意义不大(所有值都放大或是缩小相同倍数,大小关系不变),论文对其解释是用来控制softmax分布的峰度,可能与优化有关,个人认为这个参数没有深入了解的必要,因此不在此做过多解释

为什么要对特征提取器的输出进行L2归一化呢?
此时特征提取器的输出向量与类权重向量都位于一个高维球体内部,但论文并没有解释这样做有什么好处,由于特征提取器进行L2正则化有助于模型收敛,这里这么做可能是为了加速模型收敛


Less-Forget Constraint

按国际惯例,一篇增量学习论文必然会对loss函数进行魔改,本论文自然不能免俗

论文冻结了全连接层分类器旧类别分支的权重向量,定义的知识蒸馏loss如下:
在这里插入图片描述
f ‾ ∗ ( x ) \overline{f}^*(x) f(x) f ‾ ( x ) \overline{f}(x) f(x)表示增量学习前后特征提取器L2归一化后的输出,由于进行了L2归一化, f ‾ ∗ ( x ) \overline{f}^*(x) f(x) f ‾ ( x ) \overline{f}(x) f(x)的模为1,当上式取值为0时,意味着两个向量的夹角为0,则有 f ‾ ∗ ( x ) = f ‾ ( x ) \overline{f}^*(x)=\overline{f}(x) f(x)=f(x),由于全连接层旧类别分支的权重向量被冻结,此时对于旧类别数据,增量学习前后模型的输出一致。

作者认为全连接层分类器中的权重在一定程度上反映了类与类之间的关系,因此一个
自然的想法就是固定旧类别分支的权重向量(从而保留类与类之间的关系),让训练后的特征提取器尽可能与训练前的一致,从而抵抗灾难性遗忘。


Inter-Class Separation

为了预防模型将新旧类别混淆,论文定义了如下loss函数:

在这里插入图片描述
选出新类别中,输出( < θ ‾ i , f ‾ ( x ) > <\overline\theta_i,\overline f(x)> <θi,f(x)>)值与旧类别输出值最接近的 K K K个分支,计算其差距,只要差距大于 m m m,损失函数的值即为0,对于旧类别数据,随着优化的进行,旧类别分支的输出与新类别分支的输出差距会逐渐拉大,从而防止将旧类别数据划分为新类别数据

需注意,旧类别的fc权重向量是固定的,上式中, θ ‾ k \overline\theta^k θk是固定的


损失函数

在这里插入图片描述
L c e ( x ) L_{ce}(x) Lce(x)即为交叉熵损失函数, N N N表示训练数据, N o N_o No表示训练数据中的旧类别数据, λ \lambda λ是是一个自适应参数,其取值为
λ = λ b a s e ∣ C n ∣ ∣ C o ∣ (式1) \lambda=\lambda_{base}\sqrt\frac{|C_n|}{|C_o|}\tag{式1} λ=λbaseCoCn (1)
∣ C o ∣ 、 ∣ C n ∣ |C_o|、|C_n| CoCn表示旧类别与新类别的数目, λ b a s e \lambda_{base} λbase是一个自定义大小的参数

疑问
由于每次需要学习的新类别数目是固定的,即 ∣ C n ∣ |C_n| Cn固定, ∣ C o ∣ |C_o| Co不断提高,会导致 λ \lambda λ下降,即distillation loss在损失函数中的占比下降,这有点奇怪,随着增量学习步骤的增多,distillation loss在损失函数中的占比应该增加才对。


实验

baseline解释
iCaRL-CNN用examplar+distillation loss训练CNN
iCaRL-NME用examplar+distillation loss训练CNN,分类器采用nearest- mean-of-exemplars(最近邻)
Ours-CNNexamplar+上述损失函数训练CNN
Ours-NMEexamplar+上述损失函数训练CNN,分类器采用nearest- mean-of-exemplars(最近邻)
joint-CNN用全部数据训练CNN

CIFAR100、ImageNet-Subset、ImageNet-Full上的结果
在这里插入图片描述
比较有意思的是Ours-CNN与Ours-NME差距不大,两者只是采用的分类器不同,NME并不会出现分类偏好的情况,这在一定程度上说明,使用论文提出的损失函数进行增量学习,可以让分类器抵抗分类偏好

按国际惯例,应该给出混淆矩阵进一步说明抵抗分类偏好,如下
在这里插入图片描述

Ablation Study

符号约定

  1. CN:Cosine Normalization
  2. LS:Less-Forget Constraint
  3. IS:Inter-Class Separation
  4. AW:自适应参数,即式1

每进行完一次增量学习,都会使用类别平衡的数据(examplar+新类别部分数据)对模型进行finetuning(这个操作可以查看End-to-End Incremental Learning)


CN、LS、IS的影响
在这里插入图片描述
上图可以看出损失函数每个部分对于准确率提升的效果,说明三者缺一不可,上图中的Ours-CNN使用了AW,未使用CBF,其他模型都使用了CBF,可以看出,CBF对于模型的准确率的影响不大,说明应用本论文提出的方法,分类器分类偏好已经被较好解决


AW的影响
在这里插入图片描述
所有实验数据都是进行多次实验取平均


个人理解

本人入门时的观点如下,各位康康就好

为什么增量学习的CNN比非增量学习的CNN准确率低?
答案是灾难性遗忘,但是造成灾难性遗忘的核心原因,个人觉得还是类别不平衡,类别不平衡会导致分类器出现分类偏好(更偏向于新类别,因为新类别的训练数据多),因此,目前阅读过的大部分论文都是针对分类器入手。

想要提高增量学习的分类准确率,首要解决的是类别不平衡问题带来的负面影响,

但是即使类别不平衡问题可以较好的解决,模型的分类准确率为什么无法达到非增量学习分类模型的准确率呢?

  • 10
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
25篇机器学习经典论文合集,有需要欢迎积分自取 Efficient sparse coding algorithms论文附有代码 [1] Zheng S, Kwok J T. Follow the moving leader in deep learning[C]//Proceedings of the 34th International Conference on Machine Learning-Volume 70. JMLR. org, 2017: 4110-4119. [2] Kalai A, Vempala S. Efficient algorithms for online decision problems[J]. Journal of Computer and System Sciences, 2005, 71(3): 291-307. [3] Kingma, D. and Ba, J. Adam: A method for stochastic optimization. In Proceedings of the International Conference for Learning Representations, 2015. [4] Lee H, Battle A, Raina R, et al. Efficient sparse coding algorithms[C]//Advances in neural information processing systems. 2007: 801-808. [5] Fan J, Ding L, Chen Y, et al. Factor Group-Sparse Regularization for Efficient Low-Rank Matrix Recovery[J]. 2019. [6] Z. Lai, Y. Chen, J. Wu, W. W. Keung, and F. Shen, “Jointly sparse hashing for image retrieval,” IEEE Transactions on Image Processing, vol. 27, no. 12, pp. 6147–6158, 2018. [7] Z. Zhang, Y. Chen, and V. Saligrama, “Efficient training of very deep neural networks for supervised hashing,” in Proc. IEEE Int. Conf. Computer Vision and Pattern Recognition, 2016, pp. 1487–1495. [8] Wei-Shi Zheng, Shaogang Gong, Tao Xiang. Person re-identification by probabilistic relative distance comparison[C]// CVPR 2011. IEEE, 2011. [9] Liao S, Hu Y, Zhu X, et al. Person re-identification by local maximal occurrence representation and metric learning[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2015: 2197-2206. [10] Liu X, Li H, Shao J, et al. Show, tell and discriminate: Image captioning by self-retrieval with partially labeled data[C]//Proceedings of the European Conference on Computer Vision (ECCV). 2018: 338-354. [11] Yao T, Pan Y, Li Y, et al. Exploring visual relationship for image captioning[C]//Proceedings of the European conference on computer vision (ECCV). 2018: 684-699. [12] Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang., ”Image Super-Resolution Using Deep Convolutional Networks, ” IEEE Transactions on Pattern Analysis and Machine Intelligence, Preprint, 2015. [13] M. D. Zeiler, D. Krishnan, Taylor, G. W., and R. Fergus, "Deconvolutional networks," in Proc. IEEE Comput. Soc. Conf. Comput. Vision Pattern Recog., 2010, pp. 2528-2535. [14] Girshick R, Donahue J, Darrell T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2014: 580-587. [15] Girshick R . Fast R-CNN[J]. Computer Science, 2015. [16] Joseph Redmon, Santosh Divvala, Ross Girshick, et al. You Only Look Once: Unified, Real-Time Object Detection[C]// 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, 2016. [17] LeCun Y, Bottou L, Bengio Y, et al. Gradient-based learning applied to document recognition[J]. Proceedings of the IEEE, 1998, 86(11): 2278-2324. [18] Hinton G E, Salakhutdinov R R. Reducing the dimensionality of data with neural networks[J]. science, 2006, 313(5786): 504-507. [19] Krizhevsky A, Sutskever I, Hinton G E. Imagenet classification with deep convolutional neural networks[C]//Advances in neural information processing systems. 2012: 1097-1105. [20] Zeiler M D, Fergus R. Visualizing and understanding convolutional networks[C]//European conference on computer vision. Springer, Cham, 2014: 818-833. [21] Szegedy C, Liu W, Jia Y, et al. Going deeper with convolutions[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2015: 1-9. [22] Wu, Y., & He, K. (2018). Group normalization. In Proceedings of the European Conference on Computer Vision (ECCV) (pp. 3-19). [23] Goodfellow I,Pouget-Abadie J, Mirza M, et al. Generative adversarial nets[C]//Advances in Neural Information Processing Systems. 2014: 2672-2680. [24] Tran, L., Yin, X., & Liu, X. (2017). Disentangled representation learning gan for pose-invariant face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 1415-1424). [25] Pu, Y., Gan, Z., Henao, R., Yuan, X., Li, C., Stevens, A., & Carin, L. (2016). Variational autoencoder for deep learning of images, labels and captions. In Advances in neural information processing systems (pp. 2352-2360).

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值