Tiago Rangel de Sousa
Tiago's notes

Follow

Tiago's notes

Follow
Teachable Machine: Make your own AI!

Teachable Machine: Make your own AI!

It's really easy.

Tiago Rangel de Sousa's photo
Tiago Rangel de Sousa
ยทFeb 28, 2023ยท

3 min read

Play this article

Hi there everyone! Today, I'm going to introduce you to the magical world of AI and how you can create your very own AI using Teachable Machine, all while using the ever-so-popular programming language, JavaScript.

Now, let me start by saying that making your own AI might sound like a daunting task, but fear not! Teachable Machine is here to save the day. This cool little tool, created by people at Google, allows you to train your own machine learning model really easily. Believe me, really easy.

So, what is Teachable Machine, you ask? ๐Ÿค” Well, let me tell you. Teachable Machine is a web-based tool that allows you to train a machine learning model to recognize images, sounds, and poses. This means that you can teach your computer to recognize things like a cat meowing, a dog barking, or anything you want.

But don't worry, you're not making this AI:

AI WILL DESTROY THE WORLD IN A DECADE | Funny disney jokes, Funny ...

To get started with Teachable Machine, you'll need to have a basic understanding of JavaScript. But don't worry, you don't need to be a JavaScript master. You just need to be able to copy and paste some code snippets. And if you're anything like me, copying and pasting is your specialty.

Teachable Machine's website with a arrow next to the "Get started" button

First, you'll need to head over to the Teachable Machine website and click on the "Get Started" button. From there, you'll be asked to choose what type of model you want to create. You can choose from image, audio, or pose. For the purpose of this article, let's choose image.

Teachable Machine's editor with the "image" model

Next, you'll be asked to collect some images for your model. This is where the fun begins. You'll need to gather a bunch of images of whatever it is you want your model to recognize. For example, if you want to train your model to recognize different types of fruit, you'll need to gather images of apples, oranges, bananas, etc. And the best part? You get to eat the fruit once you're done! ๐ŸŽ (Just kidding, don't eat the pictures. That's not how this works.)

After you've collected your images, you'll need to upload them to Teachable Machine. This is where you'll start training your model. You'll need to label your images with their respective categories. For example, if you've uploaded an image of an apple, you'll need to label it as "apple." You'll also need to do this for all of your other images.

Once you've labeled your images, it's time to train your model. Teachable Machine will take care of the heavy lifting and train your model for you. It might take a little while, but just sit back, relax, and let the magic happen.

โš ๏ธ Warning! When training your model, your computer will probabily stop updating the screen. Don't panic, the model is being trained! Also don't switch tabs please.

After your model is trained, you can start using it in your own JavaScript code. Teachable Machine provides you with some code snippets that you can copy and paste into your own code (click "Export model" to show them). Once you've done that, you can start using your model to recognize images in your own projects.

I really recommend Glitch ๐ŸŽ to try your AI model in a real website and make it really fancy (add styles! interactivity! server things!)

And that's it! You've just created your very own AI using Teachable Machine and JavaScript. See, I told you it wasn't that hard. Now go out there and train your computer to recognize all sorts of wacky things. Who knows, maybe you'll be the next AI superstar. Or, at the very least, you'll impress your friends at parties! ๐Ÿฅณ