Rethinking the Inception Architecture for Computer Vision
- Publication
- CVPR 2016Conference
- First submitted to arXiv
- arXiv:1512.00567
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{classiccnnsinceptionv32015,
title = {{Rethinking the Inception Architecture for Computer Vision}},
author = {Christian Szegedy and Vincent Vanhoucke and Sergey Ioffe and Jonathon Shlens and Zbigniew Wojna},
year = {2015},
eprint = {1512.00567},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1512.00567}
}
When GoogLeNet won the ILSVRC 2014 classification challenge, it used only about 5 million parameters, a twelfth of AlexNet's.
That efficiency is tempting, but anyone who tries to modify it soon runs into trouble. The GoogLeNet paper doesn't clearly explain how each design decision was reached, and the Inception module has many branches. The most intuitive way to scale the model up is to double the number of filters in every group, which quadruples both computation and parameters.
In December 2015, Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, and Jonathon Shlens of Google, together with Zbigniew Wojna of University College London, released this paper. The “Rethinking” in the title refers to taking Inception apart and thinking it through again, to find which approaches make the extra computation worthwhile as the network grows.
Defining the Problem
The authors want to know how a network should be scaled up when the compute budget is limited.
From a large number of architecture experiments, they distilled four principles. The authors themselves are cautious, saying the principles are still partly speculative, that more experiments are needed to establish where they apply, and that they should be consulted only when in doubt. Still, in their experiments, networks that clearly violated them tended to get worse, and got better again once corrected.
- Avoid representational bottlenecks, especially early in the network. From input to output, the size of the representation should shrink gradually instead of being squeezed flat all at once at some layer. The authors also note that dimensionality is only a rough estimate of information content.
- Higher-dimensional representations are easier to process locally. More activations per position make features easier to disentangle, and training goes faster.
- Spatial aggregation can be done in lower dimensions. For example, reducing the number of channels before a convolution doesn't hurt expressiveness much. The authors guess that outputs at adjacent positions are highly correlated, so little information is lost in the reduction.
- Balance width and depth. Increasing both helps; at a fixed computational cost, increasing width and depth together works best.
Much of GoogLeNet's early gain came from heavy use of convolutions for dimensionality reduction, which is principle 3. The authors see dimensionality reduction as a special case of “factorizing convolutions,” and next they go looking for other ways to factorize.
Solving the Problem
Splitting 5×5 into Two 3×3 Layers
Large kernels are expensive. With the same numbers of input and output channels, a convolution costs times as much as a one.
But large kernels also see farther. Can we get the same field of view with fewer parameters?
The authors look at a convolution from another angle, treating each output as a small fully connected network sliding over a region of the input. Since this is a vision network, the small network can itself exploit translation invariance and be split into two layers, the first a convolution and the second fully connected over the grid of the first layer's output. Slide this two-layer mini-network over the whole input, and you get two convolutional layers.

First, the savings. With the number of output channels unchanged, two layers have of the parameters of one , a saving of 28%. In a convolutional network every weight is used exactly once at each output position, so the computation shrinks by the same proportion. This assumes the middle layer has as many channels as the input, the same simplification the paper makes.
Next, the receptive field. With two stacked layers, one output at the top sees a region of the input, as far as a single layer, except that the middle positions carry more weight: there are 9 paths from the central input point to the output, and only 1 from a corner.
This replacement raises two questions. First, does it lose expressiveness? Second, since what we're factorizing is the linear operation, shouldn't the first layer stay linear, without a ReLU?
The authors ran several control experiments. One compares two Inception models, one using a linear activation in the first factorized layer and the other using ReLU in both layers. On the validation set they settle at 76.2% and 77.2% top-1 accuracy, respectively. The authors say the linear version was worse in all their control experiments; their explanation is that the extra nonlinearity lets the network learn more variations, especially with batch normalization.
Splitting Further into 1×n and n×1
By this logic, any kernel larger than can be replaced with a chain of layers. Can itself be split further?
Splitting it into two layers saves only 11%. The authors found a better split in asymmetric convolutions. Do a first, then a , and the field of view is still .

The asymmetric factorization works the same way. A followed by a also sees a region, but needs only 6 multiplications per output and per pair of input and output channels, a third fewer than the 9 of a ; two layers need 8, only a ninth fewer. The larger the kernel, the bigger the saving: a needs 49, while splitting it into plus needs only 14.
This trick doesn't work well everywhere, though. The authors found that it does poorly early in the network but works very well on medium-sized feature maps (sides of roughly 12 to 20). The actual network uses followed by on feature maps:

GoogLeNet's original module had four branches, namely , , , and pooling. By comparison, the leftmost branch here amounts to two layers, each split into a pair of asymmetric convolutions; the second branch is the split version of a single layer. The stage uses the module from Figure 5, which replaces the with two layers.
At the smallest feature maps, , the authors use the idea differently:

