All Projects → lucidrains → Transformer In Transformer

lucidrains / Transformer In Transformer

Licence: mit
Implementation of Transformer in Transformer, pixel level attention paired with patch level attention for image classification, in Pytorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Transformer In Transformer

Sianet
An easy to use C# deep learning library with CUDA/OpenCL support
Stars: ✭ 353 (+100.57%)
Mutual labels:  artificial-intelligence, image-classification
Hardhat Detector
A convolutional neural network implementation of a script that detects whether an individual is wearing a hardhat or not.
Stars: ✭ 41 (-76.7%)
Mutual labels:  artificial-intelligence, image-classification
Bottleneck Transformer Pytorch
Implementation of Bottleneck Transformer in Pytorch
Stars: ✭ 408 (+131.82%)
Mutual labels:  artificial-intelligence, image-classification
Vit Pytorch
Implementation of Vision Transformer, a simple way to achieve SOTA in vision classification with only a single transformer encoder, in Pytorch
Stars: ✭ 7,199 (+3990.34%)
Mutual labels:  artificial-intelligence, image-classification
Global Self Attention Network
A Pytorch implementation of Global Self-Attention Network, a fully-attention backbone for vision tasks
Stars: ✭ 64 (-63.64%)
Mutual labels:  artificial-intelligence, image-classification
Lightnet
🌓 Bringing pjreddie's DarkNet out of the shadows #yolo
Stars: ✭ 322 (+82.95%)
Mutual labels:  artificial-intelligence, image-classification
Pba
Efficient Learning of Augmentation Policy Schedules
Stars: ✭ 461 (+161.93%)
Mutual labels:  artificial-intelligence, image-classification
Caer
High-performance Vision library in Python. Scale your research, not boilerplate.
Stars: ✭ 452 (+156.82%)
Mutual labels:  artificial-intelligence, image-classification
The Third Eye
An AI based application to identify currency and gives audio feedback.
Stars: ✭ 63 (-64.2%)
Mutual labels:  artificial-intelligence, image-classification
Meme Generator
MemeGen is a web application where the user gives an image as input and our tool generates a meme at one click for the user.
Stars: ✭ 57 (-67.61%)
Mutual labels:  artificial-intelligence, image-classification
Transfer Learning Suite
Transfer Learning Suite in Keras. Perform transfer learning using any built-in Keras image classification model easily!
Stars: ✭ 212 (+20.45%)
Mutual labels:  artificial-intelligence, image-classification
Image classifier
CNN image classifier implemented in Keras Notebook 🖼️.
Stars: ✭ 139 (-21.02%)
Mutual labels:  artificial-intelligence, image-classification
Deep Learning With Python
Deep learning codes and projects using Python
Stars: ✭ 195 (+10.8%)
Mutual labels:  artificial-intelligence, image-classification
Artificio
Deep Learning Computer Vision Algorithms for Real-World Use
Stars: ✭ 326 (+85.23%)
Mutual labels:  artificial-intelligence, image-classification
Computervision Recipes
Best Practices, code samples, and documentation for Computer Vision.
Stars: ✭ 8,214 (+4567.05%)
Mutual labels:  artificial-intelligence, image-classification
Malware Classification
Towards Building an Intelligent Anti-Malware System: A Deep Learning Approach using Support Vector Machine for Malware Classification
Stars: ✭ 88 (-50%)
Mutual labels:  artificial-intelligence, image-classification
Iresnet
Improved Residual Networks (https://arxiv.org/pdf/2004.04989.pdf)
Stars: ✭ 163 (-7.39%)
Mutual labels:  artificial-intelligence, image-classification
Machine Learning Notes
周志华《机器学习》手推笔记
Stars: ✭ 2,710 (+1439.77%)
Mutual labels:  artificial-intelligence
Vit
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Stars: ✭ 176 (+0%)
Mutual labels:  image-classification
Elf
An End-To-End, Lightweight and Flexible Platform for Game Research
Stars: ✭ 2,057 (+1068.75%)
Mutual labels:  artificial-intelligence

Transformer in Transformer

Implementation of Transformer in Transformer, pixel level attention paired with patch level attention for image classification, in Pytorch.

AI Coffee Break with Letita

Install

$ pip install transformer-in-transformer

Usage

import torch
from transformer_in_transformer import TNT

tnt = TNT(
    image_size = 256,       # size of image
    patch_dim = 512,        # dimension of patch token
    pixel_dim = 24,         # dimension of pixel token
    patch_size = 16,        # patch size
    pixel_size = 4,         # pixel size
    depth = 6,              # depth
    num_classes = 1000,     # output number of classes
    attn_dropout = 0.1,     # attention dropout
    ff_dropout = 0.1        # feedforward dropout
)

img = torch.randn(2, 3, 256, 256)
logits = tnt(img) # (2, 1000)

Citations

@misc{han2021transformer,
    title   = {Transformer in Transformer}, 
    author  = {Kai Han and An Xiao and Enhua Wu and Jianyuan Guo and Chunjing Xu and Yunhe Wang},
    year    = {2021},
    eprint  = {2103.00112},
    archivePrefix = {arXiv},
    primaryClass = {cs.CV}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].