Abstract
Generative self-supervised learning (SSL) has significantly advanced computer vision, yet scaling these models to high-resolution images remains computationally prohibitive due to the $O(n^2)$ complexity of Transformers. We present LoMaR (Local Masked Reconstruction), a method that addresses this bottleneck by restricting the reconstruction task to small, local windows. LoMaR achieves up to a 5.0× speedup over state-of-the-art models like BEiT while improving accuracy on high-resolution downstream tasks.
Introduction
Methods such as Masked Autoencoders (MAE) and BEiT have revolutionized pretraining by training models to reconstruct masked image patches. However, as image resolution increases, the number of patches ($n$) grows, leading to a quadratic explosion in computational cost. This "scalability wall" makes high-resolution pretraining inaccessible for many researchers. LoMaR overcomes this by shifting from global to local reconstruction, leveraging the observation that visual information is often redundant and reconstruction is naturally a local process.
Methodology: Local Masked Reconstruction
LoMaR introduces a simple yet effective shift in the masking strategy and attention mechanism:
- Local Window Masking: Instead of sampling masked patches randomly across the entire image, LoMaR samples several small $7 \times 7$ windows. Within each window, a high percentage (approximately 80%) of patches are masked.
- Restricted Attention: The model is constrained to reconstruct missing patches using only the visible patches within that specific local window. This transforms the global $O(n^2)$ complexity into a linear complexity relative to the number of windows, significantly reducing the memory and compute footprint.
- Architectural Simplification: Unlike the heavy decoders used in MAE, LoMaR utilizes a lightweight Multi-Layer Perceptron (MLP) head. Both masked and visible patches are fed into the encoder, which enhances the robustness of the learned representations for local tasks.
Key Insights
The motivation for LoMaR stems from the fact that even global models primarily utilize neighboring patches to reconstruct a target. By restricting the "search area," the computational cost becomes invariant to the total image resolution, depending only on the window size and count. Furthermore, sampling windows at random locations introduces a form of translation invariance, providing an inductive bias similar to Convolutional Neural Networks (CNNs).
Experimental Results
LoMaR was evaluated on standard benchmarks including ImageNet-1K, iNaturalist 2018, MS COCO, and ADE20K.
- Efficiency and Speed: During $384 \times 384$ resolution pretraining on ImageNet, LoMaR demonstrated a 2.5× speedup over MAE and a 5.0× speedup over BEiT.
- Accuracy Gains: Despite the reduced compute, LoMaR achieved 84.5% Top-1 accuracy on ImageNet (384 res), outperforming MAE by 0.2% and BEiT by 0.8%.
- Downstream Performance: On MS COCO object detection, LoMaR surpassed MAE by 0.5 $AP^{box}$, indicating that local pretraining effectively transfers to tasks requiring global spatial understanding.
Discussion and Limitations
One observed trade-off is in linear probing, where LoMaR performs slightly worse than MAE when the backbone is frozen. This suggests that local pretraining creates highly specialized features that may require full fine-tuning to reach peak performance. However, since fine-tuning is the standard practice for most applications, this limitation is minor compared to the massive gains in pretraining efficiency.
Conclusion
LoMaR demonstrates that local reconstruction is a powerful and efficient alternative to global masking for high-resolution vision pretraining. By breaking the quadratic complexity of Transformers, it paves the way for more accessible large-scale model training and potential extensions into even more compute-intensive domains like video analysis.
Summary updated