Architectures/CNN Architectures

Lesson 6.22,369 words

CNN Architectures

Six landmark networks, each contributing exactly one idea: LeNet's conv-pool stack, AlexNet's ReLU-and-dropout scale, VGG's 3×33\times3 uniformity, Inception's multi-scale module, ResNet's residual skip, and DenseNet's dense connectivity. The common thread is the degradation problem (why plain deeper nets train worse, not just overfit) and the residual block that solved it by keeping a +1+1 path open for the gradient.

╌╌╌╌

The convolutional layer fixes the primitive (local, weight-shared, translation-equivariant filtering), but it does not fix the wiring. How many filters, how deep, connected how? The answer came from a decade of architectures, each one isolating a single structural idea and pushing it until it broke. This lesson is that sequence: six landmark networks, the one idea each contributed, and the degradation problem that the most important of them solved.

The landmark architectures

Every modern vision backbone is a recombination of six prior moves. Read the table as a list of contributions, not models; each row is one idea that survived.

ArchitectureYearDepthKey ideaApprox. params
LeNet-519987conv-pool stacks for digits
AlexNet20128ReLU + dropout + GPU scale
VGG-16201416uniform stacks, depth
GoogLeNet (Inception)201422multi-scale module, bottleneck
ResNet-50201550residual / skip connections
DenseNet-1212017121dense connectivity (concat all prior)

Two numbers in that table summarize the trend. Depth climbs from to ; parameter count peaks at VGG's M and then falls — Inception and ResNet are an order of magnitude deeper than VGG yet carry far fewer weights. Depth and parameter count decoupled, and every architecture after VGG is a way of adding depth without adding parameters.

LeNet-5: the template

LeNet-5 set the pattern every later network inherits: alternate convolution (detect local features) with subsampling/pooling (shrink spatial extent, grow receptive field), then finish with a few dense layers. Spatial resolution falls while channel depth rises: features get coarser and more abstract toward the output.1

The LeNet-5 template: conv-pool stacks halve resolution as channels grow, then dense layers read off the class. Every later CNN varies this skeleton.

AlexNet: scale, ReLU, dropout

AlexNet is LeNet, larger, trained on two GPUs over ImageNet's M images. Its contribution is the three choices that made depth trainable at scale: the ReLU nonlinearity, which does not saturate and so keeps gradients alive; aggressive dropout in the dense layers to fight overfitting; and GPU implementation to make the compute feasible.2

ChoiceReplacesWhy it mattered
ReLU / sigmoidno saturation no vanishing gradient; faster convergence
dropout nonedecorrelates dense units, cuts overfitting on M params
GPU trainingCPUmakes M params over M images tractable in days, not months

Where the M parameters actually sit is worth tracing, because it explains every design move that follows. AlexNet takes a image through five convolutional stages and three dense layers. The convolutions are cheap in weights but expensive in activations; the dense layers are the reverse.

LayerOutput shape Kernel / strideWeights
input
conv1 + pool, s
conv2 + pool
conv3
conv4
conv5 + pool
fc6dense
fc7dense
fc8 (softmax)dense

The first dense layer alone, fc6, holds M weights — of the whole network — because it flattens the entire final feature map and connects it fully to units. That single number is why later architectures replace the flatten-then-dense head with global average pooling: collapsing the map to a -vector by averaging removes the M-weight layer outright. Inception and ResNet both do exactly this, which is a large part of why they carry an order of magnitude fewer parameters than VGG.

VGG: depth through uniformity

VGG replaces every large filter with a stack of convolutions, and proves the substitution is strictly better: two stacked layers see the same receptive field as one layer, but with fewer parameters and an extra nonlinearity in between.

Two stacked convolutions cover the same receptive field as one filter, at fewer parameters and with an extra nonlinearity.

The uniformity yields more than a parameter saving. Because every stage keeps the same kernel and halves the spatial resolution at each pooling step, VGG-16 is a single rule applied five times: two-or-three convolutions, then a pool that halves and and doubles the channel count. The tensor shape follows a clean geometric progression.

BlockConvsOutput shape Receptive field
input
block 1 (+ pool) conv
block 2 (+ pool) conv
block 3 (+ pool) conv
block 4 (+ pool) conv
block 5 (+ pool) conv
fc6 / fc7 / fc8densefull image

Resolution falls (a reduction, five halvings) while channels climb . By block 5 a single unit's receptive field () covers nearly the whole input, so the final feature map sees the entire image at once. Each pooling step both grows that field and, by doubling , keeps the per-layer compute roughly constant as the map shrinks.

Receptive field growth by depth. Stacking convolutions expands the field linearly (); each pool then multiplies the stride, so the field a deep unit sees grows to cover the whole image.

