This project aims to develop a sensor-agnostic posture classification system that uses an IMU sensor unit embedded in an Arduino board. The system will gather sensor data, including 3-axis accelerometer, 3-axis gyroscope, and 3-axis magnetometer, and implement a machine learning algorithm for real-time posture detection. The final model will be deployed on the microcontroller for live predictions and communicate the results to a base station (laptop or smartphone).
Run readData.ino
code to read IMU sensor data and store signal readings on your computer.
Run readData.py
Collect data for different postures (supine, prone, side, sitting, and unknown). Ensure to gather data for various sensor orientations to ensure robustness.
Construct data.csv
with all 3 sensors data for all 5 postures and split it into training, validation, and test sets. Train the model with only 3 input channels (x, y, and z).
Run Relu_datamodel.py
a custom neural network architecture and train your model offline.
Obtain model_pred.tflite
and model_pred_quant.tflite
Assess the performance of your model. Make adjustments to the architecture and dataset to prevent overfitting or underfitting.
Test your model on the test dataset.
Convert model_pred.tflite
or model_pred_quant.tflite
into a model.cc
source file for Arduino BLE Sense.
- Ensure the model is insensitive to sensor orientation changes.
- Collect data representing the same posture in different orientations and label them consistently.
- Discuss assumptions about sensor positioning, operating points, and corner cases in the report.
- The following has a prediction value of about 81% because of the gyroscope sensor.
- The gyroscope measured the angular velocity of the system and when we were collecting data we kept it at rest so the angular velocity values were kind of gibberish.
- The value of the magnetometer affects the magnetic field of the thighs around it. So we made sure that during data collection and inference, we kept the same setup.
For a visual demonstration of this project, please refer to the video linked below: