Skip to content
fn

efficientnet_b2_cls

→EfficientNetForImageClassification
efficientnet_b2_cls(pretrained: bool | str = False, weights: EfficientNetB2Weights | None = None, overrides: object = {})

EfficientNet-B2 image classifier (backbone + GAP + linear head).

Builds an EfficientNetForImageClassification with the B2 compound-scaling configuration (width × 1.1, depth × 1.2) followed by dropout (p=0.3p = 0.3) and a linear classifier. Approximately 9.2M parameters and 80.1% ImageNet-1k top-1 accuracy at 260×260 (Tan & Le, 2019, Table 2).

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag (EfficientNetB2Weights.IMAGENET1K_V1); a tag string → that specific checkpoint. Mutually exclusive with weights.
weights(EfficientNetB2Weights, optional, keyword - only)= None
Explicit weights enum member. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides forwarded into EfficientNetConfig.

Returns

EfficientNetForImageClassification

Classifier with the B2 configuration applied (or with overrides merged on top of it), optionally initialised from pretrained weights.

Notes

See Tan & Le, "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks", ICML 2019 (arXiv:1905.11946), Table 2. Pretrained weights are converted from the reference-framework EfficientNet_B2_Weights and hosted under lucid-dl/efficientnet-b2.

Examples

>>> import lucid
>>> from lucid.models.vision.efficientnet import efficientnet_b2_cls
>>> model = efficientnet_b2_cls(pretrained=True)
>>> x = lucid.randn(1, 3, 260, 260)
>>> out = model(x)
>>> out.logits.shape
(1, 1000)

Used by 1