Physical Teachable


Machine v2.0


Machine Learning tools for physical computing

Summary:

Wekinator inspired a series of accessible Machine Learning tools for the web such as Teachable Machine and Teachable Machine 2. These teaching tools expand these hands-on supervised learning concepts into Physical Computing materials.

Version 2.0 builds upon the 2019 examples, streamlining the examples and adding further resources that compliment existing tools for Tensorflow Lite models. These templates provide students with a quick prototyping enviornment such as the P5JS Web Editor to generate graphical, audio , image outputs.


The code is open source and uses the ML5 Library and Neural Net Function

The repo for the examples lives here

---------------------------------------------------------------------------->

Tiny Motion Trainer to P5JS :

Google’s Tiny Motion Trainer is a very powerful interface for training gestural data. However, it only captures the data (much like Teachable Machine) and if you want to do more with it you need to transfer the model data to other tools.

This example enables you to stream the trained data from Google's Tiny Motion Trainer Arduino example to P5JS

Steps:

  1. Follow the setup, labelling and training steps via Tiny Motion Trainer interface
  2. Once training is complete, select Download Model and check the Arduino example box
  3. In order to work with the Tiny Motion Trainer P5 example you need to make two changes to the Arduino template. This is so the data can be parsed correctly and set to P5JS
    1. Replace the model.h file with your own
    2. Replace lines 45 - 53 with the custom data from your downloaded .ino sketch
  4. Upload the edited template to your Arduino board and connect to the P5JS Visualiser!
---------------------------------------------------------------------------->

Physical Teachable Machine v2.0 in P5 :

This is an updated P5JS sketch that utilises the ML5JS Neural Net function. It allows you to send any number of inputs to P5JS and train them. This example no longer requires a template per different sensor; allowing changes to the settings variables to adapt to differring inputs.

Steps:

  1. Select your type of input on line 15. There are some preset settings such as TRILLCRAFT, ANALOG, CUSTOM
  2. These settings dictate what the maximum data readings will be. You can also change the minimum reading of 0 if required here on line 20. let dataRange = [0, TRILLCRAFT];
  3. Select the number of inputs you are sending into the sketch on line 23: const NUM_INPUTS = 24;
  4. Change the labels to what you want them to be on line 24 const LABLES = ["Square", "Circle", "Triangle"];
  5. Make sure you have the correct Arduino sketch on your microcontroller for the type of sensor in use. If you are using a Trill Craft select that corresponding Arduino sketch. For all other inputs use the sensor array example sketch. Example templates
  6. That’s it ! Press run and connect your board.

Once you have trained your model you may want to save it then pre-load it to work with when developing the outputs. The Physical Teachable Machine v2.0 pre-loaded model template helps you do this.

---------------------------------------------------------------------------->

J3n Sykes

GitHub | Home