Neural Networks :Simply Explained.....

Hey guys! Let me explain neural networks in simple terms. 😊In fact, the explanation lies in the name itself. Neural networks are about the understanding of what are neurons and how are they interconnected. The concept of neural networks provides the foundation for deep learning and machine learning algorithms. 

Simple Neural Network Structure

                                                                               

The neural network structure mimics the human brain🧠 that contains billions of neurons. This distributed representation depicts the way of parallel computations and the adaptive sense of human brain. Therefore, first we will understand how human brain learns. Humans learn by recognizing patterns, features through experience. In order to replicate the human brain, we create these neural network algorithms, teach them to learn through training and make decisions.

Let’s take a simple neural network using an analogy,

Let’s assume that we are performing image classification to identify and classify baby Yoda’s images.
Assume person A is given the task only to learn and identify about baby Yoda’s eyes, person B is given a task only to learn and identify about baby Yoda’s ears, person C to identify baby Yoda’s mouth, person D to identify baby Yoda’s hands, person E to identify baby Yoda’s feet.

Now I have set of people who have specialized in identifying certain features. Say I provided them an image to identify baby Yoda. These people analyze the image and provide certain scores based on their knowledge and pass the scores to F and G who will later come with an equation based on these scores and come to person H who will later tell them how close their prediction was to the actual image. Based on the feedback everyone will learn better each feature and adjust the scores until they can correctly predict the output through multiple trials and errors.

The neural network consists of three main layers of neurons:

              • Input layer
              • Hidden layer(s)
              • Output layer

Computer systems only understands numbers. Therefore, in order for neural networks process images their pixel values are passed into the network. Let’s take an image of size 28x28. We will have 784 pixel values. All these pixel values will be passed to the input layer as features. The hidden layers of neurons will be connected with their previous layer neurons through links with their own weights and biases. Each neuron will perform some mathematical computation and hold a number which will decide whether to activate this neuron or not. This mathematical computation is known as activation function.

A single neuron

From above image we can see that each neuron in hidden layers will have linear expression with weights and biases of previous layer neuron links. The weights are the scores how close the input feature is to the output and the bias tell us about how high the weighted sum needed to be before the neuron starts get activated. The activation function (ex: sigmoid) will squish this linear weighted sum into a value in the range of 0 and 1. With this value is greater than a threshold value like 0.5 the neuron will be said to be activated or otherwise be deactivated. Since the neurons of each layer are interconnected activation of neurons in each layer determines the activation of neurons in the next layer. The output layer contains neurons that are based on your required outputs. Each neuron holds a probability of how the system think that the given image corresponds to the actual image.

In reality it’s not going to be the same image the system is going to classify or identify it’s going to vary in its pixel values. Therefore, our system needs to be smart enough to identify them correctly. But how do they actually learn?

The total process of passing the pixels into the input layer, perform computations in the hidden layers, predict the output is known as forward propagation. At the output the system learns the error (predicted value-expected value). This error may have positive or negative sign based on their influence on the output. In order to minimize the error, the system goes through training where the error is sent back with the input as feedback. This process is called backward propagation. Neural networks learn through backward propagation. Based on this feedback the weights are adjusted until the system nearly correctly predict the output. How do they tweak these weight values? The beauty of mathematics to the save. “Derivatives”.

That’s all forks.

Let’s dive more into this quest in future. Leave your insights in the comment section below.

May the force be with you!✨

Post a Comment