[Paper Review] S$^2$-MLP: Spatial-Shift MLP Architecture for Vision
S2-MLP is a pure MLP architecture that uses a parameter-free spatial-shift operation for cross-patch communication, achieving competitive ImageNet-1K performance with fewer FLOPs and parameters than ViT and MLP-Mixer.
Recently, visual Transformer (ViT) and its following works abandon the convolution and exploit the self-attention operation, attaining a comparable or even higher accuracy than CNNs. More recently, MLP-Mixer abandons both the convolution and the self-attention operation, proposing an architecture containing only MLP layers. To achieve cross-patch communications, it devises an additional token-mixing MLP besides the channel-mixing MLP. It achieves promising results when training on an extremely large-scale dataset. But it cannot achieve as outstanding performance as its CNN and ViT counterparts when training on medium-scale datasets such as ImageNet1K and ImageNet21K. The performance drop of MLP-Mixer motivates us to rethink the token-mixing MLP. We discover that the token-mixing MLP is a variant of the depthwise convolution with a global reception field and spatial-specific configuration. But the global reception field and the spatial-specific property make token-mixing MLP prone to over-fitting. In this paper, we propose a novel pure MLP architecture, spatial-shift MLP (S$^2$-MLP). Different from MLP-Mixer, our S$^2$-MLP only contains channel-mixing MLP. We utilize a spatial-shift operation for communications between patches. It has a local reception field and is spatial-agnostic. It is parameter-free and efficient for computation. The proposed S$^2$-MLP attains higher recognition accuracy than MLP-Mixer when training on ImageNet-1K dataset. Meanwhile, S$^2$-MLP accomplishes as excellent performance as ViT on ImageNet-1K dataset with considerably simpler architecture and fewer FLOPs and parameters.
Motivation & Objective
- Motivate the need for alternatives to convolution and self-attention in vision backbones on medium-scale data.
- Propose a pure MLP architecture (S2-MLP) with a parameter-free spatial-shift block for patch communication.
- Show that spatial-shift-based communication yields competitive accuracy with fewer parameters and FLOPs than ViT and MLP-Mixer.
- Evaluate S2-MLP on ImageNet-1K and perform ablations to understand depth, width, shift directions, and input scale.
Proposed method
- Introduce patch-wise fully-connected embedding of image patches.
- Use N stacked S2-MLP blocks where each block contains four fully-connected layers plus two GELU activations and two layer norms.
- Replace token-mixing with a spatial-shift module that groups channels and shifts each group in a direction to enable local cross-patch communication.
- Define the spatial-shift as a parameter-free operation equivalent to a fixed-depthwise-like shift across neighboring patches.
- Provide complexity analysis for PFL, S2-MLP blocks, and final classifier layer.
Experimental results
Research questions
- RQ1Can a pure MLP architecture without token-mixing achieve competitive ImageNet-1K accuracy on medium-scale data?
- RQ2Does a parameter-free spatial-shift mechanism provide sufficient cross-patch communication to match or exceed MLP-Mixer and approach ViT performance?
- RQ3How do depth (N), hidden size (c), expansion ratio (r), shifting directions, and input scale affect accuracy and efficiency?
- RQ4Is the S2-MLP architecture invariant to input scale, and how does that compare to token-mixing MLP models?
Key findings
- S2-MLP-wide achieves Top-1 80.0% and Top-5 94.8% on ImageNet-1K with 71M parameters and 14B FLOPs, outperforming MLP-Mixer (Top-1 76.4%) with similar scale.
- S2-MLP-deep achieves Top-1 80.7% and Top-5 95.4% on ImageNet-1K with 51M parameters and 10.5B FLOPs, exceeding ResMLP-36 under similar conditions.
- S2-MLP performance is competitive with ViT on ImageNet-1K while maintaining a simpler architecture and lower FLOPs/parameters in the reported configurations.
- Ablation results show increasing depth from 1 to 12 blocks raises accuracy (56.7% to 87.1% Top-1 on ImageNet100), with performance saturating or slightly dropping beyond 12–16 blocks on smaller datasets due to overfitting.
- Expanding the hidden size c improves accuracy up to a point (c=768 yields 87.1% Top-1), with higher c increasing parameters and FLOPs.
- Shifting across four directions (default) provides strong cross-patch communication; increasing directions improves performance up to a point, while removing shifting greatly degrades accuracy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.