700개 이상의 실습 및 과정 이용하기

Classify Images of Clouds with Vertex AI

실습 1시간 universal_currency_alt 크레딧 5개 show_chart 중급
info 이 실습에는 학습을 지원하는 AI 도구가 통합되어 있을 수 있습니다.
700개 이상의 실습 및 과정 이용하기

GSP223

Google Cloud self-paced labs logo

Overview

Vertex AI is Google Cloud's unified platform for machine learning. The AutoML feature within Vertex AI simplifies training high-quality custom image recognition models without requiring deep ML expertise. After training, models are deployed to a managed Endpoint for real-time predictions via an easy-to-use API.

In this lab, you'll upload cloud images to Cloud Storage, create a Vertex AI Dataset from them, and use a pre-trained model (simulated) on a Vertex AI Endpoint to generate predictions.

Objectives

In this lab, you perform the following tasks:

  • Set up the Vertex AI environment and a Cloud Storage bucket.
  • Upload a labeled dataset to Cloud Storage.
  • Create and inspect a Vertex AI Dataset.
  • Generate predictions against a Vertex AI Endpoint.

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details pane.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details pane.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field. Navigation menu icon and Search field

Activate Cloud Shell

Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.

  1. Click Activate Cloud Shell Activate Cloud Shell icon at the top of the Google Cloud console.

  2. Click through the following windows:

    • Continue through the Cloud Shell information window.
    • Authorize Cloud Shell to use your credentials to make Google Cloud API calls.

When you are connected, you are already authenticated, and the project is set to your Project_ID, . The output contains a line that declares the Project_ID for this session:

Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}

gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.

  1. (Optional) You can list the active account name with this command:
gcloud auth list
  1. Click Authorize.

Output:

ACTIVE: * ACCOUNT: {{{user_0.username | "ACCOUNT"}}} To set the active account, run: $ gcloud config set account `ACCOUNT`
  1. (Optional) You can list the project ID with this command:
gcloud config list project

Output:

[core] project = {{{project_0.project_id | "PROJECT_ID"}}} Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.

Task 1. Set up the Vertex AI environment

You will enable the necessary APIs, access the Vertex AI console, and prepare your storage bucket.

Confirm that Vertex AI is enabled

The Vertex AI API is required for managing datasets, training, and deploying models.

  1. In the Google Cloud console, in the Navigation menu (Navigation menu icon), select APIs & Services > Library.

  2. In the Search for APIs & services field, type Vertex AI API, then click Vertex AI API in the search results.

  3. Confirm that the Vertex AI API is in the Enable state. If not, click Enable.

Open the Vertex AI Dashboard

  • In the Navigation menu (Navigation menu icon), click Vertex AI.

Create a storage bucket

The storage bucket will hold your training images and the manifest file. The region must be supported by Vertex AI.

  • In Cloud Shell, run the following command to create a storage bucket named -vcm:
gsutil mb -p $GOOGLE_CLOUD_PROJECT \ -c standard \ -l {{{project_0.default_region | Region}}} \ gs://$GOOGLE_CLOUD_PROJECT-vcm/

Click Check my progress to verify the objective.

Create a Cloud Storage bucket

Task 2. Upload training images to Cloud Storage

To train a model to classify cloud images, you need 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 learns to classify three different types of clouds: cirrus, cumulus, and cumulonimbus.

To put the training images in your Cloud Storage bucket:

  1. In Cloud Shell, run the following command to create an environment variable with the name of your bucket:
export BUCKET=$GOOGLE_CLOUD_PROJECT-vcm

The training images are publicly available in a Cloud Storage bucket.

  1. Use the gsutil command line utility for Cloud Storage to copy the training images from a public bucket into your new bucket:
gsutil -m cp -r gs://spls/gsp223/images/* gs://${BUCKET}
  1. To view the images you just copied into your bucket, in the Navigation menu, click Cloud Storage > Buckets, then click on your bucket name. You should see three folders corresponding to the cloud types.

If you click on the individual image files in each folder you can see the photos you'll use to train the model for each type of cloud.

Click Check my progress to verify the objective.

Upload training images to Cloud Storage Bucket

Task 3. Create a dataset

Now that your training data is in Cloud Storage, you need a way for Vertex AI to access it. Typically, you'd create a CSV file where each row contains a URL to a training image and the associated label for that image.

For this lab, the CSV file has been created for you; you just need to update it with your bucket name.

  1. Copy the CSV file to your Cloud Shell instance:
gsutil cp gs://spls/gsp223/data.csv .
  1. Update the CSV file with your specific bucket name:
sed -i -e "s/placeholder/${BUCKET}/g" ./data.csv
  1. Upload the updated CSV file to your Cloud Storage bucket:
gsutil cp ./data.csv gs://${BUCKET}
  1. Once that command completes, click the Refresh button at the top of the Storage browser. Confirm that you see the data.csv file in your bucket.

  2. In the Navigation menu, click Vertex AI > Datasets.

  3. Select and click Create.

  4. Set Dataset Name to clouds_vertex_ai.

  5. Select Image as the data type.

  6. Select Single-label classification (single-label) as the objective

