PVT Builds Pyramids for Transformers
PVT shrinks keys with spatial reduction so transformers output pyramid maps, fitting dense tasks like detection and segmentation.
Why Does This Exist?
Plain ViT outputs one map. Detection needs down to pyramids, but full attention on costs pairs.
PVT keeps pyramids affordable. It feeds object detection and semantic segmentation backbones past image classification only use.
Think of It Like This
Reading a map at four zoom levels
You keep country, region, city, and street maps of one area. For a country question you scan the small map, for a street question you open the large one.
Stages are zooms, reduction is folding the large map before comparing. Where it stops: folding blurs alleys, just as reduction blurs tiny objects.
How It Actually Works
Four stages output strides , , , . Stage has queries. Spatial reduction with ratio reshapes keys to , so keys drop by . Attention is with reduced.
Worked example
Stage 1 on input gives tokens. Full pairs are . With , keys reshape to . Pairs drop to . Ratio . Four stages then emit , , , maps for dense heads.
Watch Out For
Setting reduction so high small objects vanish
Ratio on early stages erases -pixel lights. Symptom: good classification with weak small AP. Fix: use smaller early ( schedule from the paper) and keep high resolution for small splits.
The Quick Version
- PVT emits four pyramid maps at strides 4, 8, 16, and 32 for dense tasks.
- Reduction ratio cuts keys by before attention.
- Fixture 3136 to 49 keys cuts pairs 64 times from 9.8M to 0.15M.
- Early stages need smaller to protect tiny objects.
- Pyramids let transformers replace CNN backbones directly.