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