3217 views|3 replies

124

Posts

1

Resources
The OP
 

【LSM6DSOX's MLC machine learning understanding】--Introduction to machine learning [Copy link]

 This post was last edited by justd0 on 2020-5-2 12:43

The LSM6DSOX machine learning module is a very complex part. After a few days of research, I finally figured out the basic usage. This post will briefly introduce the features and basic operation process of the LSM6DSOX machine learning module.

Basic Features

The machine learning module of LSM6DSOX is essentially implemented through a decision tree, which is a mathematical tool consisting of a series of configurable nodes and uses a binary tree structure decision tree .

Each node consists of an "if-then-else" judgment condition, which evaluates the input data and threshold to obtain the final output result.

The input data can be accelerometer, gyroscope and external sensor data, and the mean, variance, energy, peak, zero crossing and other data calculated in the defined time window are called features in the machine learning module .

Algorithms suitable for machine learning are those that can be implemented by induction , that is, algorithms that search for results from observed data, such as: activity recognition, fitness activity recognition, motion intensity detection, vibration intensity detection, carrying position recognition, context perception, false positive rejection , etc.

The LSM6DSOX can run up to 8 decision trees independently at the same time . The decision trees are stored in the sensor registers and produce results through dedicated output registers. The output data rate ranges from 12.5-104Hz .

Core functional modules

The core functional modules of LSM6DSOX machine learning can be divided into three parts: sensor data module, calculation module, and decision tree module .

1. Sensor data module

The data generated by the accelerometer and gyroscope inside the sensor, or the data of the external sensor, is transmitted through I2C . For all sensor data , the normal and normal square will be calculated and used as input data. The acquired data will be input into the calculation module. The formulas for normal and normal square are as follows:

It should be noted that the rate of input data must be equal to or higher than the output rate of the machine learning module.

The units for the input data are also defined:

Acceleration data, in g

Gyroscope data, in dps ( rad/sec )

2. Computing module

The calculation module includes two parts: filter and feature.

The filter performs filtering on the sensor data input from the previous module. High-pass, band-pass, and low-pass IIR1\IIR2 filters can be used.

Features are statistical parameters calculated from input data or filtered data in a defined time window , such as mean, variance, energy, peak-to-peak value, zero crossing, positive zero crossing, negative zero crossing, peak detection, maximum and minimum values, etc.

3. Decision Tree Module

The decision tree module determines the action category through the if-else conditional node based on the statistical parameters output by the calculation module and the threshold value obtained through training and learning.

The decision tree generates a judgment result in each time window, which can also be filtered by an additional (optional) " meta-classifier ". The meta-classifier filters the decision tree data through internal counters.

When the decision tree value changes, the corresponding register interrupt status bit will change, and the interrupt can also be routed to the external interrupt INT1/IN2 . The output results of the machine learning module can be accessed through dedicated registers .

In terms of the number of decision trees, the size of decision trees, and the number of decision tree results, the resources of the LSM6DSOX are limited. A maximum of 8 different decision trees can be stored, but the sum of the number of conditional nodes of all decision trees cannot exceed 256 ( this value is affected by the combined influence of features and filters ) , and each decision tree has a maximum of 16 results.

The machine learning module and the finite state machine module can be used together, and CHKDT is used to enable the state machine to obtain the output of the machine learning module.

Function Implementation Process

To implement the LSM6DSOX machine learning function, a supervised learning method is required :

  • Define some feature types to recognize
  • Collect multiple data logs for each feature type
  • Perform some data analysis on the collected logs, learn a rule that maps input (data logs) to output (classes to be identified), and generate a specialized decision tree
  • With the decision tree, you can generate the configuration through Unico and import it into the sensor.

The specific implementation process will be described in detail in the next post.

Latest reply

Very clear explanation, very helpful. My project requires sleeping posture detection, and I also need to study this.   Details Published on 2020-6-7 19:20
 
 

1w

Posts

204

Resources
2
 

I don't know how impressive it is!! Cool~Keep it up, OP~

Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

https://bbs.eeworld.com.cn/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

25

Posts

0

Resources
3
 

The post by the host is clear and well-written. I gained a lot after reading it.

 
 
 

30

Posts

0

Resources
4
 

Very clear explanation, very helpful.

My project requires sleeping posture detection, and I also need to study this.

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list