On the speed of ViTs and CNNs
Computer vision is now powered by two workhorse architectures: Convolutional Neural Networks (CNN) and Vision Transformers (ViT). CNNs slide a feature extractor (stack of convolutions) over the image to get the final, usually lower-resolution, feature map on which the task is performed. ViTs on the other hand cut the image into patches form the start and perform stacks of self-attention on all the patches, leading to the final feature map, also of lower resolution. It is often stated that because of the quadratic self-attention, ViTs aren't practical at higher resolution. As the most prominent example, here is Yann LeCun, Godfather of CNNs, stating the following: However, I believe this criticism is a misguided knee-jerk reaction and, in practice, ViTs scale perfectly fine up to at least 1024x1024px², which is enough for the vast majority of usage scenarios for image encoders. In this article, I make two points: First, I set out to quantify the inference speed of plain ViTs and CNNs on
On the speed of ViTs and CNNs On the speed of ViTs and CNNs You disabled JavaScript. Please enable it for syntax-highlighting, or don't complain about unlegible code snippets =) This page doesn't contain any tracking/analytics/ad code. Context Computer vision is now powered by two workhorse architectures: Convolutional Neural Networks (CNN) and Vision Transformers (ViT). CNNs slide a feature extractor (stack of convolutions) over the image to get the final, usually lower-resolution, feature map on which the task is performed. ViTs on the other hand cut the image into patches from the start and
related reading
- [2203.09795] Three things everyone should know about Vision Transformersarxiv.org
- [2605.05331] ViTok-v2: Scaling Native Resolution Auto-Encoders to 5 Billion Parametersarxiv.org
- Yann LeCun (@ylecun) on Xx.com
- Aman's AI Journal • Primers • Ilya Sutskever's Top 30aman.ai
- Stand-Alone Self-Attention in Vision Models - NeurIPS-2019-stand-alone-self-attention-in-vision-models-Paper.pdfpapers.nips.cc
- [2201.03545] A ConvNet for the 2020sarxiv.org
- [2302.05442] Scaling Vision Transformers to 22 Billion Parametersarxiv.org
- MobileViT · Hugging Facehuggingface.co
- [1905.11946] EfficientNet: Rethinking Model Scaling for Convolutional Neural Networksarxiv.org
- CS231n Deep Learning for Computer Visioncs231n.github.io
- Mamba: The Easy Wayjackcook.com
- 2401.10166-VMambaarxiv.org