ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

CV系列经典论文(1) -- ResNet: Deep Residual Learning for Image Recognition

2021-12-27 16:02:20  阅读:212  来源: 互联网

标签:layers 映射 -- Image 残差 网络 ResNet residual 我们


首先放原文链接https://arxiv.org/pdf/1512.03385.pdfhttps://arxiv.org/pdf/1512.03385.pdf

Abstract

Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers—8× deeper than VGG nets [41] but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers. The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions1 , where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.

越深的神经网络训练起来越困难。为此,我们提出了一个残差学习架构,去减轻网络训练的压力(这里的网络指相较于以往使用的网络都要深的网络)。具体地,我们将层重新表示为引入层输入的学习残差的函数,而不是学习无引用的函数。(这里一开始看不懂,但通读完文章后会发现表达的很清晰。)我们提供了全面的实验证据,表明这些残差网络更容易优化,并且可以从增加了相当多的深度下得到精确性。在ImageNet数据集上,我们评估了一个深达152层的残差网络——相较于VGG深了8倍,但仍然有着比它低的计算复杂度。(接下来都是实验结果......)这些残差网络的集合在 ImageNet 测试集上实现了3.57%的错误率。 该结果在ILSVRC 2015分类任务中获得第一名。我们还对具有100层和1000层的CIFAR-10进行了分析。表示的深度对于许多视觉识别任务至关重要。只是由于我们极深的表示,我们在 COCO 对象检测数据集上获得了28%的相对改进。深度残差网络是我们向ILSVRC & COCO 2015比赛提交的基础,我们还在ImageNet检测、ImageNet定位、COCO检测和 COCO分割任务中获得了第一名。

第一句话就提出问题,然后介绍我们做了什么工作去解决这个问题,它如何可以解决这个问题,通过实效果(绝对精度+相对精度)证明我们的贡献。

1 Introduction

Deep convolutional neural networks [22, 21] have led to a series of breakthroughs for image classification [21, 50, 40]. Deep networks naturally integrate low/mid/highlevel features [50] and classifiers in an end-to-end multilayer fashion, and the “levels” of features can be enriched by the number of stacked layers (depth). Recent evidence [41, 44] reveals that network depth is of crucial importance, and the leading results [41, 44, 13, 16] on the challenging ImageNet dataset [36] all exploit “very deep” [41] models, with a depth of sixteen [41] to thirty [16]. Many other nontrivial visual recognition tasks [8, 12, 7, 32, 27] have also greatly benefited from very deep models.

Driven by the significance of depth, a question arises: Is learning better networks as easy as stacking more layers? An obstacle to answering this question was the notorious problem of vanishing/exploding gradients [1, 9], which hamper convergence from the beginning. This problem, however, has been largely addressed by normalized initialization [23, 9, 37, 13] and intermediate normalization layers [16], which enable networks with tens of layers to start converging for stochastic gradient descent (SGD) with backpropagation [22].

When deeper networks are able to start converging, a degradation problem has been exposed: with the network depth increasing, accuracy gets saturated (which might be unsurprising) and then degrades rapidly. Unexpectedly, such degradation is not caused by overfitting, and adding more layers to a suitably deep model leads to higher training error, as reported in [11, 42] and thoroughly verified by our experiments. Fig. 1 shows a typical example.

The degradation (of training accuracy) indicates that not all systems are similarly easy to optimize. Let us consider a shallower architecture and its deeper counterpart that adds more layers onto it. There exists a solution by construction to the deeper model: the added layers are identity mapping, and the other layers are copied from the learned shallower model. The existence of this constructed solution indicates that a deeper model should produce no higher training error than its shallower counterpart. But experiments show that our current solvers on hand are unable to find solutions that are comparably good or better than the constructed solution (or unable to do so in feasible time).

深度卷积神经网络语句引领了图像分类任务中的许多突破。深的网络可以自然地融合低/中/高层次的特征以及端到端多层的分类器,并且,特征的层次可以通过堆叠层的数量(深度)去丰富。最近有证据揭示,网络深度十分重要,并且,在困难的ImageNet数据集上领先的结果都利用了“非常深”的网络,如16层到30层。(这里给非常深打引号我觉得非常有意思,更显示出了作者的152层真是对于网络深度很大的突破。)许多其他的重要的视觉感知任务已经从非常深的模型中受益很多了。

  

