Vertex AI: The Simplest Way to Execute Machine Learning Pipelines

Royal Cyber Inc.
7 min readNov 30, 2021

--

In May 2021, Google announced Vertex AI, a unified machine learning platform that helps you deploy models quickly by leveraging Google’s AI tools. On the face of it, Vertex AI may be a rebrand of Google’s existing AI platform, and it seems to be targeted at rivals like Amazon Sage Maker and Azure ML.

However, it is so much more than that: it guarantees a comprehensive MLOps solution, something businesses desperately need.

When I found out about Vertex AI, I couldn’t stop thinking about how we can use this platform to remove the barriers for companies who want to integrate machine learning into their operations. But to understand the role Vertex AI plays in machine learning, we first need to understand MLOps.

What is MLOps?

MLOps is the method to reduce the issue of productionizing models, getting the most out of ML models and related devices, and mitigating risk.

There are many devices for preparing models; however, the model is just the start. The keys to accomplishment in AI are:

· Collaboration: People with different specialties are empowered to work together effectively.

· Provenance: For any model, we’re able to track the code version, data version, and parameters that went into making that model.

· Reproducibility: Both experimental and production models can be reproduced easily on-demand.

· Continuity: We can build, test, and deploy models and associated infrastructure automatically and consistently.

What is Vertex AI?

Vertex AI’s goal is to become a unified platform for machine learning and artificial intelligence. For those who are familiar with Azure Machine Learning, this is Google’s answer to Azure ML.

However, it also brings some additional features and further streamlines some of the benefits to a hosted environment, which we’ll discuss further on.

How Vertex AI fits into an ML workflow:

Figure 1: What Vertex AI provides

In Figure 1, you can see that Vertex AI unites every one of the devices you need to accomplish routine errands in a regular ML work process. I’ll momentarily address each step and explicitly state how Vertex AI helps you.

You can use Vertex AI to manage the following stages in the ML workflow:

1. Training inflow

· Upload the dataset

· Training the machine literacy model on your data

While training, we can evaluate the model’s accuracy, and if we are using custom training, we can also use hyperparameter tuning.

2. Deployment

· Upload and store trained models on Vertex AI

· Emplace the model with an endpoint so that we can serve predictions from the model

· Execute requests to our endpoints for making the predictions

· Specify a traffic split in your endpoint

· Manage your models and endpoints

Workflow of Vertex AI

Each ML project starts with tests. Typically heaps of them, each with various strategies, arrangements, and datasets. Therefore, follow-ups are essential for keeping up with the coordinated effort at this stage.

1) Data ingestion and labeling

The first step in this workflow is loading the data. In Vertex AI, we can create supervised datasets, which is helpful. Having a focal area for information implies there is one wellspring of truth.

The main missing component (for the present) is information formation, which is fundamental, assuming we need full model provenance. Datasets come in various kinds: pictures, tables, text, and video.

The Figure 2 below shows the options available during the process of creating a dataset. You can choose the type: Image, Tabular, Text, and Video. The UI guides you in the objective, the problem you want to solve, and where to upload the data.

Figure 2: How to load the data in Vertex AI

2) Training

In ML activities, one thing which is mainly required is to train models in Vertex AI. We can prepare models utilizing AutoML, or regardless of customization, utilize a broad scope of customization choices and use cases accessible in AI Platform Training.

Utilizing AI Platform Training, we can exploit a wide range of machine types to control your ML preparation like dispersed preparation, hyperparameter tuning, and increasing the speed of cycles with GPUs.

In Figure 3 below you can see that this is all integrated into Vertex AI now, so you have two options:

· You can use AutoML, assuming you need to prepare a model by utilizing a stacked dataset without composing code. It will also handle any data preparation steps for you, such as feature engineering.

· The second option is Custom training, which is more work; however, it gives you more control. Fundamental in case you’re doing anything past what the AutoML mentors can do.

· The third option is AutoML Edge. For vision-related targets (picture and video), you can also prepare a model used on a cell phone or on-premise framework that doesn’t have internet availability.