VGG pushed this to layers and won by depth alone — but at M parameters, most of them in the dense layers, it is the heaviest model in the table. It also exposed a limit: stacking past plain layers stopped helping.

The degradation problem

The natural hypothesis — deeper is at least as good, because the extra layers can always learn the identity — is false in practice. Plain stacked networks past a depth threshold train to higher error than their shallower counterparts. This is not overfitting: the training error itself is worse, so the failure lies in optimization, not in the generalization gap.3

The degradation problem: a plain 56-layer net reaches higher training error than a 20-layer net, so deeper is worse even on the training set.

The diagnosis is that the identity map is hard to represent with a stack of nonlinear layers. Producing from a conv-ReLU-conv block requires the weights to combine into an exact identity, a thin target in weight space that gradient descent does not reliably reach.

ResNet: learn the residual

ResNet's fix is a reparameterization. Instead of asking a block to compute the target map directly, ask it to compute the residual , and add the input back via an identity skip:

Now the identity is free: if the optimal block is the identity, the network only needs , driving a stack of weights to zero, which weight decay does anyway, rather than constructing an exact identity from nonlinearities.4

The residual block. Input splits into a learned path and an identity skip, summed before the final nonlinearity.

Why the skip keeps gradients alive

The skip's deeper payoff is on the backward pass. Consider a block . The Jacobian of the output with respect to the input is

Chaining such blocks from layer to the loss at the top, the gradient flowing back to is, by the chain rule,

Expanding the product, the leading term is the bare — the gradient reaches the early layer undiminished, along a path of all-identity factors. The deep multiplicative product of Jacobians that vanishes in a plain net is now an additive correction on top of a guaranteed path.

For a concrete number, suppose each block's Jacobian has spectral norm , a modest per-layer contraction. In a plain net the signal is the product of these factors: across blocks the gradient shrinks by , five orders of magnitude, so the early layers get almost no signal and stop learning. In a residual net the same blocks contribute , whose expansion keeps the bare identity term at magnitude no matter how many factors multiply. The gradient at the first block is , not . That is the entire difference between a net that trains at depth and one that does not.

This is the same mechanism as the LSTM's cell state in recurrent networks: a near-identity path along which the gradient propagates without repeated multiplication. With it, ResNet trained layers where plain nets degraded past .

ResNet-50 stacks the bottleneck block (below) into four stages, halving resolution and doubling width at each stage boundary. The tensor shape follows the same ladder VGG used, but the flatten-then-dense head is gone: a global average pool collapses the final map to a -vector, so the classifier is a single layer instead of VGG's M-weight dense stack.

StageBlocksOutput shape Block channels ()
conv1 + pool conv, s
stage 2
stage 3
stage 4
stage 5
global avg pool + fcdense

Fifty weight layers, M parameters: a fifth of VGG's count at more than three times the depth. The bottleneck (next section) is what keeps each of those stacked blocks cheap.

Algorithm:ResidualBlock(x,W1,W2)\textsc{ResidualBlock}(x, W_1, W_2) — forward pass of a basic block
  1. 1
    aReLU(conv(x,W1))a \gets \text{ReLU}(\text{conv}(x, W_1))
    first conv path
  2. 2
    Fconv(a,W2)F \gets \text{conv}(a, W_2)
    residual, no activation yet
  3. 3
    if dim(F)dim(x)\dim(F) \ne \dim(x) then
    spatial / channel mismatch
  4. 4
    xconv1×1(x)x \gets \text{conv}_{1\times1}(x)
    project skip to match
  5. 5
    yReLU(F+x)y \gets \text{ReLU}(F + x)
    add identity, then activate
  6. 6
    return yy

1×1 convolutions and the bottleneck

A convolution touches one spatial location at a time; it has no spatial extent at all. What it does is mix channels: it is a per-pixel linear map from channels to , applied identically everywhere. That makes it a cheap dimensionality knob on the channel axis.5

The payoff is the bottleneck: squeeze channels down with a , do the expensive convolution in the reduced space, then expand back. Count the multiply-adds on an map to see why it cuts compute.

The — the costly part, quadratic in channels — runs on channels instead of , an saving on the dominant term. The two caps restore the width for free by comparison.

The bottleneck block: a squeezes channels to , the runs in the reduced space, and a expands back to .

Inception: multi-scale in one module

GoogLeNet's Inception module takes a different approach: rather than commit to one filter size per layer, run several in parallel, , , and a pooling branch — and concatenate their outputs. Each branch is prefaced by a bottleneck so the parallel paths stay cheap. The network learns, per layer, how much of each scale to use.

A VGG stack (one filter size, in series) versus an Inception module (several scales in parallel, then concatenated). VGG picks a scale; Inception offers all at once.