Note: In your own projects, you may want to use multi-class classification.
  1. For region selection, select and click Create.

Now you'll import data.

  1. Choose Select import files from Cloud Storage and then click Browse > -vcm > data.csv. Click Select.

  2. Click Continue and then Import.

Wait for the image import to complete, it should take 2 - 5 minutes.

Click Check my progress to verify the objective.

Create a Dataset

Task 4. Generate predictions

Since the model has been pre-trained and is assumed to be deployed, you'll now use the Vertex AI API (via a curl command) to get predictions.

Simulate Deployment (Pre-trained Model)

The next steps assume a pre-trained model is deployed to a Vertex AI Endpoint. In a production environment, after training, your model would be deployed to a Vertex AI Endpoint. The prediction request structure uses the model's resource ID or the endpoint's URL.

Prepare the input images

  1. Download the two example images you'll use for prediction:
gsutil cp gs://spls/gsp223/examples/* .
  1. View the example input file for prediction (CLOUD1-JSON), which contains placeholder bytes:
cat CLOUD1-JSON

Generate Predictions Against a Vertex AI Endpoint

Use the generic Vertex AI prediction API format, which requires the model to be deployed. The following commands use a placeholder endpoint/model name for illustration, assuming a deployed model named clouds-model exists.

Test 1: prediction for CLOUD1

  1. Set the input file to the first image:
INPUT_DATA_FILE=CLOUD1-JSON
  1. Simulate vertex AI preditions URL
  • Since a live endpoint can't be automatically provided, we use a command structure that reflects the Vertex AI API, which uses your Project ID and a Model ID.

  • In a real-world scenario, you would first get the actual Endpoint ID. This command is a conceptual.

  1. Set a dummy MODEL_ID and the REGION:
export MODEL_ID='clouds_vertex_model' export REGION='{{{project_0.default_region | Region}}}'
  1. Execute the (conceptual) Vertex AI prediction call:
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://${REGION}-aiplatform.googleapis.com/v1/projects/${GOOGLE_CLOUD_PROJECT}/locations/${REGION}/models/${MODEL_ID}:predict" \ -d "@${INPUT_DATA_FILE}" \ | jq > prediction1.txt

Expected Output (Conceptual): The model should predict this is a cirrus cloud with high confidence.

Test 2: prediction for CLOUD2

  1. Set the input file to the first image:
INPUT_DATA_FILE=CLOUD2-JSON
  1. Execute the (conceptual) Vertex AI prediction call:
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://${REGION}-aiplatform.googleapis.com/v1/projects/${GOOGLE_CLOUD_PROJECT}/locations/${REGION}/models/${MODEL_ID}:predict" \ -d "@${INPUT_DATA_FILE}" \ | jq > prediction2.txt

Expected Output (Conceptual): The model should predict this is a cumulonimbus cloud with high confidence.

  1. Copy the txt files to your Google Cloud Storage bucket:
gsutil cp *.txt gs://${BUCKET}

Click Check my progress to verify the objective.

Generate predictions

Congratulations!

In this lab you used Vertex AI to create an image dataset and generate predictions against a deployed model endpoint.

Next steps / Learn more

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated October 17, 2025

Lab Last Tested October 17, 2025

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.

시작하기 전에

  1. 실습에서는 정해진 기간 동안 Google Cloud 프로젝트와 리소스를 만듭니다.
  2. 실습에는 시간 제한이 있으며 일시중지 기능이 없습니다. 실습을 종료하면 처음부터 다시 시작해야 합니다.
  3. 화면 왼쪽 상단에서 실습 시작을 클릭하여 시작합니다.

시크릿 브라우징 사용

  1. 실습에 입력한 사용자 이름비밀번호를 복사합니다.
  2. 비공개 모드에서 콘솔 열기를 클릭합니다.

콘솔에 로그인

    실습 사용자 인증 정보를 사용하여
  1. 로그인합니다. 다른 사용자 인증 정보를 사용하면 오류가 발생하거나 요금이 부과될 수 있습니다.
  2. 약관에 동의하고 리소스 복구 페이지를 건너뜁니다.
  3. 실습을 완료했거나 다시 시작하려고 하는 경우가 아니면 실습 종료를 클릭하지 마세요. 이 버튼을 클릭하면 작업 내용이 지워지고 프로젝트가 삭제됩니다.

현재 이 콘텐츠를 이용할 수 없습니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

감사합니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

한 번에 실습 1개만 가능

모든 기존 실습을 종료하고 이 실습을 시작할지 확인하세요.

시크릿 브라우징을 사용하여 실습 실행하기

이 실습을 실행하려면 시크릿 모드 또는 시크릿 브라우저 창을 사용하세요. 개인 계정과 학생 계정 간의 충돌로 개인 계정에 추가 요금이 발생하는 일을 방지해 줍니다.