Images + labels
You choose which images belong to each class. Those choices define the task.
MAS S63 CRITICAL MATTER WORKSHOP
Jake Tan
16 October 2026
01 / WORKSHOP OVERVIEW
Train your own model.
Then test what it learns.
02 / A SUITCASE TERM
Marvin Minsky describes “emotion” as a suitcase term: one word carrying many different processes.
First, we have to define what emotion is for us.
TO UNDERSTAND EMOTION,
WE NEED TO UNDERSTAND
Thinking
Memory
Pleasure / Pain
03 / HOW TRAINING WORKS
You choose which images belong to each class. Those choices define the task.
The model compares predictions with your labels. Training adjusts its learned parameters to reduce the error.
Test examples it has never seen. A good result on training images alone does not establish that it learned your intended pattern.
Teachable Machine reuses pretrained image features and trains a classifier for your classes. The expression model on the next pages is already trained.
04 / FACE GEOMETRY / INTERACTIVE EXERCISE
Rotate the mesh. Take a picture, map it as the texture, then change the shape and re-read the expression.
The mesh is a separate representation of facial geometry. The expression classifier reads a crop of the rendered face; the wireframe is excluded.
05 / LEARNING THROUGH MACHINES
06 / SOFTWARE STACK
01 / WRITE CODE
A JavaScript library for creative coding in the browser. Write a sketch to draw, animate and connect webcam predictions to visuals.
Creative coding / Processing references
02 / CONNECT NODES
A visual programming environment for real-time graphics, sound and interaction. Connect operators into a network to build responsive systems and installations.
Interactive installation references
07 / LIVE P5.JS + ML5.JS
Try an expression. Watch which visible pattern the model assigns to each label.
The square follows your face. Your camera and live labels stay visible as we continue through the workshop.
08 / TEACHABLE MACHINE / DEFINE
What visible pattern
will each label mean?
Start with neutral and one expression you can perform. Name the classes in your own words.
Guiding questions for your model
What makes “happy” different from “smiling”?
Is a facial gesture an emotion, an action, or a reaction?
Are a label’s meaning and a camera’s measurements the same kind of data?
Can the same facial movement mean different things in different situations?
Which emotion matters to you, and how do you define it?
What evidence would your model need? What would make its label wrong?
09 / TEACHABLE MACHINE / TRAIN + TEST
HOLD TO RECORD examples for each class. Change your pose and distance. Keep class sizes similar.
Press Train Model. Keep the tab open and wait for training to finish.
Test an expression you did not record. Change the background. Relax between expressions. Add examples and retrain when it fails.
Guide
Step out of frame. Give the model a background class.
Return without performing an expression.
Keep the room and position similar. Change the expression.
Multiple examples cycle through each stack. Click a stack to bring the next photo forward, or capture your own.
10 / TEACHABLE MACHINE / EXPORT
THE URL POINTS TO
model.json
metadata.json
*.bin
https://teachablemachine.withgoogle.com/models/YOUR_ID/
Uploading makes the model available at its link. For a local workflow, download the model files instead. The p5.js example on the next slides uses the uploaded URL.
11 / INTEGRATION / P5.JS
01 / LOAD THE MODEL ONCE
const base = 'YOUR_EXPORTED_MODEL_URL/';
model = await tmImage.load(
base + 'model.json',
base + 'metadata.json'
);02 / PREDICT FROM THE CAMERA
// The starter prepares a square input for the model.
// Its webcam preview keeps the full camera frame.
const results = await model.predict(modelInput);
const best = results.reduce((a, b) =>
a.probability > b.probability ? a : b
);
// Use best.className in your p5.js drawing.Copy the three starter files into index.html, style.css and sketch.js. HTML loads the libraries and defines the interface; CSS styles it. Set your URL on the const MODEL_URL = ... line near the top of sketch.js, then run it. The separate ml5.js editor link opens the pretrained expression example.
12 / YOUR MODEL / LIVE P5.JS
Paste the URL you exported. Your model replaces the predictions on the same camera feed.
The camera stays connected. The tracking square follows your face while your own model supplies the labels.
13 / OTHER WORKSHOP RESOURCES
Test the pretrained expression model, or load the image model you trained in Teachable Machine.
ML5 Model Loader Sketch ↗P5JS with ML5 Model Loader ↗p5.js with the standard ml5.js expression model ↗Critical Matter Group’s inhouse prototype for ML5.js TouchDesigner integration.
Open the complete TouchDesigner project ↗Download the workshop + TouchDesigner project ↓Extract the complete folder, then open resources / touchdesigner / ML5 TouchDesigner.toe. Keep the browser assets and model files together.
14 / WORKSHOP RESOURCES
The sketches, model setup
and workshop instructions.
github.com / Critical-Matter-MIT-Media-Lab