DEV Community

Sherry List 🏡 🇩🇰 for Microsoft Azure

Posted on

Getting started with Azure Cognitive Services

The beginning

Robot
You have definitely heard of these different abbreviations: AI, ML, ANN,… But you might not know the exact meaning of each of these abbreviations or how they relate to each other. In this article we will go through each of them and find out how they relate to each other in the bigger picture.

AI (Artificial Intelligence)

The simplest definition I have found about AI is:
"AI is the simulation of human intelligence processes by machines. These processes include, reasoning, remembering, learning and self-correction."

It means we want the device's brain to function as a human's brain. So they can remember, understand, recognize things and even learn from past mistakes and correct themselves.

So as you can see, AI is all about the ability of machines to act as humans.

ML (Machine Learning)

We mentioned that we want machines to act and behave as humans. In order to do that we need to write programs that give them such an ability. This brings us to ML.

In 1959, Arthur Samuel mentioned:
"Machine learning is a field of computer science that gives computers the ability to learn without being explicitly programmed."

ML is all about writing applications which give this ability to machines without hard-coding the situations. We can not simulate the human brain with hard-coded scenarios.

Look at this picture and think about what you see here? How would you describe this picture?
What do you see in this picture?
You most probably describe it something like: "I see a cat and a dog looking at each other through a window."

What happened here is that your brain recognized a few patterns:

  • A dog
  • A cat
  • A window

This happened simply because you have seen them earlier in your life and you were able to remember the pattern. Even though you might not have met this particular cat or dog before in person, you can still relate them as cats and dogs that you have seen before.

With ML, we can write programs that can detect these patterns by using different techniques such as:

You can use either one or a combination of them to detect different patterns.

The bigger picture

Now that we know what is AI, ML and different ML techniques are, we can draw the bigger picture:
The bigger picture
AI generally refers to the ability of machines to behave as human (very general). ML is one way of giving this ability to machines by programs. To write these programs, developers often use one or a combination of ML techniques such as ANN, DL & etc.

How does ML work?

Let's figure this out by trying to teach the machine to recognize dogs. In order to do that we need to follow these steps:

  1. Create a data set which contains pictures of all dog breeds
  2. Run different algorithms to learn what a dog looks like
  3. Go through step one and two until it knows what a dog looks like

Dog

The result of these steps is called "Model" and the process of generating the model is called "Training". You might have heard the phrase before "I am training my model". It basically means I am going through step 1 & 2 multiple times to recognize a pattern.

Training a model

Once you have the Model, you can have a REST API to talk to your application.

Challenges

This process might sound pretty simple, but of course it comes with different challenges. Here are the top 3 challenges:

  • Data preparation
  • Create and test the result of the algorithm
  • Expose your model to the app Challenges

Let's go through each of them and discover what the issue is.

Data preparation

Preparing the data-set which projects the reality and covers all the edge cases is not always easy. If we get back to our dog example, you need to make sure to have a data set with pictures of all possible breed of dogs, including the mixed breeds. Collecting all of these data is not always easy.

It is not so easy to find out out which algorithm, or combination of them, is the best/worst for your scenario - supervising the results is neither easy nor straight forward. Keep in mind, cases are not always as easy as detecting pictures of dogs.

Dog or Muffin

That's why there are three types of machine learning algorithms:

  • Supervised learning: Data sets are labeled so that patterns can be detected and used to label new data sets
  • Unsupervised learning: Data sets aren't labeled and are sorted according to similarities or differences
  • Reinforcement learning: Data sets aren't labeled but, after performing an action or several actions, the AI system is given feedback

Also keep in mind these processes are pretty expensive in terms of required resources.

Expose your model to the app

Any of you who have exposed the data out to the different apps know that creating a performed and secure REST API that caters to the needs of different apps is not always easy.

Expose your model to the app

Is there an easier way?

Now that I am talking about all of these challenges you might ask. Okay, we get it, but is there any other easier way to leverage ML and create intelligent apps?

Yes there is. Azure Cognitive services can remove most of these responsibilities off your shoulders and come up with a pretty performant and secure REST API which you can use in your apps.

Your process will turn into the following picture:
Cognitive Services

Also by having your services and data in Azure, you will automatically have a basic level of security on your services that comes by default with using Azure. Azure will also guarantee that availability of your service.

As of today there are 5 available services:

  • Decision
  • Speech
  • Language
  • Search
  • Vision

List of Azure Cognitive Services

All of these services come with a pre-built model. Additionally, there is a group of services where you can customize the models, through providing training data, to cater to your specific needs. You can combine them together like LEGO pieces to create super intelligent apps.

All you need to know is how to create your Service on Azure, call the end point from your app with the Authentication key which is provided to you and leverage your app.

Azure portal

If you just want to explore and play with different services, you can also create a guest account without even providing your credit card information.

So far in this article we have been through the basics of Machine learning and how Cognitive services come into the picture as well as how easy is it to use them by just creating them and calling the secured and well performed end-point which Azure provides you.

In the next article I will give you a good overview of our available cognitive services and will show you how easily you can call them via your application (with code snippets).

Useful resources:

Top comments (2)

Collapse
 
t4rzsan profile image
Jakob Christensen

Nice writeup. Will you write more on how to set it up, especially custom models?

Also, I was very happy to see Dannebrog next to your profile name 😊

Collapse
 
sherrrylst profile image
Sherry List 🏡 🇩🇰

Thanks for the great feedback. I will continue to write about this topic and for sure I will cover the custom models.
Dannebrog is always part of my name when I am home and not traveling 😊