Summary
A convolution reuses one local linear operator across spatial positions; a CNN composes these operators with nonlinearities and other layers. Weight sharing ties parameters, while stride, padding, dilation, and channel counts determine shapes and information loss. The architectural bias does not by itself guarantee invariance, semantic hierarchy, or superior sample efficiency.
The building block: convolutional layer
Use channels-last notation here, with input . An ungrouped layer has weights and optionally biases. Along either spatial axis,
Here are padding, dilation, and stride; require valid positive output dimensions.
For unit stride and dilation, omitting boundary indexing, the common cross-correlation implementation computes:
For a numerical fixture, use input , sixteen filters, stride one, padding one, and dilation one. Output is ; parameters total . There are multiply-accumulates, excluding biases. Counting one multiply and one add per MAC gives FLOPs under that convention. The diagram uses different illustrative channel counts: thirty-two, then sixty-four.
Learning objective
Pooling collapses space while keeping one output per channel
Derivation
How many outputs remain when only the spatial axes are averaged?
Standard CNN ingredients
- Spatial convolution: shared local feature computation.
- ReLU/GELU: nonlinear composition rather than one collapsed affine map.
- Normalization: an implementation choice, not a prerequisite for every trainable CNN.
- Pooling/strided convolution: different downsampling operators with distinct aliasing and information effects.
- Global average pooling: one spatial mean per channel, not universal input-transformation invariance.
- convolution: channel mixing at each location.
Receptive field
Track receptive-field extent and input-coordinate spacing , starting from . One layer gives and per axis. Two stride-one layers therefore span five input positions, not an exponential extent. Boundary handling and strided sampling qualify translation equivariance; arbitrary one-pixel shifts need not produce one-cell output shifts.
Change the Requirement
Preserve Fine Spatial Evidence
New task: Retain small-object or boundary information that downsampling removes.
Picture and change: Consider higher-resolution paths, suitable dilation, or multiscale features rather than merely widening channels.
Check: Two patches with one active pixel in different locations have the same average, . More channels after that scalar average cannot reconstruct which location was active.
Use when: Localization matters; measure compute, aliasing, and dense-task performance together.
Reduce Channel Work
New task: Replace full convolution with depthwise spatial filtering followed by pointwise mixing.
Picture and change: For the fixture, weight counts become , ignoring biases.
Check: Arithmetic becomes MACs, but the restricted factorization cannot represent every full convolution.
Use when: Measured hardware cost binds; fewer MACs do not guarantee lower latency.
Architectural eras
| Era | Architecture | Key idea |
|---|---|---|
| 2012 | AlexNet | First major win; ReLU + dropout + GPU |
| 2014 | VGG | All convs, very deep |
| 2014 | GoogLeNet / Inception | Multi-scale modules, dim reduction |
| 2015 | ResNet | Residual connections enable 50+ layers |
| 2016 | DenseNet | Dense feature reuse |
| 2017 | MobileNet | Depthwise separable convs for efficiency |
| 2019 | EfficientNet | Compound scaling depth × width × resolution |
| 2020 | ViT | Transformers replace CNN backbones |
| 2022 | ConvNeXt | Modernized ResNet matching ViT performance |
The table names historical design examples, not a measured ranking or deployment census.
ConvNeXt and the modern CNN
ConvNeXt (Liu et al., 2022) modernized ResNet-50 by adopting transformer-era design choices:
- LayerNorm instead of BatchNorm.
- GELU instead of ReLU.
- Larger kernels ( depthwise).
- Inverted bottleneck (channels-up then down).
Compare complete training recipes, workloads, quality targets, and hardware before attributing a result solely to convolution versus attention.
Common pitfalls
- Shape assumptions. A valid convolution need not shrink the grid; stride and padding must be declared.
- Axis confusion. Distinguish the chosen tensor layout from the library’s default and physical memory layout.
- Invariance claims. Pooling averages feature positions; it does not make every input transformation irrelevant.
- Theoretical versus effective context. A receptive-field bound lists possible dependencies, not equal influence from every input pixel.
Related
- Residual connections. What made deep CNNs trainable.
- BatchNorm vs LayerNorm. Normalization for vision.
- Vision transformers. Alternative paradigm.