Train your own ML models with Teachable Machine — no coding required!

Michelle Carney
Feminist.AI
Published in
4 min readFeb 4, 2021
Michelle Cedeno and Michelle Carney training their own Teachable Machine models!

When I first used Teachable Machine (“TM”) in 2017, I was floored. I think I specifically exclaimed at my classmate at Berkeley I School: “THIS IS THE FUTURE!” Suddenly we have the ability to train a Machine Learning (“ML”) classifier — IN the browser?! In seconds?! Without coding using the terminal or jupyter?! And it maps to adorable gifs (see the original TM)?! No way!

Teachable Machine has only gotten better thanks to the Google Design Creative Lab (the folks behind AI Experiments). In the last year, the team has launched the latest version of Teachable Machine, allowing anyone with a browser to train a ML model real time, no coding required.

Michelle Cedeno and I have made a tutorial for Feminist.AI to help you get you up and running and training your own Teachable Machine!

Watch the tutorial for yourself on our Youtube channel!

What is Teachable Machine?

Teachable Machine is a web-based tool that makes creating machine learning models fast, easy, and accessible to everyone.” It does this by using the input devices already on your computer — your mic, your webcam, and any image files you want to train it on!

You determine what “Classes” or categories you want to train, then add your input (via uploading photos from your computer or drive, your webcam, or your mic or uploading audio files) and hit “Train.” The model then quickly learns the difference between these Classes you made, and you can explore in real time “what” exactly it is learning!

Teachable Machine builds a type of ML model called a “classifier” — basically a model that is only able to distinguish between the classes we give it, Teachable Machine gives a percentage as to how well the image or sound you are “testing” matches each of the classes. It’s easier to play around with it to understand, so let’s get started!

Big thanks to @teenybiscuit for the timeless classic: “poodle or fried chicken?”

How to make your own Teachable Machine

Step 1: Navigate to teachablemachine.withgoogle.com and click “Get Started”

Step 2: Select what type of model you want to train! There’s Images, Sounds, or Poses (using PoseNet). We’re going to use “Image Project” for tutorial.

Step 3: Add your “Classes.” Classes are the category types you want your model to learn. We will add two classes to start: “High FIVE!” and “Numero Uno.” Try adding anywhere from 10–300 images per class — I tried around 200 and Michelle tried around 50! See what happens — you can always add more after :)

Michelle adding images from her webcam for “high five” and “numero uno”

Step 4: Click the “Train” button to train your model! Be sure to stay on the same tab — remember the ML model is being trained in-browser so it helps to stay on that tab.

Step 5: Preview/Test it out! We tried by using the webcam because we used the webcam to capture the images for the classes, and we raised questions like: what happens if I am not holding up any fingers? (hint: it still classifies me as “Numero Uno” OR “High FIVE!”) What about three fingers? (there’s no class yet for three fingers! it has to be either “Numero Uno” OR “High FIVE!”)

Michelle + Michelle testin’ out the TM!

Step 6 — ???: Iterate! Add more classes! Change the batch size/epochs/learning rate! Explore more! The best way to learn is by doing — so try to learn on your own! We decided to add another class called “No hands” to classify — you guessed it- no hands. The world is your oyster (as long as your oyster is a classifier on images or audio)!

Step ??? + 1: (optional) Share by clicking on “Export Model” in the preview section. You can export your model in a few different ways, but you have to be sure you click on “upload my cloud model” — this creates a link which anyone can come back to if they want to try out your machine learning model, or you can use for future projects!

You can also export the code to p5.js, an amazing open source creative coding community, just a reminder you copy+paste your code from TM on top of what they have in the index.html section (see the video for more details)!

Reminder: you can make so many other types of models too! Michelle used PoseNet for yoga poses, and I uploaded some images I found to make a TM on Dog 🐶 or Food 🍗.

38% dog, 62% food, 100% adorable!

We can’t wait to see what you make for your Teachable Machines! Be sure to share back with us on twitter (tag us @ feminist_ai) and also tag #TeachableMachine!

--

--

Michelle Carney
Feminist.AI

Founder, Machine Learning and UX @mluxmeetup. Member @feministai. UXR @GoogleAI. Lecturer @Stanforddschool. Former @CTSPBerkeley @AFOGBerkeley @BerkeleyISchool