收深度的重要性的驱动,一个问题产生了:学习更好的网络和堆叠更多的层一样简单吗?回答这个问题的阻碍是臭名昭著的梯度消失和梯度爆炸问题,这从一开始就阻碍了模型的收敛。但是这个问题已经很大程度上被标准化初始化和中间归一化层解决了,它们使数十层的网络能够使用SGD通过BP算法达到收敛。

  

当更深的网络能够收敛时,又出现了一个衰退问题:随着网络深度的增加,精度达到饱和后迅速下降。出乎意料的是,根据文献的报道以及我们充分的实验证明,这样的衰退不是由过拟合导致的,向适当深度的模型添加更多层会导致更高的训练错误。Figure 1中给出了一种典型的例子。

  

训练准确度的衰退表明不是所有系统都同样易于优化。 让我们考虑一下一个较浅的架构以及在它上面加更多层的更深对应部分。有一个解决上述问题的方案:添加层是恒等映射,其他层都复制浅层模型中的学习结果。这种解决方案的存在表明,更深的模型不应产生比其浅层对应模型更高的训练误差。但实验表明,我们现有的求解器无法找到与上述解决方案相当或更好的解决方案,或者说是无法在可行的时间内找到。

In this paper, we address the degradation problem by introducing a deep residual learning framework. Instead of hoping each few stacked layers directly fit a desired underlying mapping, we explicitly let these layers fit a residual mapping. Formally, denoting the desired underlying mapping as H(x), we let the stacked nonlinear layers fit another mapping of F(x) := H(x)−x. The original mapping is recast into F(x)+x. We hypothesize that it is easier to optimize the residual mapping than to optimize the original, unreferenced mapping. To the extreme, if an identity mapping were optimal, it would be easier to push the residual to zero than to fit an identity mapping by a stack of nonlinear layers. The formulation of F(x) +x can be realized by feedforward neural networks with “shortcut connections” (Fig. 2). Shortcut connections [2, 34, 49] are those skipping one or more layers. In our case, the shortcut connections simply perform identity mapping, and their outputs are added to the outputs of the stacked layers (Fig. 2). Identity shortcut connections add neither extra parameter nor computational complexity. The entire network can still be trained end-to-end by SGD with backpropagation, and can be easily implemented using common libraries (e.g., Caffe [19]) without modifying the solvers.

We present comprehensive experiments on ImageNet [36] to show the degradation problem and evaluate our method. We show that: 1) Our extremely deep residual nets are easy to optimize, but the counterpart “plain” nets (that simply stack layers) exhibit higher training error when the depth increases; 2) Our deep residual nets can easily enjoy accuracy gains from greatly increased depth, producing results substantially better than previous networks.

Similar phenomena are also shown on the CIFAR-10 set [20], suggesting that the optimization difficulties and the effects of our method are not just akin to a particular dataset. We present successfully trained models on this dataset with over 100 layers, and explore models with over 1000 layers.

On the ImageNet classification dataset [36], we obtain excellent results by extremely deep residual nets. Our 152- layer residual net is the deepest network ever presented on ImageNet, while still having lower complexity than VGG nets [41]. Our ensemble has 3.57% top-5 error on the ImageNet test set, and won the 1st place in the ILSVRC 2015 classification competition. The extremely deep representations also have excellent generalization performance on other recognition tasks, and lead us to further win the 1st places on: ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation in ILSVRC & COCO 2015 competitions. This strong evidence shows that the residual learning principle is generic, and we expect that it is applicable in other vision and non-vision problems.

