LAB 04 / 04

Train Your Own Mini AI

Give the AI a few examples of two different things. Watch it train live in your browser. Then test it. See exactly what training data means — and why more examples produce better results.

🔒  Everything runs in your browser using TensorFlow.js. No images are uploaded or stored anywhere. The model exists only in your browser session.
How this lab works
STEP 01

Name your classes

STEP 02

Add training images

STEP 03

Train the model

STEP 04

Test a new image

STEP 05

Understand results

Step 1 & 2 — Set up your two classes and add images

Class A

Images added: 0

Class B

Images added: 0
Add at least 3 images to each class to begin training.
Step 3 — Train

Train the Model

// Waiting for training data...\n// Add images to both classes above then click Start Training.
Step 4 — Test a new image

Test Your Model

AI prediction
Step 5 — What just happened

Under the Hood

// Train the model first to see the explanation here.

What this lab teaches

Training data is everything

The model can only learn what you show it. If your Cat A images are all orange cats, it may fail on black cats. That is bias — baked in from the data.

More examples = better results

3 images gives a weak model. 20 images gives a much stronger one. Real AI models train on millions. Scale is the difference.

Transfer learning

This lab uses MobileNet — a model already trained on millions of images — as a starting point. Your training only adjusts the final layer. That is why it works with so few images.

Confidence is not certainty

Even a 95% confidence score means 1 in 20 predictions will be wrong. Real AI systems make wrong predictions. High confidence wrong predictions are particularly dangerous.

Edge cases break models

Try an image that is somewhere between your two classes. The model must still pick one — it cannot say "I don't know." That is a fundamental limitation.

The model is a black box

You cannot see exactly why it made a decision. It found patterns in the features — but which patterns? This is the explainability problem in real AI systems.