--- 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/swinv2_base/web-assets/model_demo.png) # SwinV2-Base: Optimized for Qualcomm Devices SwinV2Base 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 SwinV2-Base found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/swin_transformer.py). This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/swinv2_base) 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.3 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/swinv2_base/releases/v0.51.0/swinv2_base-onnx-float.zip) | ONNX | w8a16 | Universal | QAIRT 2.42, ONNX Runtime 1.24.3 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/swinv2_base/releases/v0.51.0/swinv2_base-onnx-w8a16.zip) | QNN_DLC | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/swinv2_base/releases/v0.51.0/swinv2_base-qnn_dlc-float.zip) | QNN_DLC | w8a16 | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/swinv2_base/releases/v0.51.0/swinv2_base-qnn_dlc-w8a16.zip) | TFLITE | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/swinv2_base/releases/v0.51.0/swinv2_base-tflite-float.zip) For more device-specific assets and performance metrics, visit **[SwinV2-Base on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/swinv2_base)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/swinv2_base) 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 [SwinV2-Base on GitHub](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/swinv2_base) for usage instructions. ## Model Details **Model Type:** Model_use_case.image_classification **Model Stats:** - Model checkpoint: Imagenet - Input resolution: 256x256 - Number of parameters: 88.8M - Model size (float): 339 MB - Model size (w8a16): 90.2 MB ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | SwinV2-Base | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 11.733 ms | 1 - 1020 MB | NPU | SwinV2-Base | ONNX | float | Snapdragon® X2 Elite | 12.544 ms | 179 - 179 MB | NPU | SwinV2-Base | ONNX | float | Snapdragon® X Elite | 32.734 ms | 178 - 178 MB | NPU | SwinV2-Base | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 21.746 ms | 0 - 2329 MB | NPU | SwinV2-Base | ONNX | float | Qualcomm® QCS8550 (Proxy) | 31.491 ms | 0 - 196 MB | NPU | SwinV2-Base | ONNX | float | Qualcomm® QCS9075 | 38.785 ms | 0 - 4 MB | NPU | SwinV2-Base | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 16.303 ms | 0 - 1012 MB | NPU | SwinV2-Base | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 11.395 ms | 0 - 1005 MB | NPU | SwinV2-Base | ONNX | w8a16 | Snapdragon® X2 Elite | 12.122 ms | 97 - 97 MB | NPU | SwinV2-Base | ONNX | w8a16 | Snapdragon® X Elite | 31.018 ms | 97 - 97 MB | NPU | SwinV2-Base | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 20.319 ms | 0 - 1295 MB | NPU | SwinV2-Base | ONNX | w8a16 | Qualcomm® QCS6490 | 1306.327 ms | 62 - 91 MB | CPU | SwinV2-Base | ONNX | w8a16 | Qualcomm® QCS8550 (Proxy) | 29.734 ms | 0 - 102 MB | NPU | SwinV2-Base | ONNX | w8a16 | Qualcomm® QCS9075 | 34.846 ms | 0 - 3 MB | NPU | SwinV2-Base | ONNX | w8a16 | Qualcomm® QCM6690 | 713.751 ms | 80 - 101 MB | CPU | SwinV2-Base | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 14.665 ms | 0 - 866 MB | NPU | SwinV2-Base | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 662.899 ms | 156 - 178 MB | CPU | SwinV2-Base | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 11.557 ms | 0 - 424 MB | NPU | SwinV2-Base | QNN_DLC | float | Snapdragon® X2 Elite | 12.375 ms | 1 - 1 MB | NPU | SwinV2-Base | QNN_DLC | float | Snapdragon® X Elite | 29.74 ms | 1 - 1 MB | NPU | SwinV2-Base | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 19.935 ms | 1 - 552 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 74.006 ms | 1 - 393 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 28.682 ms | 1 - 3 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® SA8775P | 31.978 ms | 1 - 392 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® QCS9075 | 37.916 ms | 1 - 3 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 44.29 ms | 0 - 538 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® SA7255P | 74.006 ms | 1 - 393 MB | NPU | SwinV2-Base | QNN_DLC | float | Qualcomm® SA8295P | 38.42 ms | 1 - 384 MB | NPU | SwinV2-Base | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 15.045 ms | 1 - 398 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 11.362 ms | 0 - 943 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 12.461 ms | 0 - 0 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Snapdragon® X Elite | 31.327 ms | 0 - 0 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 20.03 ms | 0 - 621 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Qualcomm® QCS8275 (Proxy) | 53.241 ms | 0 - 934 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Qualcomm® QCS8550 (Proxy) | 29.722 ms | 0 - 3 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Qualcomm® SA8775P | 29.923 ms | 0 - 916 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Qualcomm® QCS9075 | 36.121 ms | 0 - 2 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Qualcomm® SA7255P | 53.241 ms | 0 - 934 MB | NPU | SwinV2-Base | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 15.127 ms | 0 - 888 MB | NPU | SwinV2-Base | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 11.961 ms | 0 - 969 MB | NPU | SwinV2-Base | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 21.923 ms | 0 - 655 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 75.284 ms | 0 - 902 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 32.027 ms | 0 - 3 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® SA8775P | 35.296 ms | 0 - 847 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® QCS9075 | 39.731 ms | 0 - 180 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 46.679 ms | 0 - 647 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® SA7255P | 75.284 ms | 0 - 902 MB | NPU | SwinV2-Base | TFLITE | float | Qualcomm® SA8295P | 43.86 ms | 0 - 474 MB | NPU | SwinV2-Base | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 15.94 ms | 0 - 904 MB | NPU ## License * The license for the original implementation of SwinV2-Base can be found [here](https://github.com/pytorch/vision/blob/main/LICENSE). ## References * [Swin Transformer V2: Scaling Up Capacity and Resolution](https://arxiv.org/abs/2111.09883) * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/swin_transformer.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).