SPFormer: Enhancing Vision Transformer with Superpixel Representation
Jieru Mei, Liang-Chieh Chen, Alan Yuille, Cihang Xie
TL;DR
SPFormer tackles the gap between pixel-level detail and patch-based global reasoning by introducing an adaptive superpixel representation for Vision Transformers. It pairs a trainable superpixel module with Superpixel Cross Attention to iteratively fuse pixel and superpixel information, enabling efficient global interactions over a compact token set. The approach yields improvements on ImageNet over DeiT baselines, enhances segmentation performance through high-resolution feature preservation, and provides explainability via visualizable pixel–superpixel associations that align with semantic boundaries. The results demonstrate robust performance under rotations and occlusions, highlighting the practical potential of region-aware representations in scalable vision models.
Abstract
In this work, we introduce SPFormer, a novel Vision Transformer enhanced by superpixel representation. Addressing the limitations of traditional Vision Transformers' fixed-size, non-adaptive patch partitioning, SPFormer employs superpixels that adapt to the image's content. This approach divides the image into irregular, semantically coherent regions, effectively capturing intricate details and applicable at both initial and intermediate feature levels. SPFormer, trainable end-to-end, exhibits superior performance across various benchmarks. Notably, it exhibits significant improvements on the challenging ImageNet benchmark, achieving a 1.4% increase over DeiT-T and 1.1% over DeiT-S respectively. A standout feature of SPFormer is its inherent explainability. The superpixel structure offers a window into the model's internal processes, providing valuable insights that enhance the model's interpretability. This level of clarity significantly improves SPFormer's robustness, particularly in challenging scenarios such as image rotations and occlusions, demonstrating its adaptability and resilience.
