RepMLP论文阅读

本文最后更新于:1 天前

RepMLP利用结构重参数化对MLP进行改进,优化了传统MLP模型参数规模大,训练速度慢等缺点。

关键

  • 结构重参数化
    • 卷积和FC的转换,分组FC
  • 图片的三要素
    • local prior,global capacity, positional perception

概括

论文地址RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition

详细讲解可看作者在知乎的论文解读热点讨论:MLP,RepMLP,全连接与“内卷”

基本思想

image-20211023004702079

利用结构重参数化提高MLP性能,采用training和inference的训练模式。

  • 整体结构

    • training: Global Perceptron, Partition Perceptron, Local Perceptron
    • inference: 将training的三个结构转换为单纯的FC
  • 为什么选择MLP

    • FC可以很好地捕获全局信息,但不能捕获局部信息

      Compared to convolutional layers, FC layers are more efficient,
      better at modeling the long-range dependencies and positional patterns, but worse at capturing the local structures, hence usually less favored for image recognition.

  • 利用卷积结构

    • 卷积可以很好地学习到局部信息
  • 应用场景

    • RepMLP主要是为提高准确率和吞吐量而设计的,而不是为了更少的参数

      It should not be left unmentioned that RepMLP is designed for the application scenarios where the major concerns are the inference throughput and accuracy, less concerning the number of parameters.

CNN的优点与不足

优点

  • 卷积可以很好的捕获一张图片的局部信息
    • local prior: 图片中某一个像素点与其周围像素点的关联程度要比更远距离的像素点的关联程度的大
    • 通过卷积核可以将一个像素点和其周围像素点的特征联系起来,这也是CNN成功的原因之一

      The locality of images (i.e., a pixel is more related to its neighbors than the distant pixels) makes Convolutional Neural Network (ConvNet) successful in image recognition, as a conv layer only processes a local neighborhood.

缺点

  • 传统CNN通过堆叠卷积层来捕获全局信息,但效果差,成本高

Traditional ConvNets model the long-range dependencies by the large receptive fields formed by deep stacks of conv layers [29]. However, repeating local operations is computationally inefficient and may cause optimization difficulties.

FC的优势及改进方法

优势

  • 对比于CNN,FC可以捕获到图片的全局信息和位置信息

we can enjoy the positional perception (because its parameters are position-related) and global capacity (because every output point is related to every input point).

结构重参数化

  • Global Perceptron

    • 对feature map进行切分,可以减少参数量,但是破坏了不同块之间的联系
    • However, splitting breaks the correlations among different partitions of the same channel. In other words, the model will view the partitions separately, totally unaware that they were positioned side by side

    • 通过平均池化层来学习不同块之间的联系,然后通过BN+2 layersMLP(需思考为什么),由于自动广播机制可以直接相加
  • Partition Perceptron

    • 参考分组卷积使用分组FC,可以减少参数量
    • 实现:将一维vector转化为二维feature map,采用1x1的卷积核实现分组卷积,再转换为一维vector,实现分组FC(值得学习的思路)
  • Local Perceptron

    • 保持分辨率不变,经过多个卷积分支,分组数量与Partition Perceptron相同。(需思考为什么)

创新点

  • 利用了图像的三个要素,全局信息,局部信息,位置信息
  • 结构重参数化

    • 提出一种简单的转换方式
  • 采用FC分组

方法与实现

实验

总结

RepMLP是MLP的变体,解决的传统MLP开销大的问题,同时也可以替换CNN模型中的MLP层,从而提高模型性能。

思考

  • 理解卷积是一种特殊的FC,存在一个FC可以替代卷积核操作(阅读代码,加深理解)
  • 借鉴分组卷积使用分组FC,作者采用升维方式,利用1x1卷积核实现分组

    • 分组思想是否有别的应用(思考)
    • 升维思想,维度转换的灵活应用,特殊卷积核的使用
  • 图片的三要素包含了图像的丰富信息

  • 参数转换策略

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!