Inception's M parameters (against VGG's M at comparable accuracy) come almost entirely from the bottlenecks pruning each branch before the expensive convolution.

DenseNet: dense connectivity

ResNet adds the skip; DenseNet generalizes it. Each layer receives, by concatenation, the feature maps of all preceding layers in its block:

where is channel-wise concatenation. Where ResNet sums a single skip, DenseNet stacks every prior output, giving each layer direct access to the raw features below it and to the loss gradient above. Because features are reused rather than relearned, each layer adds only a few channels (the growth rate), so a -layer DenseNet carries just M parameters.

ConnectivityCombine ruleSkip to layer Params
Plainnonehigh
Residualsum, one backmedium
Denseconcat, all backlow

The accuracy/compute frontier

Depthwise-separable convolution, MobileNet's core, pushes the bottleneck idea to its limit. It factorizes a standard convolution into a depthwise step (one filter per channel, no cross-channel mixing) followed by a pointwise step (mix channels, no spatial extent). The standard conv does both at once and pays per pixel; the factorized version pays only

of the cost, roughly for a kernel, at a small accuracy penalty. This is the accuracy/compute frontier: the same recognition quality at a fraction of the multiply-adds, which is what makes CNNs run on phones.

ImageNet top-1 accuracy climbs across the landmark models as depth grows, from AlexNet through VGG and Inception to ResNet.

Pushing the CNN frontier

The six landmarks end with ResNet and DenseNet (2015–2017); the standard references stop there. Two later results changed how the frontier is pushed and are worth naming.

  • Compound scaling (EfficientNet). VGG-to-ResNet progress came from scaling one axis at a time — deeper (VGG), then a better block (ResNet). Tan & Le (EfficientNet, ICML 2019) showed the axes should move together: depth , width , and input resolution scaled by a shared coefficient under the constraint , with found by a small grid search. For example, doubling the compute budget () is best spent as roughly depth, width, and resolution together, not as a on any single axis. EfficientNet-B7 matched the then-best accuracy with fewer parameters than the previous record, by scaling in balance rather than blindly deepening.
  • CNNs after the Transformer (ConvNeXt). When the Vision Transformer overtook CNNs, it was unclear whether attention or merely a decade of better training recipes was responsible. Liu et al. (A ConvNet for the 2020s, CVPR 2022) modernized a plain ResNet one change at a time — larger kernels, fewer activations, LayerNorm, the AdamW schedule — until a pure convolutional network (ConvNeXt) matched a comparable ViT. The result is a useful control: much of the ViT's early advantage was training protocol, not the attention block itself.

The residual skip these landmarks introduced is the one idea that survived intact into every architecture since — it is the same path that stabilizes the deep Transformer stack.

Takeaways

  • The six landmarks each isolate one idea: LeNet's conv-pool stack, AlexNet's ReLU-dropout-GPU scale, VGG's uniform depth, Inception's parallel multi-scale module, ResNet's residual skip, DenseNet's dense concatenation.
  • After VGG, depth and parameter count decoupled — Inception and ResNet are far deeper than VGG with an order of magnitude fewer weights.
  • Degradation is an optimization failure, not overfitting: plain nets past layers reach higher training error because a stack of nonlinearities cannot easily represent the identity.
  • ResNet reparameterizes the block to learn the residual , so ; the identity skip injects a into the backward Jacobian, giving the gradient an additive path that never vanishes across depth.
  • convolutions mix channels at zero spatial cost; squeeze-then-expand bottlenecks run the costly in a reduced channel space, cutting compute by .
  • Depthwise-separable convolution factorizes spatial and channel mixing for a saving, defining the accuracy/compute frontier that puts CNNs on mobile hardware.

Footnotes

  1. Goodfellow, Deep Learning, §9.11 — The Neuroscientific Basis / historical notes: LeNet and the lineage of conv-pool stacks that every modern vision backbone inherits.
  2. Chollet, Deep Learning with Python, Ch. 5 — Deep Learning for Computer Vision: ReLU, dropout, and data augmentation as the practical tricks that made deep convnets trainable at ImageNet scale.
  3. Goodfellow, Deep Learning, §8.2 — Challenges in Neural Network Optimization: why adding depth can raise training error, framing degradation as an optimization failure rather than overfitting.
  4. Goodfellow, Deep Learning, §8.7.5 — skip/residual connections and §9.x design: re-parameterizing a block to learn so the identity is free.
  5. Goodfellow, Deep Learning, §9.5 — Convolution and Pooling as an Infinitely Strong Prior / variants: convolutions as a per-pixel channel projection and the bottleneck they enable.

╌╌ END ╌╌