ZFNet feature-extracting backbone (no fully-connected head).
Builds a ZFNet with the paper-cited Zeiler & Fergus 2014
topology: five convolutional blocks with a tightened
stride-2 first convolution and a
stride-2 second convolution (versus AlexNet's
stride-4 and stride-1). Approximately 62 M
parameters in the full classifier variant — the topology difference
versus AlexNet does not change the headline parameter count.
Model Size
Parameters
pretrainedbool= False**overridesobject= {}ZFNetConfig (e.g.
in_channels=1 for grayscale inputs).Returns
ZFNetBackbone with the ZFNet configuration applied (or with
overrides merged on top of it).
Notes
See Zeiler & Fergus, "Visualizing and Understanding Convolutional Networks", ECCV 2014. The paper reports a top-5 ImageNet validation error of 11.7% — an improvement over AlexNet's 15.3% achieved with essentially the same parameter count by retuning the first two conv layers based on deconvolutional-network visualisations. ZFNet is a single architecture; there are no paper-cited size variants (H11).
Examples
>>> import lucid
>>> from lucid.models.vision.zfnet import zfnet
>>> model = zfnet()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape # (B, 256, 6, 6)
(1, 256, 6, 6)