[Paper Review] Vision Transformers with Patch Diversification
The paper introduces three patch-diversity losses to diversify patch representations in vision transformers, stabilizing training and boosting accuracy on ImageNet and improving semantic segmentation performance without changing architecture.
Vision transformer has demonstrated promising performance on challenging computer vision tasks. However, directly training the vision transformers may yield unstable and sub-optimal results. Recent works propose to improve the performance of the vision transformers by modifying the transformer structures, e.g., incorporating convolution layers. In contrast, we investigate an orthogonal approach to stabilize the vision transformer training without modifying the networks. We observe the instability of the training can be attributed to the significant similarity across the extracted patch representations. More specifically, for deep vision transformers, the self-attention blocks tend to map different patches into similar latent representations, yielding information loss and performance degradation. To alleviate this problem, in this work, we introduce novel loss functions in vision transformer training to explicitly encourage diversity across patch representations for more discriminative feature extraction. We empirically show that our proposed techniques stabilize the training and allow us to train wider and deeper vision transformers. We further show the diversified features significantly benefit the downstream tasks in transfer learning. For semantic segmentation, we enhance the state-of-the-art (SOTA) results on Cityscapes and ADE20k. Our code is available at https://github.com/ChengyueGongR/PatchVisionTransformer.
Motivation & Objective
- Motivate the instability observed in deep vision transformers due to high similarity among patch representations.
- Propose regularization losses to explicitly diversify patch features across layers.
- Show that diversity-promoting training stabilizes training and enables training wider/deeper transformers.
- Demonstrate improved transfer learning performance on semantic segmentation benchmarks Cityscapes and ADE20K.
Proposed method
- Compute patch-wise cosine loss to directly minimize cosine similarity between different patch representations at the final layer.
- Introduce a patch-wise contrastive loss to align last-layer patches with first-layer patches while pushing different patches apart.
- Apply a patch-wise mixing loss by mixing input patches from two images and training patches to predict their own image labels.
- Train with a weighted sum of the three losses (α1 L_cos + α2 L_contrastive + α3 L_mixing) without network modifications.
- Leverage existing architectures (e.g., DeiT, SWIN) to assess improvements on ImageNet and downstream segmentation tasks.
Experimental results
Research questions
- RQ1Can explicit diversification of patch representations stabilize training of deep/wide vision transformers?
- RQ2Do patch-diversity losses improve ImageNet classification accuracy without architectural changes?
- RQ3Do diversified patch features transfer better to downstream tasks like semantic segmentation?
- RQ4How do the proposed losses interact with existing training tricks and data augmentations?
Key findings
- On ImageNet, DeiT-Base24 with DiversePatch reaches 83.3% top-1 accuracy (from 82.1%), and DeiT-Small24 reaches 82.2% (from 80.3%).
- SWIN-Base with DiversePatch improves to 83.7% top-1 accuracy (from 83.4%), and SWIN-Large to 87.4% when pre-trained on ImageNet-22K and finetuned.
- Patch-wise cosine similarity in final representations decreases, making patch features more diverse and comparable to ResNet-50 in late layers.
- Backbones pretrained with DiversePatch achieve new state-of-the-art segmentation performance on ADE20K (54.5% mIoU) and Cityscapes validation (83.6% mIoU).
- ImageNet-22K finetuning with DiversePatch yields 87.4% top-1 on SWIN-Large and 83.9% on ViT-Large (vs. 87.3% and 83.6% baseline).
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.