Machine learning for beginners

Diego Armando Lopez Quevedo
9 min readOct 26, 2019

It is not easy to talk about technology, when it has advanced so much and many times we get lost in its infinite terms, however, I will try in the following paragraphs a person with few notions or experience in everything related to science, technology, engineering or mathematics, that is, my grandmother, can understand the basic concepts of Artificial Intelligence (AI) and Machine Learning (ML), and be able to explain it to someone else. But first of all, to explain to my dear grandmother what machine learning is, first I would have to tell her about the intelligence of the machines.

To begin, we can conceptualize artificial intelligence as the intelligence of machines. And when do we know if we are really facing the presence of artificial intelligence? Actually we are already familiar with this concept. We are facing an “intelligent” machine when the machine can mimic some of the cognitive functions of humans, such as planning, understanding a language, recognizing objects and sounds, but most important learning and solving problems.

In his book on intelligence, published in 2004, Jeff Hawkins defined intelligence as “the ability to predict the future, for example, the weight of a glass we are going to lift or the reaction of others to our actions, based on the patterns stored in memory” (memory — prediction). That same principle is behind Machine Learning.

Why AI?

The simplest example of artificial intelligence can be seen in the famous science fiction film The Terminator (although my favorite is Terminator 2), where a robot is sent to the past to fix certain issues … The important thing to note here is how it in this film made several years ago what is expected of artificial intelligence and what can become a future, a robot created by humans and that has characteristics of a human to such a degree that the machine can not be differentiated to the naked eye.

It is then possible to differentiate artificial intelligence into two parts, general artificial intelligence and narrow artificial intelligence. The first would have all the characteristics of human intelligence, the second can only show some facets being really good in those while lacking others.

If we realize, one of those facets of artificial intelligence has taken a lot of strength in recent years, and it is learning. But how can a machine learn? One way to achieve this is through machine learning, the sub field of AI that more is in fashion, is revolutionizing the world and its incidence is increasingly greater in everyday life.

Everyday Machine Learning

A technical definition of what Machine Learning means is that it is a practice that uses algorithms to read data, learn from them and then make a prediction or suggestion about something. A simpler definition is that Machine Learning is the way in which we achieve that a machine like a computer can learn without the need for us to give it any instruction or order and in this way they can perform some tasks autonomously.

For Lisa Tagliaferri, Machine Learning is a sub field of artificial intelligence and its objective “…is to understand the structure of data and fit that data into models that can be understood and utilized by people”.

Now, if my grandmother is the one who asks me what is machine learning, I would answer with an example, teach her the Photo gallery of my cell phone and I would show you that just by typing the word cats, only the images that have cats in their content will be displayed, that is machine learning. Then, I would explain how it works.

I would tell you that, my photo gallery (the place where I save the images that I take from my cell phone) is able to recognize the images thanks to machine learning, it is a system which gives the instructions to the application of my cell phone so that I can learn from some type of image and in this way I can detect when it is not that type of image just by analyzing its content. When using images of cats I am telling the machine what a cat is.

If the example of the cats was not clear enough, I would tell him the one of the facial recognition of the cell phones. My grandmother is somewhat modern and of course she has a smartphone that an aunt gave her, this cell phone has built-in facial recognition functionality, and of course this is achieved through machine learning.

So, he would take the cell phone and ask him how is it that the cell phone can recognize his image and unlock the screen as soon as he shows his face?

As you can see in the image, when facial recognition is used for the first time, what is being done is to tell the machine what your face is. This is achieved because the cell phone camera emits invisible infrared points to the naked eye, which help to build a kind of face mold (a mathematical model to be precise).

In this way, every time you show your face to the cell phone camera, it will verify the points (collecting more data and information), if almost most of the points coincide with those taken in a previous verification or are the same, it means that the cell phone camera recognizes that it is indeed your face, in addition, it is learning and adjusting the same points to improve its accuracy making it safer as you unlock the device allowing us to recognize our faces regardless of whether one day we wear glasses, if we put on makeup, or if we left a beard.

