What Is Teachable Machine?

2021-06-26 · 2 min read

Machine learning used to mean wrangling Python, datasets, and training scripts long before you saw any result. Teachable Machine, a free tool Google released on November 7, 2019 (teachablemachine.withgoogle.com), flips that around: it lets anyone train a working ML model entirely in the browser, no machine learning background required.

Three Kinds of Projects

The tool offers three project types — Image Project for classifying pictures, Audio Project for recognizing sounds, and Pose Project for detecting body positions. All three run on TensorFlow.js right in the browser tab, so there's no environment to install or configure.

Training a Model in Three Steps

Image Project is the easiest starting point, and the workflow boils down to three steps:

  1. Samples — create classes (default names like "Class 1" are editable) and fill each one with data, either by uploading images or capturing them live from a webcam.
  2. Training — hit the Train button. An Advanced panel exposes knobs like Epochs and Batch Size, but the defaults are usually good enough to get a usable model without touching them.
  3. Export — before exporting, you get a live prediction preview to sanity-check the model's behavior. Once it looks right, export to TensorFlow.js for web/JavaScript use, or TensorFlow Lite for mobile apps.

A TensorFlow.js export gives you three files — model.json, metadata.json, and weights.bin — which you load in plain JavaScript to run real-time predictions against a webcam feed:

const model = await tmImage.load('model.json', 'metadata.json');




NextGetting to Know Jenkins: Your First CI/CD Pipeline
const prediction = await model.predict(webcamImage);
prediction.forEach((p) => {
console.log(`${p.className}: ${p.probability.toFixed(2)}`);
});

Each class comes back with its own probability score, so picking the highest one gives you the final classification.

What stands out about Teachable Machine is how short the distance is between poking around in a browser tab and having a model wired into a real application. If you haven't tried it yet, the official site is worth ten minutes of your time — it's simpler than it sounds.