本文中,我们通过引入一个深度残差学习框架解决了该退化问题。我们让堆叠层去你和一个残差映射,而不是让他直接去拟合需要的底层映射(就是最终我们需要的映射)。我们将需要的底层映射表示为H(x),让堆叠的非线性层去拟合F(x):=H(x)-x的映射,原始的底层映射H(x)即被表示为F(x)+x。我们假定相较于优化原始底层映射,优化残差映射会更加简单。极端一点来说,如果一个恒等映射是最优的,对于堆叠的非线性层来说,相较于拟合一个恒等映射,将残差向零推进会更加的简单。F(x)+x这个公式可以被带有shortcut connection(残差/跳跃/捷径链接)的前驱神经网络实现。shortcut connection,也就是跳跃了一层或多层的连接。在我们的案例中,残差连接只是使用了一个恒等映射,残差连接的输出被加入到堆叠层的输出当中。恒等的残差链接既不会增加参数的个数,也不会提高模型的算法复杂度(因为它只是一个加法而已)。整个网络可以被使用SGD的端到端的BP算法训练出来,并且可以使用通用库轻松实现,无需修改求解器。

  

我们在 ImageNet上进行了全面的实验,展示了衰退问题并评估了我们的方法。我们展示出:1)我们极深的残差网络很容易优化。当深度增加时,对应的“普通”网络(简单的无残差连接的堆叠层)表现出了更高的训练误差;2)我们的深度残差网络可以很容易地随着网络深度的大幅度增加,获得准确度的提升,产生的结果比以前的网络要好得多。

同样的现象在CIFAR-10的数据集上也体现了出来,这表明,深层网络优化的困难和我们方法的效果不是仅仅局限于一个特定的数据集。我们在这个数据集上展现出了超过100层的成功训练的模型,并探索了超过1000层的模型。

  

接下里的都是实验结果......表现出了残差网络模型的高准确性和很好的泛化能力。

2 Related Work

Residual Representations. In image recognition, VLAD [18] is a representation that encodes by the residual vectors with respect to a dictionary, and Fisher Vector [30] can be formulated as a probabilistic version [18] of VLAD. Both of them are powerful shallow representations for image retrieval and classification [4, 48]. For vector quantization, encoding residual vectors [17] is shown to be more effective than encoding original vectors.

In low-level vision and computer graphics, for solving Partial Differential Equations (PDEs), the widely used Multigrid method [3] reformulates the system as subproblems at multiple scales, where each subproblem is responsible for the residual solution between a coarser and a finer scale. An alternative to Multigrid is hierarchical basis preconditioning [45, 46], which relies on variables that represent residual vectors between two scales. It has been shown [3, 45, 46] that these solvers converge much faster than standard solvers that are unaware of the residual nature of the solutions. These methods suggest that a good reformulation or preconditioning can simplify the optimization.

Shortcut Connections. Practices and theories that lead to shortcut connections [2, 34, 49] have been studied for a long time. An early practice of training multi-layer perceptrons (MLPs) is to add a linear layer connected from the network input to the output [34, 49]. In [44, 24], a few intermediate layers are directly connected to auxiliary classifiers for addressing vanishing/exploding gradients. The papers of [39, 38, 31, 47] propose methods for centering layer responses, gradients, and propagated errors, implemented by shortcut connections. In [44], an “inception” layer is composed of a shortcut branch and a few deeper branches.

Concurrent with our work, “highway networks” [42, 43] present shortcut connections with gating functions [15]. These gates are data-dependent and have parameters, in contrast to our identity shortcuts that are parameter-free. When a gated shortcut is “closed” (approaching zero), the layers in highway networks represent non-residual functions. On the contrary, our formulation always learns residual functions; our identity shortcuts are never closed, and all information is always passed through, with additional residual functions to be learned. In addition, high way networks have not demonstrated accuracy gains with extremely increased depth (e.g., over 100 layers).

残差表示

在图像识别领域,VLAD是一种由残差向量相对于字典进行编码的表示,Fisher Vector可以表示为 VLAD 的概率版本。它们都是面向图像检索和分类任务的强大的浅层表示。 对于矢量量化,编码残差向量被证明比编码原始矢量更有效。

  

在低层次视觉和计算机图形学中,为了求解偏微分方程 PDE,被广泛使用的多重网格方法Muiltigrid将系统重新表述为多个尺度的子问题,其中每个子问题负责粗粒度尺度和细粒度尺度间的残差解。Multigrid的一种替代方法是分层基础预处理,它依赖于两个尺度间残差向量的变量。有研究已经表明这些求解器的收敛速度比未利用残差性质的标准求解器快得多。这些方法表明,好的重构或预处理可以简化优化过程。

  