Note that and are side by side here, with both outputs going straight into the final concatenation instead of being chained. This increases the number of output channels to produce high-dimensional representations on the last feature maps, in line with principle 2. The authors use it only at , reasoning that at this stage the local processing done by convolutions matters more than spatial aggregation.
What Auxiliary Classifiers Really Do
GoogLeNet attached two auxiliary classifiers to the middle of the network. The original idea was to send useful gradients to the earlier layers, fighting vanishing gradients and speeding up convergence.
When the authors took another look, that's not what they found. Early in training, the curves with and without auxiliary classifiers are nearly identical; only near the end of training does the network with auxiliary classifiers pull ahead, settling at a slightly higher plateau. Removing the lower of the two auxiliary classifiers didn't hurt the final quality either.
So GoogLeNet's original hypothesis, that the auxiliary branches help the low-level features evolve, is most likely mistaken in the authors' view. They instead view auxiliary classifiers as regularizers. The evidence is that the main classifier performs better when the auxiliary branch has batch normalization or dropout; adding batch normalization to the auxiliary branch gives a 0.4% absolute gain in top-1 accuracy. Inception-v3's auxiliary classifier sits on top of the last feature map.
The authors also remark in passing that this offers weak supporting evidence for the conjecture that batch normalization acts as a regularizer.
Shrinking the Feature Map Without Choking the Information
Convolutional networks usually shrink feature maps with pooling. Suppose we want to turn into . There are two direct ways to do it:
- Convolve, then pool: first raise the channels from 320 to 640 at , then pool. No information gets choked, but the most expensive convolution runs on the large feature map.
- Pool, then convolve: first pool to , then add channels. Much cheaper, but along the way there's a step with only , which violates principle 1.
A rough estimate with a single convolution, going from to : convolving before pooling takes about 2.26 billion multiply-adds, pooling before convolving about 533 million, a difference of more than four times.
The authors' solution is to put a stride-2 convolution and a stride-2 pooling side by side, each shrinking the feature map directly, and then join the channels from the two sides, halving the computation again to about 266 million multiply-adds:

