Worked examples — Inception - GoogLeNet
This page is the "get your hands dirty" companion to the parent Inception note. There we learned what an inception module is and why the 1×1 bottleneck saves work. Here we grind through every kind of number the topic can throw at you, so no exam or interview question can surprise you.
Before we start, two words we will use constantly, defined from zero:
The scenario matrix
Every question about inception modules lands in one of these cells. The worked examples below are labelled with the cell(s) they cover. Ten cells (A–J), covered by ten worked examples.
| # | Case class | What makes it tricky | Covered by |
|---|---|---|---|
| A | Plain conv cost (no bottleneck) | baseline — the number to beat | Ex 1 |
| B | Bottleneck cost ( small) | two stages added together | Ex 2 |
| C | Break-even / degenerate | when does the bottleneck stop helping? | Ex 3 |
| D | (identity-ish, no reduction) | bottleneck can hurt | Ex 3 |
| E | Full module: 4 branches, depth-concat | keep spatial size, add channels | Ex 4 |
| F | 1×1 conv as pure channel mixer () | limiting case, no spatial extent | Ex 5 |
| G | Pooling branch (pool then 1×1) | pooling doesn't change ; 1×1 does | Ex 6 |
| H | Auxiliary-loss arithmetic (weighted sum) | the weights | Ex 7 |
| I | Real-world word problem (memory/latency budget) | translate English → formula | Ex 8, Ex 9 |
| J | Exam twist (solve for unknown ) | algebra, inequality direction | Ex 10 |
[!example] Example 1 — Cell A: the naive cost
Statement. Input . Apply a conv producing output channels, no bottleneck. How many operations?
Forecast: guess the order of magnitude first — thousands? millions? hundreds of millions? Write it down before reading on.
- Count output pixels. . Why this step? Every output pixel is an independent little computation; we need to know how many there are.
- Count weights per output pixel. The filter is over all input channels: . Why this step? Each output value sums a product over the whole patch — that's multiply-accumulates.
- Multiply by number of output channels. We make separate output grids: . Why this step? Each of the filters repeats the whole thing independently.
- Combine. operations.
Verify: Units sanity — (pixels) (ops/pixel/channel) (channels) has no leftover unit, pure op count. , i.e. hundreds of millions. This is our baseline to beat.
[!example] Example 2 — Cell B: same job with a 1×1 bottleneck
Statement. Same input and same goal ( → channels), but first squeeze the channels down to with a conv.
Forecast: we added an extra layer. Will total ops go up or down? Guess a factor.
- Stage 1: the squeeze. so . Ops . Why this step? Cheaply mash channels into — a per-pixel linear combination, no spatial cost.
- Stage 2: the on the skinny map. Now . Ops . Why this step? The expensive now runs over only channels, not .
- Add the stages. . Why this step? The two convs run in sequence, so total work is their sum.
- Compare to Ex 1. .
Verify: Even though we added a layer, we cut ops by . The whole trick: pay a tiny toll (M) to make the giant toll (M) small (M). ✔ matches the parent note's .
[!example] Example 3 — Cells C & D: when the bottleneck stops helping
The parent gave the beneficial condition: Let's find the exact where the trick breaks even, and show it can hurt.
Statement. . (a) What is the break-even point? (b) What happens at (no reduction at all)?
Forecast: guess whether break-even is closer to or to .
- Write the break-even equality. Set the two sides equal: Why this step? Break-even = the where bottleneck cost exactly equals naive cost.
- Compute constants. , so left factor . Right side . Why this step? Reduce to a one-variable linear equation.
- Solve. . Why this step? Any below saves ops; above it, the bottleneck costs more than naive.
- Case D, . Ops . Why this step? At the does no reduction, so you pay it on top of the full naive cost.
Verify: Naive cost was . Case D gives — the "bottleneck" made things worse. ✔ This is why the paper picks tiny like : only a big squeeze pays off. (Break-even confirms the direction.)
[!example] Example 4 — Cell E: a full inception module, all four branches
Statement. Input . Configure:
- Branch 1: , filters.
- Branch 2: (96) → (128).
- Branch 3: (16) → (32).
- Branch 4: max-pool → (32). Find the output shape.
Forecast: guess the final channel count and whether change.

