VehicleMakeNet Model Card
The model described in this card is a classification network, which aims to classify car images into 20 popular car makes. VehicleMakeNet is generally cascaded with DashCamNet or TrafficCamNet for smart city applications.
This model classifies following cars: Acura, Audi, BMW, Chevrolet, Chrysler, Dodge, Ford, GMC, Honda, Hyundai, Infiniti, Jeep, Kia, Lexus, Mazda, Mercedes, Nissan, Subaru, Toyota, and Volkswagen.
This is a classification model with a Resnet18 backbone.
The training algorithm optimizes the network to minimize the categorical cross entropy loss for the classes. The training is carried out in two phases. In the first phase, the network is trained with regularization to facilitate pruning. Following the first phase, we prune the network removing channels whose kernel norms are below the pruning threshold. In the second phase the pruned network is retrained.
- He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016)
VehicleMakeNet is generally cascaded with DashCamNet or TrafficCamNet for smart city applications. For example, DashCamNet or TrafficCamNet acts as a primary detector, detecting the objects of interest and for each detected car the VehicleMakeNet acts as a secondary classifier determining the make of the car. Businesses such as smart parking or gas stations can use the insights of the make of vehicles to understand their customers.
RGB Images of dimensions: 224 X 224 X 3 (W x H x C) Channel Ordering of the Input: NCHW, where N = Batch Size, C = number of channels (3), H = Height of images (224), W = Width of the images (224) Input scale: None Mean subtraction: [103.939, 116.779, 123.68]
This model needs to be used with NVIDIA Hardware and Software. For Hardware, the model can run on any NVIDIA GPU including NVIDIA Jetson devices. This model can only be used with Train Adapt Optimize (TAO) Toolkit, DeepStream SDK or TensorRT.
There are two flavors of the model:
unpruned model is intended for training using TAO Toolkit and the user's own dataset. This can provide high fidelity models that are adapted to the use case. The Jupyter notebook available as a part of TAO container can be used to re-train.
pruned model is intended for efficient deployment on the edge using DeepStream SDK or TensorRT. This model accepts
224x224x3 dimension input tensors and outputs a
1x20 class confidence tensor. DeepStream provides a toolkit to create efficient video analytic pipelines to capture, decode, and pre-process the data before running inference. DeepStream provides a toolkit to attach the classification model to any primary detector. The primary detector will detect the object and crop the object before sending to secondary classifiers.
pruned models are encrypted and will only operate with the following key:
- Model load key:
Please make sure to use this as the key for all TAO commands that require a model load key.
- unpruned_v1.0 - ResNet18 based pre-trained model.
- pruned_v1.0 - ResNet18 deployment models. Contains common INT8 calibration cache for GPU and DLA.
Instructions to use the unpruned model with TAO
In order, to use this model as a pretrained weights for transfer learning, please use the below mentioned snippet as template for the
traning_config component of the experiment spec file to train a Classification model. For more information on the experiment spec file, please refer to the TAO Toolkit User Guide.
Instructions to deploy the pruned model with DeepStream
To create the entire end-to-end video analytic application, deploy this model with DeepStream SDK. DeepStream SDK is a streaming analytic toolkit to accelerate building AI-based video analytic applications. DeepStream supports direct integration of this model into the deepstream sample app.
To deploy this model with DeepStream 5.1, please follow the instructions below:
Run the default
deepstream-appincluded in the DeepStream docker, by simply executing the commands below.
## Download Model: mkdir -p $HOME/vehiclemakenet && \ wget https://api.ngc.nvidia.com/v2/models/nvidia/tao/vehiclemakenet/versions/pruned_v1.0/files/resnet18_vehiclemakenet_pruned.etlt \ -O $HOME/vehiclemakenet/resnet18_vehiclemakenet_pruned.etlt && \ wget https://api.ngc.nvidia.com/v2/models/nvidia/tao/vehiclemakenet/versions/pruned_v1.0/files/vehiclemakenet_int8.txt \ -O $HOME/vehiclemakenet/vehiclemakenet_int8.txt ## Run Application xhost + sudo docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v $HOME:/opt/nvidia/deepstream/deepstream-5.1/samples/models/tlt_pretrained_models \ -w /opt/nvidia/deepstream/deepstream-5.1/samples/configs/tlt_pretrained_models nvcr.io/nvidia/deepstream:5.1-21.02-samples \ deepstream-app -c deepstream_app_source1_dashcamnet_vehiclemakenet_vehicletypenet.txt
Install deepstream on your local host and run the deepstream-app.
To deploy this model with DeepStream, please follow the instructions below: Download and install DeepStream SDK. The installation instructions for DeepStream are provided in DeepStream development guide. The config files for the purpose-built models are located in:
/opt/nvidia/deepstream is the default DeepStream installation directory. This path will be different if you are installing in a different directory.
You will need multiple config files and 1 label file. These files are provided in the
deepstream_app_source1_dashcamnet_vehiclemakenet_vehicletypenet.txt - Main config file for DeepStream app
config_infer_primary_dashcamnet.txt - File to configure primary detection (DashCamNet)
config_infer_secondary_vehiclemakenet.txt - File to configure Vehicle make classifier
labels_dashcamnet.txt - Label file with 3 for object detection
labels_vehiclemakenet.txt - Label file with 20 classes of Vehicle make
deepstream_app_source1_dashcamnet_vehiclemakenet_vehicletypenet.txt configures 3 models: DashCamNet as primary detector, and VehicleMakeNet and VehicleTypeNet as secondary classifiers. The classification models are typically used after initial object detection.
Key Parameters in
deepstream-app -c deepstream_app_source1_dashcamnet_vehiclemakenet_vehicletypenet.txt
Documentation to deploy with DeepStream is provided in "Deploying to DeepStream" chapter of TAO User Guide.
VehicleMakeNet was trained on a proprietary dataset with more than 60K car images. The training dataset contains car crops from a mix of camera heights, camera angles, field-of view (FOV) and occlusions.
The inference performance of the VehicleMake model was measured against 2000 proprietary images across a variety of environments, occlusion conditions, camera heights and camera angles.
Methodology and KPI
The KPI for the evaluation data are reported in the table below. Model is evaluated based on Top-1 accuracy.
|Top1 Accuracy (in %)
The inference is run on the provided pruned model at INT8 precision. On Jetson Nano, FP16 precision is used. The inference performance is run using
trtexec on Jetson Nano, AGX Xavier, Xavier NX and NVIDIA T4 GPU. The Jetson devices are running at Max-N configuration for maximum GPU frequency. The performance shown here is the inference only performance. The end-to-end performance with streaming video data might slightly vary depending on other bottlenecks in the hardware and software.
This model is design to classify detected cars from DashCamNet model with cars visible at a 5ft height, with visible front, back or side. The model doesn't classify well for cars seen from top view.
- Get TAO Container
- Get other Purpose-built models from NGC model registry:
License to use this model is covered by the Model EULA. By downloading the unpruned or pruned version of the model, you accept the terms and conditions of these licenses.
- Train like a ‘pro’ without being an AI expert using TAO AutoML
- Create Custom AI models using NVIDIA TAO Toolkit with Azure Machine Learning
- Developing and Deploying AI-powered Robots with NVIDIA Isaac Sim and NVIDIA TAO
- Learn endless ways to adapt and supercharge your AI workflows with TAO - Whitepaper
- Customize Action Recognition with TAO and deploy with DeepStream
- Read the 2 part blog on training and optimizing 2D body pose estimation model with TAO - Part 1 | Part 2
- Learn how to train real-time License plate detection and recognition app with TAO and DeepStream.
- Model accuracy is extremely important, learn how you can achieve state of the art accuracy for classification and object detection models using TAO
- More information on about TAO Toolkit and pre-trained models can be found at the NVIDIA Developer Zone
- TAO documentation
- Read the TAO getting Started guide and release notes.
- If you have any questions or feedback, please refer to the discussions on TAO Toolkit Developer Forums
- Deploy your models for video analytics application using DeepStream. Learn more about DeepStream SDK
- Deploy your models in Riva for ConvAI use case.
Training and evaluation dataset mostly consists of North American content. An ideal training and evaluation dataset would additionally include content from other geographies.
NVIDIA’s 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 developer to ensure that it meets the requirements for the relevant industry and use case; that the necessary instruction 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.