facebook / deit-tiny-patch16-224

huggingface.co
Total runs: 62.2K
24-hour runs: 0
7-day runs: 1.7K
30-day runs: 22.2K
Model's Last Updated: July 13 2022
image-classification

Introduction of deit-tiny-patch16-224

Model Details of deit-tiny-patch16-224

Data-efficient Image Transformer (tiny-sized model)

Data-efficient Image Transformer (DeiT) model pre-trained and fine-tuned on ImageNet-1k (1 million images, 1,000 classes) at resolution 224x224. It was first introduced in the paper Training data-efficient image transformers & distillation through attention by Touvron et al. and first released in this repository . However, the weights were converted from the timm repository by Ross Wightman.

Disclaimer: The team releasing DeiT did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

This model is actually a more efficiently trained Vision Transformer (ViT).

The Vision Transformer (ViT) is a transformer encoder model (BERT-like) pre-trained and fine-tuned on a large collection of images in a supervised fashion, namely ImageNet-1k, at a resolution of 224x224 pixels.

Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which are linearly embedded. One also adds a [CLS] token to the beginning of a sequence to use it for classification tasks. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder.

By pre-training the model, it learns an inner representation of images that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled images for instance, you can train a standard classifier by placing a linear layer on top of the pre-trained encoder. One typically places a linear layer on top of the [CLS] token, as the last hidden state of this token can be seen as a representation of an entire image.

Intended uses & limitations

You can use the raw model for image classification. See the model hub to look for fine-tuned versions on a task that interests you.

How to use

Since this model is a more efficiently trained ViT model, you can plug it into ViTModel or ViTForImageClassification. Note that the model expects the data to be prepared using DeiTFeatureExtractor. Here we use AutoFeatureExtractor, which will automatically use the appropriate feature extractor given the model name.

Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:

from transformers import AutoFeatureExtractor, ViTForImageClassification
from PIL import Image
import requests
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
feature_extractor = AutoFeatureExtractor.from_pretrained('facebook/deit-tiny-patch16-224')
model = ViTForImageClassification.from_pretrained('facebook/deit-tiny-patch16-224')
inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])

Currently, both the feature extractor and model support PyTorch. Tensorflow and JAX/FLAX are coming soon.

Training data

The ViT model was pretrained on ImageNet-1k , a dataset consisting of 1 million images and 1k classes.

Training procedure
Preprocessing

The exact details of preprocessing of images during training/validation can be found here .

At inference time, images are resized/rescaled to the same resolution (256x256), center-cropped at 224x224 and normalized across the RGB channels with the ImageNet mean and standard deviation.

Pretraining

The model was trained on a single 8-GPU node for 3 days. Training resolution is 224. For all hyperparameters (such as batch size and learning rate) we refer to table 9 of the original paper.

Evaluation results

Note that for fine-tuning, the best results are obtained with a higher resolution (384x384). Of course, increasing the model size will result in better performance.

