We investigate the token mixer in vision backbones by revisiting clustering, one of the most classic approaches in machine learning. An effective token mixer is a fundamental component of modern vision backbones like vision Transformers, facilitating information exchange between image patches. Mainstream token mixers, which rely on convolution, attention, MLP, or their hybrids, primarily focus on navigating the trade-off between accuracy and computational cost. However, a significant drawback of these methods is their black-box nature; their encoding process is opaque and lacks interpretability. Diverging from these opaque designs, we introduce ClusterMixer, a transparent token mixer that is grounded in a clustering paradigm and interpretable by design. ClusterMixer explicitly formulates the token mixing process through a hierarchical clustering mechanism. To model the natural, tree-like relationships inherent in visual data, the clustering is performed in hyperbolic space, which is well-suited for embedding hierarchies with low distortion. Building on this innovation, we present HCFormer, a new backbone architecture that integrates ClusterMixer with a series of meticulously designed clustering strategies to ensure robust performance across tasks. Extensive experiments demonstrate that HCFormer consistently outperforms its counterparts across diverse tasks, including image classification, object detection, instance segmentation, and semantic segmentation. Considering its transparency and efficacy, we hope HCFormer can facilitate a paradigm shift toward interpretable backbones.
Figures & tables
Figure 1: Top-1 accuracy of HCFormer and other SOTAs on ImageNet-1K [ 13 ] .
Figure 2: (a) Overall pipeline of HCFormer . Following the MetaFormer paradigm [ 72 ] , HCFormer adopts a hierarchical architecture with 4 stages. (b) Hierarchical clustering . ClusterMixer conducts patch-level clustering in Euclidean space and window-level clustering in hyperbolic space.
Method
Param. (M)
GFLOPs (G)
Top-1(%) ↑
Throughput (images/s)
CLIP
MERU-S/16
[ 14 ] [ICML23]
-
-
34.3
-
MERU-B/16
[ 14 ] [ICML23]
-
-
37.5
-
MERU-L/16
[ 14 ] [ICML23]
-
-
38.8
-
HyCoCLIP-S/16
[ 49 ] [ICLR24]
-
-
41.7
-
HyCoCLIP-B/16
[ 49 ] [ICLR24]
-
-
45.8
-
HCL
[ 20 ] [CVPR23]
-
-
58.5
-
Table 1: Classification top-1 accuracy on ImageNet-1K [ 13 ] val . Throughput (images/s) measured on a single V100 GPU at batch size 128, averaged over last 500 iterations.
Backbone
Param. (M)
mIoU(%) ↑
ResNet-18
[ 24 ] [CVPR16]
15.5
32.9
ResNet-50
[ 24 ] [CVPR16]
28.5
36.7
PVT-Tiny
[ 65 ] [ICCV21]
17.0
35.7
PVT-Small
[ 65 ] [ICCV21]
28.2
39.8
CoC-Small/4
[ 46 ] [ICLR23]
17.6
36.6
CoC-Medium/4
[ 46 ] [ICLR23]
25.2
40.2
Table 2: Segmentation mIoU score of different backbones with Semantic FPN [ 30 ] on ADE20K [ 76 ] val .
Method
Param. (M)
APbox
AP50box
AP75box
APmask
AP50mask
AP75mask
ResNet-18
[ 24 ] [CVPR16]
31.2
34.0
54.0
36.7
31.2
51.0
32.7
ResNet-50
[ 24 ] [CVPR16]
44.2
38.0
58.6
41.4
34.4
55.1
36.7
PVT-Tiny
[ 65 ] [ICCV21]
32.9
36.7
59.2
39.3
35.1
56.7
37.3
PVT-Small
[ 65 ] [ICCV21]
44.1
40.4
62.9
43.8
37.8
60.1
40.3
CoC-Small/4
[ 46 ] [ICLR23]
33.6
35.9
58.3
38.3
33.8
55.3
35.8
CoC-Small/25
[ 46 ] [ICLR23]
33.6
37.5
60.1
40.0
35.4
57.1
37.9
Table 3: Object detection and instance segmentation results using Mask R-CNN [ 23 ] on COCO [ 38 ] val2017 . APbox and APmask denote bounding box AP and mask AP .
Table 4: A set of ablative experiments on ImageNet [ 54 ] val . Hier. Clus. indicates hierarchical clustering; Shift. implies shifted windows; Hyp. Geo. represents hyperbolic geometry; Rel. Pos. denotes relative position; Euc. and Hyp. are Euclidean and hyperbolic geometry, respectively.
Figure 3: Visualization of clustering maps for our HCFormer-Tiny on ImageNet [ 54 ] val . Different colored masks indicate different clusters, ranging from 2 to 5.
Visual representation learning develops image and video features that capture useful structure for recognition, retrieval, spatial reasoning, and action.
We present ARTA, a mixed-resolution coarse-to-fine vision transformer for efficient dense feature extraction. Unlike models that begin with dense high-resolution (fine) tokens, ARTA starts with low-resolution (coarse) tokens and uses a lightweight allocator to predict which regions require more fine tokens. The allocator iteratively predicts a semantic (class) boundary score and allocates additional tokens to patches above a low threshold, concentrating token density near boundaries while maintaining high sensitivity to weak boundary evidence. This targeted allocation encourages tokens to represent a single semantic class rather than a mixture of classes. Mixed-resolution attention enables interaction between coarse and fine tokens, focusing computation on semantically complex areas while avoiding redundant processing in homogeneous regions. Experiments demonstrate that ARTA achieves state-of-the-art results on ADE20K and COCO-Stuff with substantially fewer FLOPs, and delivers competitive performance on Cityscapes at markedly lower compute. For example, ARTA-Base attains 54.6 mIoU on ADE20K in the ~100M-parameter class while using fewer FLOPs and less memory than comparable backbones.
David Hagerman, Roman Naeem, Erik Brorsson +2
Chalmers University of TechnologyChalmers University of technology, 412 96 Gothenburg, Sweden
Linear attention has emerged as a promising direction for scaling Vision Transformers beyond the quadratic cost of dense self-attention. A prevalent strategy is to compress spatial tokens into a compact set of intermediate proxies that mediate global information exchange. However, existing methods typically derive these proxy tokens from predefined spatial layouts, causing token compression to remain anchored to image coordinates rather than the semantic organization of visual content. To overcome this limitation, we propose Representative Attention (RPAttention), a linear global attention mechanism that performs token compression directly in representation space. Instead of constructing intermediate tokens from fixed spatial partitions, it dynamically forms a compact set of learned representative tokens to enable semantically related regions to communicate regardless of their spatial distance, by following a lightweight Gather-Interact-Distribute paradigm. Spatial tokens are first softly gathered into representative tokens through competitive similarity-based routing. The representatives then perform global interaction within a compact latent space, before broadcasting the refined information back to all spatial tokens via query-driven cross-attention. Via replacing coordinate-driven aggregation with representation-driven compression, RPAttention preserves global receptive fields while adaptively aligning token communication with the content structure of each input.RPAttention reduces the dominant token interaction complexity from quadratic to linear scaling with respect to the number of spatial tokens, while maintaining expressive global context modeling. Extensive experiments across diverse vision transformer backbones on image classification, object detection, and semantic segmentation demonstrate the effectiveness of our design.
Yuntong Li, Hainuo Wang, Hengxing Liu +2
College of Intelligence and Computing, Tianjin University, Tianjin 300350, China
Although hyperspectral images (HSIs) provide rich spectral-spatial information, accurate pixel-level classification remains challenging because of spectral-spatial heterogeneity and complex spatial structures. Existing vision state space models (Mamba) typically construct sequences according to predefined spatial neighborhoods, without explicitly accounting for semantic similarity or spatial non-stationarity. To address this limitation, we propose Token Clustering and Semantic Sequence Mamba (STMamba), which organizes sparse tokens into semantically coherent sequences for hyperspectral image classification with the following features. First, at the macro level, a hierarchical encoder decoder progressively selects semantic tokens with the Token Clustering Module (TCM) and restores dense features using a parameter-free Cross-scale Neighborhood Attention (CNA) Upsampler. Second, at the micro level, TCM first identifies representative cluster centers through density-aware clustering and estimates soft memberships based on feature similarity. A quadtree-based dynamic selection strategy then retains sparse and spatially distributed tokens from each semantic cluster, forming coherent semantic-token sequences while reducing redundant pixel-wise representations. Third, parallel Spatial and Spectral Semantic-wise Sequencing Mamba (SWSM) modules capture complementary long-range spatial and spectral dependencies within homogeneous semantic token sequences while suppressing irrelevant interactions across heterogeneous regions. Experimental results on three large-scale benchmark datasets demonstrate that STMamba outperforms the SOTA methods with respect to quantitative and qualitative results.
Yimin Zhu, Mahmood Elahi, Lincoln Linlin Xu
Department of Geomatics Engineering, University of Calgary, Canada · Department of Electrical and Software Engineering, University of Calgary, Canada