Do you know how an autonomous car works? How Facebook is able to identify you in each of your photos? How Alexa's or Google's voice recognition works? You might be thinking "This all works with artificial intelligence", and you're almost right. In fact, to be more precise, it all works with Machine Learning.
In this article, you will learn what Machine Learning is, how it works, and why it is used. As a bonus, I'll even tell you the story of how Machine Learning was invented. Let's get started!
Computers are not intelligent
A CPU (Central Processing Unit) is mostly composed of transistors, so computers can only do one thing: calculations.
The interesting thing is that they can perform calculations in a few seconds that would take us thousands of years to solve (sending a rocket into space), but they are unable to recognize a cat in a picture. This is because in the first case, it is enough to enter well known mathematical equations into the computer by writing a program, this is called programming, but in the second case, there is no exact calculation to recognize a cat from pixels...
Generally speaking, can we describe the functioning of our brain (reasoning, memory, etc.) by a set of equations? No. But there is a solution...
Is Artificial Intelligence a Solution?
In the face of this problem, Alan Turing, one of the founding fathers of artificial intelligence, asked himself a question in 1950 in his scientific article Computing Machinery and Intelligence. Here is the question: "Can machines do what we do?" Because we, in addition to making calculations, are able to solve problems, play chess, drive a car, or recognize the objects we see around us...
This question actually sets the basis for what is called Artificial Intelligence: All the theories and techniques that seek to develop systems that can simulate what human beings do.
Well, Machine Learning is a technique that allows computers to do all these things.
Machine Learning, a technique within AI
With Machine Learning, our computers are able to drive cars and planes more safely than we can, they can diagnose a patient (cancer, fracture) more reliably than a doctor. Machine Learning is now at the heart of our decision making systems: banking, justice, security, business, marketing. The algorithms of Google, Youtube, Facebook, Amazon, or Netflix, all work using Machine Learning. With Machine Learning, computers can even learn to paint, or compose music.
In short, Machine Learning is everywhere. But how does it work?
How does Machine Learning work? Definition
Machine Learning consists in writing a program that at the beginning doesn't know how to do anything, but will learn to do something with time and experience... A bit like a human being would learn to ride a bike: at the beginning you don't know how to do it at all, but after a while you get better and better at it, until you do it really well.
This example fits very well with the definition of Machine Learning given by the American Tom Mitchell in 1998. According to him, a machine learns, when its Performance P to do a Task T improves with a new Experience E.
For example:
- Task T: Riding a bike
- Performance P: Riding straight, not falling
- Experience E: Every time riding a bike, including the times of fall.
But it was Arthur Samuel, an American professor, who was the first to use the term Machine Learning to explain in 1959 the functioning of his checkers program. He declared: "Machine Learning is a Field of study that gives computers the ability to learn without being explicitly programmed".
The 3 learning types in Machine Learning
We'll come back to its story as a bonus at the end of this article, because I think you're most curious to learn how Machine Learning really works! Because it's all very well to say that "it's a program that at the beginning doesn't know how to do anything, but with time it learns how to do things blah blah blah" But exactly?! How to write a program to give the ability to a computer to learn, knowing that a computer can only do calculations?
Well there are many learning algorithms, and together we will see the 3 most used families of algorithms, namely :
- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning
Supervised Learning: Showing the machine what to do
The most common technique to give a program the ability to learn is to use Supervised Learning.
Creating a Model
In this method, we start by giving the computer a random calculation, which the computer will solve in order to do its task T. This is called a model. For example, we will give it the task of determining the price of an apartment f(x) according to its living area x, and for this, here is the calculation to solve: f(x) = x.
At this stage, according to the computer, a 1000 ft2 apartment is worth $100 . Not a very good model... So we will give experience to the machine so that it improves this model.
Training The Model
For that, we will look for examples of apartments, many examples, it is what we call data. We will show the machine a first apartment, for example an apartment that is 1000 ft2 and the computer will use its calculation: f(x) = x to predict a value of $100. And there we will show it the answer it was supposed to give us, that's why it' s called supervised learning.
We tell it: "No, no, no, that apartment you have just seen, in fact it costs $300,000". And there, in the program there is an algorithm that will do two things:
- First, it will measure the error between the computer's answer (100), and the expected result (300,000).
- Second, it will slightly change the calculation f(x) = x that allowed the computer to give this answer in order to minimize this error, i.e. to improve its performance in finding the right price. For example, this calculation will become f(x) = 3000 x.
The longer the training, the better the performance
A large number of examples of apartments will be shown, and each time the program will make a self-evaluation, and then slightly correct the calculation it uses in order to minimize its errors. This process is called the training phase. Depending on the number of examples available, and the complexity of the function to be learned, this phase can last a few seconds, or it can take several years.
Supervised Learning Applications
Supervised Learning is the most popular type of Machine Learning, because there are a huge number of applications in which we have examples (data) on which we can put a label (associate an apartment with a price, tell what a photo represents). There are generally 2 families of problems
- Regression problems, which consists of predicting the value of a continuous variable:
- Real estate prices
- Stock market value
- Weather tomorrow or in 10 years
- Amount of a customer's shopping cart
- Electricity consumption of a factory
- Robot's arm position in automatic
- Classification problems, which consists of predicting the value of a discrete variable:
- Is the email spam?
- Is this software malware?
- Does the X-ray show a fracture?
- Does the medical analysis show cancer?
- What animal is in the picture? Dog? Cat? Fox?
Supervised Learning Algorithms
Supervised Learning algorithms to do this kind of things are many: K-Nearest Neighbour, Linear Regression, Logistic Regression, Support Vector Machine, Neural Network, Naive Bayes, Random Forest, Adaboost, etc.
So much for Supervised Learning. But can you guess what other strategy can be implemented to give a computer the ability to learn? The answer right away...
Unsupervised Learning: Let The Machine Learn by Itself.
The second technique to give a program the ability to learn is to use Unsupervised Learning. But what is the difference with the first type?
Well, since we don't supervise the learning, i.e. we don't show the machine examples of what it is supposed to give us as results, the program, which used to proceed to its self-evaluation, doesn't know what to do anymore because it can't compare its results with examples.
That's right! This time instead of saying "here is a picture of a cat, a picture of a dog, etc.", we say: "here are a lot of pictures, do it yourself". To which the machine could answer: "Well ok I do it, but...what do you want me to learn?"
If there are no examples to copy, what should be learned?
In fact, in Unsupervised Learning, we ask our program to learn to recognize structures in what we show it. Similarities. Differences. And with the knowledge that the program will develop on these structures, we will be able to use it to do many things like grouping its examples according to their common points.
Unsupervised Learning Applications
Well, doing this kind of things, for example K-mean clustering, is useful for market research, business, merchandising (gathering together the products that a customer is likely to buy).
We will use the knowledge that a program will have accumulated by analyzing the structure of the data we give it for scientific research, medical research (classifying new diseases, new bacteria) to study the behavior of animals, decipher ancient languages, or the reduction of dimensions. Another very common application is the development of anomaly detection systems (bank fraud, internet hacking, surveillance cameras).
In general, if we have labeled data, we opt for Supervised Learning, and we use Unsupervised Learning in cases where the data are poorly understood or even unknown (e.g. medical research).
Unsupervised Learning Algorithms
The most commonly used algorithms in unsupervised learning are: K-mean clustering, anomaly detection systems, principal component analysis, auto-encoding neural networks, generative adversarial network, Manifold Learning, etc.
Well, we have just seen 2 families of learning algorithms. Let's take a break. Do you like animals? Maybe you have a cat or a dog? Have you ever given your pet a treat to teach them to paw? Well, that's it! That's what we call reinforcement learning. Let's see it right now!
Reinforcement Learning: Let The Machine Generate Its Own Experience
The third family of learning algorithms is the one I like the most for its complexity and its applications. It is Reinforcement Learning. Few people know this term, yet it is the discipline that comes closest to the idea of an 'intelligent robot' capable of doing what we do: driving a car, solving problems, playing chess, etc.
In this technique, the machine generates its own experiences. As an Agent, it has the freedom to undertake Actions within an Environment. Depending on the action taken, the Environment modifies the Agent's State and gives a positive or negative reward associated with this State. This constitutes a new experience.
Within the program, there is an algorithm that develops a policy of actions with the aim of maximizing the number of positive rewards, i.e. improving P performance.
Example of Reinforcement Learning
Let us imagine that our Agent is a car. At any moment, the car can choose to take actions in its Environment which is the road: it can brake, accelerate, turn left, or turn right. If the Agent chooses to turn left when there is a wall there, the State of the car will change from 'Normal' to 'Accidental', and the Environment will give the Agent a negative reward. Thus, the algorithm which seeks to maximize the rewards will modify its action policy to avoid such an 'accident'.
The program learns to drive: it improves its performance P to not make an accident through a new experience E.
Reinforcement Learning Applications
As you may have guessed, Reinforcement Learning is used to develop autonomous cars, drones, robotics, but it is also through this type of Machine Learning that Deep Mind developed AlphaGo and AlphaZero to play Go. By far, Reinforcement Learning can be used for all types of games, including video games, and to solve problems.
Reinforcement Learning Algorithms
Popular algorithms in Reinforcement Learning are Monte Carlo Tree search, Temporal Difference Learning, SARSA, and Q-Learning.
What You Should Remember about Machine Learning
Congratulations for reading this article! Here is a little summary of what we saw.
Basically, a computer only knows how to do one thing, calculations, which is quite different from what we know how to do: solve problems, ride a bike, recognize the objects we see around us, etc.
Thus, artificial intelligence represents all the techniques that seek to develop systems able to simulate what human beings do. Among these techniques, we find Machine Learning, which works so well that it has become part of our daily lives.
Machine Learning consists in writing a program that learns to do a Task T when its Performance P improves with an Experiment E. To do this, Supervised Learning, Unsupervised Learning, or Reinforcement Learning algorithms are commonly used.
Deep Learning is Machine Learning on a large scale
In general, the more experience (i.e. data) a machine is given, the better it will perform. Thus, Deep Learning, which is a field within Machine Learning, seeks to train extremely complex models with billions of data in order to achieve better performance.
Machine Learning and Deep Learning are now fields in great expansion, due to the emergence of connected objects in 2007 (launch of the IPhone) which now provide an explosion of data (Big Data) to train the models of Data Scientists.
Post a Comment