- Place the tiny sorter over your webcam so the camera can see into the bucket.
- To create a new image project on Teachable Machine click here.
Time to grab some cereal and train some models!
Fill your first class with pictures of cereal captured from your webcam. The sorter will be shaking while training. Hint: the shaking mechanism allows the cereal to flow down the chute and into the bucket for the camera to see.
A: Try to get somewhere between 75 - 150 pictures per class. But experiment with it! Remember the more accurate data your model has the better it will be.
Then train a third class with nothing inside the bucket. This class lets the sorter know when there is nothing in the bucket thus it should continue to shake until there is something identifiable.
Next, hit "train model" and that's it! You've trained a model.
- Try testing out how well your model works by placing items in the bucket. The model will try to classify the items on the bottom right of the site.
- If your model isn't recognizing very accurately, try adding more pictures to the classes that seem weak.
Next click "export model" and then "upload my model" to upload to the cloud.
- After uploading the model, copy the sharable link to your clipboard.
- Back on the p5 sketch site, paste in the link and hit "load model".
Label a couple of bowls or cups and place next to each other accordingly under the sorter.
Drop in some cereal and see how well you've trained your model. Does it go into the right bucket?
Problem: The sorter is not accurately identifying the cereal.
Solution 1: Make sure the tiny sorter is aligned with your webcam for good classification.
Solution 2: Try adding more pictures to the "nothing" class in your model. Add some pictures of the background that your webcam sees when the sorter tilts one way or the other. This will help the model know when to keep wigglin' away! (eg. it may see the colors in your room or on your shirt and think it's a marshmallow)
Problem: The cereal is getting stuck or is moving too slowly down the ramp.
Solution: Tilt your computer screen up or down to make the ramp steeper or shallower.
You can always feel free to refer to the original guide which has videos and more.
Make this project your own! Classify whatever you can think up and train new and exciting models.
Other ideas include:
nuts vs dried fruit
goldfish vs Swedish fish
- hoodie vs no hoodie!
You're in luck because Web USB and the code from this guide is now supported by any board with SAMD chip. This means you will be able to use the code from this project with the following boards:
- Metro Express
- Gemma M0
- Itsy Bitsy M0 express
- Feather M0
- So many more!
Check out more tools and resources on machine learning from Teachable Machine.
Good luck modeling!