# Dynamic Grained Encoder for Vision Transformers

Source: [Dynamic Grained Encoder for Vision Transformers](<https://www.sota2.com/research/paper/68fa6e561e209131cea3f22d>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-01-04T04:27:47.377Z

Authors: Lin Song, Songyang Zhang, Songtao Liu, Zeming Li, Xuming He, Hongbin Sun, Jian Sun, Nanning Zheng

Published: 2023-01-10T07:55:29.000Z

## Abstract

Transformers, the de-facto standard for language modeling, have been recently applied for vision tasks. This paper introduces sparse queries for vision transformers to exploit the intrinsic spatial redundancy of natural images and save computational costs. Specifically, we propose a Dynamic Grained Encoder for vision transformers, which can adaptively assign a suitable number of queries to each spatial region. Thus it achieves a fine-grained representation in discriminative regions while keeping high efficiency. Besides, the dynamic grained encoder is compatible with most vision transformer frameworks. Without bells and whistles, our encoder allows the state-of-the-art vision transformers to reduce computational complexity by 40%-60% while maintaining comparable performance on image classification. Extensive experiments on object detection and segmentation further demonstrate the generalizability of our approach. Code is available at https://github.com/StevenGrove/vtpack.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Instance Segmentation on COCO (val)](<https://www.sota2.com/research/sota/instance-segmentation-on-coco-val.md>): Instance Segmentation; COCO (val); APmk: 42.

- [Semantic Segmentation on ADE20K (val)](<https://www.sota2.com/research/sota/semantic-segmentation-on-ade20k-val.md>): Semantic segmentation; ADE20K (val); mIoU: 46.1.

- [Object Detection on COCO (val)](<https://www.sota2.com/research/sota/object-detection-on-coco-val.md>): Object Detection; COCO (val); mAP: not recorded.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2301.03831>)

[PDF](<https://arxiv.org/pdf/2301.03831.pdf>)

[Implementation](<https://github.com/StevenGrove/vtpack>)
