ST AIoT Craft is the first cloud tool from ST for MEMS smart sensors.
by Zuzana Jiránková, Senior Application Engineer at STMicro
Certain ST MEMS sensors are equipped with a machine learning core (MLC). This core can process input data (mostly from accelerometers, but also from gyroscopes and eventually external data readable through the I2C interface) and make predictions using a pre-trained decision tree model. The decision tree model running directly inside the sensor can detect specific events from motion patterns with extremely low power consumption. This approach offloads the microcontroller, reduces the overall power consumption of the device, and prolongs the device’s battery runtime.
ST AIoT Craft is the first cloud tool from ST for MEMS smart sensors that helps users create machine learning models based on decision trees for MLC-enabled sensors. It allows users with little to no data science background to create machine learning core configurations effortlessly and swiftly by automating the model training process.
What is a decision tree?
A decision tree is a supervised learning algorithm that uses a binary tree-like structure, which is also utilized in ST MEMS smart sensors. The decision tree consists of two types of nodes: inner nodes and outer nodes, along with branches.
Inner nodes contain “if-then-else” conditions whereby a feature calculated from input data is compared against a threshold. A specific type of inner node is the root node, which carries the initial condition to evaluate and does not have any incoming branches. Branches represent the result of the inner node (true or false) and select the next node to be evaluated. Outer nodes, also called leaf nodes, do not have any outgoing branches and contain the prediction / result.
Decision trees inside ST MEMS smart sensors can be used for a wide range of applications, including activity/fitness recognition, asset tracking, or vibration monitoring.
Making decision tree usage more accessible
To create a decision tree, we need to perform the following tasks:
Define Classes: Identify the set of classes we want to predict.
Data Collection and Labeling: Gather and tag data for each class with corresponding labels as supervised learning requires labeled data for training.
Data Analysis: Analyze the collected data to select useful signal features and determine the appropriate window length. Optionally, digital filters can be included.
Feature Calculation: Calculate signal features from a specific number of samples determined by the window length. These features can include mean, variance, zero-crossing, minimum, maximum, and so on.
Model Training: Perform model training on the selected signal features calculated from the input data.
Simplifying model training
ST AIoT Craft simplifies the model training process, making it more accessible to non-data scientists. Here’s how it helps:
Development Board Support: The tool supports several ST development boards with ready-to-use firmware for data logging and model evaluation.
Data Logging and Labeling: Data logging and labeling can be performed using a web GUI or a companion mobile application. Data can also be imported in CSV format if logging was performed using a different application, like MEMS Studio, for example. (MEMS Studio is a complete desktop software solution designed to develop embedded AI features and evaluate embedded libraries and sensors. This includes sensor configuration and evaluation, offline data analysis, spectrogram analysis, and advanced embedded features development. You can access the application and more information from st.com/mems-studio)
Data Parsing and Labeling: The tool includes utilities to help parse and label large data files. Users can visualize data in a graph, select sections, and assign corresponding labels to motion patterns. The labeled dataset can be then split into smaller logs with assigned labels ready for training.
Automatic Analysis: After selecting input data for decision tree training (a subset of available data logs can be chosen), the tool automatically analyzes the data and selects appropriate filters, features, and window length.
Model Training and Evaluation: The tool trains a decision tree and generates a sensor configuration. The trained model can be easily evaluated using selected development boards through the web GUI or a companion mobile application.
Additionally, there is no need to install any software on your PC, as your datasets and projects are stored in the cloud. This provides more flexibility when working on your application and allows an IoT system to be set up.
The currently supported development boards for data logging and evaluation of trained models are SensorTile.box PRO, STWIN.box, and STWIN. A preconfigured Linux gateway image running on Raspberry Pi hardware can be downloaded from the ST AIoT Craft website.
Example projects are available for users to test the capabilities of the machine learning core. Among the entertainment case studies, there are examples of human activity recognition, head gesture detection, and gesture recognition. In the industrial domain, the focus is on smart asset tracking, fan coil monitoring, and drilling machine monitoring.
If you want to experience ST AIoT Craft firsthand by either trying a project example or creating your own decision tree, please visit staiotcraft.st.com. You can learn more about our sensor portfolio with machine learning core capabilities and the core itself, including application notes, on st.com/mlc.
ST AIoT Craft is part of the ST Edge AI suite, which is a collection of software tools for integrating AI features into embedded systems—edge AI. It supports a wide range of ST products, including MEMS smart sensors, and provides resources for data handling, AI model optimization, and deployment. More information and available tools and software can be found at st.com/st-edge-ai-suite