Machine Learning Algorithm for Personal Training

Omar Husain, 12 August 2019

Since machine learning has become a huge trend, I wanted to apply it to solve an everyday problem. The problem I had was that I was performing a lot of exercises in the gym but I wasn’t sure if I was doing them correctly. I was always worried about hurting myself with bad movements. I therefore decided to use computer vision to solve this problem.

I created an app that gives feedback on video footage of exercises. I trained a machine learning model to be able to identify correct squats, and bad squats based on video footage. You can try out the app on the website: https://squatapp.herokuapp.com.

Animation

The algorithm is based on the concept of transfer learning. This entails taking a pre-trained model and further adding layers to this model which will be trained on my particular data.

This method allows for very rapid training and can result in accuracy as high as 95%.

On the web application side this app uses a flask server along with a celery server to take care of the squat evaluation function. The flask server takes requests from the browser, while the celery server takes inputs from a redis queue given by the flask server. Any videos sent by the user are sent straight to a cloud storage service via javascript. The architecture can be seen below

Web Architecture Squat App