Hello again!!! We are back with yet another article where we will talk about the most fun and practical part of Vertex AI: Train and Deploy. We have finally reached the end of our journey with Custom Vision.
Or have we?
Story So Far
Let's have a quick recap of what we learned so far in this series.
- How do computers perceive images like humans do and identify different objects: Custom Vision: Chapter 6 - Object Detection
- How to use Label Studio or any other data annotation tools to annotate our images: Custom Vision: Chapter 7 - Object Detection - Data Annotation
- How to setup Google - Vertex AI to train an Object Detection model: Custom Vision: Chapter 8 - Object Detection with Vertex AI
Today we will talk about the final step which will logically conclude all the tasks we performed earlier in this series. So what are we waiting for? Let's dive right in...
Let's Start Training
Now let's see how can we start training on the dataset we uploaded earlier. We just need to navigate to Vertex AI and locate the dataset we created earlier.
Now that we have located the desired dataset, we can start training just by clicking on the "Train New Model" button on the right side of the screen.
Wait, is that it?
Not yet. We need to provide some additional details for Vertex AI to understand what are we trying to do here. There are few attributes we need to provide before starting the training process.
- Training Method: Which training methodology we need our model to follow. AutoML, AutoML Edge, or Custom training. Refer to our previous article where we have explained all these different methods in detail.
- Model Name: A unique name for the trained model. This will help us locate the model later.
- Type of Training: We need to make a selection here whether we want our inferences to be higher on the accuracy or higher on prediction speed. This decision can be made based on business requirements. If accuracy is a priority or low latency.
- Compute and Pricing: Let's talk money now. We need to enter the number of nodes we need to train our model on. The selection we make here will directly impact our monthly bill, so we need to keep this in mind before providing a number.
- Early Stopping: Vertex AI provides us an option to enable early stopping while training our model. Early Stopping is a widely used approach to prevent the Deep-Learning model from overfitting.
Now that we have configured the training job the way we want, let's initiate training by clicking on "Start Training"
Too much information? Don't worry, we have consolidated all the steps mentioned above in the video below.
The training process will take few hours to complete depending on the type of model and size of the dataset. Its time for a short break. :)
After few cups of coffee and a short power nap, we got a notification from Google stating that the model we trained, is ready for deployment. So we are back on the Vertex AI landing page.
Let's locate our model in the "Models" section, with the name we provided at the time of training, and drill down on the model to see details.
Here we can evaluate and visualize what our model has learned. There are multiple evaluation matrices available to monitor and analyze.
We would like to spend some time here to analyze and evaluate what our model has learned. This is a critical step that may highly depend on business requirements.
Now that we have evaluated the model and are satisfied with what the model has learned, it's time to finally deploy the model and make it available for others to test on.
To do so, we need to navigate to the "Deploy & Test" tab and just click on the "Deploy To Endpoint" button.
Wait!!! there is more to the story. We need to pass on some more attributes.
- Model Endpoint: Provide a name to your hosted model endpoint. This can be anything but should only contain letters, numbers, and underscores.
- Compute Nodes: We need to host the model for inference and that requires an always-on instance to host it. We need to provide the number of nodes we want to be always hosting our trained model. Keep in mind, this will have an impact on pricing.
- Region: Next we need to select the region where we want our model to be hosted.
Once all the attributes are selected, click on the "Deploy" button and sit back.
All done!!! We have trained and deployed our own Object Detection model using Vertex AI. Now we can share the endpoint with the business users and test our model on real-time data.
We have concluded our mini-series on Custom Object Detection and we have a custom object detection model in our hand. What could have been a better way to conclude a series!!!
Stay tuned to stay updated with all the latest AI tools and frameworks available in the market. See you soon in our future posts.