残差链接

关于残差连接的实践和理论已经被研究了很长一段时间。一个训练多层感知器MLP的早期实践是添加一个连接输入到输出的线性层 。在[44, 24]中,一些中间层被直接连接到辅助分类器来解决梯度消失/爆炸问题。 [39, 38, 31, 47]的论文提出了一个通过残差连接实现的层响应、梯度和传播误差的居中方法。在[44]中,一个“原始”层由一个shortcut分支和一些更深的分支组成。

在我们的工作的同时,highway networks展示了带有门控功能的残差连接。这些门控函数依赖于数据并且带来了额外的参数,而与我们的恒等残差连接与之相反,是无参的。当门控捷径关闭(接近零)时,highway networks中的层代表为无残差函数。相反,我们的公式总是在学习残差函数,我们的恒等残差连接永远不会关闭,所有信息总是连带着额外的待学习的残差函数被传输。此外,highway networks没有表现出随着深度增加的准确性提升(如超过 100 层)。

Multigrid:多重网格法,一种多分辨率算法,原理是通过不同尺度、疏密的网格去消除不同波长的误差分量。由于直接在高分辨率(细粒度尺度)上求解释,图像低频不分收敛较慢,与间隔的的平方成反比,所以就在低分辨率(粗粒度尺度)上先进行求解,然后再进行插值,提高分辨率。在对粗粒度尺度的网格进行修正之前,要先对细粒度尺度的网格进行光华迭代,消除高频误差。

3 Deep Residual Learning

3.1 Residual Learning

Let us consider H(x) as an underlying mapping to be fit by a few stacked layers (not necessarily the entire net), with x denoting the inputs to the first of these layers. If one hypothesizes that multiple nonlinear layers can asymptotically approximate complicated functions2 , then it is equivalent to hypothesize that they can asymptotically approximate the residual functions, i.e., H(x) − x (assuming that the input and output are of the same dimensions). So rather than expect stacked layers to approximate H(x), we explicitly let these layers approximate a residual function F(x) := H(x) − x. The original function thus becomes F(x)+x. Although both forms should be able to asymptotically approximate the desired functions (as hypothesized), the ease of learning might be different.

This reformulation is motivated by the counterintuitive phenomena about the degradation problem (Fig. 1, left). As we discussed in the introduction, if the added layers can be constructed as identity mappings, a deeper model should have training error no greater than its shallower counterpart. The degradation problem suggests that the solvers might have difficulties in approximating identity mappings by multiple nonlinear layers. With the residual learning reformulation, if identity mappings are optimal, the solvers may simply drive the weights of the multiple nonlinear layers toward zero to approach identity mappings.

In real cases, it is unlikely that identity mappings are optimal, but our reformulation may help to precondition the problem. If the optimal function is closer to an identity mapping than to a zero mapping, it should be easier for the solver to find the perturbations with reference to an identity mapping, than to learn the function as a new one. We show by experiments (Fig. 7) that the learned residual functions in general have small responses, suggesting that identity mappings provide reasonable preconditioning.

让我们把H(x)看作几个人堆叠层(不一定是整个网络)拟合的底层映射,其中x表示这些层中第一个层的输入。如果假设多个非线性层可以逐渐逼近复杂函数,那么就等价于假设它们可以逐渐逼近残差函数,即H(x)−x(假设输入和输出的维度相同)。因此,与其期望堆叠层逼近H(x),我们让这些层去逼近残差函数F(x):=H(x)−x。初始的函数H(x)也就因此变成了F(x)+x。尽管这两种形式都能够逐渐逼近我们需要的函数(如假设所述),但学习的难易程度可能是不同的。

  

这种重构表示的想法的是由上述违反直觉的衰退问题现象所启发的。正如我们在引入中所讨论的,如果添加的层可以构建为恒等映射,那么更深的模型的训练误差应该不大于它对应的较浅的模型。衰退问题表明求解器可能难以通过多个非线性层去逼近恒等映射。通过残差学习的表示重构,如果恒等映射是最优的,求解器可以简单地将多个非线性层的权重推向零以接近恒等映射。

  

