Mobilenet v1 trained on Imagenet for STM32 using extended CMSIS-NN with INT-Q quantization support
This project contains an STM32 application for executing a quantized Mobilenet v1 (160x160x3
, alpha 0.25
) trained for Imangenet on a STM32H7 NUCLEO evaluation board.
If you want to collaborate, contribute, or to rise issues and suggestions to this project you can use the Issues page or contact us:
MobileNets are small, low-latency, low-power models parameterized to meet the resource constraints of a variety of use cases. They can be built upon for classification, detection, embeddings and segmentation similar to how other popular large scale models, such as Inception, are used. MobileNets can be run efficiently on mobile devices with TensorFlow Mobile. MobileNets trade off between latency, size and accuracy while comparing favorably with popular models from the literature.
Only a limitated set of configurations for MobileNet can be hosted on a ST32H7 device, memory limitation are there (2MB flash + 512kB L2 SRAM). The following chart highlights the subset of configurations compatible for the device.
The parameters used on this project is image input 160x160x3
and alpha 0.25
. The following table show the classification performance of such configuration.
Model | Million MACs | Million Parameters | Top-1 Accuracy | Top-5 Accuracy |
---|---|---|---|---|
MobileNet_v1_0.25_160_uint8 | 21 | 0.47 | 43.4 | 68.5 |
To limit the classification error introduced by the quantization this Mobilenet implementation uses our extended CMSIS-NN that support an Asymmetric Quantization methodology mapped on UINT8 datatypes. You find additional information on this article.
Shortly we will release a Python script for the import of pre-trained Tensorflow models.
File> Import...
, then select Git> Project from Git
and click the button Next
Clone URI
and click the button Next
https://github.com/EEESlab/mobilenet_v1_stm32_cmsis_nn.git
and click Next
Next
Next
Next
The following table show the profiling layer-per-layer of this Mobilenet implementation on the STM32H7 running at 400MHz.