AdPE: Adversarial Positional Embeddings for Pretraining Vision Transformers via MAE+

Xiao Wang, Ying Wang, Ziwei Xuan, Guo-Jun Qi · DOI

Researchers from Purdue University, Amazon AWS, and the OPPO US Research Center have introduced Adversarial Positional Embeddings (AdPE), a novel technique designed to enhance the pretraining of Vision Transformers (ViTs). By intentionally introducing adversarial perturbations to a model's spatial understanding during its early training phase, AdPE forces the network to learn more robust, global features that translate into significant performance gains across downstream computer vision tasks.

The Challenge: Overcoming Local Shortcuts in MIM

The current state-of-the-art for self-supervised pretraining in computer vision is Masked Image Modeling (MIM), exemplified by frameworks like Masked Autoencoders (MAE). In standard MIM, a model is tasked with reconstructing hidden image patches. However, because neighboring pixels in natural images are highly correlated, models often learn to "cheat" by relying on local interpolation—simply looking at the immediate neighbors of a missing patch to guess its content. This results in a model that excels at local texture reconstruction but lacks a comprehensive "big picture" understanding of objects and scenes.

Methodology: MAE+ and AdPE

To address these limitations, the authors propose a two-pronged approach: an optimized baseline called MAE+ and the adversarial core, AdPE.

MAE+: An Efficient Baseline

Before introducing adversaries, the authors optimized the standard MAE framework. They introduced multi-crop tokenization, where multiple $112 \times 112$ crops are used instead of a single $224 \times 224$ image. This modification allows for a significantly lighter decoder, reducing computational costs while simultaneously improving accuracy.

Figure 1: Accuracy vs. GPU Time for MAE and MAE+ variants, demonstrating the efficiency gains of multi-crop tokenization.

AdPE: The Adversarial Core

AdPE introduces "noise" to the Positional Embeddings, the component that informs the transformer of each patch's grid location. The authors explored two primary modes of perturbation:

  • Embedding Mode: Directly adding adversarial noise to the high-dimensional positional vectors.
  • Coordinate Mode: Perturbing the actual $(x, y)$ coordinates before they are transformed into embeddings.

To maintain training efficiency, the authors utilized Parallel Mode Updates. Unlike traditional adversarial training, which iteratively updates the adversary and the model, AdPE updates both simultaneously. This approach keeps the computational overhead to a negligible 1.5%.

Key Insights: Forcing Global Context

By distorting the local spatial structure, the model can no longer rely on immediate neighbors to fill in masked regions. Visualization of attention maps reveals that AdPE-trained models "look" much further across the image than standard MAE models, indicating a shift toward global feature extraction.

Figure 6: Visualization of attention maps across different methods. AdPE (Embed and Coord) shows a much broader, more global focus compared to standard MAE.

The authors found that perturbing 2D coordinates $(x, y)$ is more effective than perturbing high-dimensional embedding vectors. Coordinate-mode perturbations directly target the spatial structure without the risk of distorting features into uninterpretable noise. To make this work with Relative Positional Embeddings, they developed a "relaxed" piece-wise linear function to allow gradients to flow through the discrete indexing process.

Performance and Results

AdPE consistently outperformed standard MAE across industry-standard benchmarks, particularly in complex spatial tasks:

  • ImageNet-1K: Fine-tuning accuracy improved by 0.8% for ViT-B and 0.4% for ViT-L.
  • ADE20K (Segmentation): Outperformed MAE by a significant 2.6% mIoU, demonstrating a superior understanding of scene layout.
  • COCO (Detection/Segmentation): Improved object detection by 3.2% AP and instance segmentation by 1.6% AP.

Crucially, these gains were achieved without additional training data or external models (like CLIP), and with minimal impact on training time.

Conclusion and Future Directions

AdPE demonstrates that making the pretraining task harder through adversarial spatial distortion leads to more capable Vision Transformers. While the MAE+ baseline is highly efficient, the authors note that performance can degrade if crops become too small to contain meaningful information. Future research may extend this adversarial approach to video (distorting temporal positions) or 3D point clouds, where spatial relationships are even more critical for scene understanding.

Summary updated

BibTeX
@misc{wang2023adpe,
  author = {Xiao Wang and Ying Wang and Ziwei Xuan and Guo-Jun Qi},
  title = {{AdPE: Adversarial Positional Embeddings for Pretraining Vision Transformers via MAE+}},
  year = {2023},
  eprint = {2303.07598},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.07598},
}
Figure