GoogLeNet uses ordinary convolutions for its first few layers and stacks 9 Inception modules on top of them. The left side of the figure at the top of the article shows the overall flow, and the right side shows the inside of one Inception module.
Inception module
A module feeds the previous layer's output into 4 branches simultaneously and concatenates their outputs along the channel axis.
- A 1×1 convolution
- A 1×1 convolution to reduce channels, followed by a 3×3 convolution
- A 1×1 convolution to reduce channels, followed by a 5×5 convolution
- A 3×3 max pooling (stride 1) followed by a 1×1 convolution to reduce channels
ReLU is applied after every convolution (including the channel-reducing 1×1 ones). None of the 4 branches changes the height or width, so their outputs can be stacked directly. With x as the output of the previous layer, the module's output can be written as follows.
Inception(x)=concat(f1×1(x), f3×3(x), f5×5(x), fpool(x))
concat is concatenation along the channel axis, and each f is the computation of a branch. For example, the first module (3a) produces 64, 128, 32, and 32 channels from a 192-channel input, outputting 256 channels in total.
Why 1×1 convolutions are used to reduce channels
The paper first considered a naive form that simply places the 4 branches side by side. In that form, however, applying 5×5 convolutions to an input with many channels is too expensive. Moreover, the pooling branch outputs as many channels as its input, so the number of output channels grows with every module stacked, and within a few stages the computation becomes unmanageable.
So a 1×1 convolution is placed before the 3×3 and 5×5 convolutions (after it in the pooling branch) to reduce the number of channels. Comparing the number of multiplications per output position in the 5×5 branch of (3a) gives the following (height and width stay at 28×28).
| Form of the 5×5 branch | Multiplications per position | Whole 28×28 map |
|---|
| 5×5 applied directly to 192 channels (32 channels) | 52×192×32=153,600 | About 120M |
| Reduce to 16 channels with 1×1, then 5×5 | 192×16+52×16×32=15,872 | About 12.4M |
Reducing the channels cuts the computation to roughly one tenth. Since there is also a ReLU after the 1×1 convolution, it has the added effect of increasing the number of nonlinear layers.
Overall flow
An image (224×224×3, with the RGB mean subtracted) flows in the following order (Table 1 of the paper).
| Layer | Output shape | Parameters | Computation (multiply-adds) |
|---|
| 7×7 convolution (stride 2) | 112×112×64 | 2.7K | 34M |
| 3×3 max pooling (stride 2) | 56×56×64 | 0 | — |
| 1×1 → 3×3 convolution | 56×56×192 | 112K | 360M |
| 3×3 max pooling (stride 2) | 28×28×192 | 0 | — |
| Inception (3a), (3b) | 28×28×480 | 159K, 380K | 128M, 304M |
| 3×3 max pooling (stride 2) | 14×14×480 | 0 | — |
| Inception (4a)–(4e) | 14×14×832 | 364K–840K | 73M–170M |
| 3×3 max pooling (stride 2) | 7×7×832 | 0 | — |
| Inception (5a), (5b) | 7×7×1024 | 1072K, 1388K | 54M, 71M |
| 7×7 average pooling | 1×1×1024 | 0 | — |
| Dropout (40%) | 1×1×1024 | 0 | — |
| Fully connected (softmax) | 1000 | 1000K | 1M |
Counting only layers with parameters gives 22 layers (27 if pooling is also counted). Summing the parameters in Table 1 gives about 6.8 million, and the computation is about 1.5 billion operations. In the paper's overall diagram (Figure 3), the same local response normalization (LRN) as in AlexNet appears after the first max pooling and after the 3×3 convolution.
Inception modules are used only in the higher layers to save memory during training, and the paper states that this is not strictly necessary. Also, instead of stacking fully connected layers at the end, it uses global average pooling (following Network In Network), with only a single fully connected layer for classification. This improved top-1 accuracy by about 0.6 points.
Auxiliary classifiers
Because the network is deep, there was a concern about whether gradients would reach the lower layers. So small classifiers (auxiliary classifiers) are attached to the outputs of the intermediate modules (4a) and (4d).
- 5×5 average pooling with stride 3 (output 4×4×512, or 4×4×528 for (4d))
- A 1×1 convolution with 128 channels and ReLU
- A fully connected layer with 1024 neurons and ReLU
- Dropout that sets 70% of the outputs to 0
- A 1000-class fully connected layer and softmax function
During training, the losses of the auxiliary classifiers are multiplied by 0.3 and added to the total loss. At inference, the auxiliary classifiers are removed.
L=Lmain+0.3(Laux1+Laux2)