在实际情况下,恒等映射不可能是最优的,但我们的重构表示可能有助于先决问题。如果最优函数更接近恒等映射而不是零映射,那么求解器就应该更容易参考恒等映射找到扰动项,而不是把待求解函数当作新函数去学习。 我们通过实验表明,学习到的残差函数通常具有较小的响应,这表明恒等映射提供了合理的预处理。

3.2 Identity Mapping by Shortcuts

我们将残差学习应用到了每一个少量的堆叠层上,模块构建如Figure 2。通常,我们会将一个模块表示为:

y=F(x,\{W_{i}\})+x

其中,x,y 分别表示相关模块的输入向量和输出向量,F(x,\{W_{i}\}) 表示待学习的残差映射。对应Figure 2的双层模块,j即为 F=W_{2}\sigma (W_{1}x),其中,\sigma 表示ReLU函数,即 \sigma (x)=max\{x,0\}。这里为了简化符号表示,我们省去了bias偏差项。F+x 的操作我们通过残差连接和element-wise(逐元素)的加法去实现,我们在执行完连接后使用才第二个激活函数。

残差连接没有引入任何额外的参数和计算复杂度。这不仅非常易于实践,对于我们普通网络和残差网络的对比也十分重要。(因为保证了两者参数个数相同,而不是因为参数的增加才得到了更好的效果。)我们公平地比较了这两种网络的效果,保证了同样的参数个数、深度、宽度和计算代价(除了可忽略的element-wise加法复杂度)。

在我们给出的情况中,x 和 F 的维度必须是相同的。如果是在其他情况下,比如改变输入输出通道时,我们可以通过一个线性映射 W_{s} 来将残差连接匹配为输出维度,即:

y=F(x,\{W_{i}\})+W_{s}x

我们也可以在残差连接中使用线性映射,但我们将会在后面的实验中证明这一步是多余的,恒等映射对于解决衰退问题来说已经足够了,并且相对来说省去了很大一部分的计算代价。因此我们只在需要匹配维度时,才使用线性映射。

残差函数 F 的表示是灵活的。本文中的残差函数涉及到了两到三个层,其实用更多的层也是可以的。但是如果 F 只有一层,那么他的形式就和普通线性层没什么区别了,即 y=W_{1}x+x ,因此我们在实验中对于这一方式没有观察到明显优势。

我们也指出,尽管上述符号为了简便起见表示为了全连接层,但是它们同样适用于卷积层。函数 F(x,\{W_{i}\}) 可以表示多个卷积层。element-wise addition将在两个特征图上逐通道地进行。

 3.3 Network Architectures

         

我们测试了各种普通/残差网络,观察到了一致的现象。为了提供讨论的实例,我们在下文描述了进行ImageNet任务的两个模型:

普通网络

我们的普通网络基础架构主要受 VGG 网络的思想启发。卷积层大多使用的是 3×3 的过滤器,并遵循两个简单的设计规则:(i)对于相同的输出特征图大小,层具有相同数量的过滤器; (ii) 如果特征图大小减半,就通过过滤器数量的加倍来保持每层的时间复杂度。我们直接通过步长为 2 的卷积层进行下采样。整个网络以全局平均池化层和带有 softmax的1000类全连接层结束,加权层的总数为 34。

  

值得注意的是,相比于VGG网络,我们的模型具有更少的过滤器和更低的计算复杂度。我们的34层基础架构有36亿次FLOP(乘加),仅为 VGG-19(196 亿次 FLOP)的 18%。

  

残差网络

基于上述普通网络,我们添加了残差连接,将网络转换为其对应的残差版本。当输入和输出的维度相同时(Figure 3 中的实线残差连接),可以直接使用恒等映射方式进行残差连接。当维度增加时(Figure 3 中的虚线残差连接),我们考虑两种选择:(A)残差连接仍然执行恒等映射,填充额外的零以增加维度,这个选项没有引入额外的参数; (B) 对恒等映射进行投影用于匹配维度(由 1×1 卷积完成)。对于这两个选项,当残差连接跨越两种尺寸的特征图时,它们将由步长为2的卷积完成尺寸适配。

 3.4 Implementation

