Giter Site home page Giter Site logo

stmicroelectronics / stmems_machine_learning_core Goto Github PK

View Code? Open in Web Editor NEW
156.0 32.0 58.0 35.51 MB

Configuration files, examples and tools for the Machine Learning Core feature (MLC) available in STMicroelectronics MEMS sensors. Some examples of devices including MLC: LSM6DSOX, LSM6DSRX, ISM330DHCX, IIS2ICLX, LSM6DSO32X, ASM330LHHX, LSM6DSV16X, LIS2DUX12, LIS2DUXS12, LSM6DSV16BX, ASM330LHHXG1, LSM6DSV32X

License: BSD 3-Clause "New" or "Revised" License

MATLAB 0.30% Jupyter Notebook 1.08% Python 1.64% C 96.98%
stmicroelectronics mems-sensors machine-learning mlc decision-tree lsm6dsox lsm6dsrx ism330dhcx iis2iclx asm330lhhx

stmems_machine_learning_core's Introduction

Machine Learning Core

This repository provides information, examples and configurations of the Machine Learning Core (MLC), a hardware processing engine dedicated to the most extreme real-time edge computing available in the latest products in the ST sensors portfolio. Products that offer the MLC end in "X".

Machine Learning processing allows moving some algorithms from the application processor to the STMicroelectronics sensor, enabling consistent reduction of power consumption.

Machine Learning processing is obtained through decision-tree logic. A decision tree is a mathematical tool composed of a series of configurable nodes. Each node is characterized by an “if-then-else” condition, where an input signal (represented by statistical parameters calculated from the sensor data) is evaluated against a threshold.

The results of the decision tree can be read from the application processor at any time. Furthermore, there is the possibility to generate an interrupt for every change in the result in the decision tree.

For more information about MLC, please explore the dedicated page available on the ST website: MEMS Sensors Ecosystem for Machine Learning.

Repository overview

This repository is structured as follows:

  • An application_examples folder, containing examples of applications ready to be used with the sensor.
  • A configuration_examples folder, containing examples of configurations using different ST hardware and software tools.
  • A tools folder, containing some additional scripts for decision tree generation.

More information: http://www.st.com

Copyright © 2021 STMicroelectronics

stmems_machine_learning_core's People

Contributors

ashment avatar gualor avatar mariotesi avatar michelefer avatar rehmc avatar sicsoftware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stmems_machine_learning_core's Issues

MLC configuration for LSM6DSO32X

Very appreicate your help!
Could you please let me know, is there a MLC configuration example for LSM6DSO32X?
Currently, I want to implement the LSM6DSO32X sensor to recognize human's sleep, could you please give me some guide about how to achieve that?

How the norm is calculated ?

Dear everyone,

I wrote my own functions similar to those of MLC module of UNICO.
However I don't understand how is calculated the norm and the squared norm.

From UNICO, I got this result:

     ENERGY_on_ACC_X  ENERGY_on_ACC_Y	ENERGY_on_ACC_Z	ENERGY_on_ACC_V	F25_ENERGY_on_ACC_V2
0	11.01560    37.9688    4.31641    53.4063    54.6875
1	14.50780   47.9063   11.27340   73.5625    115.1880
2	5.58203    47.6875   22.06250   75.2500   124.7500
3	15.19530   14.6328     8.66406  38.5000     29.6563
4	22.07810   15.1484     5.67969   43.0313     36.0938

If I follow the documentation (ref - AN5259 - Rev 4), the norm is :
norm = sqrt(sum(i^2)) with i: [x, y, z]
norm square = sum(i^2) with i: [x, y, z]

I'm curious because these formulas don't match with the results from UNICO.
ENERGY_on_ACC_V2 != sum(ENERGY_on_ACC_i^2) with i: [X, Y, Z]

The values can change the weight for nodes in the decision tree.
Does MLC's UNICO calculate norm and square norm in the same way that LSM6DSOX?

About the sensor lsm6dso32x

Just want to know, is it possible to use the MLC configuration of lsm6dsox on the lsm6dso32x.
Is there anything that I should to modify?

Thanks!

How to load multiple data logs

I am using STMems_Machine_Learning_Core/tools/mlc_python_script/Script/MLC.ipynb to load an existing dataset for acc+gyr. It is not clear how to load multiple data logs for same classes for example 10 files have "jogging" and another 10 files have "running" data. Is there any example or data format instructions?

Regrading empty drff file generation

Hi, I've met a weird issue. My target is to classify two types of motions. In my design, each motion is covered in 1.7 s and I want the MLC of my sensorTile.box to recognise it during this period.

To do this, I follow the tutorial in this repo. One of the main steps is to generate an .arff file. I have the following settings:

  • First, I have multiple log files (.csv files), where each file contains 354 samples (given an ODR of 208 Hz, 354 = 1.7 * 208) and each sample has ACC_XYZ and GYRO_XYZ attributes. These log files can be loaded successfully in Unico GUI. I've also attached one of the log files here Walk_1.csv
  • After loading and labelling them in Unico GUI, I configure as follows:
  1. MLC ODR = 26 Hz
  2. Accelerometer 16 g + 208 Hz ODR, gyroscope 2000 dps + 208 Hz ODR
  3. Window length = 52
  4. Features are simple means and variations. No filters applied

And when reaching the .arff file generation step, the software generates an almost empty file, which only contains the .arff headers but no data (i.e., the feature values and labels after the '@DaTa' sign are missing), as shown below.

@relation 'MLC'
@attribute F1_MEAN_on_ACC_X numeric
@attribute F2_MEAN_on_ACC_Y numeric
@attribute F3_MEAN_on_ACC_Z numeric
@attribute F4_MEAN_on_GY_X numeric
@attribute F5_MEAN_on_GY_Y numeric
@attribute F6_MEAN_on_GY_Z numeric
@attribute F7_VAR_on_ACC_X numeric
@attribute F8_VAR_on_ACC_Y numeric
@attribute F9_VAR_on_ACC_Z numeric
@attribute F10_VAR_on_GY_X numeric
@attribute F11_VAR_on_GY_Y numeric
@attribute F12_VAR_on_GY_Z numeric
@attribute class {walk, nowalk}

@data

This is very confusing. When I reduce the configuration of ODR of accelerometer and gyroscope (e.g., 208 Hz -> 104 Hz), the problem magically vanishes. Therefore, the problem seems to be that my log files do not have sufficient samples? However I don't see such requirements from any of the manuals.

I hope I've made myself clear. And I really appreciate it if anyone could give an answer about this. Thanks a lot!

Support for mlc_python_script with macOS

Does the mlc_python_script work with macOS? I found the code is using unico.exe which is for Windows. I have installed Unico GUI on macOS but how can we provide path for it in the script. Also, a Windows specific python module is being using in the notebook which I think only for version check and can be ignored but what is the supported Unico version for macOS.

Generating .h header file without Unico GUI

Hello,

I was wondering if there is existing functionality for generating .h file for use with the standard C drivers. The mlc_configurator.py file appears to not provide this functionality. Is there a way to invoke Unico to do this through python instead of through the GUI, or would I need to write my own wrapper for converting .ucf into a corresponding .h file?

Thanks for any help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.