# Neural Networks are Easy and Here’s Why

This is the most dummy proof explanation of neural networks and how they work.

Andraz Krzisnik
Neural Networks are Easy and Here’s Why

Neural networks is a term for computer algorithms, which are a vague imitation of real neurons in biological brains. What separates these kinds of algorithms from other hard coded ones, is the capability of storing information by learning from examples. Such systems can improve their performance by learning from a larger dataset, from which it will recognize different patterns automatically, when they are faced with a previously not met example.

We can take image recognition as an example. Pictures are a specific form of data, which can be decostructed into numbers. These numbers are values, each pixel of the image holds in 3 or 4 different channels. These channels are for Red, Green, Blue colours (RGB) and in some cases Alpha (opacity). By taking different numbers into these channels, we can create a specific colour. Each image is formed by collection of pixels.

Now we can take these numbers and feed it into a neural network. Each picture will represent a separate example. When we’re training our neural network, our goal is to minimize the error. Error is a number that tells us how likely are the predictions, from our neural network, going to be false. So when we feed our images through, values called “Weights” inside the neural network, will change ever so slightly with each image declining the error until these weights reach a point where the changes become miniscule. That’s the time where we set a stop to our training.

This is basically how these algorithms work, if we put it in words. But fret not, a more detailed explaination with supporting mathematics behind it will be shown aswell.

## Say, what can we do with these things when they are fully trained?

In image recognition, as in the example set above, we can train our neural networks to classify certain images into different classes. For example we want to make it tell apart cats from dogs. So for our training dataset, we will need a set of different images of cats and dogs, each being labeled what it is, a cat or a dog.

So once we finish training, we can present it with an image of a cat or a dog, that it hasn’t seen before, and it will be able to distinguish with a fair amount of certainty, if it’s a cat or a dog. Neural networks won’t be able to tell with 100% certainty, which class our presented example belongs to, but it might get as close as to 95%, which is basically close enough.

## What are neural networks made of?

It’s comprised out of nodes that act as neurons and weights, which represent synapses. Synapses are connections between neurons. A neural network can have a certain depth, which we set by defining a number of layers it will have. In a fully connected neural network every neuron is connected to all neurons from a neighboring layer. However, they aren’t connected to other neurons in the same layer. Every neural network must have an input layer and an output layer. neural network: By Glosser.caOwn work, Derivative of File:Artificial neural network.svg, CC BY-SA 3.0, Link

Nodes or neurons in input layer will take raw data from our dataset of examples, it will learn from. Purpose of an output layer is to execute a certain action, for which our ANN is being learned for. For example, in image classification, our output layer will give us probabilities for each class, to which our presented image belongs to.

## How to train a Neural network?

For training an ANN we need to prepare a dataset of examples, which we feed it to our ANN.

### Now, what does that mean actually?

We will stick to supervised learning for now. This basically means, we need to provide raw input data and a label for each example. When we talked about image recognition before, our images represent raw input data and labels represent the answer our neural network needs to output. In essence, we provide the question and the answer.