Artificial intelligence revolutionizes the precision of human activity recognition, and edge AI enables these algorithms to be embedded everywhere. They can run locally without disclosing any personal information and are embedded in devices such as smartwatches and wristbands.
If you are developing such an application and are concerned about power consumption, this use case is for you. The gym activity recognition use case serves as a fitness example for wearable devices, recognizing activities like bicep curls, lateral raises and squats - all with very low power consumption, thanks to the Machine Learning Core (MLC) available in ST MEMS sensors.
Approach
- Data logs can be acquired through MEMS Studio if the Profi-MEMS board (STEVAL-MKI109V3) and the LSM6DSV16X DIL24 adapter board (STEVAL-MKI227KA) are used.
- Data logs can also be acquired using the SensorTile.box PRO wireless box kit and the STBLESensor app on Android or iOS.
- A low-pass filter (IIR1) has been applied to the accelerometer input data.
- We used Unico-GUI to generate and configure a decision tree model with four features: mean, peak-to-peak, min, max.
- The MLC runs at 30 Hz, computing features on windows of 90 samples (corresponding to 3 seconds).
Sensor
Data
The accelerometer is configured with 8 g full scale, 30 Hz output data rate, low-power mode 1.
The sensor orientation for this algorithm is east-north-up (ENU):
- X parallel to the arm (directed towards the hand for left wrist, directed away from the hand for right wrist)
- Y perpendicular to the arm (directed away from the user when looking at the device)
- Z pointing up
To implement this algorithm with a decision tree, all the data logs have been acquired using the device (LSM6DSV16X) mounted on a wristband on the left hand (or right hand).
Results
Power consumption (sensor + algorithm): 16.5 uA
The decision tree has around 30 nodes and it is configured to detect the different classes.
The output of the decision tree classifier is stored in the register MLC1_SRC (70h):
- 0 = No activity
- 4 = Bicep curls
- 8 = Lateral raises
- 12 = Squats
The configuration generates an interrupt (pulsed and active high) on the INT1 pin every time the register MLC1_SRC (70h) is updated with a new value.
The duration of the interrupt pulse is 33.3 ms in this configuration.
Model created with MEMS-Studio
A complete software solution for desktops to enable AI features on smart sensors. It allows users to analyze data, evaluate embedded libraries, and design no-code algorithms for the entire portfolio of MEMS sensors.
Compatible with LSM6DSV16X
Smart sensors capable of directly processing the data they capture and delivering meaningful insights to the host device. By processing data locally, smart sensors reduce transmitted data and cloud processing requirements, thus lowering power consumption at the system level.