1. 程式人生 > 其它 >MLP是否可以發展為下一代視覺網路主幹【讀論文,網路結構】

MLP是否可以發展為下一代視覺網路主幹【讀論文,網路結構】

論文:Are we ready for a new paradigm shift? A Survey on Visual Deep MLP,review,2021年末

1. MLP、CNNs和transformer結構分析

  1. MLP即為多層感知機,多層全連線網路前向堆疊而成,主要存在問題是引數量太大;
  2. CNNs為了解決上述問題,引入了兩個inductive biases(可以理解為先驗假設):
  3. 區域性相關下;2. 平移不變性。由於卷積核引數是共享的,極大的降低了模型引數量;
  4. 由於使用卷積核的尺寸較小(3x3,5x5),使得模型感受野較小;transformer將圖片打成patch,然後在全域性作self-attention運算,感受野為全域性,在大資料集上效果更好;
  5. 最近一篇研究:Scaling Up Your Kernels to 31x31: Revisiting Large Kernel Design in CNNs,(CVPR2022),使用大卷積核,擴大感受野,取得不錯結果。
  6. 發展趨勢:使得感受野該大時候大,改小時候小,現在需要集大成性質工作。

2. MLP作為新正規化的嘗試:MLP-Mixer 【是否恰當?】

MLP作為新正規化在視覺上應用以MLP-Mixer為開端,結果如下:

per-patch fully-connected對每個patch作線性投影,類似ViT,可以用和patch同樣大小的卷積核、stride=patch size一次計算得到。
tocken-mixing MLP 和 channel-mixing MLP分別由兩個全連線層加非線性啟用函式(GELU)組成。tocken-mixing MLP具有全域性感受野,在tocken層作變化(引數量\(H^2W^2\)

),channel-mixing在特徵維度作變化,做不同層間特徵融合,和1x1卷積效果相當。兩者都引數共享。
感受野、是否對輸入解析度敏感、引數量、計算複雜度(FLOPs)對比如下:

瓶頸:

  1. 和CNNs相比,沒有先驗偏差,因此需要大的資料集來訓練;
  2. 計算複雜度和輸入尺寸成平方關係(\(H^2W^2\)),複雜度過大;
  3. 不能處理任意 尺寸的圖片輸入;

3. MLP正規化在模組層面的變體【魔改】

3.1 大部分都在魔改MLP-Mixer的tocken-mixing塊,分為三類:

1.Axial and channel projection blocks
原有的tocken-mixing計算複雜度過大,因此一些人將投影空間正交分解;沿分解後的維度編碼空間資訊,為了解決對對輸入解析度敏感問題,WaveMLP and MorphMLP使用了局部視窗策略,但是因此影響了長程依賴(大的感受野)。
2. Channel-only projection blocks
一些人直接拋棄了空間全連線層,為了重新引入感受野,將不同空間位置的特徵對齊到一個channel,實現了類似cnn的區域性感受野的效果(為何不對一層全部空間做對齊?這不就全域性感受野了?


spatial-shift MLP在通道維,選取不同的位置對齊,然後做1x1卷積,可以一定程度做到感受野擴張。
3. Spatial and channel projection blocks
4.
為了降低計算複雜度,走了CNN的老路,降低了感受野

3.2 感受野和複雜度分析

下面這張圖很形象了

關於複雜度:

文章總結寫的很棒,這裡做摘記:
The bottleneck of Token-mixing MLP (Section 3.3) induces researchers to redesign the block. Recently released MLP-like variants reduce the model’s computational complexity, dynamic aggregation information, and resolving image resolution sensitivity. Specifically, researchers decompose the full spacial projection orthogonally, restrict interaction within a local window, perform channel projection after shifting feature maps, and make other artificial designs. These careful and clever designs demonstrate that researchers have noticed that the current amount of data and computational power is insufficient for pure MLPs. Comparing the computational complexity has a theoretical significance, but it is
not the only determinant of inference time and final model efficiency. Analysis of the receptive field shows that the new paradigm is instead moving towards the old paradigm. To put it more bluntly, the development of MLP heads backto the way of CNNs. Hence, we still need to make efforts to balance long-distance dependence and image resolution sensitivity.

4. MLP正規化的網路結構(從single-stage到pyramid)

三類,如圖:

Single-stage來源於ViT,patch embedding之後,特徵圖尺寸不在變化,然後堆疊;由於計算資源有限,圖片打成patch時候一般很大,例如16x16,這樣對於下游任務影響較大,不利於小目標檢測。

Vision Permutator提出了two-stage方法,開始採用7x7小patch,然後進行patch merge:寬高減半,通道增加;結果是相較於one-stage,在imagenet-1k上有一個點提升
在金字塔結構中(patch為4x4),the researchers find that using an overlapping patch embedding provides better results, that is, convolution of 7x7 with stride = 4 instead of 4x4, which is similar to ResNet(增加不同patch間資訊互動?

ViT全域性感受野,swin-transformer區域性感受野+shift windows進行區域性資訊連線,swin效果更好,是否可以設計比swin更好的區域性資訊互動方式應用在CNN上?擴大CNN感受野?
如何擴大CNN感受野是個有前途的方向!

5. 在任務中表現

  1. 圖片分類 imagenet-1k
    結論:(1) MLP is still relatively backward compared to CNN and Transformer,
    (2) the performance gains brought by increasing data volume and architecture-specific training strategies may be greater than the module redesign, (3) the visual community is encouraged to build self-supervised methods and appropriate training strategies for pure MLPs.
  2. 點雲
    由於點雲的無規律性,使得MLP和transformer更適合;

6. 結論