这篇论文是2016cvpr最佳论文,该论文提出了一种残差网络的模型,很大程度上解决了深度网络难以学习的问题。作者使用152的残差网络在2015 ImageNet 分类和检测的比赛中均获得第一名。
退化问题
随着网络深度加深,网络的训练准确率却不断下降,这个问题不是由过拟合引起的。
这种现象是不合理的。
假设我们有浅层网络Net1,深层网络Net2,我们让Net1完全替代Net2的前半部分网络,Net2的后半部分网络我们做恒等映射。那么Net2的训练准确率应比Net1高(至少不比Net1低)。但实际训练情况并非如此。
这说明,并不是所有的网络都易于优化。
残差学习
作者提出了下面的网络模型
网络的期望输出是H(x),我们让F(x) + x去拟合H(x),即 H(x) := F(x) + x。
有 F(x) := H(x) - x
假设恒等映射是最优解,那么,训练残差函数F(x)等于零要比在一个多层非线性网络上训练恒等映射要容易。
解决x与F(x)维度不等的问题
作者给出两种解决方案
identity mapping
通过给低维的x加0来增加维度,这种方式不会增加多余的参数;(parameter-free)projection shortcut
给x乘以一个投影矩阵:
实验表明:identity mapping is sufficient for addressing the degradation problem and is economical, and thus Ws is only used when matching dimensions.
网络结构
左边是VGG-19网络,中间是没有shortcut-connection的平凡网络(plain net),右边是34层的残差网络(ResNet-34)。
作者说ResNet-34 与VGG相比有更少的卷积核和更低的复杂度,与VGG-19相比参数减少18%。那当然了,人VGG-19有两个4096的全连接层,你虽然深,但都是卷积核啊。
实验-ImageNet Classification
一些基本设置
- 数据增强
- adopt batch normalization right after each convolution and before activation
- use SGD with a mini-batch size of 256
- the learning reate starts from 0.1 and is divided by 10 when the error plateaus
- the models are trained for up to 60*10^4 iterations
- use a weight decay of 0.0001 and a momentum of 0.9
- do not use dropout
Residual Networks 实验一:Plain Net vs. ResNet
18-layer和34-layer 残差网络,基本结构与plain net类似,应用identity mapping 实现 shortcuts,因此相比plain net没有增加参数。
由Figure4的结果可知:
- ResNet很好的解决了退化问题,并且随着深度加深,准确率增高;
- 与Plain Net相比,ResNet-34 error减小了3.5%,这说明残差学习在极深度网络中的有效性;
- 与Plain Net相比,RestNet能够更快的收敛。
Residual Networks 实验二:Identity mapping vs. Projection Shortcuts
A:需要升维的shortcuts使用zero-padding方式,其他的shortcuts使用identity mapping方式,没有参数增加;
B:需要升维的shortcuts使用projection,其他shortcuts使用identity mapping;
C:所有的shortcuts都使用projection。
Small differences among A/B/C indicate that projection shortcuts are not essential for addressing the degradation problem.
Residual Networks 实验三:Deeper BottleNeck Architectures
这个就是设计的152层的网络,top-1的错误率19.38%,top-5错误率4.49%,据说已经超过了人眼的识别水平。
实验-CIFAR-10 and Analysis
然后作者又设计了一个1000多层的网络并在CIFAR-10数据集上进行训练,误差率比千层网络高了一点,作者猜测是数据集太小过拟合了。想想也是,拿大炮打蚊子效果肯定不好。作者的原话是“We argure that this is because of overfitting. The 1202-layer network may be unnecessarily large(19.4M) for this small dataset.”
然后作者又做了个分析,输出了一下每层卷基层的输出的标准差,见下图。
层数越深,标准差越小。这似乎说明了什么,作者的结论是:These results support our basic motivation that the residual functions might be generally closer to zero than the non-residual functions.
说实话,我没怎么理解,因为你拿到的是标准差不是均值,标准差小只说明输出的数据比较聚合而已,怎么能说说明趋近于0呢?