Step-by-Step Tutorial of Azure Custom Vision

Kristjan Eljand
5 min readSep 24, 2019

--

This is a step-by-step guide of how to create a computer vision model with Azure Custom Vision Service without writing a single line of code. After finishing, you’ll be able to set up the service, train a machine learning model, evaluate the performance of the model and publish your freshly created machine learning solution.

1. Prerequisites

1.1. Create an account in Microsoft Azure Cloud Platform

If you don’t have an account, ask IT admin or your manager to enable the service for you.

1.2. Create Custom Vision Resource

Azure platform has a concept of resources which means a specific service. In order to create a Custom Vision resource, log in to your Azure Cloud account and:

Click on create a resource in upper left corner and search for “Custom vision”:

On the next page click “Create”:

The form that opens asks for the following information:

  • Name: Give a name to your service and remember it (NB: use very short name and space is not allowed)
  • Subscription: This should be prefilled for you
  • Location: choose either North Europe or West Europe (these are the closest cloud servers to us)
  • Prediction pricing tier (choose F0 that is free of charge — on the picture below, I chose S0 because I had already used the F0 option)
  • Resource group: Ask from IT admin or your manager what would be the correct resource group. You can create your own resource group as well.
  • Click “Create” and Azure will create two resources for you one for model training and one for prediction.

2. Start using the resource

After the resource has been created, locate it by searching by the service name and click on the correct resource (CustomVisionReview in this case)

You’ll be directed to resource management page that includes quickstart guide. Click on Custom Vison Portal (highlighted on the picture below) to access the simple web-based interface.

You’ll be directed to www.customvision.ai . Log in and you should see an empty projects page:

3. Create your first project

Click on “New project” and fill in the new project form:

  • Name your project with short and self-explanatory name;
  • Describe what the new model is supposed to do;
  • The resource group is pre-filled;
  • Select a project type:

Use “Classification” if you want to label the whole image (cat or dog, broken or not-broken);

Use “Object detection” to find the location of object within an image.

  • Select Classification Type:

Multilabel enables to give multiple labels to one image (both dog and cat are detected from the image);

Multitag gives an specific label to image (either cat or dog);

  • Domains:

If the problem in hand falls under one of the pre-defined domains, select it because you’ll get the better results. If not, select “General”.

Click “Create project” and you’re all set up.

4. Create your first Computer Vision AI

4.1. Data preparation

The first step to create a Vision AI is to gather initial data (images) and separate them in different folders. In the context of this demo, I created three folders:

  • one that includes the pictures of broken electric lines and
  • the other one that includes the pictures for non-broken electric lines.

NB: If you have more than two labels, you should create more folders. If the data has been gathered, you are ready to go. Open your project and select “Add images”:

A pop-up window opens: locate your image folders and select all the images with one specific tag. Enter this tag to “My Tags” and click “Upload images”. NB: some images might not be uploaded if they are too big or otherwise incompatible.

Repeat the step as many times as necessary (depends on how many labels/folders you created).

4.2. Model training

You are now ready to train the Machine Learning model. Just click “Train” on the navigation bar.

You’ll be asked whether to use Fast training or Advanced training. If you select the latter one, you’ll be asked about the training time. NB: the longer you train the model, the better the result but you also pay by hour. I suggest starting with Fast Training and if the results have any promise, continue with Advanced Training.

When the training is ended, the performance metrics will be shown. Click on the “i” bubble to see the meaning of each performance metric.

5. Making predictions

Now, if you want to test your Newly created AI on new images, open Quick test:

Load a new image from your computer and the model automatically label’s it.

And that is it — you have created your first computer vision system. You can now continue with your next project or start to think how to create an automated solution.

6. Publishing the model

If you want to use that model somewhere inside software application, you first need to Publish the model. Go to “Perfomance” tab and click “Publish”:

An API will be created, meaning that this model can now be used in any software application (with the help of IT team). To see the details of API, open “Prediction URL” and show it to your nearest developer.

--

--

Kristjan Eljand
Kristjan Eljand

Written by Kristjan Eljand

Technology Scout in Eesti Energia

No responses yet