Pre-trained FasterViT based ImageNet Classification weights
Model
Pre-trained FasterViT based ImageNet Classification weights

Pre-trained FasterViT weights trained on ImageNet to facilitate transfer learning using TAO Toolkit.

TAO Non-Commercial Pretrained FasterViT Classification Model

What is Train Adapt Optimize (TAO) Toolkit?

Train Adapt Optimize (TAO) Toolkit is a Python-based AI toolkit for customizing purpose-built pre-trained AI models with your own data. TAO Toolkit adapts popular network architectures and backbones for your data, allowing you to train, fine-tune, prune, and export highly optimized and accurate AI models for edge deployment.

The pre-trained models accelerate the AI training process and reduce costs associated with large-scale data collection, labeling, and training from scratch. Transfer learning with pre-trained models can be used for AI applications in smart cities, retail, healthcare, industrial inspection, and more.

Build end-to-end services and solutions for transforming pixels and sensor data into actionable insights using the TAO DeepStream SDK and TensorRT. These models are suitable for object detection, classification, and segmentation.

Model Overview

Image Classification is a popular computer vision technique in which an image is classified into one of the designated classes based on the image features. This model card contains pretrained weights for most of the popular classification models. These weights can be used as a starting point with the classification app in TAO Toolkit to facilitate transfer learning.

Model Architecture

FasterViT is a hybrid CNN-ViT-based family of backbone from NVIDIA research that achieves SOTA in ImageNet-1K classification with focus on throughput. This family of backbone leverages Hierarchical Attention (HAT), which decomposes global self-attention with quadratic complexity into a multi-level attention with reduced computational cost. FasterViT architecture was designed with TensorRT in mind, so the model throughput is highly optimized in TensorRT SDK. Use FasterViT when you want to achieve SOTA accuracy on your target dataset while achieving higher throughput compared to other Vision Transformers such as Swin and ConvNext.

Training

This model was trained using the classification_pyt entrypoint in TAO. The training algorithm optimizes the network to minimize cross-entropy loss.

Training Data

Most of the FasterViT models were trained on ImageNet1K dataset. FasterViT-Large was trained on ImageNet22k dataset

Performance

Evaluation Data

The FasterViT models have been evaluated on the ImageNet1K validation dataset.

Methodology and KPI

The key performance indicator is accuracy, following the standard evaluation protocol for image classification. The KPI for the evaluation data are:

ModelTop-1 Accuracy
faster_vit_0_2240.821
faster_vit_1_2240.832
faster_vit_2_2240.842
faster_vit_3_2240.849
faster_vit_4_2240.854
faster_vit_5_2240.856
faster_vit_6_2240.858
faster_vit_4_21k_2240.866
faster_vit_4_21k_3840.876
faster_vit_4_21k_5120.878
faster_vit_4_21k_7840.879

Real-Time Inference Performance

The inference is run on the provided unpruned model at FP16 precision. The inference performance is run using trtexec on Jetson AGX Xavier, Xavier NX, Orin, Orin NX, NVIDIA T4, and Ampere GPUs. The Jetson devices are running at Max-N configuration for maximum GPU frequency. The performance shown here is for inference only. End-to-end performance with streaming video data might vary slightly depending on other bottlenecks in the hardware and software.

FasterViT-1-224

PlatformBSFPS
Jetson Orin Nano4199
Orin NX 16GB4292
AGX Orin 64GB8773
A232761
T4321214
A30163490
L4322871
L40328342
A100325653
H100328825

FasterViT-2-224

PlatformBSFPS
Jetson Orin Nano4231
Orin NX 16GB4292
AGX Orin 64GB8628
A232544
T432889
A30162719
L4321753
L40325607
A100324698
H100327363

FasterViT-4-224

PlatformBSFPS
Jetson Orin Nano443
Orin NX 16GB459
AGX Orin 64GB8149
A232117
T432198
A3016666
L432421
L40321106
A100321375
H100322510

FasterViT-4-21K-512

PlatformBSFPS
Jetson Orin Nano46
Orin NX 16GB49
AGX Orin 64GB824
A23216
T43227
A301696
L43245
L4032133
A10032205
H10032382

How to Use This Model

