efficientnet_b0_cls(pretrained: bool | str = False, weights: EfficientNetB0Weights | None = None, overrides: object = {})EfficientNet-B0 image classifier (backbone + GAP + linear head).
Builds an EfficientNetForImageClassification with the
NAS-designed B0 topology followed by global average pooling,
dropout (), and a linear projection to
config.num_classes (default 1000 for ImageNet-1k).
Approximately 5.3M parameters and 77.1% ImageNet-1k top-1
accuracy at 224×224 (Tan & Le, 2019, Table 2).
Model Size
Parameters
pretrainedbool or str= FalseFalse → random init; True
→ the DEFAULT tag
(EfficientNetB0Weights.IMAGENET1K_V1); a tag string
(e.g. "IMAGENET1K_V1") → that specific checkpoint.
Mutually exclusive with weights (which wins if both given).EfficientNetB0Weights.IMAGENET1K_V1. Takes precedence over
pretrained.**overridesobject= {}EfficientNetConfig
(typically num_classes to retarget the classifier).
Overriding num_classes away from the checkpoint's class
count makes pretrained loading fail the strict key/shape check.Returns
EfficientNetForImageClassificationClassifier with the B0 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_B0_Weights and hosted on the
Hugging Face Hub under lucid-dl/efficientnet-b0.
Examples
>>> import lucid
>>> from lucid.models.vision.efficientnet import efficientnet_b0_cls
>>> model = efficientnet_b0_cls(num_classes=10)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 10)
Load ImageNet-pretrained weights:
>>> model = efficientnet_b0_cls(pretrained=True) # DEFAULT tag