Transfer learning in JavaScript with TensorFlow.js
summary
Builds a browser Teachable Machine clone that uses TensorFlow.js and a MobileNet v3 feature vector from TF Hub, resizing webcam frames to 224×224 and extracting 1024-dim features per image. Adds a small head — a 128-unit dense head plus softmax — trained on stacked feature tensors with 1-hot labels (batch 5, 10 epochs). Requires only ~30 examples per class, trains in seconds in-browser, and runs live predictions; code and TF Hub model links are provided so the demo works end-to-end.
AI-written summary · about
chapters (15)
- 0:00Intro
- 3:08What is TensorFlow.js? Open step 2 of codelab
- 5:14Transfer Learning Open step 3 of codelab
- 8:27TensorFlow Hub - base models Open step 4 of codelab
- 10:21Get set up to code Open step 5 of codelab
- 10:42HTML Boilerplate Open step 6 of codelab
- 12:40Add CSS styles Open step 7 of codelab
- 19:49Define new model head Open step 10 of codelab
- 22:00Enable the webcam Open step 11 of codelab
- 23:31Data collection button event handler Open step 12 of codelab
- 24:40Data collection Open step 13 of codelab
- 29:10Train and predict Open step 14 of codelab
- 32:58Implement a reset button Open step 15 of codelab
- 34:02Let's try it out! Open step 16 of codelab
- 34:35Congratulations! What's next? Open step 17 of codelab
related talks
41mTensorFlow.js 101: ML in the Browser and Beyond
54mDeep Learning in JS
34mA Powerful Introduction to Machine Learning with Js
32mWe Also Can Do It! Machine Learning in Javascript!
48mTensorFlow.js
24mThe Future of Machine Learning & Javascript
34mA Powerful Introduction to Machine Learning with Js
21mMachine Learning & JS Take your PWA to the next level