These models must be used with NVIDIA hardware and software. For hardware, the models can run on any NVIDIA GPU including NVIDIA Jetson devices. These models can only be used with TAO Toolkit, the DeepStream SDK, or TensorRT.

The primary use case for these models is classifying objects in a color (RGB) image. They can be used to classify objects from photos and videos by using appropriate video or image decoding and pre-processing.

These models are intended for training and fine-tune using TAO Toolkit and user datasets for image classification. High-fidelity models can be trained to new use cases. A Jupyter Notebook is available as a part of the TAO container and can be used to re-train the models.

The models are also intended for easy edge deployment using DeepStream SDK or TensorRT. DeepStream provides the facilities to create efficient video analytic pipelines to capture, decode, and pre-process the data before running inference.

Input

  • B X 3 X 224 X 224 (B C H W)
  • B X 3 X 384 X 384 (B C H W) for faster_vit_4_21k_384
  • B X 3 X 512 X 512 (B C H W) for faster_vit_4_21k_512
  • B X 3 X 768 X 768 (B C H W) for faster_vit_4_21k_768

Output

Category labels (1000 classes) for the input image.

Instructions to Use Pretrained Models with TAO

To use these models as pretrained weights for transfer learning, use the following code snippet as a template for the model and train component of the experiment spec file when training a FasterViT Classification model. For more information on the experiment spec file, refer to the TAO Toolkit User Guide.

model:
  init_cfg:
    checkpoint: /path/to/the/faster_vit_0_224.pth
  backbone:
    type: faster_vit_0_224
  head:
    type: LinearClsHead

Instructions to Deploy These Models with DeepStream

Documentation to deploy with DeepStream is provided in the "Deploying to DeepStream" chapter of the TAO User Guide.

Limitations

FasterViT was trained on the ImageNet1K dataset with 1000 object categories. Hence, the model might not perform well on different data distributions. We recommend conducting further fine-tuning on the target domain to get higher accuracy rates.

Model Versions

  • fastervit_0_224_1k - ImageNet1K pre-trained FasterViT-0-224 model for finetune.
  • fastervit_1_224_1k - ImageNet1K pre-trained FasterViT-1-224 model for finetune.
  • fastervit_2_224_1k - ImageNet1K pre-trained FasterViT-2-224 model for finetune.
  • fastervit_3_224_1k - ImageNet1K pre-trained FasterViT-3-224 model for finetune.
  • fastervit_4_224_1k - ImageNet1K pre-trained FasterViT-4-224 model for finetune.
  • fastervit_5_224_1k - ImageNet1K pre-trained FasterViT-5-224 model for finetune.
  • fastervit_6_224_1k - ImageNet1K pre-trained FasterViT-6-224 model for finetune.
  • fastervit_4_21k_224_w14 - ImageNet22k pre-trained FasterViT-4-224 model for finetune.
  • fastervit_4_21k_384_w24 - ImageNet22k pre-trained FasterViT-4-384 model for finetune.
  • fastervit_4_21k_512_w32 - ImageNet22k pre-trained FasterViT-4-512 model for finetune.
  • fastervit_4_21k_768_w48 - ImageNet22k pre-trained FasterViT-4-768 model for finetune.

Reference

Citations

  • Hatamizadeh, A., Heinrich, G., Yin, H., Tao, A., Alvarez, J., Kautz, J., Molchanov, P.: FasterViT: Fast Vision Transformers with Hierarchical Attention.

Using TAO Pre-Trained Models

License

This work is licensed under the Creative Commons Attribution NonCommercial ShareAlike 4.0 License (CC-BY-NC-SA-4.0). To view a copy of this license, see link, or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

Technical Blogs

Suggested Reading

Ethical Considerations

NVIDIA platforms and application frameworks enable developers to build a wide array of AI applications. Consider potential algorithmic bias when choosing or creating the models being deployed. Work with the model’s developers to ensure that it meets the requirements for the relevant industry and use case, that the necessary instructions and documentation are provided to understand error rates, confidence intervals, and results, and that the model is being used under the conditions and in the manner intended.

Publisher
Latest Versiondeployable_fastervit_6_224_1k_op17
UpdatedDecember 12, 2023 UTC
Compressed Size18.37 MB