The diagram on the right is the easiest to read. There, splits into two paths. The convolution path outputs , the pooling path also outputs , and together they make . The convolution only has to output half the channels, so it costs half as much as even the pool-first approach; and the output has 640 channels from the start, without passing through the squeezed step.
Putting the Pieces Together
The authors assemble these components into a new network:
| Type | Kernel/stride or note | Input size |
|---|---|---|
| conv | /2 | |
| conv | /1 | |
| conv (padded) | /1 | |
| pool | /2 | |
| conv | /1 | |
| conv | /2 | |
| conv | /1 | |
| 3 × Inception | As in Figure 5 | |
| 5 × Inception | As in Figure 6 | |
| 2 × Inception | As in Figure 7 | |
| pool | ||
| linear | logits | |
| softmax | classifier |
The first three convolutions come from splitting up the traditional first layer, the same idea as replacing with two layers. Between the three Inception stages, modules like the one in Figure 10 shrink the feature maps. The whole network is 42 layers deep.
You might wonder why the input is such an odd number as . Following the table's settings, a stride-2 convolution turns 299 into 149, and the next convolutions and pooling give 147, 73, 71 and 35, finally shrinking to 17 and 8. Every stride-2 layer without padding divides exactly, no row of pixels is dropped, and the path lands on the table's , and . The paper doesn't explain why it chose 299, but this number does make the whole path line up neatly.
Keeping the Model from Getting Too Sure of Itself
The last component has nothing to do with the architecture; it deals with the labels.
For a training image , the model computes the probability of each class with a softmax:
are the logits. Writing the ground-truth label distribution as , the cross-entropy loss is:
Its gradient with respect to the logits is , which lies between and .
Ordinary training uses one-hot labels, with for the correct class and 0 for everything else. To minimize the loss, has to equal 1, which is impossible with finite logits, so the only option is for to keep pulling further ahead of the other logits.
The authors point out two problems with this. First, the model learns to assign full confidence to every training image, which may not generalize. Second, the gap between the largest logit and the others gets pushed very wide, and since the gradient is bounded, the model has a harder time adapting. Put plainly, the model is too sure of its own predictions.
Their fix is to replace the label distribution:
is a fixed distribution independent of the image; the authors use the uniform distribution . This is called label smoothing regularization (LSR). ImageNet has classes, and .
If the logits themselves are optimized as parameters, with a one-hot label the gap between the correct class's logit and the others keeps growing, pushed further the longer training runs; with the smoothed label, the gap stops at . At the minimum of the loss, , and under softmax the logit gap between two classes equals the log of their probability ratio.
The authors also offer another way to look at it. Expand the cross-entropy:
This amounts to adding a penalty on top of the original loss, so that the model pays a price whenever the predicted distribution strays too far from the uniform distribution .
On ILSVRC 2012, adding LSR lowers top-1 error from 23.1% to 22.8% and top-5 from 6.3% to 6.1%.
Training Setup
The authors train with TensorFlow's distributed system, using 50 replicas, each running on one NVIDIA Kepler GPU with a batch size of 32, for 100 epochs.
Early experiments used momentum; the best models switched to RMSProp (decay 0.9, ). The learning rate is 0.045, multiplied by 0.94 every two epochs. Gradient clipping at 2.0 is used to stabilize training, and evaluation uses a running average of the parameters.
Discussion
Adding One Change at a Time
| Network | Top-1 error | Top-5 error | Cost (billions of operations) |
|---|---|---|---|
| GoogLeNet | 29% | 9.2% | 1.5 |
| BN-GoogLeNet | 26.8% | – | 1.5 |
| BN-Inception | 25.2% | 7.8% | 2.0 |
| Inception-v2 | 23.4% | – | 3.8 |
| + RMSProp | 23.1% | 6.3% | 3.8 |
| + Label Smoothing | 22.8% | 6.1% | 3.8 |
| + Factorized 7×7 | 21.6% | 5.8% | 4.8 |
| + BN auxiliary classifier | 21.2% | 5.6% | 4.8 |
This table is cumulative, with each row adding one more change on top of the row before. The last row, “BN auxiliary classifier,” means the fully connected layer in the auxiliary classifier also gets batch normalization, not just the convolutional layers. The version with every change added is what the authors call Inception-v3.
The table shows a few things.
- Switching to the new architecture alone (the Inception-v2 row) lowers top-1 error from BN-Inception's 25.2% to 23.4%, but computation also rises from 2.0 to 3.8.
- RMSProp and label smoothing add no computation, and each gains about 0.3 percentage points of top-1.
- Splitting the first-layer into three layers raises computation from 3.8 to 4.8 and improves top-1 by 1.2 percentage points, the biggest step among the later changes.
Overall, Inception-v3 costs about 2.4 times as much computation as BN-Inception and 3.2 times as much as GoogLeNet.
All evaluations use the 48,238 non-blacklisted images of the ILSVRC 2012 validation set. The authors also tried all 50,000 images; the results differed by about 0.1 percentage points in top-5 error and about 0.2 in top-1.
How Much Does Lower Resolution Cost?
Detection systems often have to classify small patches of an image, where objects are small and blurry. The common belief is that higher input resolution is better, but the authors point out that this mixes up two things, the resolution of the first layer's receptive field and the model's own capacity and computation. If you just shrink the input and leave the model alone, you're using a much cheaper model to solve a harder problem.
So they hold computation fixed and change only the input resolution. When the input gets smaller, they remove early strides or pooling so the later feature maps stay about the same size:
| Receptive field size | Adjustment | Top-1 accuracy |
|---|---|---|
| First layer stride 1, no pooling after | 75.2% | |
| First layer stride 1, then max pooling | 76.4% | |
| First layer stride 2, then max pooling | 76.6% |
The three networks have almost the same computational cost. The lower-resolution networks take longer to train, but their final results aren't far from , with trailing by only 0.2 percentage points and by 1.4.
From this, the authors suggest that in detection pipelines like R-CNN, it may be worth using dedicated networks for small objects that are low-resolution but still computationally heavy.
Comparison with Other Models
Single model, multiple crops:
| Network | Crops | Top-1 error | Top-5 error |
|---|---|---|---|
| GoogLeNet | 144 | – | 7.89% |
| VGG | – | 24.4% | 6.8% |
| BN-Inception | 144 | 22% | 5.82% |
| PReLU | – | 21.59% | 5.71% |
| Inception-v3 | 12 | 19.47% | 4.48% |
| Inception-v3 | 144 | 18.77% | 4.2% |
Multi-model ensembles:
| Network | Models | Crops | Top-1 error | Top-5 error |
|---|---|---|---|---|
| VGGNet | 2 | – | 23.7% | 6.8% |
| GoogLeNet | 7 | 144 | – | 6.67% |
| PReLU | – | – | – | 4.94% |
| BN-Inception | 6 | 144 | 20.1% | 4.9% |
| Inception-v3 | 4 | 144 | 17.2% | 3.58% |
In the conclusion, the authors compare against the PReLU network of He et al., finding that Inception-v3 cuts top-5 and top-1 error by 25% and 14% relative, while being six times cheaper computationally and using at least five times fewer parameters (which the authors mark as an estimate). The four-model ensemble's top-5 error is about half that of the winning 2014 GoogLeNet ensemble.
Conclusion
This paper reads more like a design notebook. Table 3 adds changes one at a time, so you can see what each one contributes, and the authors candidly label their four design principles as rules of thumb that still need verification.
To wrap up, here are the components this paper left behind:
- Split large kernels into small ones: becomes two layers, and becomes followed by .
- When shrinking feature maps, run convolution and pooling side by side, so information doesn't get choked.
- Auxiliary classifiers act more like regularizers.
- Label smoothing, so the model isn't too sure of its answers.
Label smoothing is independent of the architecture, takes a few lines of code, and appears in ConvNeXt's training recipe too. In the next version, Inception meets ResNet, and Inception-v4 wires residual connections into its modules.