- Spatial size stays . Every branch uses "same" padding and pooling with stride 1, so all outputs are grids. Why this step? Concatenation (next step) requires identical — you can only stack grids of the same shape.
- Read each branch's output depth. The last number in each branch is its channel count: . Why this step? Depth = number of filters in the final conv of that branch.
- Depth-concatenate. Stack the four boxes along the channel axis: . Why this step? Concatenation glues grids together; no averaging, no loss — every branch's features survive.
- Output shape. . Why this step? Combining the unchanged spatial size (step 1) with the summed depth (step 3) gives the complete shape the next layer will receive.
Verify: unchanged (good — an inception module is a "same-size" block), depth grew . Look at the figure: four coloured stacks of equal height/width, glued side-by-side into one taller stack. ✔
[!example] Example 5 — Cell F: the conv as a pure channel mixer
Statement. Input , apply a conv with filters. (a) Ops? (b) What does one output pixel actually compute?
Forecast: with , does spatial neighbourhood matter at all?
- Ops with . , so ops . Why this step? No spatial extent means each output pixel only looks at the one pixel directly beneath it — but across all channels.
- What one pixel computes. For output channel at location : Why this step? This is a learned weighted sum of the channel values at that spot — a mini fully-connected layer applied at every pixel.
- Interpretation. It's dimensionality reduction with learned weights (), unlike PCA which uses fixed statistical directions. Why this step? This is the whole reason 1×1 convs exist — cheap, learnable channel compression.
Verify: With ReLU after step 2 it becomes nonlinear, so it is strictly more expressive than PCA (a fixed linear map). Op count M is tiny versus a over the same input ( larger). ✔
[!example] Example 6 — Cell G: the pooling branch
Statement. Branch 4 of a module: input → max-pool (stride 1, "same") → conv with filters. What is the shape after pooling, and after the ?
Forecast: does max-pooling change the channel count? Guess before step 2.
- After max-pool. "Same" stride-1 pooling keeps spatial size and does not touch depth: . Why this step? Pooling picks the max within each window per channel independently — grids stay , size stays .
- Why a afterwards? Pooling left us with channels, but the module only budgets for this branch. The squeezes . Why this step? Without it, concatenating a -channel pool branch would blow up the output depth every layer.
- After the . . Ops for the : . Why this step? Confirms the branch stays cheap while still injecting pooled, translation-robust features.
Verify: Depth path . Matches branch 3+4 giving , which together with gives the of Ex 4. ✔ Cross-consistent.
[!example] Example 7 — Cell H: auxiliary-loss arithmetic
Statement. During training GoogLeNet minimises Suppose one batch gives . (a) Total loss? (b) What fraction comes from the auxiliaries?
Forecast: guess whether the auxiliaries contribute more or less than half.
- Weighted sum. . Why this step? The down-weights the auxiliaries so they nudge, not dominate.
- Auxiliary fraction. . Why this step? Shows they are meaningful but sub-half — deliberately kept below the main signal.
- Interpretation. These extra losses shove gradient into the middle of the net, fighting vanishing gradients; they are removed at test time. Why this step? Ties the number back to the purpose — they are a training crutch, later replaced by ResNet skip-connections.
Verify: Total (auxiliaries add signal). Auxiliary fraction (they never outvote the main task). ✔ Consistent with "regularizer, not primary objective".
[!example] Example 8 — Cell I: real-world budget word problem
Statement. You must run a conv, -channel input, outputs, on a map, on a tiny always-on sensor chip that can do only ops per frame. Show the naive conv won't fit, then pick the largest (a bottleneck) that does.
Forecast: will need to be tiny (like 8) or can you afford ~100?
- Naive cost, confirm it fails. . Why this step? — the naive conv is nearly over budget, so we must use a bottleneck.
- Bottleneck cost as function of . . Why this step? Express cost as a straight line in so we can solve an inequality.
- Solve . . Why this step? Round down: largest integer that fits is .
- Check the winner. Cost , just under the ceiling. Why this step? Confirms the chosen actually fits — always plug the integer back before committing.
Verify: : bottleneck fits, naive does not. ✔ would give — over budget, confirming is the boundary. Method (solve linear inequality in ) generalises to any chip limit; in practice these picks are automated by Neural Architecture Search.
[!example] Example 9 — Cell I: a comfier budget (design choice, not the maximum)
Statement. Same , , on a map — but now on a phone GPU with a generous ops/frame budget. Both naive and bottleneck fit. Pick a sensible and quantify the saving.
Forecast: when everything fits, do you still bottleneck? Guess a factor.
- Confirm both fit. Naive . Plenty of headroom. Why this step? When the budget is loose, cost is no longer the hard constraint — accuracy and speed trade off.
- Pick (a squeeze). Bottleneck cost . Why this step? is a common design choice — a moderate squeeze that keeps enough capacity while cutting work.
- Saving factor. . Why this step? Even with a loose budget, the bottleneck still runs cheaper — free speed at little accuracy cost.
Verify: : bottleneck cheaper even when both fit. Saving . ✔ Lesson: the bottleneck is worth it for speed, not only to squeeze under a hard ceiling.
[!example] Example 10 — Cell J: exam twist, solve for the unknown
Statement. A conv, , . You want the bottleneck version to cost at most half the naive version. What is the largest ?
Forecast: half the cost — will be roughly half of , or much smaller?
- Naive cost per pixel. (drop , it cancels). Why this step? Both sides share , so ratios ignore spatial size entirely.
- Bottleneck cost per pixel. . Why this step? Factor to isolate the unknown.
- Impose "at most half". . Why this step? Translate "half the cost" into an inequality — mind the direction (, not ).
- Solve. → largest integer . Why this step? Must round down; would exceed half.
Verify: At : cost ✔. At : ✘. So is exactly the boundary. ✔
Recall Self-test
Naive over to ch: op count? ::: With bottleneck, total ops? ::: (≈12.1× fewer) Does max-pooling change the channel count? ::: No — it acts per channel; only the following changes depth A conv computes what, at each pixel? ::: A learned weighted sum over all input channels ( per-pixel dimensionality reduction) Why the weight on auxiliary losses? ::: So they regularize / feed gradient without dominating the main objective Break-even for , ? ::: ≈; below it saves, above it costs more
See also: 3.4.01-CNN-Basics · 3.4.05-VGG (uniform filters, the thing Inception rebels against) · 3.4.11-Inception-v2v3 (drops the auxiliaries) · 3.4.08 Inception - GoogLeNet (Hinglish).