DIY Fitness Tracker(GET-FIT)
Introduction: DIY Fitness Tracker(GET-FIT)
Introducing GetFit, your ultimate health and workout partner. GetFit is an easy-to-use, teachable fitness tracker with the capability of detecting an endless variety of exercises. Powered by Arduino Nano 33 BLE Sense and Edge Impulse, it is a completely open-source project.
Features
* Can Count unlimited exercises
* Fully open-source
* Teachable
* Rechargeable
* Calorie Burn Estimation on a daily and weekly basis
Step 1: Arduino Nano 33 BLE Sense(Brain)
For doing this project we are using, Arduino nano 33 BLE sense. It's a 3.3V AI-enabled board in the smallest available form factor. It comes with a series of embedded sensors.
* LSM9DS1 (9 axis IMU)
* LPS22HB (Barometer and temperature sensor)
* HTS221 (relative humidity sensor)
* APDS-9960 (Digital proximity, Ambient light, RGB, and Gesture Sensor)
* MP34DT05 (Digital Microphone)
Here we are utilizing the 3 acceleration channels of the LSM9DS1 sensor for counting the activities.
It is a very hard task to recognize the activities using rule-based programming, as people don't perform activities, in the same way, every time. But machine learning can handle these variations with ease. To create a machine learning model, you would traditionally use a framework like TensorFlow or Scikit-learn on top of a high-level language like Python. There are a lot of benefits to still learning some of these frameworks, but here we're going to use a tool called Edge Impulse as it just makes model training much easier. Fortunately, the Arduino Nano 33 BLE Sense is fully supported by Edge Impulse.
Step 2: Edge Impulse
Using Edge Impulse you can quickly collect real-world sensor data, train ML models on this data in the cloud, and then deploy the model back to your Arduino device. From there you can integrate the model into your Arduino sketches with a single function call.
This document contains "How you can get started with Edge Impulse and BLE Sense board"? And also the sample machine learning projects. Don't forget to try, if you are a beginner in this field.
Step 3: Data Aquisition
Data is an unavoidable part of the machine learning model, for the data acquisition and model generation head over to the edgeimpulse.com.
Make sure your device is connected to edge impulse.
Then we attached the Arduino to my arm with a couple of wiring ties and a sponge, to make the model very accurate for every activity. Then we started sampling.
We have collected around 17min of data. The more data you have, the better your model becomes.Also, try to maintain a balanced dataset. 152
Having a balanced data set for a model would generate higher accuracy.
Here we also took the idle state by remaining them stationary at the different starting and ending positions of the motions. We also performed the split data set for testing the model, That's really good practice when analyzing the model. Training data is used to train your model, and testing data is used to test your model's accuracy after training.
Step 4: Feature Extraction
Figuring out which features to extract from our data to submit to our model for training and, eventually, inference, is one of the most essential things we can do in machine learning. Rather than picking and choosing some of the raw samples, the edge impulse will combine the samples in a variety of ways to generate unique features that help describe what's going on in a particular motion.
We should first create an impulse, which is Edge Impulse's word for a machine learning pipeline, in order to generate features. You should see the first block, which represents your raw data. Here we used window size and window increase as 2000ms because it perfectly suits our data. The processing block refers to our feature extraction method in the edge impulse, Edge Impulse will recommend the spectral analysis block for our motion data, which is what we want. In the learning slot, we added a neural network cross-block. Although neural networks are fantastic, they have one major problem. They're useless when it comes to dealing with data they've never seen before (like a new activity). Because neural networks only have access to training data, they are unable to assess this. Even if you offer it something entirely different beyond what it's seen before, it'll still fall into one of the four categories. So we also added an Anamoly detection block to find the anomalies in the motions. They will actually stand out in the output.
After designing impulse, we generated the features for this data. 57