Active Token Mixer

Guoqiang Wei, Zhizheng Zhang, Cuiling Lan, Yan Lu, Zhibo Chen

TL;DR

The Active Token Mixer (ATM) is a novel, content-adaptive operator that actively predicts where to gather contextual information across different channels. By enabling flexible, global-scope token mixing with linear computational complexity, it allows the resulting ATMNet to outperform state-of-the-art CNNs, Transformers, and MLPs across image classification, object detection, and semantic segmentation tasks.

What Problem Does This Paper Address?

In computer vision, "token mixing" refers to how a model fuses information from different spatial locations (tokens) to understand an image. The dominant network families each have a different philosophy:

  • CNNs mix tokens locally within fixed windows.
  • Transformers use global self-attention, which is powerful but computationally expensive (quadratic complexity relative to image size).
  • MLPs often use fixed-resolution fully connected layers or hand-crafted rules that lack the flexibility to adapt to different object shapes and scales.

The authors identify a gap: we need a mechanism that is global like Transformers, efficient like CNNs, and content-adaptive—meaning it changes where it "looks" based on what is actually in the image.

Methods

The core innovation is the Active Token Mixer (ATM). Instead of using a fixed filter, for every "query" token, the ATM actively predicts relative location offsets to find useful context.

Key components include:

  • Active Offset Prediction: A small fully connected (FC) layer predicts offsets ($o_i$) for each channel. This allows the model to "reach out" to any other token in the image.
  • Channel-Wise Flexibility: Different semantic attributes of a token are stored in different channels. ATM predicts unique offsets for each channel, allowing fine-grained, semantic-aware context gathering.
  • Axial Decomposition: To keep optimization manageable and efficient, ATM processes horizontal and vertical dimensions separately (ATMW and ATMH) before fusing them.
  • Adaptive Fusion: The horizontal, vertical, and original (identity) information are combined using learned, softmax-normalized weights.
Figure 1: Illustration of our proposed Active Token Mixer (ATM). (a) ATM along the horizontal (width) dimension. For a query xq, ATM actively captures the useful contexts by recomposing the elements from selected tokens into ˜xW ∈RC based on the learned channel-wise offsets. (b) ATM module consisting of ATMW along horizontal dimension, ATMH along vertical dimension, and the identity branch ATMI. The two recomposed tokens (˜xW , ˜xH) and the original ˜xI are then adaptively fused after being embedded by FC{W,H,I}.

The authors use this operator to build ATMNet, a hierarchical backbone. They also propose ATMFPN, where standard convolutions in a Feature Pyramid Network (a common "neck" for detection tasks) are replaced with ATM operators to enhance multi-scale feature learning.

Datasets

The models were evaluated on three standard, large-scale benchmarks:

  1. ImageNet-1K: For image classification (1.2M training images, 1,000 categories).
  2. ADE20K: For semantic segmentation (20K training images).
  3. COCO (Common Objects in Context): For object detection and instance segmentation (118K training images).

Key Insights and Ideas

  • Semantics are Channel-Dependent: The authors argue that because different channels represent different semantic features, they require different spatial contexts. ATM’s ability to select context at the channel level is a major step up from deformable convolutions, which share offsets across all channels.
  • Global Reach, Linear Cost: ATM achieves a global receptive field with $O(HWC^2)$ complexity. This is linear with respect to the number of pixels, making it much more scalable for high-resolution tasks than standard self-attention.
  • Depth-Adaptive Receptive Fields: By analyzing learned offsets, the authors found that shallower layers naturally learn to look locally, while deeper layers expand their reach to capture global information. This confirms that the "active" part of the mixer is working as intended.

Key Results

ATMNet consistently surpasses prominent backbones like Swin Transformers and various MLP-like models:

  • ImageNet-1K: ATMNet-L achieves 84.8% top-1 accuracy, outperforming Swin-B while using significantly less computation at higher resolutions.
  • Semantic Segmentation: On ADE20K, ATMNet-L combined with UperNet reaches 51.1 mIoU, surpassing Swin-B by +1.4 mIoU with 10% fewer parameters.
  • Object Detection: On COCO, ATMNet-L achieves 49.5 AP using a Mask R-CNN framework, a significant margin over comparable Swin and Twin variants.
  • Plug-and-Play: Replacing standard FPN convolutions with ATM (ATMFPN) boosted a ResNet-50 baseline by +3.0 mIoU on segmentation tasks with comparable computation.
Table showing ATMNet's superior performance on ImageNet-1K compared to SOTA models.

Limitations and Future Work

While the paper demonstrates strong results for static images, the authors note that they have not yet explored ATM's potential for temporal video signals, where active context selection across time could be highly beneficial. Additionally, while the axial decomposition helps optimization, the active prediction of offsets still introduces a slight overhead compared to purely static operators, though the performance gains appear to justify the cost.

Summary updated

Abstract

The three existing dominant network families, i.e., CNNs, Transformers, and MLPs, differ from each other mainly in the ways of fusing spatial contextual information, leaving designing more effective token-mixing mechanisms at the core of backbone architecture development. In this work, we propose an innovative token-mixer, dubbed Active Token Mixer (ATM), to actively incorporate flexible contextual information distributed across different channels from other tokens into the given query token. This fundamental operator actively predicts where to capture useful contexts and learns how to fuse the captured contexts with the query token at channel level. In this way, the spatial range of token-mixing can be expanded to a global scope with limited computational complexity, where the way of token-mixing is reformed. We take ATM as the primary operator and assemble ATMs into a cascade architecture, dubbed ATMNet. Extensive experiments demonstrate that ATMNet is generally applicable and comprehensively surpasses different families of SOTA vision backbones by a clear margin on a broad range of vision tasks, including visual recognition and dense prediction tasks. Code is available at https://github.com/microsoft/ActiveMLP.
BibTeX
@inproceedings{wei2023active,
  author = {Guoqiang Wei and Zhizheng Zhang and Cuiling Lan and Yan Lu and Zhibo Chen},
  title = {{Active Token Mixer}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i3.25376},
}
Figure