Figure 3: How to train the model in Vertex AI

Pipelines in Vertex AI are Kubeflow pipelines. For those new, Kubeflow is an AI system capable of dealing with sudden spikes in demand on Kubernetes.

Interestingly, with Vertex AI, you get Kubeflow without running your foundation, which would be cumbersome. But then again, most would agree that KubeFlow has its doubters.

3) Evaluation

Before using your ML model, you should check if it is doing its job of predicting the expected values.

The Figure 4 below shows an example of the evaluation output from training an AutoML model on the flower dataset from earlier. It shows which type of flower matches our model.

We can now add more training images of flowers to our data set and train it again. The Explainable AI feature in Vertex AI can help build understanding and trust in your model predictions with robust, actionable explanations integrated into Vertex Prediction, AutoML Tables, and Notebooks.

Figure 4: Evaluation output from training an AutoML model

4) Deployment

In this step, once your model is trained, you can finally deploy it. We provide machine learning models to predict the model at an endpoint where the user can use the prediction. We can also do this in Vertex AI and thus also offer options for those models that are not Vertex AI trained.

The Vertex AI UI allows you to deploy your trained model to an endpoint in a few clicks as you can below in the Figure 5.

For both AutoML and custom models, you can do that by creating a Traffic split during deployment, and can experiment with different models. If you want to do some A/B testing, this will come in helpful and fine-tune the resources your model will need and take advantage of autoscaling by specifying the maximum number of compute nodes Vertex AI should scale to.

Figure 5: How to deploy the model once trained!

5) Monitoring

Vertex AI Endpoint also provides monitoring functionality for predictions and requests per second, latency, and predictions’ error percentage. You would need extra effort to handle concept/data drift issues. Still, it is sufficient in detecting errors in prediction requests, prediction delays, and the sufficiency of throughput with Vertex AI.

Vertex AI provides additional monitoring features for tabular models and custom-trained models to inspect the models’ behavior in depth for now. Still, AutoML models are likely going to be supported soon.

In Figure 6 below it shows how monitoring is done of tabular models and also custom-trained models in Vertex AI.

Figure 6: Steps for monitoring the model

6) Predictions

Now, this is the last process of Vertex AI workflow. At this stage, as you can see in the Figure 7 you have to select a model and construct a batch prediction via the Vertex AI UI by sending a collection of data for which you want the model to produce predictions which can be asynchronous. You don’t need to have deployed the model in this situation.

Upload your data to a Cloud Storage bucket and choose it for prediction; the data type will differ based on the model.

When you deploy the Model resource as a Deployed Model to an Endpoint, you must provide a machine type to serve online predictions using a custom-trained model or an AutoML tabular model. Vertex AI configures the machine types for various sorts of AutoML models automatically.

Figure 7: How to predict a model in Vertex AI

Conclusion

Hopefully, you have now understood what Vertex AI does in the context of creating an ML model, from data ingestion to getting it into production.

The three best things you must have noticed of Vertex AI are that it is accessible to the user interface, clean and intuitive, and has multiple entry points.

You can start utilizing Vertex AI to produce models in minutes, whether you’re using AutoML or fully customized code and a scalable infrastructure.

Experienced MLOps experts and architects have the skillset to implement Vertex AI services with exclusive knowledge and experience.

Author Bio:

Hassan Sherwani is the Head of Data Analytics and Data Science working at Royal Cyber. He holds a PhD in IT and data analytics and has acquired a decade worth experience in the IT industry, startups and Academia. Hassan is also obtaining hands-on experience in Machine (Deep) learning for energy, retail, banking, law, telecom, and automotive sectors as part of his professional development endeavors.

--

--

Royal Cyber Inc.
Royal Cyber Inc.

Written by Royal Cyber Inc.

Royal Cyber Inc is one of North America’s leading technology solutions provider based in Naperville IL. We have grown and transformed over the past 20+ years.

No responses yet