Training AI

To get started, you'll go to Teachable Machine and select Get Started. Choose a New Image Project.

HOW TO TRAIN IT

To start training the machine, you first have to create different categories, or classes, to teach it with. Make four classes here — one for bananas that are too early, one for bananas that are ripe, and one for bananas that are too late — plus one for images where there’s no banana at all.

A category or class for each thing you will teach the AI.

Now that you have your classes, you need to give each class samples to learn from. In this case, those will just be images of the banana — so let’s start with a banana that’s “Too Early.”

Then, we’ll do the same with a ripe banana:

And a banana that’s a little past its prime:

And finally, an image with no banana at all. Notice that you'll also need to show it your hand without a banana so that it doesn’t think that ripe bananas have to have hands with them.

Now that you have all your classes ready, you can click train…

And, over on the right, preview if the model works!

THINGS TO TRY

Ok, now that it’s working, you can test out how it works — and see where it doesn’t work. Try to find the edges of where the model works — machine learning has limits!

Remember that to the computer, images are just numbers & patterns of pixels.

So you haven’t truly taught it what a banana is… we taught it that THIS — a yellow shape against a background, is labeled a ripe banana — it’s just pixels to the computer.

Two Bananas

For example, if you hold up two bananas at the same time, the model never saw samples that looked like that while it was training, so it might be confused.

Different Backgrounds & Lighting

Or try evaluating your bananas on a different background, like a different color wall — does it still work?

On this new background, it gets some of the classes a little confused…

…so you can add more samples to each class with the banana on the new background.

You can add more images of your bananas in different environments to make your model more robust, so that it can work on different backgrounds.

You could also try uploading a bunch of photos of bananas from the internet to get a more robust set of banana images, or collaborate on a dataset with folks in different places.

Try to trick it!

Hold up a photo of a banana! Or a drawing of a banana! Or a toy that looks like a banana! See how the model responds to different images, and if you can figure out a way to train it so that it doesn’t get confused.

https://teachablemachine.withgoogle.com/train

https://medium.com/@warronbebster/teachable-machine-tutorial-bananameter-4bfffa765866