Andy Kim, Business Intelligence Consultant at Key2 Consulting
By: Andy Kim

BI Consultant

 

Introduction

What is machine learning? Microsoft describes it by saying, “Machine learning enables computers to learn from data and experiences and to act without being explicitly programmed.”
 
Machine learning can fall into three main categories: supervised learning, unsupervised learning, and semi-supervised learning. These categories define if the machine learns with outside help (for example, human corrections), completely autonomously, or with a hybrid approach of the two.
 
In addition to the categories, there are several generalized machine learning algorithms such as regression, decision tree, clustering, and deep learning that can be used to solve different kinds of problems.
 

The Experiment

Now let’s get some hands on experience with machine learning. Specifically, we will try a machine learning technique known as image classification.
 
In this experiment, we will:

  • Upload several images of cars, planes, and boats, with their respective tags.
  • Train the image classifier in order to produce a predictive model.
  • Upload some new images and let the image classifier predict the image type based on the predictive model we created. We will review those, add tags, and perform an iteration of retraining.

 

Preparation

To prepare for this experiment, you will need to download several image files (a minimum of 30 for each image type). I downloaded 30 images of cars…
 
Machine Learning Cars
 
… 30 images of planes.
 

 
… and 30 images of boats.
 

 
We will use the Microsoft Azure Custom Vision service to build our image classifier. An overview of the service is located here. There are some limitations, one of the biggest being that the images you select should display the subjects prominently, since object detection does not work on this service as of now.
 

Getting Set Up and Creating a New Project

Go to the web page and sign in. Create a Microsoft account if you don’t already have one.
 

 
Once you are signed in, create a new project.
 

 
Fill in a project name, a description, and click on ‘Create project’.
 

 

Creating an Initial Training Model

Let’s add our prepared images. Click on ‘Add Images’.
 

 
Then, click on ‘Browse local files’.
 

 
Navigate to the folder where the car pictures are stored, select all of them, and add them.
 

 
Add a tag of “cars”, then click on ‘Upload 30 files’.
 

 
Repeat the same process with the boat and planes. Upload the boats with a tag of “boats” and the planes with a tag of “planes” respectively.
 

 
After you upload all images, you should have 3 groups of tags with their respective pictures associated with them. We are now ready to perform initial training on the machine. Click the ‘Train’ button.
 

 
The results are displayed once the training completes. The service provides a Prediction API where you can use the provided image URL or image file to classify new images. For our simple experiment, we will just use the Quick Test.
 

 

Testing the Model

Click on ‘Quick test’.
 

 
Select a new photo (one that wasn’t used in the training process).
 

 
That particular photo is marked as being 100% probable of being a plane. The model generated from the training is accurate here.
 

 

Retraining the Model

After performing the quick test on a few different images, they will be saved onto the “predictions” tab of the project.
 

 
Go through each image on the ‘Predictions’ tab, and tag each photo.
 
Our model predicted that this image is 100% a plane. Great! Our machine learning model is working here! I will tag it as a “plane”.
 

 
Our model predicted that this image is 100% a boat. Great! Our machine learning model is working here! I will tag it as a “boat”.
 

 
Our model predicted that this image has  a 0% chance of being a car, plane, or boat. Great! Our machine learning model has identified a new type! I will tag it as a “motorcycle”.
 

 
Our model predicted that this image is 100% a plane. Great! Our machine learning model is working here! I will tag it as a “plane”.
 

 
Our model predicted that this image has  a 0% chance of being a car, plane, or boat. Great! Our machine learning model has identified a new type! I will tag it as a “hot air balloon”.
 

 
Once we go through each picture and tag it, it is time to retrain the model incorporating the new information. In order to retrain, we will need at least 2 tags, with at least 5 images for each tag. Otherwise, the Train button will error out.
 
Once the model is retrained, the predictive model will be updated, and the goal is to make this model as accurate as possible by feeding it more and more “knowledge”. It then becomes an iterative process of retraining to make it smarter and smarter. Sometimes, making a model usable can take a very long time.
 

 
I hope through this simple experiment you have gained a batter understanding of machine learning concepts. This specific technology has truly incredible real-life applications. Some examples include:

  • Scanning through a massive amount of pictures generated from remote cameras and identifying the pictures with the endangered snow leopard species (this aids in their study of movement patterns)
  • Matching customer preferences for kitchen remodels
  • Analyzing photos from powerline inspections to help predict power outages
  • Identifying defective PCB Boards during manufacturing process

The potential for the use of machine learning technology is unlimited. It will be interesting to see how the technology will integrate into our lives.
 


Key2 Consulting is a data warehousing and business intelligence company located in Atlanta, Georgia. We create and deliver custom data warehouse solutions, business intelligence solutions, and custom applications.