Creating an Image Classifier using Create ML (and how it works)

--

Artificial intelligence is everywhere these days. It’s used in recommendations, online searching, and healthcare. AI even drives the $127 billion autonomous vehicle market!!

This entire industry is driven by AI

Artificial Intelligence can become confusing since it has a lot of different fields, such as machine learning. Machine learning is responsible for most AI applications. Machine learning is used in applications like Siri, Alexa, Facebook, Twitter, Netflix, and Youtube. For this project, I used machine learning to help me create an Image classifier app.

So, what is Machine Learning exactly?

Machine Learning is an application that provides the system with the ability to learn and improve from experience without being explicitly programmed. The primary objective of machine learning is to allow computers to learn automatically without human intervention. Machine learning collects a bunch of data, such as what you clicked on and watched, then it finds a pattern from the data. It trains itself to make better recommendations based on your past actions and behaviors. There are many types of machine learning algorithms, but the two most common are supervised and unsupervised learning.

Supervised Learning

Supervised Learning uses data that has been labeled to create a function and test on new data that has been checked. The goal of supervised learning is to create predictions with already categorized data. An example would be creating models to predict how well students will do on a test based on their environmental and demographic factors.

Big Data Jobs

Unsupervised Learning

Unsupervised Learning finds hidden patterns in large amounts of data. The goal of unsupervised learning is to identify patterns within a set of data. For example, imagine you were given a bunch of images of random balls like baseballs, volleyballs, soccer balls, basketballs, kickballs, etc. all of them have different colors, sizes, etc. Then, you are asked to put them into groups. This is what an unsupervised machine learning algorithm does. The system doesn’t get the right input, but it explores the data and draws inferences from datasets to describes hidden struggle cures from unlabeled data.

Here’s what I did and how I did it

I created an app that uses supervised learning to classify images. The app can either take a picture or upload one from your photo library, and the machine learning algorithm will classify it.

The app has 3 main parts:

— A place to either take a photo or select from your photo library

— A place to display the Image

— A place for the model to classify the image

Training the model

To show I create the model, I’m going to use classifying flowers as an example.

To train the model, I used Create ML. It works by applying machine learning algorithms into the training data to help create predictions to use. Create ML uses a transfer algorithm. This means that it uses another algorithm to develop its own models. Although it never explicitly states which model it uses, I would assume it’s similar to a supervised machine learning algorithm, since its goal is to classify the data instead of finding the pattern in the data.

Trending AI Articles:

1. AI for CFD: Intro (part 1)

2. Using Artificial Intelligence to detect COVID-19

3. Real vs Fake Tweet Detection using a BERT Transformer Model in few lines of code

4. Machine Learning System Design

To create the model, I started with some training data. Training data is what the machine learning model references to help create and find the classes. In the training data, there were images with different angles, backgrounds, lighting, etc. The images had to be located in the right classes with an equal amount of photos.

Flowers folder (The classes)
(What the inside looks like)

In Create ML, certain options can be applied to the images such as Crop, Rotate, Blur, Expose, Noise, and Flip. These features also worked to help get more variety in the pictures.

What it looks like

Once all the training data has been imported, I started the training process. This process can vary on how much time it takes, depending on how much data and classes there are. Once it’s finished, the model has developed some sort of formula/algorithm to help create the model.

Finished training

The next step is testing. The testing phase can help determine if the models need to be retrained or if it's good and ready for use.

The model turned out fine after one training session, so it was ready to use. This is often not the case.

Once the testing finished, the model is ready to be exported and put into the app.

Tada!!… The finished product (and takeaways)

Now, I’ve built a simple image classifier (yay :) ). This project helped me learn what machine learning is and how I could use it. Before doing this, I didn’t know much about machine learning algorithms or how they worked. Now I understand more about the different types of machine learning.

In the end, I learned was to build my own image classifier that uses supervised learning

Link to my model: https://github.com/AssiHann21/AnImageClassifier

Don’t forget to give us your 👏 !

--

--