How to Classify Images with Teachable Machine: Image Recognition Tutorial

What is Teachable Machine?

Teachable Machine is a free, web-based tool developed by Google that allows anyone to create machine learning models easily, without needing any coding skills or technical expertise. It provides a simple, user-friendly interface where you can train models directly in your browser by uploading or capturing images, sounds, or poses. This makes machine learning accessible to students, educators, hobbyists, and developers alike, empowering them to experiment with AI in a hands-on way.

In this tutorial, you will learn how to:

  • Collect and label image data for your categories (e.g., you and your dog)
  • Train an image classification model using Teachable Machine’s no-code interface
  • Test your model live within the browser to see how well it recognizes new images
  • Export and use your trained model in various projects

By the end, you’ll have a practical understanding of how image classification works and how easy it is to build AI-powered applications with Teachable Machine

What are we going to build?

We are going to train Teachable with Kean(my dog) and my photos to classify our images.

Step 1: Collecting Image Data

The first and most important step in building an image classification model with Teachable Machine is collecting and organizing your image data. This step lays the foundation for how well your model will learn to distinguish between different categories, such as your image and your dog’s image.

Here’s how to approach it:

Create Your Classes

Start by deciding the categories you want to classify. For my project, I will create two classes: one for my photos and one for Keanu's photos.

Gather Images

You can collect images in two ways:

Using your webcam: Capture live photos directly in Teachable Machine. This is convenient for quick data collection and ensures consistent lighting and background.

Uploading images: If you have photos saved on your computer, you can upload them directly into each class.

I'm going to upload existing images of Keanu and myself to their classes

Amir's Images

Keanu's Images

Once your images are uploaded and organized into classes, you’re ready to move on to training your model. Proper data collection ensures your model will be accurate and reliable in distinguishing between your image and your dog’s image.

Step 2: Training Your Image Classification Model

Once we have collected and organized our images into classes (e.g., “Amir” and “Keanu”), the next step is to train our image classification model using Teachable Machine’s intuitive no-code interface.

Here’s how the training process works and what you need to do:

  • Start Training: After adding your images, click the “Train Model” button. Teachable Machine uses a technique called transfer learning, which builds on a pre-trained model called MobileNet. This means the model already understands general image features so that it can learn your specific categories quickly and efficiently with fewer images.
  • Training Happens Locally in Your Browser: The entire training process runs directly in your web browser, so your images and data never leave your computer unless you choose to export the model. This ensures your privacy and speeds up the process without needing powerful hardware.
  • Training Parameters (Optional): You can adjust advanced settings like epochs (number of training cycles), batch size (number of images processed at once), and learning rate (how quickly the model updates). For beginners, the default settings usually work well.
  • Don’t Switch Tabs During Training: It’s important to keep the browser tab active while training. Switching tabs or closing the window can interrupt the process and cause errors.
  • Training Time: Depending on the number of images and your device, training typically takes from a few seconds to a couple of minutes. Thanks to transfer learning, even with 25-50 images per class, you can get surprisingly accurate results quickly.
  • What Happens Under the Hood: The model learns to extract essential features from your images and associate them with the correct class labels. After training, it evaluates its accuracy using a portion of your data reserved for testing (usually about 15%).
  • After Training: Once training finishes, you can immediately test your model within the interface by showing new images to see how well it classifies them. You’ll also see confidence scores indicating how sure the model is about each prediction.

This step transforms your raw images into a functional AI model that can recognize and classify new images of you and your dog with impressive accuracy, all without writing a single line of code.

Step 3: Testing Your Model Directly in Teachable Machine UI

Step 4: Exporting and Using Your Model

After you have trained and tested your image classification model in Teachable Machine, the next important step is to export your model so you can use it outside the platform in your projects or share it with others.

Here’s how to export and use your model effectively:

  • Access the Export Model Tab: Once training is complete, click on the “Export Model” button on the right side of the Teachable Machine interface. This opens several export options tailored to different use cases and platforms.
  • Choose Your Export Format: Teachable Machine supports multiple export formats
  • Download or Host Your Model: You can either download the model files to your computer for offline use or upload them to the cloud to get a shareable URL. Downloaded models include the model file (e.g., .h5 for Keras) and a labels.txt file for class names.
  • Using Your Exported Model: For web projects, use the TensorFlow.js model with the provided code snippets to embed your model into websites or web apps.For web projects, use the TensorFlow.js model with provided code snippets to embed your model into websites or web apps.
  • For web projects, use the TensorFlow.js model with provided code snippets to embed your model into websites or web apps.

Exporting your model unlocks the ability to incorporate your custom AI into real-world applications, from websites and apps to interactive installations, making your project truly practical and shareable.

Conclusion: What You’ve Achieved and Next Steps

By completing this tutorial, you have successfully built a custom image classification model using Google’s Teachable Machine, without writing any code. You learned how to:

  • Collect and label your image data effectively
  • Train a machine learning model using transfer learning in your browser
  • Test your model live to see if it recognizes new images with confidence
  • Export your model for use in web apps, mobile projects, or other AI-powered applications

This hands-on experience has given you a practical understanding of how machine learning works and how accessible AI development can be with the right tools.

Next Steps to Explore

  • Experiment with More Classes: Try adding additional categories, such as other pets or objects, to create a more complex classifier.
  • Explore Other Teachable Machine Models: Beyond images, you can build sound recognition or pose detection models to broaden your AI skills.
  • Integrate Your Model into Projects: Use the exported model in websites, apps, or interactive installations to create real-world applications.
  • Learn More About Machine Learning: Dive deeper into concepts like data augmentation, model optimization, and neural network architectures to improve your models further.
  • Share and Collaborate: Share your model and project with others to get feedback and inspire new ideas.

Related Blogs

Looking to learn more about ai, teachable, classify images and Classify Images with Teachable? These related blog articles explore complementary topics, techniques, and strategies that can help you master How to Classify Images with Teachable Machine: Dog vs. Human Image Recognition Tutorial.

Is AI Timeless?

Unlock AI fundamentals and explore the Lindy effect to understand why artificial intelligence remains timeless and its impact keeps growing. Learn more!