
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
In this lab, you upload images to Cloud Storage and use them to train a custom model to recognize different types of clouds (cumulus, cumulonimbus, etc.).
In this lab, you learn how to perform the following tasks:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00
), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
AutoML Vision provides an interface for all the steps in training an image classification model and generating predictions on it. Start by enabling the AutoML API.
Open the navigation menu and and select APIs & Services > Library. In the search bar type in "Cloud AutoML API". Click on the Cloud AutoML API result and then click Enable.
This may take a minute. You should now be on the following page (ensure that the Activation Status is Enabled):
Similarly, in the search bar type in "Vertex AI API". Click on the Vertex AI API result and then click Enable.
In Cloud Shell, paste the below command to make a new bucket to hold your training. We use the magic variable $DEVSHELL_PROJECT_ID
, which knows your current project, and simply add -vcm
to the end.
Leave your Cloud Shell window open for additional steps to follow.
The AutoML Vision datasets page opens once the APIs are verified.
In order to train a model to classify images of clouds, you need to provide labeled training data so the model can develop an understanding of the image features associated with different types of clouds. In this example, your model will learn to classify three different types of clouds: cirrus, cumulus, and cumulonimbus. To use AutoML Vision you need to put your training images in Cloud Storage.
Once there, you should see the bucket from the last step.
gcloud storage
command-line utility for Cloud Storage to copy the training images into your bucket:data.csv
file and 3 folders of photos for each of the 3 different cloud types to be classified:If you click on the individual image files in each folder, and then click once more when you see the URL, you can see the photos you'll be using to train your model for each type of cloud.
Now that your training data is in Cloud Storage, you need a way for AutoML Vision to access it. You'll create a CSV file where each row contains a URL to a training image and the associated label for that image. This CSV file has been created for you; you just need to update it with your bucket name.
gsutil ls
like so:Highlight and copy the location of your data file to your clipboard which will look similar to:
gs://qwiklabs-gcp-your-project-id-will-be-here-vcm/data.csv
Click to open the AutoML Vision datasets page.
At the top of the Cloud Console, click Create dataset.
Type clouds for the dataset name.
Select Single-label classification.
Click Create to continue.
On the next screen you will choose the location of your training images (the ones you uploaded in the previous step).
You're ready to start training your model! AutoML Vision handles this for you automatically, without requiring you to write any of the model code.
To train your clouds model, click Train New Model from the right-side pane.
From the Training method window, select AutoML as the training method and leave Cloud selected for Choose where to use the model.
Click Continue.
Enter a name for your model, or use the default auto-generated name and click Continue.
For the Training options window, click Continue.
From Compute and pricing window, set your budget to 8 maximum node hours.
Click Start Training.
You can also adjust the Confidence threshold slider to see its impact.
Finally, scroll down to take a look at the Confusion matrix.
This tab provides some common machine learning metrics to evaluate your model accuracy and see where you can improve your training data. Since the focus for this lab was not on accuracy, move on to the next section about predictions. Feel free to browse the accuracy metrics on your own.
From the Vertex AI navigation menu on the left, select Models Registry.
Click the model you just created (damaged-car-part-model
) and then click on Version ID.
Click on DEPLOY & TEST tab, click Deploy to Endpoint.
For the name, use damaged-car-part-model-endpoint
. Click Continue.
Keep the Traffic Split and Logging as default and set the Number of compute nodes to 1.
Click Done. Then click Deploy.
Now it's time for the most important part: generating predictions on your trained model using data it hasn't seen before.
There are a few ways to generate predictions. In this lab you use the UI to upload images. You'll see how your model does classifying these two images (the first is a cirrus cloud, the second is a cumulonimbus).
Navigate to the Deploy & test tab in the AutoML UI.\
Under your newly deployed endpoint, click the Upload Image button under Test your model.
Follow the prompts to select and upload the sample images you just saved to your local disk. When the prediction requests complete you should see something like the following:
When the prediction request completes you should see something like the following:
Excellent - the model classified each type of cloud correctly!
You've learned how to train your own custom machine learning model and generate predictions on it through the web UI. Now you've got what it takes to train a model on your own image dataset.
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one