Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning
- Publication
- AAAI 2017Conference
- First submitted to arXiv
- arXiv:1602.07261
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{classiccnnsinceptionv42016,
title = {{Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning}},
author = {Christian Szegedy and Sergey Ioffe and Vincent Vanhoucke and Alex Alemi},
year = {2016},
eprint = {1602.07261},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1602.07261}
}
The ILSVRC 2015 classification winner was Microsoft Research's ResNet. Its architecture is quite traditional, convolutions stacked layer upon layer, with residual connections as the only addition; as a single model, it scores about the same as the Inception-v3 that Google had just published.
Inception keeps computation down with multi-branch modules and carefully budgeted channel counts, while ResNet uses residual connections to make very deep networks trainable.
So what happens if you combine them?
In February 2016, Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alex Alemi of Google released this paper. The title packs in the new Inception-v4, Inception-ResNet with residual connections added, and what effect residual connections actually have on training.
Defining the Problem
This paper tackles two problems at once.
The first is residual connections. The ResNet authors argue that residual connections are inherently necessary for training very deep convolutional networks. Inception networks are very deep to begin with, so replacing the “concatenate the channels” step at the end of an Inception module with “add back the input” seems natural. But where does the benefit lie? In final accuracy, or somewhere else?
The second is Inception itself. The authors admit that Inception-v3 carries a lot of historical baggage. Earlier models were trained with DistBelief, where each replica had to be split into several sub-networks to fit in memory, and the number of filters in each layer was carefully tuned to balance computation across the sub-networks. After the move to TensorFlow, that constraint was gone. On top of that, they had always been conservative about changing the architecture, modifying one component at a time while keeping the rest fixed, and the network grew more and more complicated as a result.
Now that the baggage can be set down, can Inception become simpler, deeper, and wider?
Solving the Problem
Dropping the Baggage: Inception-v4

This looks a lot like Inception-v3's architecture table, with the same three resolutions (, , ), several Inception modules stacked at each, and reduction modules in between to move to the next resolution. The difference is that Inception-v4 uses just one kind of module per resolution, and more of them, with 4 Inception-A, 7 Inception-B, and 3 Inception-C in order.
The three modules carry on Inception-v3's factorization methods:
- Inception-A (): four branches, the longest of which replaces with two layers; each branch outputs 96 channels, for 384 in total.
- Inception-B (): uses asymmetric and convolutions, for 1024 channels in total.
- Inception-C (): outputs and side by side, for 1536 channels in total.
Convolutions marked “V” in the figures use valid padding: no zero padding, so the output shrinks. Unmarked ones use same padding, so the output is the same size as the input.
The Entrance
Compared with Inception-v3, the most visible change is at the start of the network. The authors call it the stem:

The first three layers are the same as in Inception-v3, going from to . Then come three rounds of “split, then join,” each with one branch that does the downsampling or with two branches processed separately and then merged, giving the shapes marked in the figure: , and . Pooling doesn't change the channel count, so the first merge is and the last is .
The first and third merges use Inception-v3's method for shrinking feature maps, placing a stride-2 convolution and a stride-2 pooling side by side to avoid the information bottleneck that pooling first would create. This time even the start of the network does it.
Wiring Residuals into Inception
For the residual versions of Inception, the authors use cheaper modules. Take Inception-ResNet-v2's module as an example:

Compared with a pure Inception module, two things are different:
- The branches are narrower. The three branches end up with only channels, far fewer than the input's 384.
- After the branches are concatenated, there's an extra convolution with no activation function that expands the channels back to 384 so the result can be added to the input. The authors call it a filter-expansion layer; it makes up for the dimensionality reduction caused by the Inception module.
import torch
import torch.nn as nn
def conv(cin, cout, k):
return nn.Sequential(nn.Conv2d(cin, cout, k, padding=k // 2, bias=False), nn.BatchNorm2d(cout), nn.ReLU())
class InceptionResNetA(nn.Module):
def __init__(self, channels=384, scale=0.1):
super().__init__()
self.b1 = conv(channels, 32, 1)
self.b2 = nn.Sequential(conv(channels, 32, 1), conv(32, 32, 3))
self.b3 = nn.Sequential(conv(channels, 32, 1), conv(32, 48, 3), conv(48, 64, 3))
self.expand = nn.Conv2d(32 + 32 + 64, channels, 1) # 1×1, no activation function
self.scale = scale
def forward(self, x):
branches = torch.cat([self.b1(x), self.b2(x), self.b3(x)], dim=1)
residual = self.expand(branches)
print("Concatenated branches:", tuple(branches.shape[1:]), "→ expanded by 1×1:", tuple(residual.shape[1:]))
return torch.relu(x + self.scale * residual)
x = torch.randn(2, 384, 35, 35)
print("Output:", tuple(InceptionResNetA()(x).shape[1:]))
Concatenated branches: (128, 35, 35) → expanded by 1×1: (384, 35, 35)
Output: (384, 35, 35)
The scale in the code is the star of the next section; set it aside for now.
The authors tried several residual versions, but the paper details only two:
| Network | Comparable cost | Stem | Body |
|---|---|---|---|
| Inception-ResNet-v1 | About the same as Inception-v3 | Its own stem (Figure 14) | 5 × A, Reduction-A, 10 × B, Reduction-B, 5 × C |
| Inception-ResNet-v2 | About the same as Inception-v4 | Same as Inception-v4 (Figure 3) | As above, with wider modules |
Although Inception-ResNet-v2 and Inception-v4 have comparable raw computational cost, the authors note that in practice Inception-v4 is much slower per training step, probably because it has more layers.
Also, Inception-ResNet applies batch normalization only on top of the ordinary layers, not after the additions. The authors say that using batch normalization throughout should be better, but on layers with large activations it takes up a disproportionate amount of GPU memory. To keep each model replica on a single GPU, they dropped those BN layers, which let them stack many more modules.
Scaling Down the Residuals to Steady Training
Next, the authors found that when the number of filters exceeded 1000, the residual versions became unstable, and the network would “die” early in training. Concretely, after a few tens of thousands of iterations, the last layer before average pooling output nothing but zeros. Neither lowering the learning rate nor adding an extra batch normalization to that layer could bring it back.
What eventually worked was multiplying the residual by a small constant before adding it.

The authors generally pick values between 0.1 and 0.3. When the ResNet paper ran into instability with very deep networks, it used two-phase training: first a “warm-up” at a very low learning rate, then a higher learning rate. The authors found that with very many filters, even a learning rate of 0.00001 couldn't hold off the instability, and the high learning rate that followed could undo whatever the warm-up achieved. Scaling the residuals was far more reliable by comparison. Even where the network could train without scaling, adding it never hurt final accuracy, and it made training more stable.
The paper doesn't analyze why the network “dies.” Still, the Inception-ResNet branches contain batch normalization, so their output size stays roughly fixed, while the main path has no batch normalization after the addition, so the signal accumulates with every module. Without scaling, every module adds a signal about as large as the main path's, and after 40 modules the main path's standard deviation grows to about times; with a scale of 0.1, each module makes only a small correction, and the main-path signal comes mostly from the identity path. This is only a simplified estimate at initialization and cannot explain the “dying” midway through training; what the paper establishes is only the experimental result that wide residual networks train stably once scaled.
Training Setup
The setup is almost the same as Inception-v3's, using TensorFlow distributed training, this time with 20 replicas, each running on one NVIDIA Kepler GPU. The best models use RMSProp (decay 0.9, ) with a learning rate of 0.045, multiplied by 0.94 every two epochs; evaluation uses a running average of the parameters.
Discussion
Residuals Make Training Much Faster

The red line is Inception-ResNet-v1, with residuals; the green line is Inception-v3. The red line falls much faster, yet both lines end up in about the same place, with the residual version slightly worse on top-1 and slightly better on top-5. For the Inception-v4 and Inception-ResNet-v2 pair, too, the residual version trains faster and finishes slightly better.
Comparing all four models, the authors judge that the residual versions converge faster, but that final accuracy depends mainly on model size.
Single-Model Results
| Network | Top-1 error | Top-5 error |
|---|---|---|
| BN-Inception | 25.2% | 7.8% |
| Inception-v3 | 21.2% | 5.6% |
| Inception-ResNet-v1 | 21.3% | 5.5% |
| Inception-v4 | 20.0% | 5.0% |
| Inception-ResNet-v2 | 19.9% | 4.9% |
Paired by similar computational cost, Inception-v3 and Inception-ResNet-v1 are nearly tied, and Inception-v4 and Inception-ResNet-v2 are only 0.1 percentage points apart. The gap between the two pairs is much larger than the gap within each pair between the versions with and without residuals.
Multi-crop results follow the same trend:
| Network | Crops | Top-1 error | Top-5 error |
|---|---|---|---|
| ResNet-152 | 10 | 21.4% | 5.7% |
| Inception-v3 | 12 | 19.8% | 4.6% |
| Inception-ResNet-v1 | 12 | 19.8% | 4.6% |
| Inception-v4 | 12 | 18.7% | 4.2% |
| Inception-ResNet-v2 | 12 | 18.7% | 4.1% |
| ResNet-152 | dense | 19.4% | 4.5% |
| Inception-v3 | 144 | 18.9% | 4.3% |
| Inception-ResNet-v1 | 144 | 18.8% | 4.3% |
| Inception-v4 | 144 | 17.7% | 3.8% |
| Inception-ResNet-v2 | 144 | 17.8% | 3.7% |
Ensembles
| Network | Models | Top-1 error | Top-5 error |
|---|---|---|---|
| ResNet-152 | 6 | – | 3.6% |
| Inception-v3 | 4 | 17.3% | 3.6% |
| Inception-v4 + 3 × Inception-ResNet-v2 | 4 | 16.5% | 3.1% |
One Inception-v4 plus three Inception-ResNet-v2 gives 3.1% top-5 error on the validation set. This ensemble was also submitted to the test server, scoring 3.08%. The authors make a point of saying that in the past year they had submitted results to the test server only twice, once for the BN-Inception paper and once for the ILSVRC 2015 CLSLOC competition, so the test-set number can be taken as a true estimate of generalization.
The authors also notice that single-model improvements become less pronounced once models are ensembled.
Are Residual Connections “Necessary”?
Back to the first question from the beginning. At least for image recognition, the authors say, their results don't support the ResNet paper's claim that residual connections are inherently necessary. Inception-v4 has no residual connections, yet it trains just fine and performs on par with Inception-ResNet-v2.
They also leave some room, noting that seeing the full extent of what residual connections offer may take deeper architectures and more measurement points. What is certain is that residual connections make training much faster, and that alone is reason enough to use them.
Conclusion
This paper delivers the pure-Inception Inception-v4 along with Inception-ResNet-v1 and v2, whose computational costs match Inception-v3 and Inception-v4, respectively, for three networks in all.
The authors picked the Inception-ResNet modules “in a somewhat ad hoc manner” (their own words), requiring only a computational cost close to the corresponding pure Inception model; they also tried bigger and wider versions, which performed very similarly on ImageNet. With the comparison set up this way, what residual connections mainly bring is training speed. What really opens up a gap is a bigger model, with Inception-v4 and Inception-ResNet-v2 both clearly better than the v3-class models.
If you're picking a model to use and training time matters, add residual connections; if final accuracy matters, model size counts for more than whether there are residuals. When the network is very wide, remember to multiply the residual by 0.1 to 0.3 before adding it back, or training may “die” partway through.
As for whether residuals are a necessity for training deep networks, ResNet and this paper each have their own view. Around the same time, the ResNet authors themselves were studying the right way to wire residuals, which is the subject of the next note, ResNet v2.