A ResNet block runs a full dense convolution at every layer — every output channel looking at every input channel, at every position in the kernel. That's exactly the kind of arithmetic a phone's battery can't afford. What if most of those multiplications were spent re-mixing channels that filtering and mixing didn't need to happen together at all?
Same 3x3 kernel, same 4x4 output, same input and output channel count — the only difference is whether one dense convolution does the whole job, or two much smaller ones split it in half. Step through the channel counts and watch the gap between the two bars grow.
A standard convolution mixes space and channels in a single operation. Depthwise separable convolution splits that into two cheaper steps: a depthwise conv that filters each channel on its own (space only), followed by a pointwise conv that mixes channels (no spatial extent at all):
- — the kernel's spatial size (here, ).
- — the number of channels (input and output are equal here, so a residual add is possible).
- The ratio is exact, and independent of image size
Dividing separable by standard params gives — a clean identity that holds at any spatial resolution, since the spatial factor cancels out entirely.
- Wider layers save more, not less
As grows, shrinks toward , so the ratio approaches a floor of — roughly a reduction at the widest layers, versus a much smaller saving at narrow ones.
- MobileNet inverts the usual bottleneck order
An inverted-residual block puts this depthwise filter inside an expand-then-project bottleneck:
- a expands channels to
- a depthwise filters the expanded space
- a linear projects back down to
so the block's output can add back onto its input — the reverse of a ResNet bottleneck, which narrows before it widens.
The exact ratio from the formula, plotted across the same channel counts, alongside the raw FLOP counts it implies at 16 channels — over 4x fewer multiply-adds for the identical input and output shape.
, a output feature map, channels, expansion :
- Standard vs. separable at 4 channels
- Standard: params, FLOPs
- Separable, depthwise: params
- Separable, pointwise: params
- Separable, total: params, FLOPs
About of the standard conv's cost, matching exactly.
- The inverted-residual bottleneck, expanded to 24 channels
- Expand : params
- Depthwise on channels: params
- Project : params
Total: params.
- What a dense middle conv would have cost instead
Swap the depthwise filter for a dense over the same expanded channels: params, plus the same two layers, totals — over the inverted-residual block's . The entire saving lives in that one swapped layer.
Find the channel count where the separable/standard parameter ratio first drops below 0.15.
Splitting spatial filtering from channel mixing turns one expensive dense convolution into two cheap ones, saving more as layers get wider. MobileNet's inverted-residual block puts that same depthwise trick inside an expand-then-project bottleneck — the mirror image of a ResNet block's narrow-then-wide shape — so a network can keep the residual connection's training benefits while running on a fraction of the compute. The next chapter picks up a pretrained network like this one and asks how much of it can be reused as-is.