模型压缩(1) - MobileNet

MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

   

论文地址: Arxiv Paper

Github: Tensorflow, Caffe

   

  1. Related work

    构建小的、高效网络的两种方法

  • 压缩训练好的模型 shrinking / factorizing / compressing
  • 直接训练小模型 Flattened networks / Xception / Squeezenet
  1. 深度可分离卷积 Depthwise Separable Convolution

    图(a)中的标准卷积 = 图(b) depthwise conv + 图(c) 1x1 pointwise conv

    标准卷积的computation cost:

    cost1 = ic * kh * kw * oc * oh * ow (每个输出的像素点要做ic*kh*kw次乘法)

  • 优化后卷积的computation cost:

    cost2 = kh * kw * oc * oh * ow + ic * oc * oh * ow (每个输出的像素点要做kh*kw次乘法)

  • cost2 / cost1 = 1/ic + 1/ (kh * kw) 计算量减少 8 ~9倍 

MobileNet 对大多数移动终端的CPU指令加速硬件非常友善。

SIMD (single instruction multiple data, 单指令多数据流),能够复制多个操作数,并把它们打包在大型寄存器的一组指令集

   

  1. Network structure and training
  • 将原来左边的op组合改为右边的结构

  • 网络有28层

  • 其中conv1x1的占总参数的75%,占总计算时间的 95%

  • 超参数
    • Width multiplier: thinner models

      改变ic和oc,减少特征图数量,让网络变瘦

      kh * kw * alpha * oc * oh * ow + alpha * ic * alpha * oc * oh * ow

    • Resolution multiplier: reduced representation

      改变输出图像的分辨率

      kh * kw * alpha * oc * beta * oh * beta * ow + alpha * ic * alpha * oc * beta * oh * beta * ow

  1. Reference

    MobileNet网络的理解

猜你喜欢

转载自www.cnblogs.com/fighting-lady/p/8903729.html