# MobileNetV2 - pretrained

MobileNets are a family of neural network architectures released by Google to be used on machines with limited computing power, like mobile devices. They strive to provide state of the art accuracy, while requiring as little memory and computing power as possible. This makes them a very fast family of networks to use for image processing.

MobileNets achieve this performance by reducing dramatically the number of learnable parameters, which also makes them faster and easier to train compared to more traditional networks.

MobileNetV2 builds upon the ideas from MobileNetV1.

## MobileNetV2 architecture

MobileNetV2 uses:

• Depthwise separable convolutions

• Width multiplier

• Linear bottlenecks and shortcut connections

### Depthwise separable convolutions

MobileNet models are built with depthwise separable convolutions, which split a standard convolution into:

• A depthwise convolution that convolves single filter with each input channel

• A pointwise convolution that performs the weighted sum of the convolution outputs

A standard 2D Convolution performs both operations in one step, and doesn’t weigh the contribution of each convolution in the final sum.

By using weighted sums, the depthwise separable convolutions can express more features from less convolution parameters.

#### Example

Given an image of shape 28x28x3 and 64 convolutional kernels of size 3x3,
Normal convolution (with padding and stride=1) takes 3*3*3*64*28*28=1354752 multiplications, while a
Depthwise separable convolution takes 3*3*3*28*28 + 3*64*28*28 = 171696 multiplications,

Almost 8 times less computational cost!

### Width multiplier

The width multiplier is a decimal hyperparameter that scales the total number of parameters in the model up or down.
The baseline width multiplier is 1, but we provide snippets with a width multiplier between 0,35 and 1,4, allowing you to balance the model power with the computational cost.

### Linear bottlenecks and shortcut connections

MobileNetV2 uses linear bottlenecks between the layers and shortcut connections between the bottlenecks. Linear bottlenecks prevent from destroying information, while shortcut connections enable faster training and better accuracy. For more information, go ahead and read the awesome MobileNetV2.

## How to use the MobileNetV2 snippet

 Note Disclaimer Please note that datasets, machine-learning models, weights, topologies, research papers and other content, including open source software, (collectively referred to as “Content”) provided and/or suggested by Peltarion for use in the Platform and otherwise, may be subject to separate third party terms of use or license terms. You are solely responsible for complying with the applicable terms. Peltarion makes no representations or warranties about Content. You expressly relieve us from any and all liability, loss or risk arising (directly or indirectly) from Your use of any third party content.

The platform has different versions of the MobileNetV2 snippets for different width multiplier values. The purpose is to give you access to MobileNetV2 architecture with different complexity levels.

Try different versions to assess which MobileNetV2 has the best trade-off between computational cost and accuracy for your specific project.

Recommended image size 224x224 pixels or larger Your images need to be at least 32x32, but the weights of the snippets were trained on images that were 224x224. Thus you will get the best performance with minimal fine-tuning for images of 224x224 pixels or larger.

Consider the following things

• Input block:
We recommend that you use image augmentation.

• Last Dense block:
Change the number of units in to match the number of classes you have.
Change the activation.

• Target block:
Set the correct Loss function

### Available weights

The weights of the pre-trained snippets were learned by the Google team using ImageNet

### Terms

When using pretrained snippets, additonal terms apply: MobileNetV2 with weights licence.

## References

Howard AG, Zhu M, Chen B, Kalenichenko D, Wang W, Weyand T, Andreetto M, Adam H: MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications, 2017.

Sandler M, Howard A, Zhu M, Zhmoginov A, Chen LC: MobileNetV2: Inverted Residuals and Linear Bottlenecks