Skip to content
fn

densenet_161

→DenseNet26.5M
densenet_161(pretrained: bool = False, overrides: object = {})

DenseNet-161 feature-extracting backbone (no classification head).

Builds a DenseNet with the DenseNet-161 topology: per-block dense-layer counts (6, 12, 36, 24), growth rate k=48k = 48, initial conv channels 96. Approximately 28.7 M parameters — the widest of the ImageNet DenseNets. Reaches a top-1 ImageNet accuracy of 77.14%.

This variant is not in Huang et al., CVPR 2017 — that paper's Table 1 lists 121/169/201/264 at k=32k = 32 only. It comes from the authors' own released reference-framework models, which the reference vision library mirrors.

Model Size

Parameters

pretrainedbool= False
No checkpoint is published for densenet_161, so True raises NotImplementedError rather than return randomly initialised weights. densenet_161_cls is the checkpointed variant.
**overridesobject= {}
Keyword overrides forwarded into DenseNetConfig.

Returns

DenseNet

Backbone with the DenseNet-161 configuration applied (or with overrides merged on top of it).

Notes

See Huang et al., "Densely Connected Convolutional Networks", CVPR 2017, Table 1. Unlike the k=32 / 64-stem siblings, DenseNet-161 widens the growth rate to 48 and the stem to 96 channels, giving the highest accuracy of the four canonical ImageNet variants at the cost of ~3.6× the parameters of DenseNet-121.

Examples

>>> import lucid
>>> from lucid.models.vision.densenet import densenet_161
>>> model = densenet_161()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape   # (B, 2208, 1, 1)
(1, 2208, 1, 1)

Used by 1