Data-efficient Image Transformers EXPLAINED! Facebook AI's DeiT paper

AI Coffee Break with Letitia · Advanced ·📄 Research Papers Explained ·5y ago

Key Takeaways

This video explains Facebook AI's DeiT paper on data-efficient image transformers

Full Transcript

welcome we are here to discuss the best kind of paper you know those papers that are published on archive just before the end of the year because that is when everybody wants to finish stuff but does not directly have a conference to submit to so great christmas reading papers or not well it does not matter how much you like christmas and new year's eve papers since this one here comes with breaking news and the transformers are here to take over computer vision [Music] um no this is actually old news we had a previous video about the vit vision transformer by google that achieved state of the art on image recognition with a pure transformer architecture but by also using 300 million more images of their own not publicly released data find the link to the video in the description below then the actual news of this video is that facebook now managed to train a pure transformer too but unlike google they trained only on imagenet and achieved competitive results in this video we will discuss why is this surprising or even an achievement from facebook research how did they do it and what does it mean for transformers training on academic data sets as mentioned in the previous video about google's vision transformer the transformer architecture is more general than cnns or lstms for example cnns already know how to look at images patch by patch with convolutions containing the same parameters for every patch lstms on the other hand know how to handle sequences from left to right this inductive bias is intrinsically bound to their architecture but the transformer does not have these inductive biases for it the data does not have to be a 2d matrix an image or a sequence like text as long as it is a set the order if there is one is encoded in the positional embeddings hence the transformer can do computer vision and text processing or both combined by learning how to handle the visual or textual domains from the data itself but for learning this it has to see more data than the cnn or lstm counterparts then of course it is not surprising that google's vit had to look at 300 million more images to beat state of the art on imagenet on image recognition the facebook's deit's number of 84.4 percent on imagenet means a lot with around 300 times less data crazy how did they do it facebook's deit model processes images very similarly to google's vit model 16 by 16 image patches are transformed to image vectors because vectors are the representations that transformers naturally work with the authors of the deity paper call these image vectors patch tokens call them whatever you like these patch tokens are processed by transformer layers built by the usual multi-head self-attention and feed-forward layers that in the end have to predict the correct label of the image prediction which is enforced by the cross entropy loss but here one can see something that google's vid model did not have a distillation token this special token has to be predicted by a transformer to match the output of a cnn teacher model why a cnn because it has more priors about images therefore the teacher cnn model can learn from less data more easily than a transformer which without the inductive bias has more degrees of freedom and needs more data to train distillation is a cool idea to apply for the transformer here which simultaneously but with two different heads has to both maximize the cross-entropy loss to make correct predictions and also make the teacher's prediction this is distillation in the way of the transformer this is the way but unlike vit of the google researchers deit from facebook does not work with a lot of data and to alleviate this the authors apply three common techniques for cnns on transformers data augmentation optimization and regularization for data augmentation the authors do not provide that many details except that almost every data augmentation technique is useful if you are not familiar with data augmentation for images here are some examples flipping the image on both axes when it makes sense or slightly changing the contrast or brightness or saturation are useful ways to change the image in the eyes of the neural network but without changing its meaning now about the optimizers because transformers are very sensitive to different optimizers the authors choose the best one and search for the best hyper parameters like the learning rates and weight decay by cross validation well i mean for this you need the facebook computing power right furthermore after training they fine tune the transformer on images of a greater resolution than during training they train on 224 by 224 pixel images and fine tune on 384 by 384 pixel images by this even though the number of instances in the training data is the same for the network the effective training data is increased because the scaled higher resolution images are new for the network do not forget that these images are then converted to patch tokens or image vectors as ms coffee bean likes to call them so the transformer can work with these vectors but in order to make this work properly the authors need to upscale the images with a special bicubic interpolation with a specific regularization that preserves the norm of the image vectors if they would not do so the norm of the original image vectors would be too different to the norm of the upscaled image and the trained transformer would not recognize the relatedness between the data seen during training and what it gets during fine tuning okay so to generalize and to conclude d-e-i-t is like vit but i side trained with a procedure more adapted to a data starving regime and this is the cool thing about it leaving vit state of the art numbers on imagenet a little in the shadow especially now that it seems like transformers are here to stay it is great that a step towards data efficiency was made by deit making it possible to train a transformer on image data sets of millions of images instead of hundreds of millions of images and this is great perhaps you remember what miss coffee bean said in the vit video about transformers taking over cnns perhaps not but i can tell you that she is very surprised by this deit paper coming so quickly after vit and addressing the data efficiency aspect of visual transformers right away she really thought this might take longer but it's machine learning what did you expect you turn your head for a second and next an awesome thing happens how can you keep up with this but rather how to not be overly excited by this miss coffee bean are you done yes i am okay bye you

