HGFormer: Topology-Aware Vision Transformer with HyperGraph Learning
Hao Wang, Shuo Zhang, Biao Leng
TL;DR
HGFormer introduces a topology-aware HyperGraph Transformer that integrates a Center Sampling K-Nearest Neighbors construction and topology-guided HyperGraph Attention to encode local groups and spatial topology within a vision transformer. By transforming image tokens into a hypergraph and performing node↔hyperedge↔node messaging, it achieves higher-order modeling while maintaining competitive complexity. Across ImageNet, COCO, ADE20K, pose estimation, and weakly supervised segmentation, HGFormer attains competitive or superior results compared to SoTA methods, with clear ablations validating the CS-KNN and HGA contributions. The approach demonstrates the practical value of perceptual organization in transformers, though it relies on carefully tuned hypergraph construction and hyperparameters for different tasks and resolutions.
Abstract
The computer vision community has witnessed an extensive exploration of vision transformers in the past two years. Drawing inspiration from traditional schemes, numerous works focus on introducing vision-specific inductive biases. However, the implicit modeling of permutation invariance and fully-connected interaction with individual tokens disrupts the regional context and spatial topology, further hindering higher-order modeling. This deviates from the principle of perceptual organization that emphasizes the local groups and overall topology of visual elements. Thus, we introduce the concept of hypergraph for perceptual exploration. Specifically, we propose a topology-aware vision transformer called HyperGraph Transformer (HGFormer). Firstly, we present a Center Sampling K-Nearest Neighbors (CS-KNN) algorithm for semantic guidance during hypergraph construction. Secondly, we present a topology-aware HyperGraph Attention (HGA) mechanism that integrates hypergraph topology as perceptual indications to guide the aggregation of global and unbiased information during hypergraph messaging. Using HGFormer as visual backbone, we develop an effective and unitive representation, achieving distinct and detailed scene depictions. Empirical experiments show that the proposed HGFormer achieves competitive performance compared to the recent SoTA counterparts on various visual benchmarks. Extensive ablation and visualization studies provide comprehensive explanations of our ideas and contributions.