BibTeX entry and citation info
@misc{touvron2021training,
      title={Training data-efficient image transformers & distillation through attention}, 
      author={Hugo Touvron and Matthieu Cord and Matthijs Douze and Francisco Massa and Alexandre Sablayrolles and Hervé Jégou},
      year={2021},
      eprint={2012.12877},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@misc{wu2020visual,
      title={Visual Transformers: Token-based Image Representation and Processing for Computer Vision}, 
      author={Bichen Wu and Chenfeng Xu and Xiaoliang Dai and Alvin Wan and Peizhao Zhang and Zhicheng Yan and Masayoshi Tomizuka and Joseph Gonzalez and Kurt Keutzer and Peter Vajda},
      year={2020},
      eprint={2006.03677},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@inproceedings{deng2009imagenet,
  title={Imagenet: A large-scale hierarchical image database},
  author={Deng, Jia and Dong, Wei and Socher, Richard and Li, Li-Jia and Li, Kai and Fei-Fei, Li},
  booktitle={2009 IEEE conference on computer vision and pattern recognition},
  pages={248--255},
  year={2009},
  organization={Ieee}
}

Runs of facebook deit-tiny-patch16-224 on huggingface.co

62.2K
Total runs
0
24-hour runs
-560
3-day runs
1.7K
7-day runs
22.2K
30-day runs

More Information About deit-tiny-patch16-224 huggingface.co Model

More deit-tiny-patch16-224 license Visit here:

https://choosealicense.com/licenses/apache-2.0

deit-tiny-patch16-224 huggingface.co

deit-tiny-patch16-224 huggingface.co is an AI model on huggingface.co that provides deit-tiny-patch16-224's model effect (), which can be used instantly with this facebook deit-tiny-patch16-224 model. huggingface.co supports a free trial of the deit-tiny-patch16-224 model, and also provides paid use of the deit-tiny-patch16-224. Support call deit-tiny-patch16-224 model through api, including Node.js, Python, http.

deit-tiny-patch16-224 huggingface.co Url

https://huggingface.co/facebook/deit-tiny-patch16-224

facebook deit-tiny-patch16-224 online free

deit-tiny-patch16-224 huggingface.co is an online trial and call api platform, which integrates deit-tiny-patch16-224's modeling effects, including api services, and provides a free online trial of deit-tiny-patch16-224, you can try deit-tiny-patch16-224 online for free by clicking the link below.

facebook deit-tiny-patch16-224 online free url in huggingface.co:

https://huggingface.co/facebook/deit-tiny-patch16-224

deit-tiny-patch16-224 install

deit-tiny-patch16-224 is an open source model from GitHub that offers a free installation service, and any user can find deit-tiny-patch16-224 on GitHub to install. At the same time, huggingface.co provides the effect of deit-tiny-patch16-224 install, users can directly use deit-tiny-patch16-224 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

deit-tiny-patch16-224 install url in huggingface.co:

https://huggingface.co/facebook/deit-tiny-patch16-224

Url of deit-tiny-patch16-224

deit-tiny-patch16-224 huggingface.co Url

Provider of deit-tiny-patch16-224 huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 15.5M
Run Growth: -891.5K
Growth Rate: -5.63%
Updated:September 15 2023
huggingface.co

Total runs: 8.1M
Run Growth: 458.1K
Growth Rate: 5.69%
Updated:January 20 2022
huggingface.co

Total runs: 4.9M
Run Growth: 1.7M
Growth Rate: 35.14%
Updated:September 06 2023
huggingface.co

Total runs: 3.3M
Run Growth: -560.0K
Growth Rate: -17.31%
Updated:December 28 2021
huggingface.co

Total runs: 2.6M
Run Growth: 378.5K
Growth Rate: 15.32%
Updated:January 17 2024
huggingface.co

Total runs: 2.2M
Run Growth: 211.6K
Growth Rate: 9.41%
Updated:November 21 2025
huggingface.co

Total runs: 2.1M
Run Growth: 709.7K
Growth Rate: 33.47%
Updated:March 23 2023
huggingface.co

Total runs: 1.8M
Run Growth: -356.7K
Growth Rate: -20.06%
Updated:January 25 2024
huggingface.co

Total runs: 834.6K
Run Growth: -237.8K
Growth Rate: -27.99%
Updated:September 06 2023
huggingface.co

Total runs: 674.5K
Run Growth: -927.6K
Growth Rate: -139.04%
Updated:January 12 2024
huggingface.co

Total runs: 608.1K
Run Growth: 139.2K
Growth Rate: 22.58%
Updated:May 22 2023
huggingface.co

Total runs: 499.7K
Run Growth: 155.4K
Growth Rate: 31.09%
Updated:March 17 2025
huggingface.co

Total runs: 395.0K
Run Growth: -81.9K
Growth Rate: -20.76%
Updated:January 12 2024
huggingface.co

Total runs: 386.1K
Run Growth: 42.7K
Growth Rate: 11.13%
Updated:February 29 2024
huggingface.co

Total runs: 376.2K
Run Growth: 222.5K
Growth Rate: 59.03%
Updated:September 06 2023
huggingface.co

Total runs: 340.4K
Run Growth: -473.6K
Growth Rate: -141.72%
Updated:July 25 2023
huggingface.co

Total runs: 327.5K
Run Growth: -80.2K
Growth Rate: -24.88%
Updated:November 17 2022
huggingface.co

Total runs: 247.5K
Run Growth: 67.4K
Growth Rate: 26.28%
Updated:June 13 2023
huggingface.co

Total runs: 236.9K
Run Growth: 14.3K
Growth Rate: 6.02%
Updated:July 23 2024
huggingface.co

Total runs: 236.3K
Run Growth: -47.5K
Growth Rate: -19.96%
Updated:June 15 2023
huggingface.co

Total runs: 235.8K
Run Growth: 38.5K
Growth Rate: 14.67%
Updated:September 15 2023
huggingface.co

Total runs: 185.8K
Run Growth: 36.4K
Growth Rate: 21.54%
Updated:May 22 2023
huggingface.co

Total runs: 163.2K
Run Growth: 2.1K
Growth Rate: 1.30%
Updated:September 01 2023
huggingface.co

Total runs: 143.1K
Run Growth: 26.5K
Growth Rate: 19.46%
Updated:February 12 2023
huggingface.co

Total runs: 140.3K
Run Growth: 32.7K
Growth Rate: 23.74%
Updated:June 13 2023
huggingface.co

Total runs: 135.5K
Run Growth: -58.1K
Growth Rate: -34.24%
Updated:June 13 2023
huggingface.co

Total runs: 129.3K
Run Growth: -17.3K
Growth Rate: -13.31%
Updated:June 03 2022
huggingface.co

Total runs: 115.3K
Run Growth: -17.5K
Growth Rate: -14.38%
Updated:September 15 2023
huggingface.co

Total runs: 111.3K
Run Growth: 6.6K
Growth Rate: 5.96%
Updated:September 06 2023
huggingface.co

Total runs: 97.9K
Run Growth: 91.4K
Growth Rate: 92.16%
Updated:September 06 2023
huggingface.co

Total runs: 89.0K
Run Growth: 5.4K
Growth Rate: 5.99%
Updated:January 25 2023
huggingface.co

Total runs: 88.5K
Run Growth: -9.6K
Growth Rate: -10.64%
Updated:November 20 2023
huggingface.co

Total runs: 87.0K
Run Growth: 13.7K
Growth Rate: 15.75%
Updated:March 28 2026
huggingface.co

Total runs: 78.8K
Run Growth: 46.4K
Growth Rate: 56.99%
Updated:June 13 2023
huggingface.co

Total runs: 71.0K
Run Growth: -24.6K
Growth Rate: -37.23%
Updated:November 16 2023
huggingface.co

Total runs: 69.3K
Run Growth: 60.9K
Growth Rate: 87.41%
Updated:September 01 2023
huggingface.co

Total runs: 62.2K
Run Growth: 15.3K
Growth Rate: 24.65%
Updated:March 27 2026
huggingface.co

Total runs: 52.6K
Run Growth: 24.8K
Growth Rate: 48.09%
Updated:March 13 2024