What are the additional scaling factors applied during feature computation on IMU chips with MLC?
- November 26, 2021
- 1 reply
- 1608 views
In developing some activity classification models using the LSM6DSOX, I have noticed that some information regarding the computation of features appears absent from the documentation. For some features (mean, min, max, maybe more), it would appear that the raw components (X, Y, and Z) as well as the norm are scaled by a factor of 1/1000; similarly, the norm squared variable seems to get scaled by 1/1,000,000. However, this does not seem to hold for other features like variance or energy.
This is based on analysis of results returned from the Unico API (as accessed from this repo: https://github.com/STMicroelectronics/STMems_Machine_Learning_Core/tree/master/tools/mlc_python_script). Below I have displayed two printouts comparing the Unico result and manual computation of features in Python.
Max value:
Unico results:
F27_MAX_on_ACC_X F28_MAX_on_ACC_V F29_MAX_on_ACC_V2
0 0.003998 0.006924 0.000048
1 0.003998 0.006924 0.000048
Manual results:
A_X [mg] ACC_V ACC_V2
0 4.0 6.928203 48.0
1 4.0 6.928203 48.0Energy:
Unico results:
F7_ENERGY_on_ACC_X F8_ENERGY_on_ACC_V F9_ENERGY_on_ACC_V2
0 0.000273 0.000777 0.0
1 0.000273 0.000777 0.0
Manual results:
A_X [mg] ACC_V ACC_V2
0 273.0 819.0 31941.0
1 273.0 819.0 31941.0Could someone please clarify what is happening here? Beyond just the scaling, it would also seem that floating point accuracy is diminished as part of this scaling. I have searched every piece of documentation I can find and no mention of these scaling factors is apparent to me. Please find attached code (with annotated Jupyter notebook) describing my analysis.



