arrow_back

Training an AutoML Video Classification Model

Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

Training an AutoML Video Classification Model

Lab 3 год 30 годин universal_currency_alt 5 кредитів show_chart Поглиблений
info This lab may incorporate AI tools to support your learning.
Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

Overview

In this lab, you will create a video dataset and import videos, train an AutoML video classification model, and deploy a model to make batch prediction.

Learning objectives:

  • Create a video dataset and import videos.
  • Train an AutoML video classification model.
  • Deploy a model to make batch predictions.

Introduction to Vertex AI

This lab uses the newest AI product offering available on Google Cloud. Vertex AI integrates the ML offerings across Google Cloud into a seamless development experience. Previously, models trained with AutoML and custom models were accessible via separate services. The new offering combines both into a single API, along with other new products. You can also migrate existing projects to Vertex AI. If you have any feedback, see the Google Cloud, Vertex AI Support page.

Vertex AI includes many different products to support end-to-end ML workflows. This lab focuses on the products highlighted below: Training/HP-Tuning and Notebooks.

Vertex AI products

Setup

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Sign in to Qwiklabs using an incognito window.

  2. 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.

  3. When ready, click Start lab.

  4. Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.

  5. Click Open Google Console.

  6. 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.

  7. Accept the terms and skip the recovery resource page.

Task 1. Set up your environment

Enable the APIs

  1. In the Google Cloud Console, on the Navigation menu, click Vertex AI > Dashboard.
  2. Click Enable All Recommended API.

Task 2. Create a video dataset and import videos

In this task, create a video dataset. After your dataset is created, use the CSV pointing to the videos you copied into your Cloud Storage bucket to import those videos into the dataset.

  1. On the Vertex AI page, click Create dataset.

  2. Provide a name for your dataset.

  3. For Select a data type and objective:

    a. Select the Video data type.

    b. Select the Video classification objective.

  4. For Region, select us-central1.

  5. Click Create.
    The data import window appears.

  6. For Select an import method, select Select import files from Cloud Storage.

  7. For the Import file path, copy and paste the following text:

    cloud-training/mlongcp/v3.0_MLonGC/toy_data/hmdb_split1_5classes_all_toy.csv
  8. For Data split, select Default.

  9. Click Continue to begin video import.

    The import process takes a few minutes. When it is complete, the Browse tab opens and displays the newly imported data.

Task 3. Train an AutoML video classification model

After your dataset is created and data is imported, use the Cloud Console to review the training videos and begin model training.

Begin AutoML model training

  1. In the right pane, click Train new model.

  2. For Training method, select AutoML.

  3. Click Continue.

  4. In Model details, for Model name, provide a name for your model.

  5. Click Start training.

The training job appears under the Training jobs and models section in the right pane.

Note: It takes nearly 2 hours to complete the training. Please wait till the training completes

To check the current training status, click the training job in the right pane. A training page appears for the model.

Check evaluation results

After training is completed, select your model to check the model evaluation results. This will open the Evaluate tab. In this tab you can view model performance metrics.

Task 4. Deploy a model to make batch predictions

Create batch predictions

  1. On the Batch Predict tab, click Create Batch Prediction.

  2. Provide a batch prediction name.

  3. For the Source path, use automl-video-demo-data/hmdb_split1_predict.jsonl

  4. For the Destination path to your bucket, click Browse.

  5. Click Create new bucket, type Project_ID.

  6. Click Create.

  7. Click Create new folder, type predict_results.

  8. Click Create, and select the destination path.

  9. Click Select.

  10. Click Create.

  11. You can navigate to Cloud Storage to find your bucket name. Results are added to the predict_results folder.

View results

When the job is complete, your prediction is displayed on the Batch predictions tab.

  1. Click on the prediction in the Batch prediction view.

    Details of the batch prediction job appear.

  2. Click the Export location link to view the results in your storage bucket.

  3. To see your results in the UI, click View results.

    A video appears. From the dropdown menu at the top of the page, you can select other videos you want to see the results for.

Understanding the results

In the results for your video annotation, Vertex AI provides three types of information:

  • Labels for the video: This information is on the Segment tab below the video on the results page.
  • Labels for shots within the video: This information is on the Shot tab below the video on the results page.
  • Labels for each 1-second interval within the video: This information is on the Interval tab below the video on the results page.

If the prediction fails, the results in the list show a red icon on the Recent Predictions list.

If only one video in the prediction attempt failed, the results show a green icon in the Recent Predictions list. On the results page for that prediction, you can view the results for the videos that Vertex AI has annotated.

End your lab

When you have completed your lab, click End Lab. Qwiklabs 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:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

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 2022 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