DenseNet
DenseNet connects every layer to all later layers by concatenation, maximizing feature reuse and gradient flow with few parameters.
Dense connectivity
In a densely connected network, each layer receives as input the concatenated feature maps of all preceding layers within a block, and passes its own output to all subsequent layers. Where ResNet adds a shortcut to a layer's output, DenseNet concatenates all earlier outputs. A block of L layers therefore has L(L+1)/2 direct connections rather than L. This dense wiring encourages feature reuse and keeps a short path from any layer to the loss.
Growth rate
Each layer contributes a small fixed number of new feature maps, called the growth rate, often just 12 to 32 channels. Because layers reuse all previous features rather than relearning them, they can be narrow, so DenseNet achieves strong accuracy with fewer parameters than a comparable ResNet. The concatenation makes the collective knowledge of the block available to every layer.
# dense block: each layer sees all previous feature maps
# x0 -> l1 -> x1
# concat(x0, x1) -> l2 -> x2
# concat(x0, x1, x2) -> l3 -> x3 ... (grows by growth_rate each layer)
Transition layers
Concatenation grows the channel count quickly, so between dense blocks DenseNet inserts transition layers: a 1x1 convolution that compresses channels and an average pooling that halves spatial resolution. These keep the network's width and computation in check while moving between resolution stages, letting the architecture stay deep without exploding in size.
Advantages
- Strong gradient flow: every layer has a near-direct path to the loss.
- Feature reuse: later layers build on all earlier features rather than recomputing them.
- Parameter efficiency: narrow layers achieve high accuracy.
- Implicit deep supervision from short paths to the output.
Trade-offs versus ResNet
DenseNet is parameter-efficient but memory-hungry at training time, because all intermediate feature maps must be stored for concatenation. ResNet's additive shortcuts are lighter on memory and remain more common as a general backbone. DenseNet is attractive when parameter count matters and when strong feature reuse helps, such as certain medical imaging tasks. Both architectures share the core lesson that shortcut connections make deep networks trainable and effective.
- Layers are concatenated, not just added.
- Small growth rate keeps layers narrow.
- Transition layers control width and resolution.
- Parameter-efficient but memory-intensive.