Neural Networks

Processing an image is not something easy to do. It requires artificial intelligence to be able to detect patterns in that image from which it can generate one or several predictions of objects that could be the ones shown in the image.

This type of algorithm can be done in several ways. One of them uses deep neural networks that currently require a little time to sit down to build the architecture and program this network. The specific name for the type of network that will be used is Convolutional Neural Networks, which is the algorithm that most closely resembles the neurons in the human visual cortex. In these algorithms, the system must always be trained with a set of accurate data and a false one, that is, many photos with the object we want to recognize and another bunch of grouped photos without the object we want to recognize.

A network comprises several individual elements (the basic unit) called a perceptron or what would be equivalent to a neuron in our brain. It is composed of 3 main parts:

1. Inputs

2. Addition function (Σ)

3. Activation function

Wikimedia Commons

Inputs

These inputs are represented in the previous image as x1, x2, x3,….Xn. Later they will be multiplied by a weight w with a random value at the beginning.

Sum function (Σ)

This function performs the sum of all the inputs multiplied by their respective weight w. At the end of the operation, it sends the result to the activation function.

Activation Function

This function is similar to a key that allows water to pass or closes its passage. It works as a threshold. If the value of the result exceeds a specific number, which is usually 0, the output of the neuron will be activated.

Now that we know the basic unit of a neural network (perceptron), we will now analyze how a neural network operates. To illustrate, we will use the following image:

Tibco.com

A neural network is mainly composed of 3 layers:

· input layer

· hidden layer

· output layer

Input Layer

This layer receives all the inputs. There can be an indefinite number of neurons.

Hidden Layer

It receives the output of each neuron that exists in the first layer, performs the same process on each perceptron, and delivers its output to the output layer.

Output Layer

This is the classification layer. Here is the number of neurons equal to the classifiers we need. If we want to know if it is a cat or a dog, we will need two neurons, one for cats and the other for dogs.

All this is very cool, but there is a question that we must ask ourselves… What is learning, and where does it really happen? The learning process is how a neural network modifies its weights W in response to input information. The changes that occur during the learning stage are reduced to destruction, that is, the weight of the connection takes the value 0 (remember that initially, they had a random value), modification and creation (the weight of the connection takes a different value of 0) of connections between neurons. This learning occurs in each perceptron.

An important aspect is to determine the criteria of the learning rule; that is, how the weights are going to be modified. In general, we can consider two types of rules:

· supervised learning

· unsupervised learning

The difference between both types lies in existence or not of an external agent that controls the entire process. One of the simplest ways is calculating the error, that is, the difference between the value of the output that we expect and the one that we actually get.

Leave a comment