X-MLP: A Patch Embedding-Free MLP Architecture for Vision

Xinyue Wang, Zhicheng Cai, Chenglei Peng

Abstract

Recent advancements in vision architectures have seen a resurgence of Multi-Layer Perceptrons (MLPs) as viable alternatives to Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs). However, most existing vision MLPs rely on convolutional layers for initial patch embedding and maintain constant spatial resolutions throughout the network. This paper introduces X-MLP, a "pure" MLP architecture that eliminates convolutional dependencies through extreme decoupling of spatial features. By decomposing spatial interactions into independent width, height, and channel operations within a pyramidal structure, X-MLP achieves superior performance and parameter efficiency across multiple vision benchmarks.

Introduction

In the current "MLP renaissance," models such as MLP-Mixer and ResMLP have demonstrated that simple fully connected layers can compete with complex attention mechanisms. Despite their conceptual simplicity, these models harbor a hidden reliance on convolutional inductive biases, specifically in the "patch embedding" stage where images are partitioned into vectors. Furthermore, many of these architectures utilize a "bottleneck" design that maintains a fixed resolution, failing to leverage the multi-scale efficiency of the pyramidal structures that have long benefited CNNs.

X-MLP addresses these contradictions by proposing an architecture that is entirely patch-free and purely based on linear projections. By decoupling spatial interactions, X-MLP captures global dependencies with significantly lower parameter overhead than traditional fully connected spatial layers.

Architectural Design: Extreme Decoupling

The core innovation of X-MLP lies in its approach to spatial information. Rather than attempting to mix all spatial data simultaneously—which leads to a parameter explosion—X-MLP utilizes three distinct, alternating MLP blocks:

  1. Width-cross MLPs: These layers facilitate communication exclusively across the horizontal dimension of the feature map.
  2. Height-cross MLPs: These layers facilitate communication exclusively across the vertical dimension.
  3. Channel-cross MLPs: These layers aggregate information across the depth (channel) dimension at specific pixel locations, analogous to 1x1 convolutions but implemented as fully connected layers.

This decoupling allows the model to achieve a global receptive field efficiently. Mathematically, while a standard fully connected spatial layer requires $H^4$ weights for a square feature map, X-MLP’s decoupled approach reduces this requirement to $2H^2$, allowing for deeper and more expressive networks without increasing the parameter count.

The Pyramidal Structure and Variants

Unlike its predecessors, X-MLP adopts a pyramidal structure where spatial resolution decreases and channel depth increases as the signal progresses. The authors propose four architectural variants to balance complexity and performance:

  • X-Basic: The foundational decoupled block.
  • X-Expansion: Incorporates non-linearities and expansion factors within spatial blocks to enhance feature representation.
  • X-Alternate: Features a more aggressive interleaving of width and height mixing layers.
  • X-Superior (X-Sup): The most advanced variant, utilizing sophisticated skip connections and aggregated channel information for maximum feature extraction.

Experimental Results

X-MLP was evaluated across ten diverse datasets, ranging from small-scale benchmarks like MNIST and CIFAR-10 to mid-scale challenges like Tiny ImageNet and Food-101.

Accuracy and Efficiency

X-MLP consistently outperformed both its MLP predecessors and established CNN baselines. On the Tiny ImageNet dataset, the X-Sup variant achieved an accuracy of 42.32%, notably higher than MLP-Mixer-12 (33.10%) and VGGNet-13 (37.66%).

The architecture's parameter efficiency is particularly evident in the Flowers-102 benchmark. The X-Alt variant outperformed the leading vision MLPs by nearly 6% while utilizing only 27.72% of the parameters required by those models. Across all ten datasets, at least one X-MLP variant established a new state-of-the-art for MLP-based architectures.

Visualizing Long-Range Dependencies

Analysis of the model's learned weights reveals that X-MLP successfully captures long-range dependencies. In early layers, the model learns patterns resembling shifted convolution kernels, effectively developing a local inductive bias from scratch. In deeper layers, these patterns evolve into complex, lattice-like structures that facilitate communication between distant pixels, providing the global context necessary for accurate classification.

Conclusion and Future Work

X-MLP demonstrates that a "pure" MLP architecture, free from convolutional patch embeddings, is not only possible but highly effective. By decoupling spatial dimensions and adopting a pyramidal structure, the model achieves a balance of global context and parameter efficiency that surpasses previous MLP designs.

While the results on small to mid-scale datasets are promising, future research is required to evaluate X-MLP’s scalability on massive datasets like ImageNet-1k. Additionally, exploring the application of decoupled MLPs to high-resolution tasks such as object detection and semantic segmentation remains a compelling direction for future study.

Summary updated

BibTeX
@inproceedings{wang2023x,
  author = {Xinyue Wang and Zhicheng Cai and Chenglei Peng},
  title = {{X-MLP: A Patch Embedding-Free MLP Architecture for Vision}},
  booktitle = {IJCNN},
  year = {2023},
  doi = {10.1109/ijcnn54540.2023.10191954},
}
Figure