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 Unico-GUI or 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
6-axis inertial measurement unit (IMU) and AI sensor with embedded sensor fusion, Qvar for high-end applications (reference:
LSM6DSV16X).
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 uAThe 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.