Train and Deploy an AutoML Image Classification Model with Vertex AI
This tutorial guides you through the process of using Vertex AI to train and deploy an AutoML Image Classification model. You'll use a public flower image dataset, train the model using AutoML, evaluate its performance, deploy it to an endpoint, and send predictions — all from the Google Cloud Console.
🧱 Step 1: Set Up Your Google Cloud Project
Select or Create a Project
- Visit the Google Cloud Console project selector.
- Choose an existing project or create a new one for this tutorial.
💡 Tip: If you don't plan to retain the resources, create a new project so cleanup is easier.
Open Cloud Shell
Click the Activate Cloud Shell button in the top-right of the console. Once ready, set your project ID:
gcloud config set project PROJECT_ID
export projectid=PROJECT_ID
echo $projectid
Replace PROJECT_ID with your actual project identifier.
🔧 Step 2: Enable Required APIs
Run the following command in Cloud Shell:
gcloud services enable iam.googleapis.com compute.googleapis.com notebooks.googleapis.com storage.googleapis.com aiplatform.googleapis.com
🔐 Step 3: Set IAM Permissions
Grant the necessary IAM roles:
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:your-email@example.com" --role=roles/aiplatform.user
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:your-email@example.com" --role=roles/storage.admin
These permissions allow you to use Vertex AI and access Cloud Storage for dataset management.
🗂️ Step 4: Create and Import Image Dataset
Open Vertex AI > Datasets
- Click Create Dataset.
- Select Image as the data type.
- Choose Image Classification (Single-label).
- Set region to us-central1.
- Enter a name for the dataset (optional).
- Click Create.
Import Data from Cloud Storage
Use this public CSV containing image URIs and labels:
cloud-samples-data/ai-platform/flowers/flowers.csv
This CSV includes rows like:
gs://cloud-samples-data/ai-platform/flowers/daisy/10559679065_50d2b16f6d.jpg,daisy
gs://cloud-samples-data/ai-platform/flowers/dandelion/10828951106_c3cd47983f.jpg,dandelion
📌 You'll see a preview of your images and labels after import completes (takes a few minutes).
🧠 Step 5: Train AutoML Model
- Go to the Models section.
- Click Train new model.
- Select:
- Training method: AutoML
- Target dataset: Your image dataset
- (Optional) Name your model.
- Define training options:
- Training budget: 8 node hours
- Enable Incremental Training: Only if you have a base model
- Click Start training.
📬 You’ll get an email notification when training finishes (can take several hours).
📈 Step 6: Evaluate Model
Navigate to the Evaluate tab of your model:
- View key metrics:
- Precision
- Recall
- Confusion Matrix
- Analyze false positives, false negatives, and true positives.
- Use Review Similar Images to find label inconsistencies or outliers.
🔍 Fix incorrect labels and re-train if needed to improve accuracy.
🚀 Step 7: Deploy Model to Endpoint
- Go to Deploy & Test tab.
- Click Deploy to Endpoint.
- Choose:
- Create New Endpoint
- Name: image-classification
- Traffic Split: 100%
- Compute Nodes: 1
- Click Deploy.
Deployment takes a few minutes.
🧪 Step 8: Send a Prediction
After deployment:
- Go to Deploy & Test > Test your model.
- Click Upload Image.
- Choose a local image.
- View the predicted label and confidence.
🧹 Step 9: Clean Up Resources
To avoid charges, delete the resources:
Undeploy Model
Vertex AI > Models > Deploy & Test > Undeploy
Delete Endpoint
Vertex AI > Endpoints > Delete image-classification
9.3 Delete Model and Dataset
Vertex AI > Models > Delete
Vertex AI > Datasets > Delete
Delete Cloud Storage Bucket
Go to Cloud Storage and delete your bucket.
📚 Summary
- ✅ Created dataset with labeled images
- ✅ Trained an AutoML image classification model
- ✅ Evaluated model performance
- ✅ Deployed to a live endpoint
- ✅ Sent predictions and cleaned up
Vertex AI simplifies machine learning workflows with a UI-based AutoML approach. Stay tuned for more advanced tutorials on custom training, multi-class classification, and model explainability.
💡 "Teaching AI has never been easier. With Vertex AI, all you need is your data."