Image Classification STM32 models (PyTorch) ¶
The STM32 model zoo includes several PyTorch-based models for image classification use cases, converted to ONNX format and optimized for STM32N6 NPU deployment. All models are pre-trained on ImageNet and converted to ONNX format with QDQ quantization.
Supported model files by operation ¶
For PyTorch workflows,
model_path
accepts the following file types, subject to the model and target requirements:
|
Operation mode |
Supported
|
|---|---|
|
|
PyTorch checkpoint (
|
|
|
PyTorch checkpoint (
|
|
|
PyTorch checkpoint (
|
|
|
PyTorch checkpoint (
|
|
|
PyTorch checkpoint (
|
When using a PyTorch checkpoint, also set
model_name
so the model architecture can be created before loading the weights. Trainings run with the Model Zoo save their checkpoints as
.pth.tar
files. See the
training,
quantization,
benchmarking, and
deployment
guides for the configuration required by each operation.
Model Categories ¶
Public_pretrainedmodel_public_datasetcontains public PyTorch image classification models trained on public datasets and converted to ONNX format with QDQ quantization.ST_pretrainedmodel_public_datasetcontains public PyTorch image classification models trained on public dataset by ST.
Explore the complete ST Edge AI Model Explorer with pre-trained models optimized for STM32N6.
Model Families ¶
You can get comprehensive footprints and performance information for each model family following the links below:
Mobile-Optimized Architectures ¶
You can get footprints and performance information for each model of the mobilenet family (v1, v2, v4, fdmobilenet, different variants, different input sizes) in the ST Edge AI Model Explorer.
[mobilenet_pt]: Efficient depthwise separable convolutions (alpha variants: 0.25, 0.50, 0.75)
[mobilenetv2_pt]: Inverted residual blocks with linear bottlenecks (alpha/width variants)
[mobilenetv4_pt]: Latest MobileNet iteration with enhanced efficiency
[fdmobilenet_pt]: Fast downsampling variants for reduced latency
Lightweight Efficient Models ¶
You can also find in the ST Edge AI Model Explorer some interesting lightweight topologies:
[shufflenetv2_pt]: Channel shuffle operations (0.5x, 1.0x width multipliers)
[mnasnet_pt]: Mobile neural architecture search optimized models
[regnet_pt]: Network design space exploration
STMicroelectronics In-house Model ¶
You can get footprints and performance information for ST in-house models in the ST Edge AI Model Explorer.
[st_resnet_pt]: Custom ResNet variants optimized for STM32 (pico, nano, micro, milli, tiny)
Standard Architectures ¶
You can also find in the ST Edge AI Model Explorer the following well-known topologies:
[resnet18_pt]: Classic residual networks (width variant 0.25)
[preresnet18_pt]: Pre-activation ResNet variant
[dla_pt]: Deep Layer Aggregation with hierarchical features
[squeezenet_pt]: Fire modules with squeeze and expand
[sqnxt_pt]: More efficient SqueezeNet variants
Vision Transformer Models ¶
[st_navit_pt]: ST hierarchical vision transformer built only from convolutions (patch embedding, four stages of attention-like blocks, linear classifier), designed for the STM32N6 NPU. Pretrained on ImageNet at 224x224 and available in float32 and in the quantized
w8a8_ptq,w8a8a16_ptq_qmn, andw8a16_ptq_qmnversions.
Specialized Architectures ¶
[hardnet_pt]: Harmonic DenseNet design
[peleenet_pt]: Efficient DenseNet variant
[proxylessnas_pt]: Direct NAS on target hardware
[semnasnet_pt]: Squeeze-and-Excitation MnasNet
[darknet_pt]: Lightweight feature extraction backbone
Quick Selection Guide ¶
By Inference Speed (on STM32N6570-DK) ¶
Ultra-Fast (<5ms): fdmobilenet_a025 (1.88ms), mobilenet_a025 (2.98ms)
Fast (5-10ms): fdmobilenet_a050 (4.07ms), mobilenet_a050 (6.55ms), shufflenetv2_x050 (8.35ms)
Moderate (10-20ms): mobilenetv2_a050 (10.08ms), mobilenetv4small (13.74ms), st_resnetmicro (13.83ms)
Balanced (20-40ms): mobilenetv2_a100 (20.35ms), st_resnettiny (24.10ms), proxylessnas (27.65ms)
By Model Size ¶
Tiny (<500KB): fdmobilenet_a025 (377KB), mobilenet_a025 (469KB), st_resnetpico (607KB)
Small (500KB-1.5MB): fdmobilenet_a050 (973KB), mobilenet_a050 (1.3MB), shufflenetv2_x050 (1.4MB)
Medium (1.5-3MB): mobilenetv2_a050 (1.97MB), mnasnet_d050 (2.3MB), peleenet (2.75MB)
Large (>3MB): mobilenetv4small (3.76MB), mobilenetv2_a100 (3.81MB), st_resnettiny (4.06MB)
By RAM Requirements ¶
Internal RAM Only (<1MB): Most MobileNet, ShuffleNet, and ST ResNet variants
Requires External RAM: DLA family (~6MB), SqueezeNext family (3-9MB), SqueezeNetv10 (~6.7MB)
Platform Support ¶
All PyTorch models are specifically optimized for:
Primary Target: STM32N6570-DK with NPU acceleration
Framework: ONNX QDQ with 8-bit weights and 8-bit activations.
st_navit_ptis also available with 16-bit activations: mixed 8/16-bit (w8a8a16_ptq_qmn) or 16-bit (w8a16_ptq_qmn)STEdgeAI Core: Version 4.1
Performance Notes ¶
All inference times measured on STM32N6570-DK with NPU/MCU execution
Internal RAM usage varies from 294 KiB (fdmobilenet_a025) to 11,350 KiB (sqnxt23_x200)
Models using only internal RAM are preferred for simpler deployment
External RAM models (DLA, SqueezeNext) offer different accuracy/performance tradeoffs
Feel free to explore the ST Edge AI Model Explorer here and get pre-trained models.
For training and deployment guidance, refer to the STM32 AI model zoo documentation.