Release AI-ModelZoo-4.0.0
Browse files
README.md
CHANGED
|
@@ -1,6 +1,124 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: other
|
| 3 |
-
license_name: sla0044
|
| 4 |
-
license_link: >-
|
| 5 |
-
https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/LICENSE.md
|
| 6 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: sla0044
|
| 4 |
+
license_link: >-
|
| 5 |
+
https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/LICENSE.md
|
| 6 |
+
pipeline_tag: image-classification
|
| 7 |
+
---
|
| 8 |
+
# ST MNIST v1
|
| 9 |
+
|
| 10 |
+
## **Use case** : `Image classification`
|
| 11 |
+
|
| 12 |
+
# Model description
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
This folder contains a custom model ST-MNIST for MNIST type datasets. ST-MNIST model is a depthwise separable convolutional based model architecture and can be used for different MNIST use-cases, e.g. alphabet recognition, digit recognition, or fashion MNIST etc.
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
ST-MNIST model accepts an input shape of 28 x 28, which is standard for MNIST type datasets. The pretrained model is also quantized in int8 using tensorflow lite converter.
|
| 19 |
+
|
| 20 |
+
## Network information
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
| Network Information | Value |
|
| 24 |
+
|-------------------------|-----------------|
|
| 25 |
+
| Framework | TensorFlow Lite |
|
| 26 |
+
| Quantization | int8 |
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
## Network inputs / outputs
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
For an image resolution of 28x28 and 36 classes : 10 integers (from 0-9) and 26 alphabets (upper-case A-Z)
|
| 33 |
+
|
| 34 |
+
| Input Shape | Description |
|
| 35 |
+
| ----- | ----------- |
|
| 36 |
+
| (1, 28, 28, 1) | Single 28x28 grey-scale image with UINT8 values between 0 and 255 |
|
| 37 |
+
|
| 38 |
+
| Output Shape | Description |
|
| 39 |
+
| ----- | ----------- |
|
| 40 |
+
| (1, 36) | Per-class confidence for 36 classes in FLOAT32|
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
## Recommended Platforms
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
| Platform | Supported | Recommended |
|
| 47 |
+
|----------|-----------|-----------|
|
| 48 |
+
| STM32L0 |[]|[]|
|
| 49 |
+
| STM32L4 |[x]|[x]|
|
| 50 |
+
| STM32U5 |[x]|[x]|
|
| 51 |
+
| STM32H7 |[x]|[x]|
|
| 52 |
+
| STM32MP1 |[x]|[]|
|
| 53 |
+
| STM32MP2 |[x]|[]|
|
| 54 |
+
| STM32N6 |[x]|[]|
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
# Performances
|
| 58 |
+
|
| 59 |
+
## Metrics
|
| 60 |
+
|
| 61 |
+
- Measures are done with default STM32Cube.AI configuration with enabled input / output allocated option.
|
| 62 |
+
- `tfs` stands for "training from scratch", meaning that the model weights were randomly initialized before training.
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
### Reference **MCU** memory footprint based on EMNIST-Byclass dataset (see Accuracy for details on dataset)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
| Model | Format | Resolution | Series | Activation RAM | Runtime RAM | Weights Flash | Code Flash | Total RAM | Total Flash | STEdgeAI Core version |
|
| 69 |
+
|-------------------|--------|------------|---------|----------------|-------------|---------------|------------|-------------|-------------|-----------------------|
|
| 70 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs_int8.tflite) | Int8 | 28x28x1 | STM32H7 | 17.21 KiB | 0.3 KiB | 10.08 KiB | 27.99 KiB | 17.51 KiB | 38.07 KiB | 3.0.0 |
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
### Reference **MCU** inference time based on EMNIST-Byclass dataset (see Accuracy for details on dataset)
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
| Model | Format | Resolution | Board | Frequency | Inference time (ms) | STEdgeAI Core version |
|
| 77 |
+
|-------------------|--------|------------|------------------|---------------|---------------------|-----------------------|
|
| 78 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs_int8.tflite) | Int8 | 28x28x1 | STM32H747I-DISCO | 400 MHz | 3.48 ms | 3.0.0 |
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
### Reference **MPU** inference time based on EMNIST-Byclass dataset (see Accuracy for details on dataset)
|
| 82 |
+
|
| 83 |
+
| Model | Format | Resolution | Quantization | Board | Execution Engine | Frequency | Inference time (ms) | %NPU | %GPU | %CPU | X-LINUX-AI version | Framework |
|
| 84 |
+
|---------------------------------------------------------------------------------------------------------------------------------|--------|------------|----------------|-----------------|------------------|-----------|---------------------|-------|-------|------|--------------------|-----------------------|
|
| 85 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs_int8.tflite) | Int8 | 28x28x1 | per-channel** | STM32MP257F-DK2 | 2 CPU | 1500 MHz | 0.87 | 64.23 | 35.77 | 0 | v6.1.0 | TensorFlowLite 2.18.0 |
|
| 86 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs_int8.tflite) | Int8 | 28x28x1 | per-channel | STM32MP157F-DK2 | 2 CPU | 800 MHz | 0.70 | NA | NA | 100 | v6.1.0 | TensorFlowLite 2.18.0 |
|
| 87 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs_int8.tflite) | Int8 | 28x28x1 | per-channel | STM32MP135F-DK2 | 1 CPU | 1000 MHz | 1.02 | NA | NA | 100 | v6.1.0 | TensorFlowLite 2.18.0 |
|
| 88 |
+
|
| 89 |
+
** **To get the most out of MP25 NPU hardware acceleration, please use per-tensor quantization**
|
| 90 |
+
|
| 91 |
+
** **Note:** On STM32MP2 devices, per-channel quantized models are internally converted to per-tensor quantization by the compiler using an entropy-based method. This may introduce a slight loss in accuracy compared to the original per-channel models.
|
| 92 |
+
|
| 93 |
+
### Accuracy with EMNIST-Byclass dataset
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
Dataset details: [link](https://www.nist.gov/itl/products-and-services/emnist-dataset) , by_class, digits from [0-9] and capital letters [A-Z]. Number of classes: 36, Number of train images: 533,993, Number of test images: 89,264.
|
| 97 |
+
|
| 98 |
+
| Model | Format | Resolution | Top 1 Accuracy |
|
| 99 |
+
|-------|--------|------------|----------------|
|
| 100 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs.keras) | Float | 28x28x1 | 91.89 % |
|
| 101 |
+
| [ST MNIST Byclass v1 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/st_mnistv1/ST_pretrainedmodel_public_dataset/emnist_byclass/st_mnistv1_28_tfs/st_mnistv1_28_tfs_int8.tflite) | Int8 | 28x28x1 | 91.47 % |
|
| 102 |
+
|
| 103 |
+
Following we provide the confusion matrix for the model with Float32 weights.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
|
| 107 |
+
Following we provide the confusion matrix for the quantized model with INT8 weights.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
## Retraining and Integration in a simple example:
|
| 113 |
+
|
| 114 |
+
Please refer to the stm32ai-modelzoo-services GitHub [here](https://github.com/STMicroelectronics/stm32ai-modelzoo-services)
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
# References
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
<a id="1">[1]</a>
|
| 121 |
+
"EMNIST : NIST Special Dataset," [Online]. Available: https://www.nist.gov/itl/products-and-services/emnist-dataset.
|
| 122 |
+
|
| 123 |
+
<a id="2">[2]</a>
|
| 124 |
+
"EMNIST: an extension of MNIST to handwritten letters". https://arxiv.org/abs/1702.05373
|