我们在针对ImageNet任务的模型的实现遵循[21, 41]中的做法,图像较短的边在[256, 480]中随机采样以进行缩放,从而被调整大小。224×224 的裁剪是从原始图像或者其水平翻转图像中随机采样的,然后减去每个像素的平均值(也就是标准化)。使用了[21]中的标准颜色增强方法。我们按照[16]中的方法,在每次卷积之后和激活之前采用层归一化BN (Batch Normalization)。我们按照[13]中的方法初始化权重,并从头开始训练所有普通/残差网络。我们使用 SGD ,每个mini-batch大小为256。学习率从0.1开始,当误差趋于稳定时除以10,模型最多训练60×104次迭代(这里一般会说多少个epoch)。遵循[16]中的做法,我们使用0.0001的权重衰减和0.9的动量,且不使用dropout。

在测试中,对于比较研究,我们采用标准的10-crop 测试。为了获得最佳结果,我们采用[41, 13]中的完全卷积形式,并取得多个尺度上的平均得分(调整图像大小,使最短边分别为 {224, 256, 384, 480, 640})。

weight decay:权重衰减(L2正则化),即在代价函数的后面增加一个L2正则项,

C=C_{0}+\frac\lambda {2n} \sum W^{2}

\lambda即为权重衰减系数,其目的是防止过拟合。

4 Experiments

4.1 ImageNet Classification

我们在包含1000个类别的ImageNet 2012分类数据集上评估我们的方法。 模型在128万张训练图像上进行训练,并在5万张验证图像上进行评估。我们还获得了测试服务器报告的10万测试图像的最终结果。在这里我们将评估top-1和top-5错误率。

Plain Networks

我们首先评估了18层和34层的普通网络。结果表明,相较于18层更深的34层普通网络反而有更高的验证误差。为了揭露这一现象的理由,我们比较了它们训练过程中的训练/验证误差。我们观察到了衰退问题——34层的普通网络相较于18层的普通网络,在整个训练过程中都表现出更高的训练误差,尽管18层的普通网络是34层普通网络的一个子集!

我们认为优化的难点不可能在于梯度消失问题。这些普通网络都是由BP算法训练的来,这保证了前向传播的信号具有非零方差。我们也证明了,经过Batch Normalization的反向传播梯度表现出了健康的规范。所以不管是前向传播还是反向传播,信号都不会消失。事实上,34层的普通网仍然能够达到比较有竞争力的精度,这表明求解器在一定程度上是有效的。 我们推测深度普通网络的收敛速度可能是指数级低的,这会影响训练误差的下降。这种优化难点的原因会在后面研究。

Residual Networks

我们评估了18层和34层的残差网络,除了对于每一对3×3过滤器都加上一个残差连接之外,它们的基线架构和其对应的普通网络版本是一样的。在第一个比较中,我们使用恒等映射做所有的残差连接,并且使用zero-padding去补全维度,所以它们相较于对应的普通网络版本,不会添加额外的参数。

我们将三个主要的观察结果都放在了图表中。首先,残差网络学习的效果使得衰退现象发生了逆转——34层的残差网络以2.8%的优势超过了18层的残差网络。更重要的是,34层的残差网络表现出相当低的训练误差,并且可以泛化到验证数据集上。这表明衰退问题这样的配置下得到了很好的解决,并且我们从增加的深度中获得了精度的提升。

其次,与普通版本的网络相比,34层的残差网络通过成功地降低训练误差减少了3.5%的top-1误差。这一对比证明了残差学习在极深的网络架构体系中的有效性。

最后,我们也发现18层普通/残差网络在准确度上相当,但18层的残差网络收敛速度更快。当网络“不太深”(这里是 18 层)的时候,目前的SGD求解器仍然能够找到面向普通网络的较好的解决方案。 在这种情况下,我们的残差网络在早期提供更快的收敛,从而使得整个网络优化过程更加轻松。

Identity vs Projection Shortcuts

残差连接中恒等映射和投影映射的对比。

