Teachable Machine: Make your own AI!
Published: 2023-06-12 17:15:15

---
title: Teachable Machine: Make your own AI!
published: true
date: 2023-02-28 13:42:39 UTC
tags: 
canonical_url: 
---

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 ...](https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.pinimg.com%2F736x%2F21%2Fb7%2Fb1%2F21b7b134129c121e9d12ca6375cc33d9.jpg&f=1&nofb=1&ipt=b8a529c98f06cf6d87bf2a5d31c8b618e660c60abad0250c4d0fc569fc2e0a04&ipo=images)

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](https://cdn.hashnode.com/res/hashnode/image/upload/v1676805890231/4f12ca0a-821c-47ea-bedc-bd2a903093d3.png?auto=compress,format&format=webp)

First, you'll need to head over to the [**Teachable Machine website**](https://teachablemachine.withgoogle.com/) 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](https://cdn.hashnode.com/res/hashnode/image/upload/v1676806025653/2a940921-1e80-4e95-9c42-9eddd7b57500.png?auto=compress,format&format=webp)

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_** [**_,_**](https://i.pinimg.com/736x/6e/f6/f4/6ef6f43b067447c7ad44a2e2003581b8--cow.jpg) **_<mark>the model is being trained</mark>! 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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676806594618/f93a71ab-aa53-49a0-98b0-dda77058382c.png?auto=compress,format&format=webp)

I really recommend [**Glitch 🎏**](https://glitch.com/) 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! 🥳