Skip to content
fn

mobilenet_v4_conv_small_cls

→MobileNetV4ForImageClassification3.8M
mobilenet_v4_conv_small_cls(pretrained: bool | str = False, weights: MobileNetV4ConvSmallWeights | None = None, overrides: object = {})

MobileNet-v4-Conv-Small image classifier.

Builds a MobileNetV4ForImageClassification with the Conv-Small architecture (Qin et al., 2024, Appendix D, Table 11) and the post-pool head (960 → 1280 → classes). 3.77 M parameters; Table 6 reports 73.8% ImageNet-1k top-1 at 3.8 M parameters and 0.2 G MACs. Classifier dropout defaults to the paper's 0.3 (Table 10).

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag (MobileNetV4ConvSmallWeights.E2400_R224_IN1K); a tag string (e.g. "E2400_R224_IN1K") → that specific checkpoint. Mutually exclusive with weights (which wins if both are given).
weights(MobileNetV4ConvSmallWeights, optional, keyword - only)= None
Explicit weights enum member, e.g. MobileNetV4ConvSmallWeights.E2400_R224_IN1K. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides merged into MobileNetV4Config (typically num_classes to retarget the head). Overriding num_classes away from the checkpoint's 1000 makes pretrained loading fail the strict key/shape check — load with the matching head, then call reset_classifier.

Returns

MobileNetV4ForImageClassification

Classifier with the Conv-Small configuration (plus overrides), optionally initialised from pretrained weights.

Notes

Qin et al., "MobileNetV4: Universal Models for the Mobile Ecosystem", ECCV 2024 (arXiv:2404.10518). Parameter names match timm's implementation, so its ImageNet-1k checkpoints load with an identity key map. The paper evaluates this variant at 224x224.

Pretrained weights are converted from timm's mobilenetv4_conv_small.e2400_r224_in1k — timm's own ImageNet-1k training of this architecture, trained at 224x224; the authors released none — and hosted on the Hugging Face Hub under lucid-dl/mobilenet-v4-conv-small. timm reports 73.756% top-1 / 91.430% top-5 for it at 224x224 with the preset that MobileNetV4ConvSmallWeights.E2400_R224_IN1K.transforms reproduces (224 crop, 256 resize, bicubic, ImageNet mean/std).

Examples

>>> import lucid
>>> from lucid.models.vision.mobilenet_v4 import mobilenet_v4_conv_small_cls
>>> model = mobilenet_v4_conv_small_cls(num_classes=10).eval()
>>> model(lucid.randn(2, 3, 224, 224)).logits.shape
(2, 10)
Load ImageNet-pretrained weights:
>>> model = mobilenet_v4_conv_small_cls(pretrained=True)
>>> from lucid.models.weights import MobileNetV4ConvSmallWeights
>>> model = mobilenet_v4_conv_small_cls(
...     weights=MobileNetV4ConvSmallWeights.E2400_R224_IN1K
... )

Used by 1