ZFNet feature-extracting backbone (no fully-connected head).
Implements the five-stage convolutional trunk from Zeiler & Fergus, "Visualizing and Understanding Convolutional Networks", ECCV 2014. ZFNet is best understood as an AlexNet that was retuned by inspecting what each filter had learned: the deconvolutional- network visualisation technique introduced in the same paper revealed that AlexNet's stride-4 first convolution was producing a mixture of extremely high-frequency and dead filters, and that its stride-2 second convolution was introducing aliasing artefacts. Both layers were tightened accordingly — Conv1 became stride-2, Conv2 kept but with stride 2 — while the remaining layers retain AlexNet's topology.
Parameters
configZFNetConfigzfnet for the paper-cited
configuration; pass a custom config to override input channel
count or dropout strength.Attributes
configZFNetConfigfeaturesnn.Sequentiallucid.nn.LocalResponseNorm
after blocks 1 and 2 and max-pools after blocks
1, 2, 5 — see _build_features for the exact layer chain.avgpoolnn.AdaptiveAvgPool2dfeature_infolist[FeatureInfo]BackboneMixin.Notes
From Zeiler & Fergus, "Visualizing and Understanding Convolutional Networks", ECCV 2014. The paper reports a single-model top-5 ImageNet validation error of 16.5% for a single net (Table 2), an improvement of roughly four percentage points over the published AlexNet number, achieved with essentially the same parameter and FLOP budget. More important than the accuracy gain was the methodology: ZFNet popularised using interpretability tooling to diagnose and fix early-layer problems, an idea that propagates directly to every later vision- saliency / Grad-CAM-style analysis.
Examples
>>> import lucid
>>> from lucid.models.vision.zfnet import zfnet
>>> backbone = zfnet()
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = backbone(x)
>>> out.last_hidden_state.shape # (B, 256, 6, 6)
(2, 256, 6, 6)