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
- Convolutional Neural Networks, Explained | Towards Data Sciencetowardsdatascience.com
- The Annotated Transformernlp.seas.harvard.edu
- [2201.03545] A ConvNet for the 2020sarxiv.org
- CS231n Deep Learning for Computer Visioncs231n.github.io
- Yann LeCun (@ylecun) on Xx.com
- Stand-Alone Self-Attention in Vision Models - NeurIPS-2019-stand-alone-self-attention-in-vision-models-Paper.pdfpapers.nips.cc
- [2605.05331] ViTok-v2: Scaling Native Resolution Auto-Encoders to 5 Billion Parametersarxiv.org
- MobileViT · Hugging Facehuggingface.co
- Feature Visualizationdistill.pub
- [2301.00808] ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencodersarxiv.org
- ImageNet Classification with Deep Convolutional Neural Networksproceedings.neurips.cc