Understanding Deep Learning

Raihan Astrada Fathurrahman
5 min readJun 6, 2021

Have you ever wondered how your phone could group images based on the object in the image or location of the image? Or how your Virtual Assistant such as Google Assistant, Amazon’s Alexa and Apple’s Siri could recognize your speech?

Google Gallery grouping photos by similar faces.

Well, all of those process is possible because the existence of “Deep Learning”. Now, the next question you might ask is “What is Deep Learning?” or “How Does it Works?”. In this article, we will try to understand about deep learning, and how deep learning works.

What is Deep Learning?

Venn Diagram of Deep Learning
Venn Diagram of Deep Learning

Deep Learning is a part of Machine Learning in Artificial Intelligence (AI). Artificial Intelligence is a technique that could make a machine to do or mimic a certain human behavior. One of the way to do that is through Machine Learning. Machine Learning is a way to achieve AI through training the machine with a big data. Deep Learning is a type of Machine Learning that is built like a human brain called a Neural Network. These neural network is the one that’s responsible for the mimicking behavior.

Let’s try for an example to understand more about the difference. One of the example of AI is trying to make a machine differentiate a picture, in this case we would like to try the difference between a car and a motorcycle. A way to make a machine could do that is by making the machine learns through providing the machine with a lot of images of cars and motorcycles. We could also give the machine a prior knowledge, let’s say we give an information that a car will have a 4 wheels and a motorcycle have only 2 wheels. These prior knowledge however doesn’t exist in Deep Learning. The neural network is like human brain that draw a conclusion by continually analyzing the data with a given logical structure. So these prior knowledge , about car having 4 wheels, is not given but rather picked out by the neural network throughout the learning process.

How does it works?

After we know about deep learning, the next thing is trying to understand how deep learning works. First, we are going to take a look at neural network example.

An example of Neural Network

The neural network consist of three parts, Input Layer, Hidden Layers, and Output Layer. Each of this layers has a nodes called Neurons and a Channels that is connecting through each layer. Each of these channel has a value or weight that could make certain neuron move to another neuron on the next layer. To get these weight, it is different throughout the layer. Weight from the input layer to the first hidden layer, symbolized by Wmr in the picture, is achieved through the weighted sum of the total input. Weight throughout the hidden layers, symbolized by Wrk in the picture, is a bias value that could change the Wmr so that we could get the output that we wanted. Lastly, the weight from the last hidden layer to the output layer, symbolized by Wkn in the picture, is achieved through an activation function that takes the sum of weighted total input and bias as it’s input. The result of these activation function determines the specific output neuron that is activated. In mathematical formula, it could be represented like this.

σ is a sigmoid function, a function that is often used as an activation function because the result of the function has a range between 0 and 1. These result could then determines if the output of the certain neuron get’s activated.

Sigmoid Function

Most of neural network will flow in one direction, only from input to output. However we can also train the model with a Backpropagation, move in the opposite direction, to calculate the error that is associated with each neuron so it allows adjusting the algorithm appropriately.

To understand better of how deep learning works, let’s use an example. We’re going to use a neural network model that detect a number, based on handwritten input, as an example.

Neural Network of Number Detection

As you can see on the picture above, we’re trying to detect the number “9”. We could easily know that all of the three picture on the left is a 9, but how does a machine will detect this?

First, we assume that this picture is represented in pixels, in this case let’s say that it’s a 28x28 px of picture of a handwritten “9”. Then, we will have a 784 pixel which will consist of the color black or white. These 784 pixels are then made as an input and the collections of the pixels in certain coordinate could then activate neurons on the hidden layers. Even though the handwritten number of “9” could be different, the machine could deduct that the number “9” will consist of a circle on the top part and a straight line at the bottom part. Thus, that’s how the machine will generate a 9 as an output. This would also apply to the other numbers. For example, when we try to use the number “4” as the input, the third and last neurons on the last hidden layer will then activate the output of 4.

In conclusion, Deep Learning is a type of Machine Learning that used neural network to mimic human behaviors. It works by calculating the weighted sum of the input, adding the bias, feeding the result to an activation function, then getting a specific output neuron to be activated. Even though this article only show deep learning usage as detecting numbers, there are also other usage of deep learning such as detecting objects, recognizing speech, translating languages, and making decision.

Sources:

--

--