That is why the use of machine learning is important in the technology of our era, because as we mentioned before, in the example of facial recognition, this practice shows you the way in which the device like a cell phone should adapt to facial variations, which can be learned every time something changes in the face through the collection of more and more data.

In the same way as with facial recognition, machine learning is also used in voice recognition, only that instead of images it is sound and thus, in this way the device that has voice services can learn and differentiate the voice from Username. It is something that is widely used in virtual assistants such as Siri, Cortana or Alexa, to understand our language and the same way in which we speak humans.

Machine learning allows the analysis of data in different ways, regardless of the origin or format of these, it is possible to make use of machine learning. It all depends on the type of algorithm used, in fact there are three categories in which machine learning can assimilate the data: supervised learning, unsupervised learning and reinforcement learning.

What’s an algorithm?

According to the BBC “You use code to tell a computer what to do. Before you write code you need an algorithm. An algorithm is a list of rules to follow in order to solve a problem… When you write an algorithm the order of the instructions is very important…”. Computer algorithms allow you to choose how to do a task, not just what to do. All this is achieved through basic rules and instructions that are given to the machine.

In Machine learning we use different techniques (algorithms) to get the job done, and as I said before, algorithms are often categorized as supervised, unsupervised and reinforcement. Let’s see what it is about.

Supervised learning

In this category, you would enter the first example we showed above, image recognition, here the mobile device like the smartphone has an image gallery that depends on previously adjusted data. That is, if we want images of cats to appear when we search for the word cats, some should have been provided to the smartphone photos of cats with labels or tags that define and classify them as such.

Once you have provided enough photos with cats in your content to the image gallery, you can enter photos of cats without telling the gallery that they are photos of cats, based on the patterns that have come registering and learning the cell phone. The idea is that the smartphone learn based on a multitude of examples and there is no need to teach you more.

Unsupervised learning

Contrary to supervised learning, this category does not provide “examples” to the smartphone, but an enormous amount of data with characteristics of an object, for example the aspects or characteristics that make up a cat, such as the number of legs, shape of ears, etc. so you can determine what it is, from the information collected. It is the learning method most similar to the way humans process information.

Deep Learning

It is clear that we talk about machine learning in a general way, however, within the field of machine learning is a more complex learning subfield, the deep learning. This subfield is the one that has been most successful in the area of ​​unsupervised learning. In deep learning, the Machine Learning process is carried out using an artificial neural network that is composed of hierarchical levels.

At the initial level of the hierarchy the network learns something simple and then sends this information to the next level. The next level takes this information and combines it. With this information already a little more complex, it goes to the third level, and so on. It is in this way that the cat detection of the previous example is performed. The image of a cat is reconstructed from a hierarchy that inherits the characteristics of a cat contained in each point of information that passes through the levels of the hierarchy itself.

Reinforcement learning

And finally reinforcement learning, in this case the basis of machine learning is the reinforcement from experience. Here the machine learns to trial and error, of course, the example of cat images would not be convenient due to the complexity of this case, which is based more on decision making. For example, this system is used in cars that are driven alone, where the machines look for success patterns, to repeat them over and over again until they are perfected and thus make the best decision, whether to make a turn, dodge a vehicle, calculate the speed on a slope, etc. When the vehicle makes a wrong decision, it is penalized, through a system of rewards and punishments, so the vehicle develops a more effective way to perform its tasks.

How to know then what kind of learning should we use for each machine? For Hui Li on The SAS data scientist blog “accuracy, training time and ease of use. Many users put the accuracy first, while beginners tend to focus on algorithms they know best.” That is why different types of learning are used according to the type of task that a device must perform.

A small conclusion

It is for all the above that machine learning is so important, since it facilitates people’s daily tasks and makes their life much simpler, from simple technological things such as facial and voice recognition, not as simple as the cars that they drive themselves, also going through health with disease detection systems, or simply the entertainment we consume, such as Netflix or MercadoLibre with the way they offer suggestions for what we should see or buy depending on our previously analyzed tastes.

Links for more info:

--

--