Original Description

"Training data-efficient image transformers & distillation through attention" paper explained! How does the DeiT transformer for image recognition by @facebookai train with around 100x less training data than ViT? ➡️ AI Coffee Break Merch! 🛍️ https://aicoffeebreak.creator-spring.com/ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ 🔥 Optionally, pay us a coffee to boost our Coffee Bean production! ☕ Patreon: https://www.patreon.com/AICoffeeBreak Ko-fi: https://ko-fi.com/aicoffeebreak ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ 📺 ViT Transformer: https://youtu.be/DVoHvmww2lQ 📺 Transformer architecture explained: https://youtu.be/FWFA4DGuzSc 📺 Visual Chirality: https://youtu.be/rbg1Mdo2LZM Outline: * 00:00 Facebook’s DeiT * 01:34 Why is DeiT cool? * 03:03 How does it work? * 07:10 What does this mean? 📄 DeiT paper: https://arxiv.org/pdf/2012.12877.pdf Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, Hervé Jégou (2020) “Training data-efficient image transformers & distillation through attention” 💻 DeiT code: https://github.com/facebookresearch/deit 📚 For an in-depth understanding of how it works, check out this wonderful post by @JacobGildenblat https://jacobgil.github.io/deeplearning/vision-transformer-explainability 📚 On-point blog post by Andrei-Cristian Rad: https://radandreicristian.medium.com/what-to-do-if-training-on-jft-300m-is-not-an-option-convnet-teachers-to-the-rescue-104a7bf7dccb News music 🎵 source: News Theme 2 by Audionautix is licensed under a Creative Commons Attribution 4.0 licence. https://creativecommons.org/licenses/by/4.0/ Artist: http://audionautix.com/ 🔗 Links: YouTube: https://www.youtube.com/AICoffeeBreak Twitter: https://twitter.com/AICoffeeBreak Reddit: https://www.reddit.com/r/AICoffeeBreak/ #AICoffeeBreak #MsCoffeeBean #DeiT #MachineLearning #AI #research
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AI Coffee Break with Letitia · AI Coffee Break with Letitia · 23 of 60

