See our collection for all versions of MobileNetV4.

Run MobileNetV4 with Keras 3: JAX, PyTorch, or TensorFlow

GitHub Docs Collection

zeromodels/mobilenetv4_conv_large_e600_r384_in1k

Paper: MobileNetV4 - Universal Models for the Mobile Ecosystem (arXiv:2404.10518) · HF Papers

MobileNetV4 (MNv4) refines the MobileNet line with the Universal Inverted Bottleneck (UIB) block; the hybrid variants add a Mobile Multi-Query Attention (Mobile MQA) block. Use as an ImageNet classifier or a 5-stage backbone.

For more details on the model, please go to the upstream model card.

Pure-Keras 3 conversion of timm/mobilenetv4_conv_large.e600_r384_in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.

This is an image-classification / backbone checkpoint (MobileNetV4ImageClassify / MobileNetV4Model).

✨ Quick start

import os

os.environ["KERAS_BACKEND"] = "torch"  # or "jax" / "tensorflow"

from PIL import Image
from zeromodels.models.mobilenetv4 import MobileNetV4ImageClassify, MobileNetV4Model, MobileNetV4ImageProcessor

model = MobileNetV4ImageClassify.from_weights("zeromodels/mobilenetv4_conv_large_e600_r384_in1k")
processor = MobileNetV4ImageProcessor.from_weights("zeromodels/mobilenetv4_conv_large_e600_r384_in1k")

image = Image.open("your_image.jpg").convert("RGB")
pixels = processor(image)  # resize + normalize (normalization lives in the processor)
logits = model(pixels, training=False)
print(logits.shape)  # (1, num_classes)

# Feature extraction: the backbone without the classifier head
backbone = MobileNetV4Model.from_weights("zeromodels/mobilenetv4_conv_large_e600_r384_in1k", as_backbone=True)
features = backbone(pixels, training=False)

Load any MobileNetV4 variant the same way with from_weights("zeromodels/<variant>"):

Variant Hub
mobilenetv4_conv_small_e2400_r224_in1k zeromodels/mobilenetv4_conv_small_e2400_r224_in1k
mobilenetv4_conv_medium_e500_r256_in1k zeromodels/mobilenetv4_conv_medium_e500_r256_in1k
mobilenetv4_conv_large_e600_r384_in1k zeromodels/mobilenetv4_conv_large_e600_r384_in1k
mobilenetv4_hybrid_medium_e500_r224_in1k zeromodels/mobilenetv4_hybrid_medium_e500_r224_in1k
mobilenetv4_hybrid_large_e600_r384_in1k zeromodels/mobilenetv4_hybrid_large_e600_r384_in1k

Tips

  • Set KERAS_BACKEND before importing Keras / zeromodels.
  • Pass raw [0, 255] images: the classifier normalizes internally (ImageNet mean/std).
  • MobileNetV4ImageClassify returns class logits; MobileNetV4Model returns features (as_backbone=True for the 5 stride-2 stages).
  • See docs and Loading Weights.
  • Upstream / timm checkpoints: MobileNetV4ImageClassify.from_weights("hf:timm/mobilenetv4_conv_large.e600_r384_in1k").

Special Thanks

A huge thank you to the MobileNetV4 authors and the timm / Hub communities for creating and releasing these models.

License: see YAML license (matches the upstream timm/mobilenetv4_conv_large.e600_r384_in1k checkpoint, Apache-2.0).

Downloads last month
35
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for zeromodels/mobilenetv4_conv_large_e600_r384_in1k

Finetuned
(1)
this model

Collection including zeromodels/mobilenetv4_conv_large_e600_r384_in1k

Paper for zeromodels/mobilenetv4_conv_large_e600_r384_in1k