Building your own image classifiers

The Custom Vision service allows you to build your own image classifiers. There might be cases where you require special images to use the image APIs. Such cases may be from a factory, where the equipment you need to recognize is not very available. You can start to build a prototype, using as little

Building a classifier

To build a classifier, you will need to create a new project. Doing so will allow you to specify what category the images will be in. You will also select the classification type and project type.

Moving on, you will need to upload images. This can be done through the web page or through a REST API. All images must be tagged so that the classifier will recognize similar images later.

Once all images (at least 50) are uploaded, you must train your model. Once the training is complete, you will be presented with a precision percentage per tag. This is a measurement of the accuracy of the model.

Improving the model

On the website, you can test your models. Doing so will allow you to upload images, which will be classified by the model. If it turns out that the model performs poorly, you can improve the model.

Improving the model involves uploading more images. Some general guidelines to improve the model are as follows:

  • Have enough images
  • Make sure that the balance between tags is good (so that there is an equal number of images per tag)
  • Use a diverse set of images for training
  • Use images that have been used for prediction
  • Inspect the predictions

Using the trained model

Once you are happy with the model, you can use it for predictions. The model can be used in one of the two following ways:

  • With a REST API
  • Export it to a model file

The first choice involves uploading an image. Calling the generated endpoint for your model, along with the image data, will result in a prediction. The result will contain the predicted tags, ordered by their probability.

The second choice allows you to run the prediction offline. This means that you can utilize different frameworks, such as TensorFlow, CoreML, and ONNX, for different platforms. How to use the model with these frameworks is beyond the scope of this book. The downside of using an offline model is that the accuracy may suffer a bit compared to the online version.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.103.210