Google Teachable machine
Teachable Machine is an online tool, created by Google Creative Labs, that makes creating machine learning models fast, easy and accessible to everyone.
Train a computer to recognize your own images, sounds, & poses. A fast, easy way to create machine learning models for…
Teachable Machine is based on Transfer Learning. This technique takes an already trained model and specializes it for a new task. This allows the model to be trained much faster and with less data than if it had to be trained from scratch. The new task can be to classify more or less mature bananas (Bananameter) as well as to detect a type of lung infection.
Teachable Machine Tutorial: Bananameter
Learn how to use Teachable Machine to train a model on poses.
Teachable Machine is based on the already trained MobileNet model on the ImageNet dataset. MobileNets are low latency, low power convolutional neural networks (CNNs) that can be used for classification. To make a quick comparison in terms of size, the size of the full VGG16 network on disk is about 553 megabytes. The size of one of the largest current MobileNets is about 17 megabytes. Because of their small size, they are considered excellent deep learning models for use on mobile devices.
Detecting a lung infection with Google Teachable Machine
Step 1: Load the images that will allow to train the model. Creation of 4 categories: viral pneumonia, bacterial pneumonia, covid-19, no pathology. For each category, the number of images is 133.
Step 2: Choose the parameters in the “Advanced” section that will optimize the training of the model and click on “Train Model”.
Epoch — Like humans, Artificial Intelligence learns over time and its intelligence increases as researchers continually feed the model training data. An epoch means that the model has been fed once with all the data.
Learning rate —In machine learning, the learning rate is a tuning parameter that determines the step size at each iteration while moving towards a minimum of a loss function.
Learning Rate in a Neural Network explained
In this video, we explain the concept of the learning rate used during training of an artificial neural network and…
- Batch size — The batch size defines the number of samples that will be propagated through the network. For example, let’s say you have 1050 training samples and you want to set the batch size equal to 100. The algorithm takes the first 100 samples (1st to 100th) from the training data set and trains the network. Then it takes the other 100 samples (101st to 200th) and trains the network again.
Batch Size in a Neural Network explained
In this post, we’ll discuss what it means to specify a batch size as it pertains to training an artificial neural…
Step 3: Once the model is trained, ‘model trained’ is displayed and by clicking on the “Under the hood” button, you can evaluate the performance of the trained model. Accuracy per epoch, Loss per epoch, Confusion Matrix, Accuracy per class.
We note that for the trained model the accuracy for viral pneumonia is lower than for the other classes.
The model seems to have inferior performances for the classification of this pathology. Indeed, in 6 cases out of 20, the model will predict a viral pneumonia instead of a bacterial pneumonia. It might be necessary to improve the training of this model by increasing the number of images of each class and by changing the training parameters of the model.
Step 4: Make predictions using new images that have not been used to train or validate model performance.
To make a prediction, you just have to load by drag and drop the radio that will allow the model to make the prediction.
- A first prediction is made exactly (output covid-19 = 100%) by the model from a covid-19 x-ray.
- A second prediction is made accurately (output healthy patient = 98%) by the model from an x-ray without lung infection.
- A third prediction is made incorrectly (healthy patient output = 86%) by the model from an X-ray of a viral pneumonia.
- A fourth prediction is made erroneously by the model (output covid-19 = 60%) by the model from an X-ray of a viral pneumonia. The predictions made from the X-rays of viral pneumonia confirm the 65% accuracy on this class of data.
- At last prediction shows that the model is still able to predict a viral pneumonia from an X-ray of a patient with viral pneumonia.
Step 5: Once improved in an iterative way (more images, change of training parameters) this model can be exported in a tensorflow.js, tensorflow or tensorflow lite format in order to be integrated in a website (see the Coding Train videos in appendix), in a mobile interface or to be integrated with Raspberry Pi (see the Teachable Sorter project in appendix).
How to use Teachable Machine Tutorials
Teachable Machine on the Coding Train : Image and sound classification