Release AI-ModelZoo-4.0.0
Browse files
README.md
CHANGED
|
@@ -1,6 +1,154 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: other
|
| 3 |
-
license_name: sla0044
|
| 4 |
-
license_link: >-
|
| 5 |
-
https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/image_classification/resnet/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/resnet/ST_pretrainedmodel_public_dataset/LICENSE.md
|
| 6 |
+
---
|
| 7 |
+
# ResNet v1
|
| 8 |
+
|
| 9 |
+
## **Use case** : `Image classification`
|
| 10 |
+
|
| 11 |
+
# Model description
|
| 12 |
+
|
| 13 |
+
ResNet models perform image classification - they take images as input and classify the major object in the image into a
|
| 14 |
+
set of pre-defined classes. ResNet models provide very high accuracies with affordable model sizes. They are ideal for cases when high accuracy of classification is required.
|
| 15 |
+
ResNet models consist of residual blocks and came up to counter the effect of deteriorating accuracies with more layers due to network not learning the initial layers.
|
| 16 |
+
ResNet v1 uses post-activation for the residual blocks. The models below have 8 and 32 layers with ResNet v1 architecture.
|
| 17 |
+
(source: https://keras.io/api/applications/resnet/)
|
| 18 |
+
The model is quantized in int8 using tensorflow lite converter.
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## Network information
|
| 22 |
+
|
| 23 |
+
| Network Information | Value |
|
| 24 |
+
|-------------------------|-------------------------------------------------------------------------|
|
| 25 |
+
| Framework | TensorFlow Lite |
|
| 26 |
+
| Quantization | int8 |
|
| 27 |
+
| Provenance | https://www.tensorflow.org/api_docs/python/tf/keras/applications/resnet |
|
| 28 |
+
| Paper | https://arxiv.org/abs/1512.03385 |
|
| 29 |
+
|
| 30 |
+
The models are quantized using tensorflow lite converter.
|
| 31 |
+
|
| 32 |
+
## Network inputs / outputs
|
| 33 |
+
|
| 34 |
+
For an image resolution of NxM and P classes
|
| 35 |
+
|
| 36 |
+
| Input Shape | Description |
|
| 37 |
+
|----------------|-------------------------------------------------------------|
|
| 38 |
+
| (1, N, M, 3) | Single NxM RGB image with UINT8 values between 0 and 255 |
|
| 39 |
+
|
| 40 |
+
| Output Shape | Description |
|
| 41 |
+
|----------------|-------------------------------------------------------------|
|
| 42 |
+
| (1, P) | Per-class confidence for P classes in FLOAT32 |
|
| 43 |
+
|
| 44 |
+
## Recommended Platforms
|
| 45 |
+
|
| 46 |
+
| Platform | Supported | Optimized |
|
| 47 |
+
|----------|-----------|-----------|
|
| 48 |
+
| STM32L0 | [] | [] |
|
| 49 |
+
| STM32L4 | [x] | [] |
|
| 50 |
+
| STM32U5 | [x] | [] |
|
| 51 |
+
| STM32H7 | [x] | [x] |
|
| 52 |
+
| STM32MP1 | [x] | [x]* |
|
| 53 |
+
| STM32MP2 | [x] | [] |
|
| 54 |
+
| STM32N6 | [x] | [] |
|
| 55 |
+
|
| 56 |
+
* Only for Cifar 100 models
|
| 57 |
+
|
| 58 |
+
# Performances
|
| 59 |
+
|
| 60 |
+
## Metrics
|
| 61 |
+
|
| 62 |
+
- Measures are done with default STM32Cube.AI configuration with enabled input / output allocated option.
|
| 63 |
+
- `tfs` stands for "training from scratch", meaning that the model weights were randomly initialized before training.
|
| 64 |
+
- `tl` stands for "transfer learning", meaning that the model backbone weights were initialized from a pre-trained model, then only the last layer was unfrozen during the training.
|
| 65 |
+
- `fft` stands for "full fine-tuning", meaning that the full model weights were initialized from a transfer learning pre-trained model, and all the layers were unfrozen during the training.
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
### Reference **MCU** memory footprint based on Cifar 10 dataset (see Accuracy for details on dataset)
|
| 69 |
+
|
| 70 |
+
| Model | Format | Resolution | Series | Activation RAM | Runtime RAM | Weights Flash | Code Flash | Total RAM | Total Flash | STEdgeAI Core version |
|
| 71 |
+
|----------|--------|-------------|---------|----------------|-------------|---------------|------------|-----------|-------------|------------------------|
|
| 72 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs_int8.tflite) | Int8 | 32x32x3 | STM32H7 | 62.51 KiB | 1.26 KiB | 76.9 KiB | 36.08 KiB | 63.77 KiB | 112.98 KiB | 3.0.0 |
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
### Reference **MCU** inference time based on Cifar 10 dataset (see Accuracy for details on dataset)
|
| 76 |
+
|
| 77 |
+
| Model | Format | Resolution | Board | Execution Engine | Frequency | Inference time (ms) | STEdgeAI Core version |
|
| 78 |
+
|----------------------------------|--------|-------------|------------------|------------------|--------------|---------------------|------------------------|
|
| 79 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs_int8.tflite) | Int8 | 32x32x3 | STM32H747I-DISCO | 1 CPU | 400 MHz | 28.71 ms | 3.0.0 |
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
### Reference **MPU** inference time based on Flowers dataset (see Accuracy for details on dataset)
|
| 83 |
+
|
| 84 |
+
| Model | Format | Resolution | Quantization | Board | Execution Engine | Frequency | Inference time (ms) | %NPU | %GPU | %CPU | X-LINUX-AI version | Framework |
|
| 85 |
+
|--------------------------------------------------------------------------------------------------------------------------|--------|------------|----------------|-----------------|------------------|-----------|---------------------|-------|-------|------|--------------------|-----------------------|
|
| 86 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs_int8.tflite) | Int8 | 32x32x3 | per-channel** | STM32MP257F-DK2 | NPU/GPU | 800 MHz | 2.06 | 21.76 | 78.24 | 0 | v6.1.0 | OpenVX |
|
| 87 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs_int8.tflite) | Int8 | 32x32x3 | per-channel | STM32MP157F-DK2 | 2 CPU | 800 MHz | 6.71 | NA | NA | 100 | v6.1.0 | TensorFlowLite 2.18.0 |
|
| 88 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs_int8.tflite) | Int8 | 32x32x3 | per-channel | STM32MP135F-DK2 | 1 CPU | 1000 MHz | 10.34 | NA | NA | 100 | v6.1.0 | TensorFlowLite 2.18.0 |
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
** **To get the most out of MP25 NPU hardware acceleration, please use per-tensor quantization**
|
| 92 |
+
|
| 93 |
+
** **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.
|
| 94 |
+
|
| 95 |
+
### Reference **MCU** memory footprint based on Cifar 100 dataset (see Accuracy for details on dataset)
|
| 96 |
+
|
| 97 |
+
| Model | Format | Resolution | Series | Activation RAM | Runtime RAM | Weights Flash | Code Flash | Total RAM | Total Flash | STEdgeAI Core version |
|
| 98 |
+
|-----------|--------|-------------|---------|----------------|-------------|---------------|------------|-------------|-------------|------------------------|
|
| 99 |
+
| [ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs_int8.tflite) | Int8 | 32x32x3 | STM32H7 | 45.41 KiB | 24.98 KiB | 464.38 KiB | 78.65 KiB | 70.39 KiB | 543.03 KiB | 3.0.0 |
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
### Reference **MCU** inference time based on Cifar 100 dataset (see Accuracy for details on dataset)
|
| 103 |
+
|
| 104 |
+
| Model | Format | Resolution | Board | Execution Engine | Frequency | Inference time (ms) | STEdgeAI Core version |
|
| 105 |
+
|---------|--------|------------|------------------|------------------|--------------|---------------------|------------------------|
|
| 106 |
+
| [ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs_int8.tflite) | Int8 | 32x32x3 | STM32H747I-DISCO | 1 CPU | 400 MHz | 177.7 ms |3.0.0 |
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
### Reference **MPU** inference time based on Flowers dataset (see Accuracy for details on dataset)
|
| 110 |
+
| Model | Format | Resolution | Quantization | Board | Execution Engine | Frequency | Inference time (ms) | %NPU | %GPU | %CPU | X-LINUX-AI version | Framework |
|
| 111 |
+
|---------------------------------------------------------------------------------------------------------------------|----------|------------|---------------|-------------------|------------------|-----------|---------------------|-------|-------|------|--------------------|-----------------------|
|
| 112 |
+
|[ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs_int8.tflite) | Int8 | 32x32x3 | per-channel | STM32MP257F-DK2 | NPU/GPU | 800 MHz | 9.160 ms | 14.75 | 85.25 | 0 | v6.1.0 | OpenVX |
|
| 113 |
+
|[ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs_int8.tflite) | Int8 | 32x32x3 | per-channel | STM32MP157F-DK2 | 2 CPU | 800 MHz | 34.78 ms | NA | NA | 100 | v6.1.0 | TensorFlowLite 2.11.0 |
|
| 114 |
+
|[ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs_int8.tflite) | Int8 | 32x32x3 | per-channel | STM32MP135F-DK2 | 1 CPU | 1000 MHz | 55.32 ms | NA | NA | 100 | v6.1.0 | TensorFlowLite 2.11.0 |
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
### Accuracy with Cifar10 dataset
|
| 118 |
+
|
| 119 |
+
Dataset details: [link](https://www.cs.toronto.edu/~kriz/cifar.html) ,
|
| 120 |
+
License [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) , Quotation[[1]](#1) , Number of classes: 10, Number of
|
| 121 |
+
images: 60 000
|
| 122 |
+
|
| 123 |
+
| Model | Format | Resolution | Top 1 Accuracy |
|
| 124 |
+
|------------------------------------------------------------------------------------------------------------------|----------|-------------|----------------|
|
| 125 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs.keras) | Float | 32x32x3 | 87.01 % |
|
| 126 |
+
| [ResNet v1 8 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar10/resnet8_32_tfs/resnet8_32_tfs_int8.tflite) | Int8 | 32x32x3 | 85.59 % |
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
### Accuracy with Cifar100 dataset
|
| 130 |
+
|
| 131 |
+
Dataset details: [link](https://www.cs.toronto.edu/~kriz/cifar.html) ,
|
| 132 |
+
License [CC0 4.0](https://creativecommons.org/licenses/by/4.0/), Quotation[[2]](#2) , Number of classes:100,
|
| 133 |
+
Number of images: 600 000
|
| 134 |
+
|
| 135 |
+
| Model | Format | Resolution | Top 1 Accuracy |
|
| 136 |
+
|----------------------------------------------------------------------------------------------------------------------|---------|------------|----------------|
|
| 137 |
+
| [ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs.keras) | Float | 32x32x3 | 67.75 % |
|
| 138 |
+
| [ResNet v1 32 tfs](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/resnet/ST_pretrainedmodel_public_dataset/cifar100/resnet32_32_tfs/resnet32_32_tfs_int8.tflite) | Int8 | 32x32x3 | 66.58 % |
|
| 139 |
+
|
| 140 |
+
## Retraining and Integration in a simple example:
|
| 141 |
+
|
| 142 |
+
Please refer to the stm32ai-modelzoo-services GitHub [here](https://github.com/STMicroelectronics/stm32ai-modelzoo-services)
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
# References
|
| 146 |
+
|
| 147 |
+
<a id="1">[1]</a>
|
| 148 |
+
"Tf_flowers : tensorflow datasets," TensorFlow. [Online]. Available: https://www.tensorflow.org/datasets/catalog/tf_flowers.
|
| 149 |
+
|
| 150 |
+
<a id="2">[2]</a>
|
| 151 |
+
J, ARUN PANDIAN; GOPAL, GEETHARAMANI (2019), "Data for: Identification of Plant Leaf Diseases Using a 9-layer Deep Convolutional Neural Network", Mendeley Data, V1, doi: 10.17632/tywbtsjrjv.1
|
| 152 |
+
|
| 153 |
+
<a id="3">[3]</a>
|
| 154 |
+
L. Bossard, M. Guillaumin, and L. Van Gool, "Food-101 -- Mining Discriminative Components with Random Forests." European Conference on Computer Vision, 2014.
|