Personal Trainer Anywhere: A TinyML Classification Model to Identify the Correct Execution of Gym Exercises

This project is aimed at creating a device that can act as a personal trainer. This device incorporates machine learning algorithms, specifically TinyML, to detect physical exercises and provide real-time feedback. The goal of the project is to provide an affordable and accessible solution for people who want to exercise but cannot afford a personal trainer or gym membership. The device is designed to be lightweight, portable, and user-friendly, making it ideal for use in the home or when traveling. The project utilizes an XIAO nRF52840 Sense with onboard accelerometer and gyroscope sensors, and Edge Impulse to train the machine learning model. The final product is a small wearable device that can detect eight different physical exercises and provide immediate feedback on form, repetitions, and overall performance.

Seeed Hardware: Seeed Studio XIAO nRF52840 Sense

Software: Edge Impulse、Arduino IDE

Industry: Healthcare

Background

A personal trainer can provide guidance and help individuals to stay on track with their fitness goals and achieve better results. On one hand, personal trainers can help individuals to learn proper form and technique, which can reduce the risk of injury and ensure that exercises are performed correctly, on the other, personal trainers can help individuals to stay consistent with their workouts and make progress toward their fitness goals.

The Challange

However, personal training can be expensive, with some trainers charging upwards of $100 per hour or more. Also, when choosing a personal trainer, you also need to consider your schedule, location, and personal preferences, which may make it less convenient for those on a tight budget.

  • scheduling: personal training sessions typically need to be scheduled in advance, which can be less convenient for individuals with busy or unpredictable schedules. Additionally, if a scheduled session needs to be rescheduled or canceled, it can be difficult to find a new time that works for both the trainer and the client.
  • location: personal training sessions typically take place at a gym, studio, or another fitness facility, which may not be convenient for individuals who live far away or have limited transportation options.
  • personal preferences: Some individuals may prefer to exercise alone or may not feel comfortable working with a personal trainer.

The Solution

1. Data Acquisition: XIAO nRF52840 Sense enables wireless Data Collection

One significant advantage of using the XIAO nRF52840 Sense device is its wireless data collection capabilities. This is especially important when the device is attached to a fitness facility that is in constant motion. With the XIAO nRF52840 Sense, data can be collected wirelessly using Bluetooth. This means that there are no wires or cables to get in the way during exercise, which can be both inconvenient and potentially dangerous.

The data will be collected from three exercises, the biceps curl, the bench press, and the lateral raise, all of them done using dumbbells. This Choice was based on these exercises working different types of muscles: the biceps, the chest area, and the shoulders respectively.

Biceps curl, bench press and lateral raise.

2. Data Presentation and Data Training

To receive and store data from the microcontroller, an Android app was developed using the MIT App Inventor 2 website. The app’s function is to receive data from the 6-axis IMU for a specified amount of time and store it either in a CSV file or an online Google sheet.

The app to the left and a generate file to the right.
Graphic visualization of a biceps curl collected data

3. Model training and Model Testing with Edge Impulse

Model training and model testing can be done with Edge Impulse. Edge Impulse is a platform that provides tools to help you train and test machine learning models for embedded devices. The platform offers a range of features that can help you develop machine-learning models for a variety of applications, including sensor data analysis, image recognition, and sound classification.

Model testing results.

4. Make Reference

Inferences results fluxogram.

The inference results can be displayed on the smartphone screen, by audio, or by smartphone vibration, depending on your preference. Additionally, the data collected during the exercise session can be saved to create a timeline of the entire session. This data can then be analyzed to create graphs that allow the end-user to interact and understand their performance

5. Make it Compact Enough to be Portable and Attachable

The device is designed to be compact and portable, making it easy to attach to any fitness facility or bring to any location. To ensure that the device can be used in a variety of environments, it is important to create a protective case that can withstand accidental drops and bumps while also allowing for easy portability.

A custom case can be created using 3D printing technology, which allows for precise and durable designs. The case should be designed to fit snugly around the XIAO nRF52840 Sense and battery. This makes it easier to use the device in a variety of settings and helps to ensure that it can be used safely and effectively.

Render of the 3D Casing.

The Results

A low-cost DIY personal trainer is far more affordable than hiring a professional trainer or purchasing expensive exercise equipment. This personal trainer can also be tailored to your specific needs and goals, allowing you to create a workout routine that works best for you.

More Information

Learn More Project Details on Hackster: Developing a “personal trainer” using TinyML

Seeed Studio XIAO Series

Please feel free to reach out to [email protected] for any inquiries or if you’d like to engage in further project discussions. Your questions and interest are welcomed.

About Author

Calendar

June 2023
M T W T F S S
 1234
567891011
12131415161718
19202122232425
2627282930