paper:MobileNetV2
code:caffe pytorch
Mobilenetv2核心模块是:inverted residual structure
.
1、Preliminaries, discussion and intuition
1.1、Depthwise Separable Convolutions
![](https://i-blog.csdnimg.cn/blog_migrate/6608cf0318c8a4c4a436547c7cc00f55.png)
深度可分离卷积相比普通卷积计算量减少8-9倍
下图是MobileNetv1使用普通卷积 vs 深度可分离卷积:
![](https://i-blog.csdnimg.cn/blog_migrate/3bafd2dfa7e24706ea0e7dfdf951e0d1.png)
1.2、Linear Bottlenecks
由于数据内部特征的限制,一些高维中的数据会产生维度上的冗余
,实际上只需要比较低的维度就能唯一地表示。
流行学习学习到了“将数据从高维空间降维到低维空间,还能不损失信息
”的映射,那这个映射能够输入原始数据(高维数据),输出数据更本质的特征(低维数据)。使该低维的数据能够反映原高维数据的某些本质结构特征
。
哪怕不能直接找到这个映射,那我们可以找到某种方法,在高维空间处理数据,等效于“将高维空间映射到低维空间、再处理数据、再映射回高维空间
”的这种操作。
推荐阅读大佬的文章:对ResNet本质的一些思考
Relu会造成低维数据坍塌,即信息损失。
对于一个feature,先通过一个给定的变换规则T和ReLU,将它映射到它的n维空间中,然后再把得到的feature逆变换回原始空间,这时我们会发现这个feature已经改变了。
当output_dim即输入Relu的维度比较小时,前后相差很大;
维度低的feature,分布到ReLU的激活带上的概率小,因此经过后信息丢失严重,甚至可能完全丢失。而维度高的feature,分布到ReLU的激活带上的概率大,虽然可能也会有信息的部分丢失,但是无伤大雅,大部分的信息仍然得以保留。
1、If the manifold of interest remains non-zero volume after ReLU
transformation, it corresponds to a linear transformation
.
2、ReLU is capable of preserving complete information
about the input manifold, but only if the input manifold lies in a low-dimensional subspace of the input space
可以通过改变卷积层的channel维度来改变输入空间的维度
MobileNetV1通过width multiplier parameter来调节,MobileNetV2使用expansion ratio来调节
2、Model Architecture
2.1、MobileNetV1 vs. MobileNetV2
图片来自:https://zhuanlan.zhihu.com/p/33075914
Mobilenetv2先第一个1x1的卷积升维
,第二个1x1卷积降维,且之后不使用激活函数
non-linearity destroys information in low-dimensional space
2.2 、Inverted residuals vs. residuals
图片来自:https://zhuanlan.zhihu.com/p/33075914
Resnet采用普通
卷积,Mobilenetv2采用depthwise卷积
Resnet的1x1卷积
先降维再升维,Mobilenetv2的1x1卷积先升维再降维,正好相反。
2.3、MobileNetV2
![](https://i-blog.csdnimg.cn/blog_migrate/8031c31992267f4b70c188d6796e13ce.png)
![](https://i-blog.csdnimg.cn/blog_migrate/f6d32603e9ebfca3182cfdf00685d203.png)
3、Experiments
3.1、ImageNet Classification
3.2、Object Detection
SSDLite
:replace all the regular convolutions with separable convolutions (depthwise followed by 1 × 1 projection) in SSD prediction layers.
3.3、Semantic Segmentation
3.4、Ablation study
non-linearity destroys information in low-dimensional space