Inspiration
Many people feel motivated to start working out, whether it's to lose weight, improve their health, or achieve personal fitness goals. Often, they go so far as to invest in equipment or gain access to a gym. But despite their enthusiasm, many struggle with one major obstacle: they simply don’t know how to use the equipment safely or effectively. Without proper guidance, that initial motivation quickly fades. Also, many people need tailored assistance and that is usually not possible without a personal trainer.
What it does
Our app is made of 3 main parts.
- Using ChatGPT, our app generates personalized workout plans tailored to each user's goals, schedule, and available equipment, based on a quick and simple questionnaire. It generates exactly which exercises and what times, and adds it to a calendar.
- A pose detection AI model that detects what exercise the user is doing and rewards them "credits" that can be used to play different games.
- An interface that lets users quickly and easily do the generated workout routines, with a timer and workout descriptions.
How we built it
We built the app using React Native in order to support both iOS and Android. In order to built the application into their respective platforms, we used Expo, Xcode, and Android Studio. We build the quiz using standard React Native classes, and converted the user responses into a simple JSON string. To limit hallucinations (i.e. making up exercises or choosing exercises that aren't possible with equipment), we first found a list of all exercises from a database. Then we compare our list of exercises with what equipment the user has to make a list of possible exercises with the users equipment. Finally, another LLM (gpt-4o) takes in all of the user data and possible exercise list and outputs a schedule with dates and times and exercises that can be used. We fine-tuned this LLM using a small set of examples, and tested different prompting methods in order to get the best results, and we used Structured Outputs to guarantee the output in our JSON schema. We parse this JSON and add it to a calendar to make it easy for the user to know when to do what.
In order to detect poses, the first step is to locate different body parts on a person and identify where they are relative to each other through computer vision. We do this for a few of the previous frames. Next, we used an open-weights convolutional neural network from Apple with 27 Convolution Layers and a total of 105 layers. Finally, the previous "body scans" are used and the find the probability that the user is doing each of the exercises. We keep a running total of how long a person is doing each exercise. Then, the user is rewarded "credits" based on how long they did each exercise and the intensity of the exercise that they did. They credits can be used to play Flappy Bird, and each game is 1 credit.
Challenges we ran into
For the workout planner, one big issue was avoiding AI hallucinations. When we started testing out using the LLM, it often made up complicated exercises when simpler ones were just as good. We also had issues where it was generated exercises that couldn't be done. Because of this, we used the multi-step process that we explaining above
For the pose detector, one of the biggest issues we faced was translating swift code/models into javascript. We wanted to make the app access to everybody with a phone, not just people with a iPhone. To do that, we needed convert Apple's models (.mlmodel) into a Tensorflow model that could be used in javascript/typescript. We ran into many issues while doing this as they were various formatting issues with the layers. We also had to redo the preprocessing of the input to work with the Tensorflow model.
Overall, one of the hardest things was collaborating and joining up the different parts that we did to make a single unified app. We had to spent a lot of time combining our codes and updating main to ensure all parts are running smooth. In the end, we didn't have time to connect every piece of code into one seamless app, but in the future we can make sure to finish that.
Our Impact
Creating this app revolutionizes free access to high-quality fitness advice for everyone. This app is for everyone, not just people that are already fit. In the quiz, there is the ability to explain in natural language different problems/disabilities that a user has, and generate custom workout plans based on those. Also, one of the biggest problem with fitness is motivation. With our easy-to-use interface creator and daily calendar (notifications can be added later) it is easy to start and to remember when to exercise. People who don't have the money to hire a personal trainer to physical therapist will find this app very helpful in maintaining their health. This app is simple to use for those unfamiliar with technology due to its intuitive interface and powerful AI capabilities.
What's next for Workout Planner
What we have created so far is just the beginning. In the future we can improve our app by adding more exercises for the workout routines, improving our pose detection model, and even expanding it to other areas like meal planning and dieting. In the future we can also flesh out systems we didn’t have time to fully add during this hackathon, like the points system that rewards users for staying on track and completing their workouts.
After making these changes and polishing the app design and layout, this app could not only be a place for people to work out, but an all-encompassing health app to help people reach their fitness goals through meal plans, encouragement, and personal trainer level knowledge and feedback.
Built With
- api
- expo.io
- github
- neural-network
- openai
- react-native
- typescript
- xcode
Log in or sign up for Devpost to join the conversation.