--- library_name: pytorch license: other tags: - backbone - bu_auto - android pipeline_tag: image-classification --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/web-assets/model_demo.png) # DenseNet-121: Optimized for Qualcomm Devices Densenet is a machine learning model that can classify images from the Imagenet dataset. It can also be used as a backbone in building more complex models for specific use cases. This is based on the implementation of DenseNet-121 found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py). This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/densenet121) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary). Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device. ## Getting Started There are two ways to deploy this model on your device: ### Option 1: Download Pre-Exported Models Below are pre-exported model assets ready for deployment. | Runtime | Precision | Chipset | SDK Versions | Download | |---|---|---|---|---| | ONNX | float | Universal | QAIRT 2.42, ONNX Runtime 1.24.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-onnx-float.zip) | ONNX | w8a16 | Universal | QAIRT 2.42, ONNX Runtime 1.24.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-onnx-w8a16.zip) | ONNX | w8a8 | Universal | QAIRT 2.42, ONNX Runtime 1.24.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-onnx-w8a8.zip) | QNN_DLC | float | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-qnn_dlc-float.zip) | QNN_DLC | w8a16 | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-qnn_dlc-w8a16.zip) | QNN_DLC | w8a8 | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-qnn_dlc-w8a8.zip) | TFLITE | float | Universal | QAIRT 2.43, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-tflite-float.zip) | TFLITE | w8a8 | Universal | QAIRT 2.43, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/densenet121/releases/v0.47.0/densenet121-tflite-w8a8.zip) For more device-specific assets and performance metrics, visit **[DenseNet-121 on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/densenet121)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/densenet121) Python library to compile and export the model with your own: - Custom weights (e.g., fine-tuned checkpoints) - Custom input shapes - Target device and runtime configurations This option is ideal if you need to customize the model beyond the default configuration provided here. See our repository for [DenseNet-121 on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/densenet121) for usage instructions. ## Model Details **Model Type:** Model_use_case.image_classification **Model Stats:** - Model checkpoint: Imagenet - Input resolution: 224x224 - Number of parameters: 7.99M - Model size (float): 30.5 MB - Model size (w8a16): 8.72 MB - Model size (w8a8): 8.30 MB ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | DenseNet-121 | ONNX | float | Snapdragon® X Elite | 1.729 ms | 15 - 15 MB | NPU | DenseNet-121 | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 1.075 ms | 0 - 95 MB | NPU | DenseNet-121 | ONNX | float | Qualcomm® QCS8550 (Proxy) | 1.527 ms | 0 - 18 MB | NPU | DenseNet-121 | ONNX | float | Qualcomm® QCS9075 | 2.623 ms | 1 - 3 MB | NPU | DenseNet-121 | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.782 ms | 0 - 45 MB | NPU | DenseNet-121 | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.679 ms | 0 - 46 MB | NPU | DenseNet-121 | ONNX | float | Snapdragon® X2 Elite | 0.745 ms | 16 - 16 MB | NPU | DenseNet-121 | ONNX | w8a16 | Snapdragon® X Elite | 2.59 ms | 25 - 25 MB | NPU | DenseNet-121 | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 1.717 ms | 0 - 103 MB | NPU | DenseNet-121 | ONNX | w8a16 | Qualcomm® QCS6490 | 251.531 ms | 32 - 35 MB | CPU | DenseNet-121 | ONNX | w8a16 | Qualcomm® QCS8550 (Proxy) | 2.341 ms | 0 - 172 MB | NPU | DenseNet-121 | ONNX | w8a16 | Qualcomm® QCS9075 | 2.946 ms | 0 - 3 MB | NPU | DenseNet-121 | ONNX | w8a16 | Qualcomm® QCM6690 | 115.26 ms | 21 - 31 MB | CPU | DenseNet-121 | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 1.324 ms | 0 - 77 MB | NPU | DenseNet-121 | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 103.638 ms | 30 - 41 MB | CPU | DenseNet-121 | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 1.129 ms | 0 - 79 MB | NPU | DenseNet-121 | ONNX | w8a16 | Snapdragon® X2 Elite | 1.235 ms | 27 - 27 MB | NPU | DenseNet-121 | ONNX | w8a8 | Snapdragon® X Elite | 28.06 ms | 33 - 33 MB | NPU | DenseNet-121 | ONNX | w8a8 | Qualcomm® QCS6490 | 111.592 ms | 22 - 29 MB | CPU | DenseNet-121 | ONNX | w8a8 | Qualcomm® QCS9075 | 33.165 ms | 21 - 24 MB | NPU | DenseNet-121 | ONNX | w8a8 | Qualcomm® QCM6690 | 51.762 ms | 22 - 37 MB | CPU | DenseNet-121 | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 14.159 ms | 22 - 101 MB | NPU | DenseNet-121 | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 45.988 ms | 11 - 27 MB | CPU | DenseNet-121 | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 18.887 ms | 22 - 100 MB | NPU | DenseNet-121 | ONNX | w8a8 | Snapdragon® X2 Elite | 18.347 ms | 32 - 32 MB | NPU | DenseNet-121 | QNN_DLC | float | Snapdragon® X Elite | 2.011 ms | 1 - 1 MB | NPU | DenseNet-121 | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 1.197 ms | 0 - 79 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 7.77 ms | 1 - 39 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 1.783 ms | 0 - 7 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® SA8775P | 2.694 ms | 1 - 43 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® QCS9075 | 2.791 ms | 1 - 3 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 3.312 ms | 0 - 75 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® SA7255P | 7.77 ms | 1 - 39 MB | NPU | DenseNet-121 | QNN_DLC | float | Qualcomm® SA8295P | 3.03 ms | 1 - 36 MB | NPU | DenseNet-121 | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.859 ms | 0 - 39 MB | NPU | DenseNet-121 | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.706 ms | 1 - 44 MB | NPU | DenseNet-121 | QNN_DLC | float | Snapdragon® X2 Elite | 0.968 ms | 1 - 1 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Snapdragon® X Elite | 3.47 ms | 0 - 0 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 2.122 ms | 0 - 89 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® QCS8275 (Proxy) | 6.275 ms | 0 - 62 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® QCS8550 (Proxy) | 3.123 ms | 0 - 86 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® SA8775P | 3.51 ms | 0 - 65 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® QCS9075 | 3.406 ms | 0 - 2 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® QCS8450 (Proxy) | 5.033 ms | 0 - 88 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® SA7255P | 6.275 ms | 0 - 62 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Qualcomm® SA8295P | 5.589 ms | 0 - 61 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 1.754 ms | 0 - 60 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 1.222 ms | 0 - 72 MB | NPU | DenseNet-121 | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 1.563 ms | 0 - 0 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Snapdragon® X Elite | 2.638 ms | 0 - 0 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 1.703 ms | 0 - 77 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 4.889 ms | 0 - 57 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 2.366 ms | 0 - 17 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® SA8775P | 11.689 ms | 0 - 58 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 2.569 ms | 0 - 2 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 2.934 ms | 0 - 81 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® SA7255P | 4.889 ms | 0 - 57 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Qualcomm® SA8295P | 3.457 ms | 0 - 56 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 1.044 ms | 0 - 59 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.897 ms | 0 - 64 MB | NPU | DenseNet-121 | QNN_DLC | w8a8 | Snapdragon® X2 Elite | 1.187 ms | 0 - 0 MB | NPU | DenseNet-121 | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 1.205 ms | 0 - 96 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 7.787 ms | 0 - 55 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 1.799 ms | 0 - 3 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® SA8775P | 11.956 ms | 0 - 55 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® QCS9075 | 2.814 ms | 0 - 18 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 3.329 ms | 0 - 92 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® SA7255P | 7.787 ms | 0 - 55 MB | NPU | DenseNet-121 | TFLITE | float | Qualcomm® SA8295P | 3.065 ms | 0 - 52 MB | NPU | DenseNet-121 | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.852 ms | 0 - 59 MB | NPU | DenseNet-121 | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.708 ms | 0 - 59 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 1.586 ms | 0 - 83 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® QCS6490 | 93.643 ms | 6 - 34 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 4.546 ms | 0 - 58 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 2.225 ms | 0 - 115 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® SA8775P | 2.604 ms | 0 - 61 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® QCS9075 | 2.422 ms | 0 - 11 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 2.646 ms | 0 - 84 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® SA7255P | 4.546 ms | 0 - 58 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Qualcomm® SA8295P | 3.306 ms | 0 - 57 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 1.014 ms | 0 - 62 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 26.804 ms | 6 - 171 MB | NPU | DenseNet-121 | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.861 ms | 0 - 65 MB | NPU ## License * The license for the original implementation of DenseNet-121 can be found [here](https://github.com/pytorch/vision/blob/main/LICENSE). ## References * [Densely Connected Convolutional Networks](https://arxiv.org/abs/1608.06993) * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py) ## Community * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI. * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).