1 AI Coffee Break - Channel Trailer
AI Coffee Break - Channel Trailer
AI Coffee Break with Letitia
2 How to check if a neural network has learned a specific phenomenon?
How to check if a neural network has learned a specific phenomenon?
AI Coffee Break with Letitia
3 A brief history of the Transformer architecture in NLP
A brief history of the Transformer architecture in NLP
AI Coffee Break with Letitia
4 Our paper at CVPR 2020 - MUL Workshop and ACL 2020 - ALVR Workshop
Our paper at CVPR 2020 - MUL Workshop and ACL 2020 - ALVR Workshop
AI Coffee Break with Letitia
5 The Transformer neural network architecture EXPLAINED. “Attention is all you need”
The Transformer neural network architecture EXPLAINED. “Attention is all you need”
AI Coffee Break with Letitia
6 Transformer combining Vision and Language? ViLBERT - NLP meets Computer Vision
Transformer combining Vision and Language? ViLBERT - NLP meets Computer Vision
AI Coffee Break with Letitia
7 Pre-training of BERT-based Transformer architectures explained – language and vision!
Pre-training of BERT-based Transformer architectures explained – language and vision!
AI Coffee Break with Letitia
8 GPT-3 explained with examples. Possibilities, and implications.
GPT-3 explained with examples. Possibilities, and implications.
AI Coffee Break with Letitia
9 Adversarial Machine Learning explained! | With examples.
Adversarial Machine Learning explained! | With examples.
AI Coffee Break with Letitia
10 BERTology meets Biology | Solving biological problems with Transformers
BERTology meets Biology | Solving biological problems with Transformers
AI Coffee Break with Letitia
11 Can a neural network tell if an image is mirrored? – Visual Chirality
Can a neural network tell if an image is mirrored? – Visual Chirality
AI Coffee Break with Letitia
12 The ultimate intro to Graph Neural Networks. Maybe.
The ultimate intro to Graph Neural Networks. Maybe.
AI Coffee Break with Letitia
13 Can language models understand? Bender and Koller argument.
Can language models understand? Bender and Koller argument.
AI Coffee Break with Letitia
14 GANs explained | Generative Adversarial Networks video with showcase!
GANs explained | Generative Adversarial Networks video with showcase!
AI Coffee Break with Letitia
15 What nobody tells you about MULTIMODAL Machine Learning! 🙊 THE definition.
What nobody tells you about MULTIMODAL Machine Learning! 🙊 THE definition.
AI Coffee Break with Letitia
16 Multimodal Machine Learning models do not work. Here is why. Part 1/2 – The SYMPTOMS
Multimodal Machine Learning models do not work. Here is why. Part 1/2 – The SYMPTOMS
AI Coffee Break with Letitia
17 Why Multimodal Machine Learning models do not work. Part 2/2 – The CAUSES
Why Multimodal Machine Learning models do not work. Part 2/2 – The CAUSES
AI Coffee Break with Letitia
18 An image is worth 16x16 words: ViT | Vision Transformer explained
An image is worth 16x16 words: ViT | Vision Transformer explained
AI Coffee Break with Letitia
19 AI understanding language!? A roadmap to natural language understanding.
AI understanding language!? A roadmap to natural language understanding.
AI Coffee Break with Letitia
20 "What Can We Do to Improve Peer Review in NLP?" 👀
"What Can We Do to Improve Peer Review in NLP?" 👀
AI Coffee Break with Letitia
21 The curse of dimensionality. Or is it a blessing?
The curse of dimensionality. Or is it a blessing?
AI Coffee Break with Letitia
22 PCA explained with intuition, a little math and code
PCA explained with intuition, a little math and code
AI Coffee Break with Letitia
Data-efficient Image Transformers EXPLAINED! Facebook AI's DeiT paper
Data-efficient Image Transformers EXPLAINED! Facebook AI's DeiT paper
AI Coffee Break with Letitia
24 OpenAI's DALL-E explained. How GPT-3 creates images from descriptions.
OpenAI's DALL-E explained. How GPT-3 creates images from descriptions.
AI Coffee Break with Letitia
25 Leaking training data from GPT-2. How is this possible?
Leaking training data from GPT-2. How is this possible?
AI Coffee Break with Letitia
26 OpenAI’s CLIP explained! | Examples, links to code and pretrained model
OpenAI’s CLIP explained! | Examples, links to code and pretrained model
AI Coffee Break with Letitia
27 Transformers can do both images and text. Here is why.
Transformers can do both images and text. Here is why.
AI Coffee Break with Letitia
28 UMAP explained | The best dimensionality reduction?
UMAP explained | The best dimensionality reduction?
AI Coffee Break with Letitia
29 NVIDIA Jarvis (now NVIDIA Riva) meets Ms. Coffee Bean
NVIDIA Jarvis (now NVIDIA Riva) meets Ms. Coffee Bean
AI Coffee Break with Letitia
30 Transformer in Transformer: Paper explained and visualized | TNT
Transformer in Transformer: Paper explained and visualized | TNT
AI Coffee Break with Letitia
31 [RANT] Adversarial attack on OpenAI’s CLIP? Are we the fools or the foolers?
[RANT] Adversarial attack on OpenAI’s CLIP? Are we the fools or the foolers?
AI Coffee Break with Letitia
32 Pattern Exploiting Training explained! | PET, iPET, ADAPET
Pattern Exploiting Training explained! | PET, iPET, ADAPET
AI Coffee Break with Letitia
33 Deep Learning for Symbolic Mathematics!? | Paper EXPLAINED
Deep Learning for Symbolic Mathematics!? | Paper EXPLAINED
AI Coffee Break with Letitia
34 FNet: Mixing Tokens with Fourier Transforms – Paper Explained
FNet: Mixing Tokens with Fourier Transforms – Paper Explained
AI Coffee Break with Letitia
35 Are Pre-trained Convolutions Better than Pre-trained Transformers? – Paper Explained
Are Pre-trained Convolutions Better than Pre-trained Transformers? – Paper Explained
AI Coffee Break with Letitia
36 "Please Commit More Blatant Academic Fraud" – A fellow PhD student's response.
"Please Commit More Blatant Academic Fraud" – A fellow PhD student's response.
AI Coffee Break with Letitia
37 Scaling Vision Transformers? How much data can a transformer get? #Shorts
Scaling Vision Transformers? How much data can a transformer get? #Shorts
AI Coffee Break with Letitia
38 How cross-modal are vision and language models really? 👀 Seeing past words. [Own work]
How cross-modal are vision and language models really? 👀 Seeing past words. [Own work]
AI Coffee Break with Letitia
39 Charformer: Fast Character Transformers via Gradient-based Subword Tokenization +Tokenizer explained
Charformer: Fast Character Transformers via Gradient-based Subword Tokenization +Tokenizer explained
AI Coffee Break with Letitia
40 Positional embeddings in transformers EXPLAINED | Demystifying positional encodings.
Positional embeddings in transformers EXPLAINED | Demystifying positional encodings.
AI Coffee Break with Letitia
41 Adding vs. concatenating positional embeddings & Learned positional encodings
Adding vs. concatenating positional embeddings & Learned positional encodings
AI Coffee Break with Letitia
42 Self-Attention with Relative Position Representations – Paper explained
Self-Attention with Relative Position Representations – Paper explained
AI Coffee Break with Letitia
43 Saddle points vs. local minima in high dimensional spaces | ❓ #AICoffeeBreakQuiz #Shorts
Saddle points vs. local minima in high dimensional spaces | ❓ #AICoffeeBreakQuiz #Shorts
AI Coffee Break with Letitia
44 What is the model identifiability problem? | Explained in 60 seconds! | ❓ #AICoffeeBreakQuiz #Shorts
What is the model identifiability problem? | Explained in 60 seconds! | ❓ #AICoffeeBreakQuiz #Shorts
AI Coffee Break with Letitia
45 Data leakage during data preparation? | Using AntiPatterns to avoid MLOps Mistakes
Data leakage during data preparation? | Using AntiPatterns to avoid MLOps Mistakes
AI Coffee Break with Letitia
46 Is today's AI smarter than YOU? #Shorts
Is today's AI smarter than YOU? #Shorts
AI Coffee Break with Letitia
47 Convolution vs Cross-Correlation. How most CNNs do not compute convolutions. | ❓ #Shorts
Convolution vs Cross-Correlation. How most CNNs do not compute convolutions. | ❓ #Shorts
AI Coffee Break with Letitia
48 Why do we care about cross-correlations vs convolutions | ❓ #AICoffeeBreakQuiz #Shorts
Why do we care about cross-correlations vs convolutions | ❓ #AICoffeeBreakQuiz #Shorts
AI Coffee Break with Letitia
49 The convolution is not shift invariant. | Invariance vs Equivariance | ❓ #AICoffeeBreakQuiz #Shorts
The convolution is not shift invariant. | Invariance vs Equivariance | ❓ #AICoffeeBreakQuiz #Shorts
AI Coffee Break with Letitia
50 How to increase the receptive field in CNNs? | #AICoffeeBreakQuiz #Shorts
How to increase the receptive field in CNNs? | #AICoffeeBreakQuiz #Shorts
AI Coffee Break with Letitia
51 What is tokenization and how does it work? Tokenizers explained.
What is tokenization and how does it work? Tokenizers explained.
AI Coffee Break with Letitia
52 Foundation Models | On the opportunities and risks of calling pre-trained models “Foundation Models”
Foundation Models | On the opportunities and risks of calling pre-trained models “Foundation Models”
AI Coffee Break with Letitia
53 How modern search engines work – Vector databases explained! | Weaviate open-source
How modern search engines work – Vector databases explained! | Weaviate open-source
AI Coffee Break with Letitia
54 Eyes tell all: How to tell that an AI generated a face?
Eyes tell all: How to tell that an AI generated a face?
AI Coffee Break with Letitia
55 Swin Transformer paper animated and explained
Swin Transformer paper animated and explained
AI Coffee Break with Letitia
56 Data BAD | What Will it Take to Fix Benchmarking for NLU?
Data BAD | What Will it Take to Fix Benchmarking for NLU?
AI Coffee Break with Letitia
57 SimVLM explained | What the paper doesn’t tell you
SimVLM explained | What the paper doesn’t tell you
AI Coffee Break with Letitia
58 Generalization – Interpolation – Extrapolation in Machine Learning: Which is it now!?
Generalization – Interpolation – Extrapolation in Machine Learning: Which is it now!?
AI Coffee Break with Letitia
59 Do Transformers process sequences of FIXED or of VARIABLE length? | #AICoffeeBreakQuiz
Do Transformers process sequences of FIXED or of VARIABLE length? | #AICoffeeBreakQuiz
AI Coffee Break with Letitia
60 The efficiency misnomer | Size does not matter | What does the number of parameters mean in a model?
The efficiency misnomer | Size does not matter | What does the number of parameters mean in a model?
AI Coffee Break with Letitia

Related Reads

Up next
Welcome to the Next Temperamental Era
Charles Schwab
Watch →