Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Teachable Machine: Teach a Machine Using Your Camera in Your Browser

Teachable Machine: Teach a Machine Using Your Camera in Your Browser

Leia em Português

This item in japanese

Teachable Machine is a browser application that you can train with your webcam to recognize objects or expressions.

In the demo you use your webcam to recognize three different classes of objects or expressions. Based on your camera input, the site shows different gifs, plays prerecorded sounds, or plays speech. No coding of the user is required, and no hyper-parameters or network architecture has to be programmed. The only feedback from the machine the user has, is the confidence the machine has in each of the predicted classes. Based on the recognized class, the machine shows one of three different gifs: a cat, a dog, or a cute bunny. Users can also program several sounds or words, but can't mix the output modalities. A great explanation of how to use the Teachable Machine can be found on Youtube

All training is done in the browser using the deeplearn.js library. It is a hardware-accelerated javascript library built by the Google Brain PAIR team, that is freely available. The library was announced in August 2017 on the Google blog, and several applications that use the library are available on the deeplearn.js website.

Users only have to take pictures of a few instances of objects they want to recognize. Training is accelerated by downloading the pre-trained neural network called "squeezenet". According to the research paper a squeezenet has 50 times less trainable parameters than comparable neural networks. This means it can be downloaded as a file smaller than half a megabyte. Although the network has less parameters, the output is on par with larger neural networks, and good enough for this simple browser application. The application uses the output of this pretrained network to learn what you are showing to the webcam.

The source code for teachable machine can is available on Github. Instructions to get started with deeplearn.js, and the source code for this library, are also available on Github.

Rate this Article