Research map / Architectures and efficiency / Attention and transformers
Configuring Data Augmentations to Reduce Variance Shift in Positional Embedding of Vision Transformers
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Shows that Mixup and upsampling of positional embeddings shift variance in ViTs at test time, and proposes rescaling upsampled positional embedding by 1/sqrt(k) plus configuring random erasing (pixel mode, default mean-std) to remove the shift.
Problem
Rich data augmentations such as Mixup and random erasing, together with bicubic upsampling of positional embeddings at test time, cause variance shifts in ViT positional embeddings between training and test, degrading test performance.
Approach
Analyze the variance of patch and positional embeddings after LayerNorm; show interpolation-type upsampling scales variance by k, Mixup scales variance by lambda^2+(1-lambda)^2, while Cutmix and pixel-mode random erasing (with default mean-std) conserve variance; fix by rescaling upsampled positional embedding by 1/sqrt(k) and configuring augmentations accordingly.
Key results
- Rescaling upsampled positional embedding by 1/sqrt(k) improves ViT-B/16 top-1 accuracy at 864^2 test size from 61.33% to 67.28% (+5.95), while slightly degrading the 224^2 size (-0.18).
- On ImageNet training, Mixup 0.4 with Cutmix reduces ViT-B/16 top-1 from 80.240% (Cutmix only) to 79.248%, supporting that Mixup hurts ViT training.
- Rescaling improves ADE20K mIoU from 43.16 to 43.27 and LoveDA mIoU from 47.78 to 48.37 with DeiT-S/16 + UPerNet.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Rescale upsampled positional embedding by 1/√k at test time | ViT-S/16 · ImageNet-1K val, 864² | top-1 accuracy (%): 56.528 -> 60.710 | Helped |
| Rescale upsampled positional embedding by 1/√k at test time | ViT-B/16 · ImageNet-1K val, 224² | top-1 accuracy (%): 84.528 -> 84.344 | Hurt |
| Rescale upsampled positional embedding by 1/√k at test time | DeiT-S/16 + UPerNet · ADE20K, LoveDA, and Cityscapes | mIoU: ADE20K: 43.16 -> 43.27; LoveDA: 47.78 -> 48.37; Cityscapes: 77.20 -> 77.31 | Helped |
| Apply Cutmix 1.0 without Mixup | ViT-S/16 and ViT-B/16 · ImageNet-1K | top-1 accuracy (%): ViT-S/16: 74.801 -> 79.540; ViT-B/16: 74.741 -> 80.240 | Helped |
| Add Mixup to Cutmix 1.0 (ablation) | ViT-S/16 and ViT-B/16 · ImageNet-1K | top-1 accuracy (%): ViT-S/16: 79.540 -> 78.069 (Mixup 0.2), 78.128 (Mixup 0.4); ViT-B/16: 80.240 -> 79.448 (Mixup 0.2), 79.248 (Mixup 0.4) | Hurt |
| Increase random erasing probability with pixel mode and inception mean-std (ablation) | ViT-S/16 · ImageNet-1K | top-1 accuracy (%): 79.426 -> 79.126 (RE 0.25) -> 78.726 (RE 0.50) | Hurt |
| Use default mean-std instead of inception mean-std with pixel-mode random erasing | ViT-B/16 · ImageNet-1K | top-1 accuracy (%) | Helped |
| Replace pixel-mode random erasing with rand mode (ablation) | ViT-S/16 and ViT-B/16 · ImageNet-1K | top-1 accuracy (%): ViT-S/16: 79.158 -> 79.009; ViT-B/16: 80.415 -> 80.398 | Hurt |
| Replace pixel-mode random erasing with const mode (ablation) | ViT-S/16 and ViT-B/16 · ImageNet-1K | top-1 accuracy (%): ViT-S/16: 79.158 -> 78.909; ViT-B/16: 80.415 -> 80.298 | Hurt |
Surprising findings
- Mixup, a standard ViT training augmentation, reduced ImageNet top-1 accuracy when combined with Cutmix, versus Cutmix alone.
- Nearest-neighbor upsampling conserves variance but performed poorly, so the authors instead keep bicubic upsampling and rescale.
Limitations
- Analysis assumes mean-zero positional embedding and large vectors, with variance shift framed under mean consistency.
- Nearest-neighbor upsampling, which conserves variance, performs poorly, so the fix relies on a heuristic 1/sqrt(k) rescaling.
- Experiments are on a limited set of ViT sizes and segmentation datasets; RandAugment/AutoAugment effects are only discussed conjecturally.
Experimental setup
Datasets: ImageNet-1K ImageNet-21K ADE20K LoveDA Cityscapes
Benchmarks: ImageNet-1K ADE20K LoveDA Cityscapes
Metrics: top-1 accuracy aAcc mIoU mAcc
Baselines: bicubic upsampling of positional embedding (baseline) Mixup inception-mean-std
Builds on: Vision Transformer Mixup CutMix random erasing DeiT
Closest papers by meaning
- Making Vision Transformers Truly Shift-Equivariant (CVPR 2024 · similarity 0.86)
- Accelerating Augmentation Invariance Pretraining (NeurIPS 2024 · similarity 0.86)
- Linearly Decomposing and Recomposing Vision Transformers for Diverse-Scale Models (NeurIPS 2024 · similarity 0.86)
- Vision Transformers with Self-Distilled Registers (NeurIPS 2025 · similarity 0.85)
- Vision Transformer Neural Architecture Search for Out-of-Distribution Generalization: Benchmark and Insights (NeurIPS 2024 · similarity 0.85)
- Charm: The Missing Piece in ViT Fine-Tuning for Image Aesthetic Assessment (CVPR 2025 · similarity 0.85)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
