opensi·si

timm/models/mobilenetv3.py

MobileNet-V3

Category: Efficient/Mobile · Code: timm/models/mobilenetv3.py · Architectures: 33 · Pretrained weights: 45 (39 with ImageNet-1k results)

MobileNet-V3 and the related networks built on the same MobileNetV3 class: MobileNet-V4, LCNet (PP-LCNet), FBNet-V3 and TensorFlow ported MobileNet-V3 weights (tf_*).

Papers

  • Searching for MobileNetV3
  • FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining
  • PP-LCNet: A Lightweight CPU Convolutional Neural Network
  • MobileNetV4 -- Universal Models for the Mobile Ecosystem
  • ImageNet-21K Pretraining for the Masses

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('mobilenetv4_conv_aa_large.e230_r384_in12k_ft_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

Feature MobileNetV3
features_only=True feature maps ✓ (strides 2, 4, 8, 16, 32)
forward_intermediates() ✓
prune_intermediate_layers() ✓
Any input size, no changes needed ✓
set_input_size() –
dynamic_img_size=True –
set_grad_checkpointing() ✓
Layer-wise LR decay (group_matcher()) ✓
reset_classifier() ✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (MobileNetV3 with mobilenetv3_small_050 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

جدول (34 صفًا)
Architecture Params (M) GMACs Input size Pretrained weights
fbnetv3_b 8.60 0.42 224 1
fbnetv3_d 10.31 0.52 224 1
fbnetv3_g 16.62 1.28 240 1
lcnet_035 1.64 0.03 224 0
lcnet_050 1.88 0.05 224 1
lcnet_075 2.36 0.10 224 1
lcnet_100 2.95 0.16 224 1
lcnet_150 4.50 0.34 224 0
mobilenetv3_large_075 3.99 0.16 224 0
mobilenetv3_large_100 5.48 0.23 224 4
mobilenetv3_large_150d 14.62 1.03 256 1
mobilenetv3_rw 5.48 0.23 224 1
mobilenetv3_small_050 1.59 0.03 224 1
mobilenetv3_small_075 2.04 0.05 224 1
mobilenetv3_small_100 2.54 0.06 224 1
mobilenetv4_conv_aa_large 32.59 9.63 448 4
mobilenetv4_conv_aa_medium 9.72 1.58 256 0
mobilenetv4_conv_blur_medium 9.72 1.22 224 1
mobilenetv4_conv_large 32.59 6.43 384 2
mobilenetv4_conv_medium 9.72 1.10 256 6
mobilenetv4_conv_small 3.77 0.19 224 3
mobilenetv4_conv_small_035 1.91 0.05 224 0
mobilenetv4_conv_small_050 2.24 0.07 224 1
mobilenetv4_hybrid_large 37.76 7.77 384 2
mobilenetv4_hybrid_large_075 22.75 2.06 256 0
mobilenetv4_hybrid_medium 11.07 1.29 256 5
mobilenetv4_hybrid_medium_075 7.31 0.66 224 0
tf_mobilenetv3_large_075 3.99 0.16 224 1
tf_mobilenetv3_large_100 5.48 0.23 224 1
tf_mobilenetv3_large_minimal_100 3.92 0.22 224 1
tf_mobilenetv3_small_075 2.04 0.05 224 1
tf_mobilenetv3_small_100 2.54 0.06 224 1
tf_mobilenetv3_small_minimal_100 2.04 0.06 224 1

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

Weights are grouped by source: the paper or origin given in the pretrained config, else a Hub organization other than timm, else the first part of the pretrained tag (architecture.tag). Sources with a single weight are listed under other.

ra2 tags

Weight Input size Top-1 (%) Eval size Classes License Hub
fbnetv3_b.ra2_in1k 224 (test 256) 79.154 256 1000 apache-2.0 timm
fbnetv3_d.ra2_in1k 224 (test 256) 79.682 256 1000 apache-2.0 timm
fbnetv3_g.ra2_in1k 240 (test 288) 82.034 288 1000 apache-2.0 timm
lcnet_050.ra2_in1k 224 63.138 224 1000 apache-2.0 timm
lcnet_075.ra2_in1k 224 68.786 224 1000 apache-2.0 timm
lcnet_100.ra2_in1k 224 72.130 224 1000 apache-2.0 timm

ix tags

Weight Input size Top-1 (%) Eval size Classes License Hub
mobilenetv4_hybrid_large.ix_e600_r384_in1k 384 (test 448) 84.352 448 1000 apache-2.0 timm
mobilenetv4_hybrid_medium.ix_e550_r256_in1k 256 (test 320) 82.500 320 1000 apache-2.0 timm
mobilenetv4_hybrid_medium.ix_e550_r384_in1k 384 (test 448) 83.390 448 1000 apache-2.0 timm

lamb tags

Weight Input size Top-1 (%) Eval size Classes License Hub
mobilenetv3_small_050.lamb_in1k 224 57.918 224 1000 apache-2.0 timm
mobilenetv3_small_075.lamb_in1k 224 65.284 224 1000 apache-2.0 timm
mobilenetv3_small_100.lamb_in1k 224 67.636 224 1000 apache-2.0 timm

ra4 tags

Weight Input size Top-1 (%) Eval size Classes License Hub
mobilenetv3_large_100.ra4_e3600_r224_in1k 224 (test 256) 77.182 256 1000 apache-2.0 timm
mobilenetv3_large_150d.ra4_e3600_r256_in1k 256 (test 320) 81.832 320 1000 apache-2.0 timm

ImageNet-21K Pretraining for the Masses

Pretrained configs reference ImageNet-21K Pretraining for the Masses.

Weight Input size Top-1 (%) Eval size Classes License Hub
mobilenetv3_large_100.miil_in21k 224 - - 11221 apache-2.0 timm
mobilenetv3_large_100.miil_in21k_ft_in1k 224 77.920 224 1000 apache-2.0 timm

Other

جدول (30 صفًا)
Weight Input size Top-1 (%) Eval size Classes License Hub
mobilenetv3_large_100.ra_in1k 224 75.784 224 1000 apache-2.0 timm
mobilenetv3_rw.rmsp_in1k 224 75.616 224 1000 apache-2.0 timm
mobilenetv4_conv_aa_large.e230_r384_in12k 384 (test 448) - - 11821 apache-2.0 timm
mobilenetv4_conv_aa_large.e230_r384_in12k_ft_in1k 384 (test 480) 84.772 480 1000 apache-2.0 timm
mobilenetv4_conv_aa_large.e230_r448_in12k_ft_in1k 448 (test 544) 84.990 544 1000 apache-2.0 timm
mobilenetv4_conv_aa_large.e600_r384_in1k 384 (test 480) 83.826 480 1000 apache-2.0 timm
mobilenetv4_conv_blur_medium.e500_r224_in1k 224 (test 256) 80.152 256 1000 apache-2.0 timm
mobilenetv4_conv_large.e500_r256_in1k 256 (test 320) 82.672 320 1000 apache-2.0 timm
mobilenetv4_conv_large.e600_r384_in1k 384 (test 448) 83.418 448 1000 apache-2.0 timm
mobilenetv4_conv_medium.e180_ad_r384_in12k 384 - - 11821 apache-2.0 timm
mobilenetv4_conv_medium.e180_r384_in12k 384 - - 11821 apache-2.0 timm
mobilenetv4_conv_medium.e250_r384_in12k 384 - - 11821 apache-2.0 timm
mobilenetv4_conv_medium.e250_r384_in12k_ft_in1k 384 82.776 384 1000 apache-2.0 timm
mobilenetv4_conv_medium.e500_r224_in1k 224 (test 256) 79.836 256 1000 apache-2.0 timm
mobilenetv4_conv_medium.e500_r256_in1k 256 (test 320) 80.890 320 1000 apache-2.0 timm
mobilenetv4_conv_small.e1200_r224_in1k 224 (test 256) 74.282 256 1000 apache-2.0 timm
mobilenetv4_conv_small.e2400_r224_in1k 224 (test 256) 74.644 256 1000 apache-2.0 timm
mobilenetv4_conv_small.e3600_r256_in1k 256 (test 320) 75.616 320 1000 apache-2.0 timm
mobilenetv4_conv_small_050.e3000_r224_in1k 224 (test 256) 65.826 256 1000 apache-2.0 timm
mobilenetv4_hybrid_large.e600_r384_in1k 384 (test 448) 84.264 448 1000 apache-2.0 timm
mobilenetv4_hybrid_medium.e200_r256_in12k 256 (test 320) - - 11821 apache-2.0 timm
mobilenetv4_hybrid_medium.e200_r256_in12k_ft_in1k 256 (test 320) 82.998 320 1000 apache-2.0 timm
mobilenetv4_hybrid_medium.e500_r224_in1k 224 (test 256) 81.284 256 1000 apache-2.0 timm
tf_mobilenetv3_large_075.in1k 224 73.442 224 1000 apache-2.0 timm
tf_mobilenetv3_large_100.in1k 224 75.510 224 1000 apache-2.0 timm
tf_mobilenetv3_large_minimal_100.in1k 224 72.270 224 1000 apache-2.0 timm
tf_mobilenetv3_small_075.in1k 224 65.706 224 1000 apache-2.0 timm
tf_mobilenetv3_small_100.in1k 224 67.922 224 1000 apache-2.0 timm
tf_mobilenetv3_small_minimal_100.in1k 224 62.892 224 1000 apache-2.0 timm

Source and license

Source: timm documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.