Give Feedback
Grades
5 - 12
1
-
1.5
Hours

AI Image Filter

AI
Coding
Scratch
Students will use Teachable Machine and Scratch to train an AI model to recognize specific gestures. This project fosters an understanding of AI applications, limitations, trustworthiness, and bias.

Concepts at a Glance

Curriculum Connections

In progress

Materials

Laptops

Activity Instructions

Background Info and Resources

For explaining to kiddos

In depth - for instructor curiosity or strong students (warning! Math heavy!)

How does google teachable machine image classification work?

AI Bias

Video Instructions

A video walkthrough of this activity is available on youtube

Written Instructions


--- Part 1: Teachable Machine ---


1. Go to bit.ly/teachablescratch and click on "Teachable Machine" at the top of the page.

2. Select an "Image Project" and "Standard Image Model."

3. Choose two gestures for the machine to recognize and enter them as class names (e.g. "question" and "heart").

4. Click on the webcam button, then go into settings and turn "hold to record" off.

5. Click "Record" and provide varied examples of each gesture (ex: question -> use both hands in different positions)

6. Collect data for both classes

7. When done collecting data, click "Train Model." This process can take some time (up to a few minutes). If the page becomes unresponsive, click "Wait."

8. Test the model and note its performance.

9. Go back and add a third class (e.g. "nothing") and train the model on data not representing a gesture.

10. Continue testing and training the model to improve its performance.

11. While waiting for the model to train, discuss AI limitations, trustworthiness, and bias with students. Get them to try to fool their model into giving the wrong answer, and notice when this happens.

12. Once satisfied with the model's performance, turn off the webcam input.

13. Export the model and upload it to the cloud, then copy the provided link.

--- Part 2: Scratch ---

14. Return to the Scratch page and add the "Google Teachable Machine" extension.

15. Drag in a "when green flag clicked" block and attach a "use model URL" block below it.

16. Paste the copied URL into the "use model URL" block.

17. Run the code and check for a green checkmark in the top left; assist students if needed.

18. Add a loop to the code that displays the current prediction.

19. Add a new sprite (e.g. heart) that will appear when the model predicts a specific gesture.

20. Inside the sprite, add a "when green flag clicked" block, a loop, and an "if-then-else" statement.

21. Use "show" and "hide" blocks to control the sprite's visibility based on the model prediction.

22. Test the code to ensure it works.

23. Add a second sprite (e.g. question mark) and repeat steps 20-22 for it.

24. Test the code to see if both sprites appear when the associated gestures are made.

25. Celebrate the successful completion of the activity!

Worksheets

No items found.

Lesson Plan

Download Lesson Plan