Mobile and Embedded Vision Applications Network series

December 7, 2021 ยท View on GitHub


Catalogue

1. Overview

MobileNetV1 is a network launched by Google in 2017 for use on mobile devices or embedded devices. The network replaces the depthwise separable convolution with the traditional convolution operation, that is, the combination of depthwise convolution and pointwise convolution. Compared with the traditional convolution operation, this combination can greatly save the number of parameters and computation. At the same time, MobileNetV1 can also be used for object detection, image segmentation and other visual tasks.

MobileNetV2 is a lightweight network proposed by Google following MobileNetV1. Compared with MobileNetV1, MobileNetV2 proposed Linear bottlenecks and Inverted residual block as a basic network structures, to constitute MobileNetV2 network architecture through stacking these basic module a lot. In the end, higher classification accuracy was achieved when FLOPs was only half of MobileNetV1.

The ShuffleNet series network is the lightweight network structure proposed by MEGVII. So far, there are two typical structures in this series network, namely, ShuffleNetV1 and ShuffleNetV2. A Channel Shuffle operation in ShuffleNet can exchange information between groups and perform end-to-end training. In the paper of ShuffleNetV2, the author proposes four criteria for designing lightweight networks, and designs the ShuffleNetV2 network according to the four criteria and the shortcomings of ShuffleNetV1.

MobileNetV3 is a new and lightweight network based on NAS proposed by Google in 2019. In order to further improve the effect, the activation functions of relu and sigmoid were replaced with hard_swish and hard_sigmoid activation functions, and some improved strategies were introduced to reduce the amount of network computing.

GhosttNet is a brand-new lightweight network structure proposed by Huawei in 2020. By introducing the ghost module, the problem of redundant calculation of features in traditional deep networks is greatly alleviated, which greatly reduces the amount of network parameters and calculations.

Currently there are 32 pretrained models of the mobile series open source by PaddleClas, and their indicators are shown in the figure below. As you can see from the picture, newer lightweight models tend to perform better, and MobileNetV3 represents the latest lightweight neural network architecture. In MobileNetV3, the author used 1x1 convolution after global-avg-pooling in order to obtain higher accuracy,this operation significantly increases the number of parameters but has little impact on the amount of computation, so if the model is evaluated from a storage perspective of excellence, MobileNetV3 does not have much advantage, but because of its smaller computation, it has a faster inference speed. In addition, the SSLD distillation model in our model library performs excellently, refreshing the accuracy of the current lightweight model from various perspectives. Due to the complex structure and many branches of the MobileNetV3 model, which is not GPU friendly, the GPU inference speed is not as good as that of MobileNetV1.

2. Accuracy, FLOPs and Parameters

ModelsTop1Top5Reference
top1
Reference
top5
FLOPs
(G)
Parameters
(M)
MobileNetV1_x0_250.5140.7550.5060.0700.460
MobileNetV1_x0_50.6350.8470.6370.2801.310
MobileNetV1_x0_750.6880.8820.6840.6302.550
MobileNetV10.7100.8970.7061.1104.190
MobileNetV1_ssld0.7790.9391.1104.190
MobileNetV2_x0_250.5320.7650.0501.500
MobileNetV2_x0_50.6500.8570.6540.8640.1701.930
MobileNetV2_x0_750.6980.8900.6980.8960.3502.580
MobileNetV20.7220.9070.7180.9100.6003.440
MobileNetV2_x1_50.7410.9171.3206.760
MobileNetV2_x2_00.7520.9262.32011.130
MobileNetV2_ssld0.76740.93390.6003.440
MobileNetV3_large_
x1_25
0.7640.9300.7660.7147.440
MobileNetV3_large_
x1_0
0.7530.9230.7520.4505.470
MobileNetV3_large_
x0_75
0.7310.9110.7330.2963.910
MobileNetV3_large_
x0_5
0.6920.8850.6880.1382.670
MobileNetV3_large_
x0_35
0.6430.8550.6420.0772.100
MobileNetV3_small_
x1_25
0.7070.8950.7040.1953.620
MobileNetV3_small_
x1_0
0.6820.8810.6750.1232.940
MobileNetV3_small_
x0_75
0.6600.8630.6540.0882.370
MobileNetV3_small_
x0_5
0.5920.8150.5800.0431.900
MobileNetV3_small_
x0_35
0.5300.7640.4980.0261.660
MobileNetV3_small_
x0_35_ssld
0.5560.7770.4980.0261.660
MobileNetV3_large_
x1_0_ssld
0.7900.9450.4505.470
MobileNetV3_large_
x1_0_ssld_int8
0.761
MobileNetV3_small_
x1_0_ssld
0.7130.9010.1232.940
ShuffleNetV20.6880.8850.6940.2802.260
ShuffleNetV2_x0_250.4990.7380.0300.600
ShuffleNetV2_x0_330.5370.7710.0400.640
ShuffleNetV2_x0_50.6030.8230.6030.0801.360
ShuffleNetV2_x1_50.7160.9020.7260.5803.470
ShuffleNetV2_x2_00.7320.9120.7491.1207.320
ShuffleNetV2_swish0.7000.8920.2902.260
GhostNet_x0_50.6680.8690.6620.8660.0822.600
GhostNet_x1_00.7400.9160.7390.9140.2945.200
GhostNet_x1_30.7570.9250.7570.9270.4407.300
GhostNet_x1_3_ssld0.7940.9450.7570.9270.4407.300

3. Inference speed and storage size based on SD855

ModelsBatch Size=1(ms)Storage Size(M)
MobileNetV1_x0_253.2201.900
MobileNetV1_x0_59.5805.200
MobileNetV1_x0_7519.43610.000
MobileNetV132.52316.000
MobileNetV1_ssld32.52316.000
MobileNetV2_x0_253.7996.100
MobileNetV2_x0_58.7027.800
MobileNetV2_x0_7515.53110.000
MobileNetV223.31814.000
MobileNetV2_x1_545.62426.000
MobileNetV2_x2_074.29243.000
MobileNetV2_ssld23.31814.000
MobileNetV3_large_x1_2528.21829.000
MobileNetV3_large_x1_019.30821.000
MobileNetV3_large_x0_7513.56516.000
MobileNetV3_large_x0_57.49311.000
MobileNetV3_large_x0_355.1378.600
MobileNetV3_small_x1_259.27514.000
MobileNetV3_small_x1_06.54612.000
MobileNetV3_small_x0_755.2849.600
MobileNetV3_small_x0_53.3527.800
MobileNetV3_small_x0_352.6356.900
MobileNetV3_small_x0_35_ssld2.6356.900
MobileNetV3_large_x1_0_ssld19.30821.000
MobileNetV3_large_x1_0_ssld_int814.39510.000
MobileNetV3_small_x1_0_ssld6.54612.000
ShuffleNetV210.9419.000
ShuffleNetV2_x0_252.3292.700
ShuffleNetV2_x0_332.6432.800
ShuffleNetV2_x0_54.2615.600
ShuffleNetV2_x1_519.35214.000
ShuffleNetV2_x2_034.77028.000
ShuffleNetV2_swish16.0239.100
GhostNet_x0_55.71410.000
GhostNet_x1_013.55820.000
GhostNet_x1_319.98229.000
GhostNet_x1_3_ssld19.98229.000

4. Inference speed based on T4 GPU

ModelsFP16
Batch Size=1
(ms)
FP16
Batch Size=4
(ms)
FP16
Batch Size=8
(ms)
FP32
Batch Size=1
(ms)
FP32
Batch Size=4
(ms)
FP32
Batch Size=8
(ms)
MobileNetV1_x0_250.684221.130211.720950.672741.2261.84096
MobileNetV1_x0_50.693261.090271.847460.699471.430452.39353
MobileNetV1_x0_750.67931.295242.154950.798441.862053.064
MobileNetV10.719421.450182.479530.911642.268713.90797
MobileNetV1_ssld0.719421.450182.479530.911642.268713.90797
MobileNetV2_x0_252.853993.624054.299522.819893.526954.2432
MobileNetV2_x0_52.842583.15114.102672.802643.652844.31737
MobileNetV2_x0_752.821833.276224.981612.865383.551985.10678
MobileNetV22.786033.719826.278792.623983.544296.41178
MobileNetV2_x1_52.818524.874348.979342.793985.301499.30899
MobileNetV2_x2_03.651976.3232911.6443.297887.0864412.45375
MobileNetV2_ssld2.786033.719826.278792.623983.544296.41178
MobileNetV3_large_x1_252.343873.161034.797422.351173.449035.45658
MobileNetV3_large_x1_02.201493.084234.077792.042962.93224.53184
MobileNetV3_large_x0_752.10582.614263.610212.00062.569873.78005
MobileNetV3_large_x0_52.069342.773413.353132.111992.881723.19029
MobileNetV3_large_x0_352.149652.78683.361451.90412.629513.26036
MobileNetV3_small_x1_252.068172.901933.52452.029162.918663.34528
MobileNetV3_small_x1_01.739332.594783.402761.745272.635653.28124
MobileNetV3_small_x0_751.806172.646463.245131.936972.642853.32797
MobileNetV3_small_x0_51.950012.740143.394851.884062.996013.3908
MobileNetV3_small_x0_352.106832.942673.442541.944272.941163.41082
MobileNetV3_small_x0_35_ssld2.106832.942673.442541.944272.941163.41082
MobileNetV3_large_x1_0_ssld2.201493.084234.077792.042962.93224.53184
MobileNetV3_small_x1_0_ssld1.739332.594783.402761.745272.635653.28124
ShuffleNetV21.950642.159282.971691.894362.263393.17615
ShuffleNetV2_x0_251.432422.381722.967681.486982.290852.90284
ShuffleNetV2_x0_331.690082.657062.973731.755262.855573.09688
ShuffleNetV2_x0_51.480732.281742.854361.590552.187083.09141
ShuffleNetV2_x1_51.510542.45653.417381.453892.52033.99872
ShuffleNetV2_x2_01.956162.447514.191732.156543.182475.46893
ShuffleNetV2_swish2.502132.928813.4742.51292.974223.69357
GhostNet_x0_52.644923.484734.488442.361153.528023.89444
GhostNet_x1_02.631203.920654.482962.570423.562964.85524
GhostNet_x1_32.897153.803294.816612.818103.720715.92269