on 2025-05-08 7:00 AM
In this article, we explore one of the new features of ST AIoT Craft v1.1: machine learning core (MLC) expert mode. It offers advanced customization of the decision tree classifier in the MEMS sensor, and improved algorithm accuracy.
MLC expert mode enables you to set all parameters of the machine learning core engine, namely:
With MLC expert mode, you can fully leverage on the automatic parameter extractor. You can automatically generate window length and the most suitable filters and features for the dataset used in that model.
It is possible to choose between two filtered search modes: basic and exhaustive.
Basic search is faster but may be inaccurate on flat signals without significant peaks. Exhaustive search is a more computationally expensive method but identifies one filter on norm (V) for each class.
You can select one among the following five extraction methods:
If you are not familiar with extraction methods, you can choose one of the predefined presets:
The set of features is generated up to the maximum number of features which you can configure.
A standard set is built from six features; mean, energy, variance, peak to peak, minimum, maximum.
You can extend it by including the following features with threshold: zero-crossing, positive zero-crossing, negative zero-crossing, peak detector, positive peak detector, and negative peak detector.
For selected sensors, it is possible to include recursive features. Recursive features have an infinite window (infinite impulse response) and provide a valid value for every MLC ODR. They allow better detection of short events and simplify the coexistence of different algorithms.
The recursive features are divided into two groups:
Selecting any additional features might add significant generation time depending on the size of the dataset.
Apart from using the automatic parameters extractor, you can also set window length, filters, and features manually.
Figure 1. Add new filters and features manually by clicking on the blue buttons
All parameters must be selected carefully so that the requirement of minimum number of samples in each file is satisfied.
Files within the dataset were acquired with certain output data rate (ODR). If it was acquired with a rate higher than MLC ODR, the data is sampled down to the value of MLC ODR. There must be enough samples in each file to have at least one window of data.
The number of samples in one window is calculated according to the equation below:
Samples = max(Oa, Og) / Om * wl
Figure 2. Filters can be added with Add new filter button and deleted with Remove button for respective filter
There are four types of filters:
Each filter must have one of the following inputs: Acc_XYZ, Acc_V, Acc_V2 and Gyr_XYZ, Gyr_V, Gyr_V2 that are only available when gyroscope is selected as the input data source.
Filters with inputs ending with "_XYZ" are calculated from individual axes, with inputs ending with "_V" being calculated from norm and with inputs ending with "_V2" calculated from norm squared.
Figure 3. Features can be added with Add new feature button and deleted with Remove button for respective feature
There are 12 types of basic features: mean, variance, energy, peak to peak, zero-crossing, positive zero-crossing, negative zero-crossing, peak detector, positive peak detector, negative peak detector, minimum, maximum.
Features can be computed either from raw sensor input data.
In that case, each feature must have one of the following inputs: Acc_X, Acc_Y, Acc_Z, Acc_V, Acc_V2 and Gyr_X, Gyr_Y, Gyr_Z, Gyr_V, Gyr_V2, which are only available when gyroscope is selected as input data source.
Additionally, features can be computed from filtered data. In that case, there are also possible following inputs:
For example, input Acc_X_filter_3 means that there is an applied filter with index 3 on X axis of accelerometer. Filter 3 must be declared with Acc_XYZ input.
When activating the expert mode, parameters are loaded. If the auto mode is executed as well, its results are also loaded. You can either modify the parameters together with the auto mode results or define a new MLC configuration from scratch.
When switching back from expert mode to auto mode, parameters are automatically set. Therefore, the previously set MLC configuration might be rewritten.
In this article you have discovered one of the new features implemented inside ST AIoT Craft v1.1: MLC expert mode for advanced decision tree customization in MEMS sensors. It is based on the setting of MLC filters and features.