arXiv(opens in a new tab)cs.CVDec 2015Cited by 116 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:1512.03385

Deep Residual Learning for Image Recognition

Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun

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×\times 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 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.

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/high-level features [50] and classifiers in an end-to-end multi-layer 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].

Figure 1: Training error (left) and test error (right) on CIFAR-10 with 20-layer and 56-layer “plain” networks. The deeper network has higher training error, and thus test error. Similar phenomena on ImageNet is presented in Fig. 4.

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).

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)\mathcal{H}(\mathbf{x}), we let the stacked nonlinear layers fit another mapping of F(x):=H(x)−x\mathcal{F}(\mathbf{x}):=\mathcal{H}(\mathbf{x})-\mathbf{x}. The original mapping is recast into F(x)+x\mathcal{F}(\mathbf{x})+\mathbf{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\mathcal{F}(\mathbf{x})+\mathbf{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.

Figure 2: Residual learning: a building block.

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.

References (40)

  • Learning long-term dependencies with gradient descent is difficult
  • Siam, 2000
  • The devil is in the details: an evaluation of recent feature encoding methods
  • The Pascal Visual Object Classes (VOC) Challenge
  • Object detection via a multi-region & semantic segmentation-aware cnn model
  • Rich feature hierarchies for accurate object detection and semantic segmentation
  • Understanding the difficulty of training deep feedforward neural networks
  • Maxout Networks
  • Convolutional neural networks at constrained time cost
  • Spatial pyramid pooling in deep convolutional networks for visual recognition
  • Delving deep into rectifiers: Surpassing human-level performance on imagenet classification
  • Improving neural networks by preventing co-adaptation of feature detectors
  • Long short-term memory
  • Batch normalization: Accelerating deep network training by reducing internal covariate shift
  • Product quantization for nearest neighbor search
  • Aggregating local image descriptors into compact codes
  • Caffe: Convolutional Architecture for Fast Feature Embedding
  • Imagenet classification with deep convolutional neural networks
  • Backpropagation applied to handwritten zip code recognition
  • Deeply-Supervised Nets
  • Network In Network
  • Fully convolutional networks for semantic segmentation
  • On the number of linear regions of deep neural networks
  • Rectified linear units improve restricted boltzmann machines
  • Fisher kernels on visual vocabularies for image categorization
  • Deep learning made easier by linear transformations in perceptrons
  • Faster R-CNN: Towards real-time object detection with region proposal networks
  • Object detection networks on convolutional feature maps (opens arXiv in a new tab)
  • Fitnets: Hints for thin deep nets
  • ImageNet Large Scale Visual Recognition Challenge
  • Exact solutions to the nonlinear dynamics of learning in deep linear neural networks
  • Overfeat: Integrated recognition, localization and detection using convolutional networks
  • Very deep convolutional networks for large-scale image recognition
  • Highway networks (opens arXiv in a new tab)
  • Training very deep networks
  • Going deeper with convolutions
  • Pushing stochastic gradient towards second-order methods–backpropagation learning with transformations in nonlinearities
  • VLFeat: An open and portable library of computer vision algorithms, 2008
  • Modern applied statistics with s-plus
  • Visualizing and understanding convolutional neural networks

Cited by (116)