With the recent pandemic, many gyms and fitness centers have closed down leaving many without a way to continue their active lifestyle. Especially with the lack of gym equipment at home, people are even less motivated to adapt to a new routine.
What it does
trAIner makes this new routine much easier to adapt to by using machine learning and AI to detect the specific workout routine that would best suit you based on your ideal weight and current fitness level. During a workout, trAIner uses real-time feedback to discern whether a specific exercise is liked or disliked by a user, which then helps in producing the next workout routine for the user.
While there are currently many AI fitness apps on the market right now, we believe we stand out since:
- We give users workout routines based on activity type such as "HIIT" or "Cardio", not a body part.
- Our real-time feedback system allows users to create more curated workout routines for themselves over time.
How I built it
trAIner was built using primarily asp.net core. For the backend we had classes for users and for the structure of an exercise. We then set up in memory databases for the exercises that will be serialized and saved to the user. The most technologically interesting aspect of this project is our learning system. This module works by using a dictionary of every exercise type, along with values of doubles and a list of past workoutTypes used that acts as memory. While the user is working with our procedurally generated exercises, they can give feedback on whether they liked it or not. Based on that feedback, which is sent to the backend through real time signalr websockets, Not only is the double associated with that workoutType increased based on an exponentially increasing amount based on how many times that workoutType has been judged, but values such as times, rep amounts, and intensity are increased or decreased to better fit their preferences. When the next exercise is generated, a staggered random is used based on those doubles from the dictionary which makes the more disliked activities less likely and the others more likely. In the end, trAIner offers a personalized workout every time the user logs in, and is increased in accuracy each time they supply feedback.
Challenges I ran into
While building it, trAIner served as an overall good experience, however there were some very significant problems I ran into. The first of these was setting up SignalR, which gave me many 404 responses before I noticed a small typo. The bigger challenge I had was the very algorithmically demanding exercise generation function. All of the small details that I had to incorporate in order to give the best user experience was a very challenging hassle, but I think it paid off.
Accomplishments that I'm proud of
I am really proud personally of how well the staggered random system worked in the end. It really blew me away that I could visually see certain workoutTypes get less or more likely.
What I learned
I learned a big lesson about the patience required to correctly make an efficient algorithm as well as lots of useful information about websockets and how they work.
What's next for trAIner
In the future, we plan to refine some of the UI of the trAIner and make it a real mobile app available on all devices using gonative.io.