【论文阅读】Bag of Tricks for Image Classification with Convolutional Neural Networks

Bag of Tricks for Image Classification with Convolutional Neural Networks

论文:https://arxiv.org/pdf/1812.01187.pdf

本文作者总结了模型训练过程中可以提高准确率的方法,如题,作者说 bag of tricks,阅读了一遍文章,有用的内容挺多,为了比赛上分,可以一试,总结如下。文中提到的方法在GLuonCV 0.3中有实现,可以参考这个源代码

文中提到技巧不仅可以应用于图像分类任务中,还可以应用于图像识别和语义分割任务中。

有效训练

利用更大的batch size 进行训练,但利用更大的batch size使得验证集上的准确率降低,为解决这个问题,文中提出了四种解决方法,分别为:Linear scaling learning rate, Learning rate warmup, Zero γ \gamma γ ,No bias decay。具体可参考文中说明,实验结果如下,对准确率几乎无提升。

在这里插入图片描述

利用16位进行训练可有效的减少模型的训练时间,结果如下:

在这里插入图片描述

模型优化

在ResNet的结构基础上调整了模型中间部分结构,下图为ResNet-50网络结构:

在这里插入图片描述

​ 修改上图中的Down Sampling结构为下图中的ResNet-D,其中下图中的(a)是之前修改使用的模型,(b)是将输入部分的7x7卷积核换成了3x3卷积核,Inception-v2网络中有使用。

在这里插入图片描述

实验结果为下表,从表中可以看出修改模型后的准确率有较明显的提升。

在这里插入图片描述

训练过程优化

1) cos学习率衰减

常用的学习率衰减方法为“step decay”,如每过30个epochs,学习率乘以0.1,cos学习率衰减公式如下:
η t = 1 2 ( 1 + cos ⁡ ( t π T ) ) η \eta _ { t } = \frac { 1 } { 2 } \left( 1 + \cos \left( \frac { t \pi } { T } \right) \right) \eta ηt=21(1+cos(Ttπ))η
其中, T T T为总的batches数,t为第几个batch, η \eta η为初始学习率,实验过程学习率变化如下图,cos学习率衰减方法在起始阶段,学习率衰减较慢,中间阶段趋于线性衰减,后序阶段衰减较快,认为该衰减方法有效的原因是cos衰减在训练没过多久学习率很大,而step方法的学习率降低很多,而起始阶段的高学习率可以加速训练过程。

在这里插入图片描述

2) label 平滑

这个label平滑大致意思就是正常情况下真值是1,非真值是0,平滑处理后真值不等于1,变换方法如下:
q i = { 1 − ε  if  i = y ε / ( K − 1 )  otherwise  q _ { i } = \left\{ \begin{array} { l l } { 1 - \varepsilon } & { \text { if } i = y } \\ { \varepsilon / ( K - 1 ) } & { \text { otherwise } } \end{array} \right. qi={1εε/(K1) if i=y otherwise 

3) 知识蒸馏

利用教师模型来指导学生模型训练,教师模型是指对同一个任务准确率高的模型,例如,利用ResNet-152作为教师模型,ResNet-50作为学生模型,引入蒸馏损失函数来进行优化,公式如下:
ℓ ( p ,  softmax  ( z ) ) + T 2 ℓ (  softmax  ( r / T ) ,  softmax  ( z / T ) ) \ell ( p , \text { softmax } ( z ) ) + T ^ { 2 } \ell ( \text { softmax } ( r / T ) , \text { softmax } ( z / T ) ) (p, softmax (z))+T2( softmax (r/T), softmax (z/T))
p p p表示真实值, z z z表示学生模型预测输出, r r r表示老师模型预测输出, T T T为超参数, ℓ ( p , softmax ( z ) ) \ell(p,\text{softmax}(z)) (p,softmax(z))表示交叉熵损失函数;

4) 混合训练

混合的意思是给定两个值,根据给定的两个值获得一个新的值,利用如下公式:
x ^ = λ x i + ( 1 − λ ) x j y ^ = λ y i + ( 1 − λ ) y j \begin{array} { l } { \hat { x } = \lambda x _ { i } + ( 1 - \lambda ) x _ { j } } \\ { \hat { y } = \lambda y _ { i } + ( 1 - \lambda ) y _ { j } } \end{array} x^=λxi+(1λ)xjy^=λyi+(1λ)yj
上述4个方法的实验结果如下,提到的方法对模型的准确率提升都有影响,而知识蒸馏方法对Inception-V3和MobileNet没有提升,文中的解释是使用Resnet-152作为教师模型,而和后两个模型属于不同的模型家族,预测结果的分布也不同,因此对后两个模型到来的负面的影响。

在这里插入图片描述

总结

本文从模型优化,学习率衰减,label平滑,知识蒸馏,混合训练等方面总结了一些模型训练技巧,对准确率提升有较好的作用。

参考

https://github.com/kmkolasinski/deep-learning-notes/tree/master/seminars/2018-12-Improving-DL-with-tricks
https://zhuanlan.zhihu.com/p/51870052

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Deep person re-identification is the task of recognizing a person across different camera views in a surveillance system. It is a challenging problem due to variations in lighting, pose, and occlusion. To address this problem, researchers have proposed various deep learning models that can learn discriminative features for person re-identification. However, achieving state-of-the-art performance often requires carefully designed training strategies and model architectures. One approach to improving the performance of deep person re-identification is to use a "bag of tricks" consisting of various techniques that have been shown to be effective in other computer vision tasks. These techniques include data augmentation, label smoothing, mixup, warm-up learning rates, and more. By combining these techniques, researchers have been able to achieve significant improvements in re-identification accuracy. In addition to using a bag of tricks, it is also important to establish a strong baseline for deep person re-identification. A strong baseline provides a foundation for future research and enables fair comparisons between different methods. A typical baseline for re-identification consists of a deep convolutional neural network (CNN) trained on a large-scale dataset such as Market-1501 or DukeMTMC-reID. The baseline should also include appropriate data preprocessing, such as resizing and normalization, and evaluation metrics, such as mean average precision (mAP) and cumulative matching characteristic (CMC) curves. Overall, combining a bag of tricks with a strong baseline can lead to significant improvements in deep person re-identification performance. This can have important practical applications in surveillance systems, where accurate person recognition is essential for ensuring public safety.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值