CODE! 2
Machine Learning
Welcome to the Machine Learning module! Writing code typically involves a process of expliciting designing and writing out a series of rules for a computer program to follow.
Machine learning, however, involves a process of showing a computer program a large dataset of examples and asking it to learn those very rules.
In this module, you will learn how to train a machine learning model to recognize images and sounds using the following three tools:
● Teachable Machine
● Ml5.js
● p5.js
Before You Start Coding
Before you start diving into the code, I would suggest doing some reading and research about machine learning and neural networks. Here are a few resources to get you started.
● What is Machine Learning? By Karen Hao
● But what is a Neural Network by 3Blue1Brown.
Required Materials
Read and watch the following tutorials.
Teachable Machine and Images
The main material of this module is Teachable Machine from Google Creative Lab.
1. Watch Teachable Machine 2.0: Making AI easier for everyone
2. Watch these three short tutorials on gathering data, training the model, and exporting the model.
Teachable Machine models can be used within the p5.js web editor. The following
tutorials demonstrate how to train your model and create a sketch that shows an emoji based on what object is seen by your webcam.
● Teachable Machine 1: Training an Image Classifier and ml5.js
● p5.js web editor example
● Teachable Machine 2: Image Classifier as game controller
● p5.js web editor example
Teachable Machine and Audio
Teachable Machine can also be used to train a model to recognize sounds.
● Teachable Machine 3: Audio and ml5.js
● p5.js web editor example
Assignment
Your assignment for the Machine Learning Module is:
1. Train your own machine learning model on images or sounds.
2. Create a p5.js sketch where the primary mechanism for interaction is the machine learning model. You can change what is on the canvas based on the classification, control a game like in the Snake example, or invent your own interaction.
3. Document your experience using Teachable Machine, ml5.js, and p5.js in a discussion post. What challenges did you face? What worked well? What didn’t work?
4. Share your sketch as a new post on this week’s discussion board. Write a ~ 200 word description about what you made and your process. You can write anything, but if you’re stuck here are some guiding questions:
● What did you originally intend to create?
● Narrate the process of creating your sketch.
● What resources and examples did you draw on to create your sketch? What was most helpful / least helpful from this week’s materials.
● What problems/discoveries did you encounter along the way?
5. Paste the link to your discussion post (not just the code) as your assignment submission.
6. Please also write a short response on at least two other classmate’s sketches on the forum. Review the Feedback Guide (especially the “Content” section) for ideas on what to talk about. Note: It’s okay to do this step after the deadline, when everyone has submitted!