AI-based Workout Assistant and Fitness Guide
AI-based Workout Assistant and Fitness Guide
AI-based Workout Assistant and Fitness Guide
Abstract: Nowadays virtual assistant is playing a very important This project, which will have a non-distractive interface,
role in our daily activities and has become an inseparable part intends to make exercising more easy and more fun. We are
of our lives. As per the Clutch survey report that was published going to see an overview of the contribution of these families,
in 2019, almost 27% of people are using AI virtual assistants for their algorithms, advantages, disadvantages, its efficiency
performing their day-to-day activities. AI is an emerging field
that we aim to explore through this project of AI-based workout
compared to other existing technologies, applications and
assistants. In our work, we introduce Fitcercise, an application possible future work.
that detects the user’s exercise pose counts the specified exercise
repetitions and provides personalized, detailed 2. LITERATURE REVIEW:
recommendations on how the user can improve their form. The There are numerous applications available in the market
application uses the MediaPipe to detect a person’s pose, and which guide the user about the exercises to be performed. But
afterwards analyses the geometry of the pose from the dataset through our application, we not only guide the user regarding
and real-time video and counts the repetitions of the particular which exercise to perform but also about the correct posture
exercise. and counting the repetitions using computer vision. This
Keywords: AI, Virtual assistant, CNN, workout assistant, Pose
application can be considered as the workout assistant which
estimation. Blazepose, OpenCV. provides real-time posture detection and diet
recommendations. The application can not only be used by
1. INTRODUCTION: individuals at homes but by increasing the scope can be used
In our work, we introduce Fitcercise, an application that in gyms as smart trainers thus reducing the human
detects the user’s exercise pose counts the specified exercise intervention.
repetitions and provides personalized, detailed analysis about
improving the user’s body posture. This is an AI-based [1]Their objective was to provide a bottom-up approach for
Workout Assistant and Fitness guide to guide people who the activity of estimation of the pose of the user and real-time
don’t have access to the gym but are still willing to work out segmentation of the user while using images of the multi-
at home to maintain their physique and fitness and keep their person solution and by implementing an effective single-shot
body in good shape. To help them perform the exercises approach.
correctly and prevent them from chronicle and immediate So the idea they proposed used a CNN that is a convolutional
injuries. This also provides a personalised health guide and neural network by training it to detect and classify the key
diet plan along with a personalised daily workout calorie points and accordingly give accurate results by studying the
count. The application also displays necessary health relative displacements and thus by clustering or identifying
insurances and policies provided by the government of India the group of different key points and studying the pose
for the common people and check the eligibility criteria using instances.
API and Web services. Staying at home for long periods of Using single-scale inference, the model obtained a COCO[6]
time can become boring, especially when most fun activities accuracy of the points of 0.665 and 0.687 using multiple level
are done outdoors, which is difficult considering the current inference. Using part-based modelling. It depends on the key
scenario of pandemics and lockdown. But this cannot be a point level structure in order for training the real-time
relevant excuse for being unproductive because it is an segmentation activity. In the future, there might be ways to
excellent idea to utilize the extra time we get into our own overcome this limitation.
health.
Most gyms have a wide variety of exercise equipment and
also have trainers who guide us about the exercise and its
correct posture. But the unavailability of the above equipment
and trainers can be an important reason that can stop us from
doing exercise at home.
We aim to build an AI-based trainer that would help you
exercise more efficiently in your own homes. The project
focuses on creating an AI algorithm to help you exercise, by
determining the quality and quantity of repetitions which is
done by using pose estimation running on the CPU.
3. DATASET USED:
As most of the solutions use the key points and the heatmaps,
first we require to pose alignment data for each pose. We can
take into consideration the different test cases where if the
complete body is visible and there are detectable key points
for the body parts. To make sure that the pose detector can
perform in heavy occlusions which are some different test
cases than normal ones, we can make use of occlusion-
simulating augmentation. The training data set has 60000
images with a few images doing the same pose that have
different key points and 25000 frames in which the user
performs the actual exercise.
Fig 1: 33 Body Key Points[6]
4. IMPLEMENTATION AND ALGORITHM:
In research paper[2] Their objective was to create BlazePose, We have used JavaScript node JS and different libraries such
a mobile-optimized lightweight convolutional neural as Open CV and MediaPipe which is a library using ML
network architecture for human posture prediction. On a algorithms along with different numerical and algorithms.
Pixel 2 phone, the network creates 33 body key points(as
shown in Fig 1) for a single individual during inference and The MediaPipe pose estimation tool uses a 33 key points
operates at over 30 frames per second. This makes it ideal for approach wherein it detects the key points and accordingly
real-time applications such as fitness tracking and sign uses and studying the data set estimates the pose. It tracks The
language recognition. Two of our most significant pose from the real-time camera frame or RGB video by using
contributions are a novel body posture monitoring method the blaze pose tool that has a Machine Learning approach in
and a lightweight body pose prediction neural network. Both pose detection.
approaches use heatmaps and regression to find the points.
They built a robust technique to estimate the posture using This approach uses a double step tracker machine learning
Blazepose, which uses CNN and a dataset with up to 25K pipeline which is efficient in media pipe solutions. Using the
photos demonstrating distinct body endpoints, enhancing the tracker locates the region of interest of the activity or posture
accuracy. On a mobile CPU, this model runs in near real- in the real-time video. It then predicts the key points in the
time, and on a mobile GPU, it can run in super real-time. region of interest using the real-time video frame as an input.
But the point to be noted is that the tracker is invoked only
The given algorithm of 33 keypoint topology is efficient with during the start or whenever the model is unable to detect the
BlazeFace and BlazePalm. In this paper, the authors have body key points in the frame.
developed a system for majorly upper body key points. A
solution that shows lower-body analysis of pose will also be We have created a module named PoseModule.js and defined
integrated. various functions in it and imported this module to our main
project file aiTrainer.js to utilize these functions.
In the research paper[3], the researchers proposed an efficient We are basically first detecting the landmark positions on the
solution mainly to tackle the multi-person problem while body in the video with the help of MediaPipe[9]. Then the
detecting poses when there are multiple people in the real- angle between the points is calculated and a range is
time frame. In this approach, the model is trained in such a determined. This range can be demonstrated by a 0-100 %
way that it detects the points of the user and then segregates efficiency bar on the output video frame. We also calculate
based on the affinity of different points in the frame. This is the number of repetitions of the exercise and display the count
considered as the bottom-up approach and is very efficient in in the output video.
accuracy and performance-wise without considering the Formula for calculating angle formed by 3 points:
number of people in the frame as the barrier. For the dataset Angle = math.degrees(math.atan2(y3-y2,x3-x2)-
considering 288 frame images, this approach performs well math.atan2(y1-y2,x1-x2))
as compared to the other approaches discussed above by
8.5% mAP. The approach is able to get higher accuracy and In the output following data is displayed: fps rate, counter for
precision in real-time. The earlier solutions were redefined in repetitions, landmark points, the angle between landmark
the training stages. The disadvantage of OpenPose is it points and status bar.
doesn’t return any data about the depth. and also needs high
computing power. This project can be implemented on pre-recorded videos as
well as in real-time through a webcam.
In the research paper[4] they aimed to get the precise location
of the points by using a deep neural network. In this approach,
they presented DNN-based estimators. This allowed an
denotes the input picture and byh denotes our kernel. The
indexes of the result matrix's rows and columns are denoted
by mand n, respectively.
Relu:
Softmax:
Fig 2: Inference Pipeline
Backpropagation:
5. BLOCK DIAGRAM:
7. SYSTEM ARCHITECTURE:
12. REFERENCES:
1. “PersonLab: Person Pose Estimation & Instance Segmentation with
a Bottom-Up, Part-Based, Geometric Embedding Model”
G.Papandreou, T.Zhu, L.-C.Chen, S.Gidaris, J.Tompson,
K.Murphy.
2. “BlazePose: On-device Real-time Body Pose tracking.”
V.Bazarevsky, I.Grishchenko, K.Raveendran, T.Zhu, F. Zhang,
M.Grundmann.
[2] “OpenPose: Realtime Multi-Person 2D Pose Estimation Using Part
Affinity Fields ” Z Cao, G Hidalgo, T Simon, S-E Wei, Y Sheikh.
[3] “DeepPose: Human Pose Estimation via Deep Neural Networks
(August 2014)” A.Toshev, C.Szegedy (Google) 1600 Amphitheatre
Pkwy Mountain View, CA 94043.
[4] COCO 2020 Keypoint Detection Task.
[5] “Deep Learning-based Human Pose Estimation using OpenCV” By
V Gupta.
[6] “Pose Trainer: Correcting Exercise Posture using Pose Estimation”.
By S.Chen, R.R. Yang Department of CS., Stanford University.