top of page
Writer's pictureTara Murphy

The AI Guru

The Machine Learning Yogi, here to help..


So we’ve all learned new skills and hobbies during Covid. Afterall, being in lockdown for months at a time, one can only handle so much boardgames and cringy TV shows before slowly losing one’s sanity…

And of course, I was no exception. From learning German, knitting and let’s not forget the many sourdough bread attempts, I spend the majority of my days trying to find different ways to think of anything other than the pandemic that surrounded us. But all these hobbies came and left(and after many attempts, I still fail to make a good sourdough). I simply got bored of one hobby and quickly moved onto another.

However, one hobby has stuck with me throughout Covid and is still with me today. Yoga.

With the endless amount of Apps, Blogs and YouTube videos, all I needed was a Yoga Mat and I was ready to go. With Yoga, I could forget about the stress of work and the anxiety caused by Covid and take some time out to simply relax. It was a great way for me to stretch, reflect and take time out for myself. And what is amazing about yoga is anyone can do it! Even you!

But where to start? How to even begin? The amount of poses and different types of yoga can often be daunting and difficult to remember. From Ashtanga to Vinyasa, I couldn’t even pronounce the names, never mind actually doing them!

After many months of comic attempts, sore legs and aching arms, I slowly entered the world of Hatha, Vinyasa and Iyengar (all different types of yoga). But I won’t deny, it was a long, often confusing road when doing this all by myself.


I wanted to share how transformative yoga truly is to everybody and, with a little help, show people how easy it can be. To make this journey into yoga easier for everybody else, I had the idea to combine both my skills of programming and yoga, and create the AI Guru to help you along the way!





With the AI Guru, all you need to do is give it a picture of the pose your attempting to do and it will tell you which one it is, and whether you’re doing it correctly! Giving it the picture of the pose you’re doing, it will attempt to tell you what pose you’re trying to do and whether it even looks like a yoga pose at all!


So no need to spend all that time trying to determine which pose is which or whether you’re doing it correctly, simply take a picture and give it to the AI Guru!


But how does it work? How can an AI remember hundreds of different poses, especially when I can’t even pronounce their names?


Simply put, the AI Guru, is a classifier, and determines which pose is which much like how a digit or word recognizer words.


The type of ML algorithm used for these type of classifiers is known as a Convolutional Neural Network. I know, I know, these words sound complicated. But don’t let these three words scare you, let’s divide this definition up into bit sized pieces and go through it step by step.


What is a Neural Network?


A Neural Network, first proposed in , was inspired by our own human brains. Much like the electric currents in our brain transfer information through Neurons, a Neural Network also contains artificial ‘Neurons’. These Neurons in our Neural Network are stacked up one on top of another and placed next to each other in columns we call layers. Neighbouring Neurons are connected and we can design these neural networks with as many layers or neurons as we want (but let’s try not to over-complicate it and keep it simple). An example of a Neural Network is given below.





So in a way, our AI Yogi is just effectively one huge brain!


When connected these Neurons transfer information (in our case numbers rather than electric currents) from the start to the end of the neural network and produce an output, which will tell us the information we want to find out, such as whether the yoga position was Down dog or Goddess. So it will go through the image pixel by pixel and simply determine which pose we are trying to do!


But how does it learn this? For all it knows, a Warrior II could be a Plank after all! To differentiate between different poses, we need to train it (even AI Gurus need to go to school). This involves a small bit of maths here, but I promise not much. Each Neuron is assigned a number, which we call the weight, and all these different weights effect what the AI Guru will think the yoga pose is.


To determine these weights, we need to define a cost function, which is basically just a rule that we are going to give to our AI guru.


Using this rule, we train our AI yogi by giving it these images and allowing it to guess the pose. If it gets it right, yay! It followed our rule and the weights inside the Guru’s brain don’t change. But if it gets it wrong, it broke the rule and we need to adjust the weights slightly.

And repeat.


That’s all, nothing fancy. Simply trial and error until it gets the right results (our when it follows the rule).


Hang on, we still haven’t gone through the Convolutional Part!


Don’t worry, I was getting there! A Convolutional Neural Network is a special type of brain which, rather than looking at pixel by pixel of the neural network, it looks at whole sections of the pictures and determines certain features of each pose. For example, it might determine that a Down dog looks like an upside down V or a plank is simply facing downwards with a straight back (or attempting to anyway..)


Where can I meet this AI Guru?


If you want to meet our AI Guru, we first need to download him (he is and AI after all..)

If you’re new to programming, feel free to skip this part and head down to the section where we import in our image!



Next, let’s see what the brain of our AI Guru looks like…





Here, we can see all the different layers and Neurons inside the AI Guru’s head. For example, the Conv2D layers are the layers which pick out the different features of our poses.


Now, we’re going to get a picture of a yoga pose and see if the AI Guru guesses the pose correctly!


To do this, I’m going to give the AI Guru some pictures and see which one he thinks it is!





Let’s see what it thinks…





Looks like the AI know’s what you’re trying to do!


If you want to download the AI Guru, head to my Github page and download him yourself!

And for all you programmers out there, keep an eye out in the next few weeks for a tutorial on how we train the AI Guru and what his brain actually looks like! As well as inputting in a video to determine which moves are used throughout the yoga session!


Overall, the AI Guru is here to make our journey into the world of yoga a small bit easier. Using the AI Guru, we not only can determine which pose is which but can also see if we’re doing the pose correctly! So for those of you in two mind on whether you should start yoga or even where to begin, I hope both I and the AI Guru have convinced you, and you’re currently about to go out and buy a yoga mat.


Nameste!

10 views0 comments

Recent Posts

See All

Comments


Subscribe to the Research@Cam Newsletter

bottom of page