mobilenet_v3_small_cls(pretrained: bool | str = False, weights: MobileNetV3SmallWeights | None = None, overrides: object = {})MobileNet-v3-Small image classifier with the redesigned head.
Builds a MobileNetV3ForImageClassification with the
Small topology (Howard et al., 2019) plus the redesigned
inverted classification head. Approximately 2.9M parameters
and 67.4% ImageNet-1k top-1 accuracy (Table 3) — the
latency-focused variant of the family.
Model Size
Parameters
pretrainedbool or str= FalsePretrained-weight selector.
False → random init; True
→ the DEFAULT tag
(MobileNetV3SmallWeights.IMAGENET1K_V1); a tag string →
that specific checkpoint. Mutually exclusive with weights
(which wins if both are given).Explicit weights enum member. Takes precedence over
pretrained.**overridesobject= {}Keyword overrides forwarded into
MobileNetV3Config.Returns
MobileNetV3ForImageClassificationClassifier with the MobileNet-v3-Small configuration applied
(or with overrides merged on top of it), optionally
initialised from pretrained weights.
Notes
See Howard et al., "Searching for MobileNetV3", ICCV 2019
(arXiv:1905.02244), Table 2 and Table 3. Pretrained weights are
converted from torchvision's MobileNet_V3_Small_Weights and
hosted on the Hugging Face Hub under lucid-dl/mobilenet-v3-small.
Examples
>>> import lucid
>>> from lucid.models.vision.mobilenet_v3 import mobilenet_v3_small_cls
>>> model = mobilenet_v3_small_cls()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(1, 1000)
Load ImageNet-pretrained weights:
>>> model = mobilenet_v3_small_cls(pretrained=True)
>>> from lucid.models.weights import MobileNetV3SmallWeights
>>> model = mobilenet_v3_small_cls(weights=MobileNetV3SmallWeights.IMAGENET1K_V1)