我们已经表明了无参的恒等映射残差连接有助于训练。接下来我们将研究投影映射残差连接。在表 3 中,我们比较了三个选项:(A)使用基于zero-padding的残差连接增加维度,并且所有的残差连接都是无参的;(B) 使用投影映射残差连接增加维度,其余残差连接则为恒等映射;(C) 所有的残差连接都是投影映射残差连接。

Table 3显示以上所有三个选项都比普通网络的训练效果好得多。B略好于A。我们认为这是因为A中的zero-padding维度实际上没有进行残差学习。C略好于B,我们认为原因在于十三个投影映射残差连接方式为模型引入了额外的参数。但是A/B/C之间的微小差异表明投影映射残差连接对于解决我们发现的衰退问题并不是必须的。所以我们在本文的其余部分不使用选项C,以减少模型的大小,从而减少空间复杂度和时间复杂度。恒等映射残差连接不会增加下面介绍的瓶颈架构复杂性,因而十分重要。

Deeper Bottleneck Architectures

接下来,我们将描述我们针对ImageNet任务设计的更深的网络。为了减少训练时间,我们将模块修改为bottlenect瓶颈设计。对于每个残差函数 F,我们使用3层堆叠而不是2层。这三层分别是1×1、3×3和1×1卷积,其中1×1层负责减少然后增加/恢复维度,使3×3层成为输入/输出维度较小的瓶颈。Figure 5中展示了一个示例,这两种模块设计具有相似的时间复杂度,但却实现了更维度的残差函数学习。
无参的恒等映射残差连接对于瓶颈架构尤为重要。 如果将Figure 5中的残差连接从恒等映射替换为投影映射,随着两个高维端的残差连接,整个时间复杂度和模型大小都会增加一倍。因此,恒等映射残差连接为bottleneck设计带来了更有效的模型。

 50-layer ResNet

我们使用选项B来连接不用维度的层,这个模型有着38亿次的乘加。

101-layer and 152-layer ResNets

Comparisons with State-of-the-art Methods

以上都是介绍了模型参数和实验结果,这里不过多赘述。

4.2 CIFAR-10 and Analysis

略。

Analysis of Layer Responses

Figure 7 显示了层响应的标准差std。响应指是每个 3×3 层的输出,在Batch Normalization之后和其他非线性(ReLU/addition)之前。 对于残差网络,该分析揭示了残差函数的响应强度。Figure 7显示残差网络的响应通常比它们对应的普通网络要小。这些结果支持了我们的基本假定,即残差函数通常比非残差函数更接近于零。我们还注意到,更深的残差网络会具有更小的响应量级,如Figure 7中ResNet-20、56和110之间的比较所证明的那样。当有更多层时,残差网络的单个层往往会更少地修改信号。

Exploring Over 1000 layers

1202层的残差网络能够达到低至0.1%的训练误差,它的测试误差也相当不错。

但是在如此深的模型上仍然存在未解决的问题。这个1202层的残差网络的测试结果比我们110层的残差网络要差,尽管两者都有相似的训练误差,我们认为这是过拟合导致的。对于CIFAR-10这个小数据集,1202 层网络可能会大的有点没必要了(包含19.4M个参数),所以应用强正则化(如maxout或dropout)以获得该数据集上的最佳结果。在本文中,我们没有使用 maxout/dropout,只是简单地通过设计深而纤细的架构去强加正则化,没有分散对优化难点的关注。但是结合更强的正则化可能会使得结果进一步改善,我们将在未来继续研究这一问题。

4.3 Object Detection on PASCAL and MS COCO

略。

5 Conclusion

无。

本文并没有来得及加上一个结论部分,但是整篇文章看下来已经足够清晰明确。首先引入观察到的奇怪的衰退现象,然后届时其原因,从而介绍为什么要引入残差网络、怎么引入残差网络、引入残差网络的几种方法的比较和一些实现细节,非常流畅且清晰。不断强调残差学习对于整个优化收敛过程的重要性,并用强有力的实验数据证明了文中提出的假设。牛!

结束!

标签:layers,映射,--,Image,残差,网络,ResNet,residual,我们
来源: https://blog.csdn.net/Levi_Ackerman__/article/details/122046968

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有