Dynamic Granularity Matters: Rethinking Vision Transformers Beyond Fixed Patch Splitting
Qiyang Yu, Yu Fang, Tianrui Li, Xuemei Cao, Yan Chen, Jianghao Li, Fan Min
TL;DR
Grc-ViT presents a dynamic granularity Vision Transformer that routes images to coarse or fine patch configurations using a differentiable complexity estimator based on edge, entropy, and frequency cues. A granularity-adaptive shared Transformer backbone with lightweight adapters processes multi-scale tokens under a single attention core, achieving improved fine-grained discrimination with reduced computational cost. The model is trained with learnable thresholds $alpha$ and $beta$, enabling end-to-end granularity routing, and experiments demonstrate superior accuracy–efficiency trade-offs on both standard and fine-grained benchmarks. By integrating granular computing principles into ViT design, this approach offers a scalable, interpretable framework for balancing global reasoning and local detail in vision tasks.
Abstract
Vision Transformers (ViTs) have demonstrated strong capabilities in capturing global dependencies but often struggle to efficiently represent fine-grained local details. Existing multi-scale approaches alleviate this issue by integrating hierarchical or hybrid features; however, they rely on fixed patch sizes and introduce redundant computation. To address these limitations, we propose Granularity-driven Vision Transformer (Grc-ViT), a dynamic coarse-to-fine framework that adaptively adjusts visual granularity based on image complexity. It comprises two key stages: (1) Coarse Granularity Evaluation module, which assesses visual complexity using edge density, entropy, and frequency-domain cues to estimate suitable patch and window sizes; (2) Fine-grained Refinement module, which refines attention computation according to the selected granularity, enabling efficient and precise feature learning. Two learnable parameters, α and \b{eta}, are optimized end-to-end to balance global reasoning and local perception. Comprehensive evaluations demonstrate that Grc-ViT enhances fine-grained discrimination while achieving a superior trade-off between accuracy and computational efficiency.
