SeaFormer++: Squeeze-enhanced Axial Transformer for Mobile Visual Recognition

Qiang Wan, Zilong Huang, Jiachen Lu, Gang Yu, Li Zhang

TL;DR

SeaFormer++ introduces a highly efficient, mobile-friendly Vision Transformer backbone designed specifically for resource-constrained devices. By pairing an input-adaptive "squeeze Axial attention" mechanism with a parallel local detail enhancement kernel, it achieves state-of-the-art accuracy-latency trade-offs for mobile semantic segmentation, image classification, and object detection.

What Problem Does This Paper Address?

Vision Transformers (ViTs) have fundamentally changed computer vision by allowing models to capture long-range, global context via self-attention. However, standard self-attention suffers from a quadratic computational and memory complexity ($O(H^2W^2)$ relative to image size). This makes ViTs prohibitively expensive to run on mobile devices, especially for dense, pixel-wise prediction tasks like semantic segmentation that require high-resolution inputs.

Existing workarounds either restrict attention to local windows (losing global context) or drastically downsample feature maps (harming fine-grained accuracy). SeaFormer++ aims to break this dilemma by designing an attention mechanism that captures global context with linear complexity ($O(HW)$), making it practical for real-time deployment on mobile ARM CPUs.

Methods

The core innovation of SeaFormer++ is the Squeeze-enhanced Axial (SEA) attention block, which splits the attention mechanism into two parallel, complementary paths:

  1. Squeeze Axial Attention (Global Path): Instead of calculating attention across every pixel pair, the model uses an input-adaptive learnable mask to compress (pool) the feature maps along the horizontal and vertical axes into a single row and column. Self-attention is then performed only along these squeezed axes, reducing the computational complexity to $O(HW)$.
  2. Detail Enhancement Kernel (Local Path): Squeezing features inevitably sacrifices local spatial details. To compensate, a parallel branch concatenates the Query, Key, and Value vectors and passes them through a $3\times3$ depth-wise convolution to preserve fine-grained local structures.

The outputs of these two paths are fused via element-wise multiplication.

Squeeze-enhanced Axial attention block

Dual-Branch Architecture & Distillation

SeaFormer++ uses a dual-branch macro-architecture consisting of a Context Branch (which uses the SEA attention layers to extract global semantics at lower resolutions) and a Spatial Branch (which preserves high-resolution details).

Fig. 2: The overall architecture of SeaFormer. It contains shared STEM, context branch (red), spatial branch (blue), fusion block and light segmentation head. MV2 block means MobileNetV2 block and MV2 ↓2 means Mo- bileNetV2 block with downsampling. SeaFormer layers and fusion block with dash box only exist in SeaFormer-L. The symbol N denotes element-wise multiplication.

To push mobile performance even further, the authors introduce a Multi-Resolution Distillation (KD) framework. Here, a high-resolution teacher model guides a student model that processes an image at half-resolution. A lightweight MobileNetV2-based upsampling module aligns the student's internal feature maps to the teacher's resolution at identical stages, allowing the student to mimic the teacher's performance while significantly cutting down inference latency.

Datasets

The authors evaluated SeaFormer++ across several standard computer vision benchmarks:

  • Semantic Segmentation: ADE20K, Cityscapes, PASCAL Context, and COCO-Stuff.
  • Image Classification: ImageNet-1K (used for both backbone pretraining and standalone classification evaluation).
  • Object Detection: COCO (evaluated using the RetinaNet framework).

Key Insights and Ideas

  • Adaptive Squeezing Beats Static Pooling: Rather than using standard global average pooling, SeaFormer++ employs a learnable mask to adaptively squeeze and expand tokens. This allows the model to aggregate spatial information in a data-dependent manner without adding significant computational overhead.
  • Parallel Global-Local Synergy: Instead of treating global context and local detail extraction as sequential steps, computing them in parallel and fusing them via multiplication yields a highly descriptive feature representation that is exceptionally cheap to compute.
  • Stage-Aligned Feature Distillation: For dense prediction tasks, distillation is highly effective when internal features are explicitly aligned at the same architectural stage, even if the student model is fed a lower-resolution image than the teacher.

Key Results

SeaFormer++ achieves an outstanding balance between accuracy (mIoU) and latency when benchmarked on a single ARM CPU core of a Qualcomm Snapdragon 865 processor.

Fig. 1: Left: Latency comparison with Transformer Vaswani (2017), MixFormer Chen et al. (2022a), ACmix Pan et al. (2022b), Axial attention Ho et al. (2019) and local attention Luong (2015). It is measured with a single module of channel dimension 64 on a Qualcomm Snapdragon 865 processor. Right: The mIoU versus latency on the ADE20K val set. MV2 means MobileNetV2 Sandler et al. (2018). MV3-L means MobileNetV3-Large Howard et al. (2019). MV3-Lr denotes MobileNetV3-Large-reduce Howard et al. (2019). The latency is measured on a single Qualcomm Snapdragon 865, and only an ARM CPU core is used for speed testing. No other means of acceleration, e.g., GPU or quantification, is used. For figure Right, the input size is 512×512. SeaFormer achieves superior trade-off between mIoU and latency.
  • ADE20K Segmentation: SeaFormer-Base achieves 41.0% mIoU with a latency of just 106ms, comfortably beating its CNN counterpart MobileNetV3 (33.1% mIoU / 126ms) and the Transformer-based TopFormer-B (39.2% mIoU / 110ms).
  • Distillation Efficiency: When the multi-resolution distillation framework is applied (SeaFormer-B++ KD), the latency drops drastically to 55ms while retaining a highly competitive 39.5% mIoU.
  • Image Classification: SeaFormer-L++ achieves a 80.6% Top-1 accuracy on ImageNet-1K, proving its capability as a strong, versatile backbone.
  • Object Detection: On the COCO dataset, SeaFormer-L++ reaches 40.2 AP, outperforming a standard ResNet50 backbone (36.5 AP) while requiring fewer FLOPs.

Limitations and Future Work

While SeaFormer++ is highly optimized for mobile CPUs, the paper focuses its hardware benchmarking almost exclusively on ARM-based CPU cores. The authors do not extensively explore how the custom operations (like adaptive squeezing and expanding) perform when deployed on mobile GPUs or specialized Neural Processing Units (NPUs), which often require specific hardware-level kernel optimizations. The authors suggest that expanding this linear attention mechanism to video-based dense prediction tasks represents a promising future direction.

Summary updated

BibTeX
@article{wan2025seaformer,
  author = {Qiang Wan and Zilong Huang and Jiachen Lu and Gang Yu and Li Zhang},
  title = {{SeaFormer++: Squeeze-enhanced Axial Transformer for Mobile Visual Recognition}},
  journal = {Int. J. Comput. Vis.},
  year = {2025},
  url = {https://openreview.net/forum?id=5GA6pjBxAV},
}
Figure