AS-MLP: An Axial Shifted MLP Architecture for Vision

Dongze Lian, Zehao Yu, Xing Sun, Shenghua Gao

Introduction

The landscape of computer vision backbones has seen a significant evolution from traditional Convolutional Neural Networks (CNNs) to Vision Transformers (ViTs) and, more recently, pure Multi-Layer Perceptron (MLP) architectures. While CNNs benefit from an inherent inductive bias for locality, MLP-based models like MLP-Mixer often rely on global spatial mixing. This global approach can overlook fine-grained local details and complicates adaptation to downstream tasks with varying input resolutions, such as object detection.

AS-MLP addresses this by introducing a pure MLP architecture that captures local spatial dependencies efficiently. By "axially shifting" feature map channels, the model achieves a local receptive field similar to CNNs without the computational overhead of self-attention mechanisms.

Architecture and Methodology

The AS-MLP architecture follows a hierarchical design across four stages, enabling the generation of multi-scale feature maps. This structure is particularly beneficial for dense prediction tasks like semantic segmentation and object detection.

Overall architecture of AS-MLP showing the hierarchical stages and the Axial Shift MLP Block.

The Axial Shift Block

The core innovation is the Axial Shift block, which facilitates spatial information exchange through a three-step process:

  1. Axial Shifting: Input feature map channels are partitioned into groups. Specific groups are shifted horizontally (left or right) and others vertically (up or down) by a predefined displacement, or "shift size."
  2. Channel Projection: Following the shift, a standard linear layer (MLP) is applied. Due to the prior shifting, the projection at any given spatial coordinate incorporates information from neighboring pixels.
  3. Zero Padding: To maintain feature map dimensions during shifting, zero padding is utilized. Empirical results showed zero padding outperformed circular or reflective alternatives.
Detailed view of (a) the Axial Shift MLP Block components and (b) the horizontal axial shift operation with zero padding.

This mechanism allows for a configurable receptive field—akin to kernel size and dilation in CNNs—using only memory re-indexing and linear projections. Notably, the axial shift operation itself requires zero parameters and zero FLOPs, making it a highly efficient way to introduce spatial awareness.

Experimental Results

AS-MLP was benchmarked against standard datasets for classification, detection, and segmentation, demonstrating strong performance across the board.

ImageNet-1K Classification

The AS-MLP-Base model achieved a 83.3% Top-1 accuracy, significantly outperforming earlier MLP models like MLP-Mixer (76.4%) and ResMLP (79.7%). It remains highly competitive with state-of-the-art Transformers like Swin-B.

Downstream Tasks

Unlike previous MLP architectures that struggled with variable input sizes due to fixed-resolution global mixing, AS-MLP's local shifting mechanism allows it to excel in downstream tasks:

  • Object Detection (MS COCO): Utilizing a Cascade Mask R-CNN framework, AS-MLP reached 51.5 mAP.
  • Semantic Segmentation (ADE20K): The model achieved 49.5 MS mIoU, proving its effectiveness for dense spatial reasoning.

Efficiency

AS-MLP-Tiny demonstrated superior throughput compared to Swin-T, processing 1047.7 images/s versus 755.2 images/s on a V100 GPU, highlighting its practical utility for real-world applications.

Conclusion

AS-MLP successfully bridges the gap between the simplicity of MLP architectures and the local inductive bias of CNNs. By introducing axial shifts, the model provides an efficient, parameter-free method for spatial modeling that rivals both Transformers and CNNs across a variety of vision tasks. Future work may explore the application of axial shifting in 1D sequences for Natural Language Processing or further refine boundary handling techniques.

Summary updated

BibTeX
@inproceedings{lian2022as,
  author = {Dongze Lian and Zehao Yu and Xing Sun and Shenghua Gao},
  title = {{AS-MLP: An Axial Shifted MLP Architecture for Vision}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=X3crz_2ofw},
}
Figure