Creative Coding

Your First Machine-Learning Sketch: p5.js Plus ml5.js in One Sitting

The Coding Train's beginner's guide walks through image classification, pose estimation, and hand tracking using ml5.js — no machine-learning background required to get a model running in a sketch.

ml5.js exists specifically to make machine learning approachable for artists, creative coders, and students who have no interest in the math underneath a neural network — just the ability to point a trained model at a sketch’s input and get something useful back. The most complete on-ramp for actually doing that is a long-running video series built around exactly this audience.

What to watch

The Coding Train’s Beginner’s Guide to Machine Learning in JavaScript with ml5.js spans a full playlist covering image classification, pose estimation, hand pose detection, face mesh detection, object detection with COCO-SSD, and feature extraction — each built as a working p5.js sketch rather than an abstract explanation of the underlying model. The series treats ml5.js the way it’s meant to be used: as a friendly wrapper that hands a creative coder a working model’s output — a hand’s position, a face’s landmarks, an object’s label — as data they can immediately draw with, not a black box to configure.

What you’ll actually walk away with

By the time you’ve worked through even a couple of the series’ videos, you’ll have a p5.js sketch responding to real-time input from a trained model — a shape following your hand, a sketch reacting to a detected face — without having trained anything yourself or written a line of TensorFlow. That’s the entire point of ml5.js’s design: the machine-learning model is a resource you call into your sketch, not a system you have to build first.

Where to go next

p5.js’s own tutorial on using HandPose to control a sketch with hand gestures is a good next step once the basic pattern — load a model, read its output, draw with it — feels familiar from the Coding Train series.