Now that you’ve learned about types of equity, it’s time to apply what you learned to test how easily a machine learning program can recognize an apple and a banana!

To test this activity, you’ll need a working webcam, and a printed copy of an apple, and banana.

How to Use the AI Model:

  1. Start the Code: Click on the apple & banana, and select « allow camera » when prompted by your browser.
  2. Show Apple & Banana Icon: One at a time, hold up the picture of your apple, then your banana. The AI model will react with the emoji of that fruit!
  3. Experiment: Try testing the model in different conditions, like the ones below:
    • Black & white icon: How well can the AI recognize the shapes of the apples and bananas, without the colour?
    • Real apple & banana: How well can the AI recognize a real red apple or banana?
    • Apple & banana at the same time: Does the AI recognize an apple, or banana when it sees both at the same time?

About the Tools in This Activity

This challenge features a hands on activity created using Google’s Teachable Machine, and an open source community platform, p5.js. To use this activity, you must have a working webcam.

Your camera data is not collected by p5.js or Teachable Machine. Read more about the tools used in this activity below.

Teachable Machine is a web-based tool created by Google, that makes creating machine learning models fast, easy, and accessible to everyone.

Do I HAVE to train a model using a webcam?

Nope! Teachable Machine is a flexible tool, with several ways to train your data. For example, the model featured in this Digital2030 Challenge uses public-use, creative commons images of apples and bananas, rather than images captured from a computer’s webcam.

Who can access my samples?

Your samples aren’t sent to any servers, unless you save your project to Google Drive — and even then, it’s in your Google Drive, so that sample data is still yours. When you train the model, it trains in your browser tab without sending anything to any servers.

Where is my model published when I click “upload my model”?

Your model is published to Google servers, but the examples you used to make the model are not. Just your model — the mathematical program that predicts which class you’re showing it.

Who can use my model once it’s published?

If you choose to publish your model online (like the one we created in this Digital2030 Challenge), Teachable Machine will generate a URL where your model is hosted. You can share that link with anyone if you’d like them to use your model—anyone who has that link can use your model in their projects.

If you make a website that calls the url of your model, and someone looks at your code and finds that url, they could copy it and use it in their project — just like any image or video file you host online. However, they cannot change your model.

Learn more about this AI powered tool on Teachable Machine’s website.

p5.js is an open-source JavaScript library designed to make coding visual arts and creative technology accessible and inclusive for artists, designers, and educators.

How does the p5.js webcam feature work?

When users grant camera access to a p5.js program, the video data is handled through the browser’s MediaStream API. By default, p5.js does not upload or store your video data on any server. The video is processed entirely within your computer’s local memory (RAM) and rendered on your screen via the browser.

Learn More: p5.js Video Capture, p5.js Privacy Policy