Machine Learning with ml5.js
For this tutorial you will be introduced to Machine Learning. It will cover the basic concepts and will give you an opportunity to learn as well as create your own machine learning models. For the machine learning part we will use ml5.js which is based on TensorFlow, for the coding framework we will be using p5.js as the background to the machine learning. This is all done in the web browser so no need to download anything, subscribe to anything, it is free and more importantly easy and intuitive to use.
Before we jump into the machine learning tutorial this would be a good place to familiarise yourself with p5.js as you will be using it a lot as the basis for all your coding. You don’t have to follow the tutorial but it would be useful and helpful to you as we will be ploughing on assuming some understanding. It also tells you how to get started. Highly recommend that you go through this. Click on the link below or go to the tab:
Module 1: The Perceptron
The perceptron is a single node, this is a good place to start even though it doesn’t use ml5.js. In this exercise we draw a line across the canvas and train the model to colour all the circles above the line white and all the circles below the line black. This is a simple coding exercise where you don’t need machine learning but it demonstrates what can be done.
Module 3: Regression
To demonstrate the difference between regression and classification but using a similar example we will attempt to predict the in between colours between a set of white circles and a set of black circles. This will give us a grey scale of circles depending on their closeness to either the white circles or the black circles.
Pre-trained Models
In the above examples we used ml5.js straight out of the box. Within ml5.js there a re number of very useful pre-trained models which you make use of.
Module 10: faceMesh
This uses an ml5.js built in feature, a pertained model that creates 468 data points of your face from your webcam image. it is called faceMesh. you can access any of the data points to use in any creative way you want. In this tutorial we will draw a bounding box round the mouth.
NeuroEvolution
NeuroEvolution is based on Genetic Algorithms that are a form of Reinforcement Learning. The key elements are: Population, Fitness, Selection, Crossover and Mutation