FBAGSTM commited on
Commit
4e02e2f
·
verified ·
1 Parent(s): 3110a49

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +109 -6
README.md CHANGED
@@ -1,6 +1,109 @@
1
- ---
2
- license: other
3
- license_name: sla0044
4
- license_link: >-
5
- https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/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/human_activity_recognition/gmp/ST_pretrainedmodel_public_dataset/LICENSE.md
6
+ ---
7
+ # GMP HAR model
8
+
9
+ ## **Use case** : `Human activity recognition`
10
+
11
+ # Model description
12
+
13
+ GMP is an acronym for Global Max Pooling. It is a convolutional neural network (CNN) based model that uses Global Max Pooling before feeding the data to the fully-connected (Dense) layer for performing the human activity recognition (HAR) task based on the accelerometer data. It uses the 3D raw data with gravity rotation and supression filter as preprocessing. This is a very light model with very small foot prints in terms of FLASH and RAM as well as computational requirements.
14
+
15
+ This network supports any input size greater than (3 x 3 x 1) but we recommend to use at least (24 x 3 x 1), i.e. a window length of 24 samples. In this folder we provide GMP models trained with two different window lenghts [24 and 48].
16
+
17
+ The only input required to the model is the input shape and the number of output classes.
18
+
19
+ In this folder you will find different copies of the GMP model pretrained on a public dataset ([WISDM](https://www.cis.fordham.edu/wisdm/dataset.php)) and a custom dataset collected by ST (mobility_v1).
20
+
21
+ ## Network information (for WISDM at wl = 24)
22
+
23
+
24
+ | Network Information | Value |
25
+ |:-----------------------:|:---------------:|
26
+ | Framework | TensorFlow |
27
+ | Params | 1,528 |
28
+
29
+
30
+ ## Network inputs / outputs
31
+
32
+
33
+ For a frame of resolution of (wl x 3) and P classes
34
+
35
+ | Input Shape | Description |
36
+ | :----:| :-----------: |
37
+ | (1, wl, 3, 1) | Single ( wl x 3 x 1 ) matrix of accelerometer values, `wl` is window lenght, for 3 axes and 1 is channel in FLOAT32.|
38
+
39
+ | Output Shape | Description |
40
+ | :----:| :-----------: |
41
+ | (1, P) | Per-class confidence for P classes in FLOAT32|
42
+
43
+
44
+ ## Recommended platforms
45
+
46
+
47
+ | Platform | Supported | Recommended |
48
+ |:--------:|:---------:|:-----------:|
49
+ | STM32L4 | [x] | [] |
50
+ | STM32U5 | [x] | [x] |
51
+
52
+
53
+ # Performances
54
+
55
+ ## Metrics
56
+
57
+ Measures are done with default STM32Cube.AI Dev Cloud version 10.0.0 and for target board B-U585I-IOT02A. In addition the configuration were enabled input / output allocated option and `balanced` as optimization choice.
58
+
59
+ The inference time is reported is calculated on STM32 board **B-U585I-IOT02A** running at Frequency of **160 MHz**.
60
+
61
+
62
+ ### Reference memory footprint based on WISDM dataset (see Accuracy for details on dataset)
63
+
64
+
65
+ | Model | Format | Input Shape | Target Board | Activation RAM (KiB) | Runtime RAM (KiB) | Weights Flash (KiB) | Code Flash (KiB) | Total RAM (KiB) | Total Flash (KiB) | Inference Time (ms) | STM32Cube.AI version |
66
+ |:----------------------------------------------------------------------------:|:------:|:-----------:|:-------:|:--------------------:|:-----------------:|:-------------------:|:----------------:|:-----------------:|:-----------------:|:---------------------:|:---------------------:|
67
+ | [GMP wl 24](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/ST_pretrainedmodel_public_dataset/WISDM/gmp_wl_24/gmp_wl_24.h5) | FLOAT32| 24 x 3 x 1 | B-U585I-IOT02A | 4.25 | 2.08 | 5.70 | 12.29 | 6.33 | 18.96 | 4.42 | 10.0.0 |
68
+ | [GMP wl 48](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/ST_pretrainedmodel_public_dataset/WISDM/gmp_wl_48/gmp_wl_48.h5) | FLOAT32| 48 x 3 x 1 | B-U585I-IOT02A | 8.83 | 2.08 | 5.70 | 12.29 | 10.91 | 18.96 | 10.64 | 10.0.0 |
69
+
70
+
71
+
72
+ ### Accuracy with mobility_v1 dataset
73
+
74
+
75
+ Dataset details: A custom dataset and not publically available, Number of classes: 5 [Stationary, Walking, Jogging, Biking, Vehicle]. **(We kept only 4, [Stationary, Walking, Jogging, Biking]) and removed Driving**, Number of input frames: 81,151 (for wl = 24), and 40,575 for (wl = 48).
76
+
77
+
78
+ | Model | Format | Resolution | Accuracy (%) |
79
+ |:----------------------------------------------------------------------------------------------:|:--------:|:----------:|:-------------:|
80
+ | [GMP wl 24](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/ST_pretrainedmodel_custom_dataset/mobility_v1/gmp_wl_24/gmp_wl_24.h5) | FLOAT32 | 24 x 3 x 1 | 94.08 |
81
+ | [GMP wl 48](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/ST_pretrainedmodel_custom_dataset/mobility_v1/gmp_wl_48/gmp_wl_48.h5) | FLOAT32 | 48 x 3 x 1 | 93.84 |
82
+
83
+
84
+ Confusion matrix for GMP wl 24 with Float32 weights for mobility_v1 dataset is given below.
85
+
86
+ ![plot](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/doc/img/mobility_v1_gmp_wl_24_confusion_matrix.png)
87
+
88
+ ### Accuracy with WISDM dataset
89
+
90
+
91
+ Dataset details: [link](([WISDM](https://www.cis.fordham.edu/wisdm/dataset.php))) , License [CC BY 2.0](https://creativecommons.org/licenses/by/2.0/) , Quotation[[1]](#1) , Number of classes: 6 (we are **combining Upstairs and Downstairs into Stairs** and **Standing and Sitting into Stationary**), Number of samples: 45,579 (at wl = 24), and 22,880 (at wl = 48).
92
+
93
+ | Model | Format | Resolution | Accuracy (%) |
94
+ |:--------------------------------------------------------------------------------------:|:--------:|:-----------:|:--------------:|
95
+ | [GMP wl 24](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/ST_pretrainedmodel_public_dataset/WISDM/gmp_wl_24/gmp_wl_24.h5) | FLOAT32 | 24 x 3 x 1 | 84.49 |
96
+ | [GMP wl 48](https://github.com/STMicroelectronics/stm32ai-modelzoo/human_activity_recognition/gmp/ST_pretrainedmodel_public_dataset/WISDM/gmp_wl_48/gmp_wl_48.h5) | FLOAT32 | 48 x 3 x 1 | 87.05 |
97
+
98
+
99
+ ## Retraining and Integration in a simple example:
100
+
101
+ Please refer to the stm32ai-modelzoo-services GitHub [here](https://github.com/STMicroelectronics/stm32ai-modelzoo-services)
102
+
103
+
104
+
105
+ # References
106
+
107
+ <a id="1">[1]</a>
108
+ “WISDM : Human activity recognition datasets". [Online]. Available: "https://www.cis.fordham.edu/wisdm/dataset.php".
109
+