Is it a Cirrus or a Cumulus cloud ?
I hope you had a good weekend and that the weather was as nice as the one we had this weekend in Quebec.
I captured this sky while walking near my home in Montreal, and when I was looking on this sky I was remembering me the lab I did a few weeks ago on Google Cloud. It was about “Classifying Images of Clouds in the Cloud with AutoML Vision”, as part of my journey to Machine and Deep Learning in Google Cloud (a journey started a few years ago on the Oracle Cloud). I decided to answer my question using AutoML Vision starting with the initial lab and then using a Python client to get classifications from the model created.
The core pieces of a classification system are: data, the model, and infrastructure to train and serve predictions to users.
We’ll use a deep learning model to make these recommendations, a deep neural network to be exact, which is a model inspired by our own human brain : an input layer + some activated neurons + an output layer.
Globally, we have 3 AI application strategies :
- pre-built AI : Pre-built models are offered as services, eg. chatbot Google Dialogflow
- pre-built AI + custom models : eg. BiqQuery ML
- new models : eg. TensorFlow, Google Cloud AI
Let’s go back to my cloud story. FYI, there are more than 10 different types of clouds, and each type could represent different patterns of weather if you want to go further.
Here we show the image to the Vision API. After I uploaded the image to the Vision API, here are the results for the labels it inferred. The pre-trained model probably never learned to recognize cloud types at this granularity.
We need something a little more custom that we can train ourselves. If you want to customizing Pre-built models, you can build them with no code.
Welcome to AutoML
Here we will use our own labeled dataset of cloud images and train a custom model using AutoML Vision and a single-label classification dataset.
TRAIN
Start by enabling the AutoML API .
Create a Cloud Storage bucket for your training data.
The training images are publicly available in a Cloud Storage bucket (gs://cloud-training/automl-lab-clouds). Use the gsutil command-line utility for Cloud Storage to copy the training images into your bucket.
Create an AutoML Vision training dataset.
- Import training images by selecting a CSV file on Cloud Storage (eg. gs://<your bucket>/data.csv)
- Inspect the images : add new labels, assign labels and /or delete images
For a production model, provide at least 100 images per label to ensure high accuracy
Train your new model : You can specify your model name and your training budget. AutoML Vision handles this for you automatically, without requiring you to write any of the model code.
EVALUATE
After training is complete, select the Evaluate tab.
You can view the Confusion matrix and get information about Precision and Recall of the model.
TEST
You can test your model by uploading some images.
DEPLOY
After you have created (trained) a model, you must deploy the model before you can make online (or synchronous) call to the model. You can also update model deployment if you need additional online prediction capacity.
USE
With the Cloud Client Libraries for the Cloud AutoML API, you can develop your Python client.
It’s a Cirrus cloud