Image Classification
FBAGSTM commited on
Commit
d50b66a
·
verified ·
1 Parent(s): cec277e

Release AI-ModelZoo-4.0.0

Browse files
Files changed (1) hide show
  1. README.md +110 -3
README.md CHANGED
@@ -1,3 +1,110 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: image-classification
4
+ ---
5
+ # MnasNet
6
+
7
+ ## **Use case** : `Image classification`
8
+
9
+ # Model description
10
+
11
+
12
+ Mobile Neural Architecture Search Network (MnasNet) is designed using **automated neural architecture search (NAS)** specifically targeting mobile devices. It optimizes for both accuracy and real-device latency simultaneously.
13
+
14
+ MnasNet employs **multi-objective optimization** to balance accuracy with latency on target devices, using **inverted residual blocks** similar to MobileNetV2 but with NAS-optimized configurations. The **factorized hierarchical search space** enables diverse and efficient architectures.
15
+
16
+ The architecture is well-suited for mobile and embedded vision applications, particularly in scenarios requiring optimized accuracy-latency trade-offs.
17
+
18
+ (source: https://arxiv.org/abs/1807.11626)
19
+
20
+ The model is quantized to **int8** using **ONNX Runtime** and exported for efficient deployment.
21
+
22
+ ## Network information
23
+
24
+
25
+ | Network Information | Value |
26
+ |--------------------|-------|
27
+ | Framework | Torch |
28
+ | MParams | ~2.27 M |
29
+ | Quantization | Int8 |
30
+ | Provenance | https://github.com/tensorflow/tpu/tree/master/models/official/mnasnet |
31
+ | Paper | https://arxiv.org/abs/1807.11626 |
32
+
33
+ ## Network inputs / outputs
34
+
35
+
36
+ For an image resolution of NxM and P classes
37
+
38
+ | Input Shape | Description |
39
+ | ----- | ----------- |
40
+ | (1, N, M, 3) | Single NxM RGB image with UINT8 values between 0 and 255 |
41
+
42
+ | Output Shape | Description |
43
+ | ----- | ----------- |
44
+ | (1, P) | Per-class confidence for P classes in FLOAT32|
45
+
46
+
47
+ ## Recommended platforms
48
+
49
+
50
+ | Platform | Supported | Recommended |
51
+ |----------|-----------|-----------|
52
+ | STM32L0 |[]|[]|
53
+ | STM32L4 |[]|[]|
54
+ | STM32U5 |[]|[]|
55
+ | STM32H7 |[]|[]|
56
+ | STM32MP1 |[]|[]|
57
+ | STM32MP2 |[]|[]|
58
+ | STM32N6 |[x]|[x]|
59
+
60
+ # Performances
61
+
62
+ ## Metrics
63
+
64
+ - Measures are done with default STEdgeAI Core configuration with enabled input / output allocated option.
65
+ - All the models are trained from scratch on Imagenet dataset
66
+
67
+ ### Reference **NPU** memory footprint on Imagenet dataset (see Accuracy for details on dataset)
68
+ | Model | Dataset | Format | Resolution | Series | Internal RAM (KiB) | External RAM (KiB) | Weights Flash (KiB) | STEdgeAI Core version |
69
+ |-------|---------|--------|------------|--------|--------------|--------------|---------------|----------------------|
70
+ | [mnasnet_d050_pt_224](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/mnasnet_pt/Public_pretrainedmodel_public_dataset/Imagenet/mnasnet_d050_pt_224/mnasnet_d050_pt_224_qdq_int8.onnx) | Imagenet | Int8 | 224×224×3 | STM32N6 | 612.5 | 0 | 2319.53 | 3.0.0 |
71
+
72
+ ### Reference **NPU** inference time on Imagenet dataset (see Accuracy for details on dataset)
73
+ | Model | Dataset | Format | Resolution | Board | Execution Engine | Inference time (ms) | Inf / sec | STEdgeAI Core version |
74
+ |--------|---------|--------|--------|-------------|------------------|------------------|---------------------|-------------------------|
75
+ | [mnasnet_d050_pt_224](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/mnasnet_pt/Public_pretrainedmodel_public_dataset/Imagenet/mnasnet_d050_pt_224/mnasnet_d050_pt_224_qdq_int8.onnx) | Imagenet | Int8 | 224×224×3 | STM32N6570-DK | NPU/MCU | 11.21 | 89.21 | 3.0.0 |
76
+
77
+
78
+
79
+
80
+ ### Accuracy with Imagenet dataset
81
+
82
+ | Model | Format | Resolution | Top 1 Accuracy |
83
+ | --- | --- | --- | --- |
84
+ | [mnasnet_d050_pt](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/mnasnet_pt/Public_pretrainedmodel_public_dataset/Imagenet/mnasnet_d050_pt_224/mnasnet_d050_pt_224.onnx) | Float | 224x224x3 | 67.50 % |
85
+ | [mnasnet_d050_pt](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/mnasnet_pt/Public_pretrainedmodel_public_dataset/Imagenet/mnasnet_d050_pt_224/mnasnet_d050_pt_224_qdq_int8.onnx) | Int8 | 224x224x3 | 59.99 % |
86
+
87
+
88
+ Dataset details: [link](https://www.image-net.org)
89
+ Number of classes: 1000.
90
+ To perform the quantization, we calibrated the activations with a random subset of the training set.
91
+ For the sake of simplicity, the accuracy reported here was estimated on the 50000 labelled images of the validation set.
92
+
93
+ | Model | Format | Resolution | Top 1 Accuracy |
94
+ | --- | --- | --- | --- |
95
+ | [mnasnet_d050_pt](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/mnasnet_pt/Public_pretrainedmodel_public_dataset/Imagenet/mnasnet_d050_pt_224/mnasnet_d050_pt_224.onnx) | Float | 224x224x3 | 67.50 % |
96
+ | [mnasnet_d050_pt](https://github.com/STMicroelectronics/stm32ai-modelzoo/tree/main/image_classification/mnasnet_pt/Public_pretrainedmodel_public_dataset/Imagenet/mnasnet_d050_pt_224/mnasnet_d050_pt_224_qdq_int8.onnx) | Int8 | 224x224x3 | 59.99 % |
97
+
98
+
99
+
100
+ ## Retraining and Integration in a simple example:
101
+
102
+ Please refer to the stm32ai-modelzoo-services GitHub [here](https://github.com/STMicroelectronics/stm32ai-modelzoo-services)
103
+
104
+
105
+
106
+ # References
107
+
108
+ <a id="1">[1]</a> - **Dataset**: Imagenet (ILSVRC 2012) — https://www.image-net.org/
109
+
110
+ <a id="2">[2]</a> - **Model**: MnasNet — https://github.com/tensorflow/tpu/tree/master/models/official/mnasnet