timm documentation

MobileNet-V3

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

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

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

FeatureMobileNetV3
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

ArchitectureParams (M)GMACsInput sizePretrained weights
fbnetv3_b8.600.422241
fbnetv3_d10.310.522241
fbnetv3_g16.621.282401
lcnet_0351.640.032240
lcnet_0501.880.052241
lcnet_0752.360.102241
lcnet_1002.950.162241
lcnet_1504.500.342240
mobilenetv3_large_0753.990.162240
mobilenetv3_large_1005.480.232244
mobilenetv3_large_150d14.621.032561
mobilenetv3_rw5.480.232241
mobilenetv3_small_0501.590.032241
mobilenetv3_small_0752.040.052241
mobilenetv3_small_1002.540.062241
mobilenetv4_conv_aa_large32.599.634484
mobilenetv4_conv_aa_medium9.721.582560
mobilenetv4_conv_blur_medium9.721.222241
mobilenetv4_conv_large32.596.433842
mobilenetv4_conv_medium9.721.102566
mobilenetv4_conv_small3.770.192243
mobilenetv4_conv_small_0351.910.052240
mobilenetv4_conv_small_0502.240.072241
mobilenetv4_hybrid_large37.767.773842
mobilenetv4_hybrid_large_07522.752.062560
mobilenetv4_hybrid_medium11.071.292565
mobilenetv4_hybrid_medium_0757.310.662240
tf_mobilenetv3_large_0753.990.162241
tf_mobilenetv3_large_1005.480.232241
tf_mobilenetv3_large_minimal_1003.920.222241
tf_mobilenetv3_small_0752.040.052241
tf_mobilenetv3_small_1002.540.062241
tf_mobilenetv3_small_minimal_1002.040.062241

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

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
fbnetv3_b.ra2_in1k224 (test 256)79.1542561000apache-2.0timm
fbnetv3_d.ra2_in1k224 (test 256)79.6822561000apache-2.0timm
fbnetv3_g.ra2_in1k240 (test 288)82.0342881000apache-2.0timm
lcnet_050.ra2_in1k22463.1382241000apache-2.0timm
lcnet_075.ra2_in1k22468.7862241000apache-2.0timm
lcnet_100.ra2_in1k22472.1302241000apache-2.0timm

ix tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
mobilenetv4_hybrid_large.ix_e600_r384_in1k384 (test 448)84.3524481000apache-2.0timm
mobilenetv4_hybrid_medium.ix_e550_r256_in1k256 (test 320)82.5003201000apache-2.0timm
mobilenetv4_hybrid_medium.ix_e550_r384_in1k384 (test 448)83.3904481000apache-2.0timm

lamb tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
mobilenetv3_small_050.lamb_in1k22457.9182241000apache-2.0timm
mobilenetv3_small_075.lamb_in1k22465.2842241000apache-2.0timm
mobilenetv3_small_100.lamb_in1k22467.6362241000apache-2.0timm

ra4 tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
mobilenetv3_large_100.ra4_e3600_r224_in1k224 (test 256)77.1822561000apache-2.0timm
mobilenetv3_large_150d.ra4_e3600_r256_in1k256 (test 320)81.8323201000apache-2.0timm

ImageNet-21K Pretraining for the Masses

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

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
mobilenetv3_large_100.miil_in21k224--11221apache-2.0timm
mobilenetv3_large_100.miil_in21k_ft_in1k22477.9202241000apache-2.0timm

Other

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
mobilenetv3_large_100.ra_in1k22475.7842241000apache-2.0timm
mobilenetv3_rw.rmsp_in1k22475.6162241000apache-2.0timm
mobilenetv4_conv_aa_large.e230_r384_in12k384 (test 448)--11821apache-2.0timm
mobilenetv4_conv_aa_large.e230_r384_in12k_ft_in1k384 (test 480)84.7724801000apache-2.0timm
mobilenetv4_conv_aa_large.e230_r448_in12k_ft_in1k448 (test 544)84.9905441000apache-2.0timm
mobilenetv4_conv_aa_large.e600_r384_in1k384 (test 480)83.8264801000apache-2.0timm
mobilenetv4_conv_blur_medium.e500_r224_in1k224 (test 256)80.1522561000apache-2.0timm
mobilenetv4_conv_large.e500_r256_in1k256 (test 320)82.6723201000apache-2.0timm
mobilenetv4_conv_large.e600_r384_in1k384 (test 448)83.4184481000apache-2.0timm
mobilenetv4_conv_medium.e180_ad_r384_in12k384--11821apache-2.0timm
mobilenetv4_conv_medium.e180_r384_in12k384--11821apache-2.0timm
mobilenetv4_conv_medium.e250_r384_in12k384--11821apache-2.0timm
mobilenetv4_conv_medium.e250_r384_in12k_ft_in1k38482.7763841000apache-2.0timm
mobilenetv4_conv_medium.e500_r224_in1k224 (test 256)79.8362561000apache-2.0timm
mobilenetv4_conv_medium.e500_r256_in1k256 (test 320)80.8903201000apache-2.0timm
mobilenetv4_conv_small.e1200_r224_in1k224 (test 256)74.2822561000apache-2.0timm
mobilenetv4_conv_small.e2400_r224_in1k224 (test 256)74.6442561000apache-2.0timm
mobilenetv4_conv_small.e3600_r256_in1k256 (test 320)75.6163201000apache-2.0timm
mobilenetv4_conv_small_050.e3000_r224_in1k224 (test 256)65.8262561000apache-2.0timm
mobilenetv4_hybrid_large.e600_r384_in1k384 (test 448)84.2644481000apache-2.0timm
mobilenetv4_hybrid_medium.e200_r256_in12k256 (test 320)--11821apache-2.0timm
mobilenetv4_hybrid_medium.e200_r256_in12k_ft_in1k256 (test 320)82.9983201000apache-2.0timm
mobilenetv4_hybrid_medium.e500_r224_in1k224 (test 256)81.2842561000apache-2.0timm
tf_mobilenetv3_large_075.in1k22473.4422241000apache-2.0timm
tf_mobilenetv3_large_100.in1k22475.5102241000apache-2.0timm
tf_mobilenetv3_large_minimal_100.in1k22472.2702241000apache-2.0timm
tf_mobilenetv3_small_075.in1k22465.7062241000apache-2.0timm
tf_mobilenetv3_small_100.in1k22467.9222241000apache-2.0timm
tf_mobilenetv3_small_minimal_100.in1k22462.8922241000apache-2.0timm
Update on GitHub