Learn how to use a custom AutoML model to predict labels (categories) by testing with a variety of input photos.
- [Instructor] We have created a model, we have trained it, we have evaluated it, now let's use it. The easiest way to try it out is to use this predict button. So this is very similar to using the Vision API in that you have an endpoint and you simply can upload an image, you can see there's a Rest API or a Python API, and then look at the predictions. Of course labels here we would expect to have something to do with the labeled data that we presented. So let's try it out. So I've created a folder called photosPredict and purposely picked photos that I think should be predicted correctly, and some that I'm guessing will not, but I haven't tried this in advance so let's try it out.
So the first thing I'm gonna pick is a sunset. Sunset is a category and I'm expecting, based on our model evaluation, that this is going to be correctly predicted as a sunset. Now while we're waiting for this to come back, I'm gonna go ahead and upload some more images. This one is, I would consider a food, it's a martini, and this is somewhat correctly predicted to be flowers. It is a lavender martini and the plant inside of it is lavender.
Gonna try another one. This is correctly predicted as food, this is Bitterballen from the Netherlands, quite yummy, 99%. So we did get a good result on that one. This one is a statue. I expect that there won't be a prediction on this, because I don't have any samples with people, or anything in here that would be predicted.
And it looks like this has met my expectation that no prediction or label was generated. And the last one is particularly tricky. Again, I'm expecting no prediction here. And this one is an example of a false positive. This is not a vista, this is actually one of the first computer programs, this was in the Computer History Museum, so interestingly, this is a type of data that Google recommends to not use with the AutoML Vision API.
This is a character data kind of of a poor quality. So again, what I'm trying to demonstrate in working with this, is it does go to the old metaphor of what you put in is what you get out. So the quality of the information is heavily based on your training images. And again, just to refresh what we had here, for example, we had a good result with food, and you can see that in the food I had another example of Bitterballen. What happens in this type of modeling is the closer that you have a match, the higher the likelihood of prediction.
Google actually says that this is designed to work in situations that mimic human ability to visualize. So I'm sure as they evolve this API, there will be additional capabilities, but I think it's very important to understand what it's designed to do and what it's designed not to do. To summarize this session where we have covered both AutoML and referred to the APIs or endpoints, you want to for the APIs or endpoints, send data: picture, videos, text to that endpoint and then the API, let's take the case of the Vision API, would return labels, and you can get likelihoods as well, percentage of likelihood there's a cat in the picture, for example.
You've gotta authenticate and you pay by the invocation. For AutoML services, you create the labels and label your data. And the quality of the output is heavily dependent on the quality of the data and the quality of the labels associated. You send that labeled data, pictures, text, video, to an endpoint, Google creates the model training, and they hyperparameter tune the model, and present you with numeric evaluation. As you saw though, in the earlier section of this movie, I highly recommend that you manually test, as this is a new service and in beta, and so you wanna understand the quality.
And you may need to iterate. Course you also may need to provide more labeled data. And then you can predict using that model endpoint.
- Hosting options: Serverless, containers, and virtual machines
- Enabling the GCP ML AIs
- Preparing data with Cloud Dataflow and Dataprep
- Modeling predictions for images, video, text to speech, and cloud translation
- Machine learning with AutoML
- Advanced machine learning and deep learning
- Machine learning architectures