Close

Human Activity Recognition using MicroPython and emlearn

A project log for Machine Learning on Microcontrollers

Using machine learning to analyze sensor data in embedded systems

jon-nordbyJon Nordby 01/04/2025 at 14:070 Comments

There is now an example project in emlearn-micropython for doing (human) activity recognition using accelerometer/IMU. It can be found here: https://github.com/emlearn/emlearn-micropython/tree/master/examples/har_trees
Example applications of human activity detection could be sleep tracking, overall everyday activities' classification (sitting, walking, running, etc), exercise tracking (can be specific exercises like jacks/lunges/pushups/etc). Since machine learning is dependent on datasets, what exactly we will be able to do is of course a bit dependent on what datasets we are able to find and/or gather.


The feature extraction code is in MicroPython, but it could easily be ported to C. The classifier used is Random Forest, and that is implemented in C using the emlearn C library.


Discussions