EfficientNet
PretrainedModelBackboneMixinEfficientNet(config: EfficientNetConfig)EfficientNet feature-extracting backbone (no classification head).
Implements the compound-scaled topology from Tan & Le, "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks", ICML 2019 (arXiv:1905.11946). The baseline (B0) is a NAS-designed network of MBConv blocks — inverted-residual bottlenecks (MobileNet-v2 style) augmented with a squeeze-and-excitation module and the swish (SiLU) activation. Successive B-variants (B0 through B7) apply the paper's compound-scaling rule
to scale depth, width, and resolution jointly along a single coefficient .
The body is a 3×3 stem (stride 2) followed by seven MBConv
stages and a final 1×1 head expansion to round(1280 · width_mult) channels. Stochastic depth (drop_connect_rate)
is applied linearly across blocks as a strong regulariser at
large depth.
Parameters
configEfficientNetConfigefficientnet_b0 through efficientnet_b7)
for paper-cited variants.Attributes
configEfficientNetConfigfeaturesnn.Sequentialconfig.width_mult and
config.depth_mult.avgpoolnn.AdaptiveAvgPool2d(B, C, 1, 1).feature_infolist[FeatureInfo]BackboneMixin for downstream FPN / decoder
modules.Notes
Each MBConv block applies
with a residual when stride is 1 and channel counts match.
During training the residual branch is randomly dropped with
probability drop_connect_rate * block_idx / (total - 1) —
deeper blocks get a higher drop probability, matching the
"deep network regularisation" recipe of stochastic depth.
Examples
Build an EfficientNet-B0 backbone and run a forward pass:
>>> import lucid
>>> from lucid.models.vision.efficientnet import efficientnet_b0
>>> backbone = efficientnet_b0()
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = backbone(x)
>>> out.last_hidden_state.shape
(2, 1280, 1, 1)Used by 2
Constructors
1Properties
1feature_info: list[FeatureInfo]Instance methods
2forward(x: Tensor)Parameters
featuresReturns
BaseModelOutputFused [P3_out, P4_out, P5_out, P6_out, P7_out].