MakeAI Logo

What is a Neural Network and How Does It Work?

Neural Network

Like in a human, a neuron is the basic element of any deep learning AI, think Chat-GPT, Dalle, or our own Number Recognizer. Each of these neurons contains a specific value, allowing it to have some meaning to our model.

Neuron Sketch

When we predict something with our model we assign the neurons in the first layer of our neural network with the values of our input. For example, if we have an image of a dog, the RGB values are what we assign to the first layer.

Dog example

Now to move to our next layer we have to somehow change our values in a way that creates something new. We do this by “connecting” each neuron with all the neurons in the next layer. By having each connection be a unique function we can create new content in each layer.

Moreover, if we manipulate these connections based on how good our model is, we can create better predictions. This part is complicated but we basically find out how wrong our model is, then we find the best ways to correct each connection to get a better prediction. This is why a large and varied data set is needed for a good model. You can test this yourself with our new Builder tool. If you play around with it you will see the more data you give it the better it will be at predicting your drawings.

Neural network diagram

Input and Output Layers:

How do we classify the layers of our model? Well, the first layer is called the input layer, because it takes in our input. As an extension of that, we call the last layer the output layer. You have to be careful to make sure your input and outputs mirror the shape of the data you're giving them. Otherwise, there will be an error, our Builder automatically takes care of this for you.

Hidden Layers:

The layers in the middle are called hidden layers, these can be further subdivided into many categories. The notable ones are Dense, Convolutional, and RNNs. Our Builder does not provide the last as an option, they are quite complicated and won't produce better results.

Dense Layers:

Dense layers are the most simple, they consist of a row of nodes. Each node stores a value and passes this value into a function, this function contains two additional variables, weight and bias, which change as the model learns. The output of this function is then passed on to the next layer.

Convolutional Layers:

Convolutional layers are a bit more complex. Mostly used for computer vision, each node is a multi-dimensional array of values, like an image. This allows the model to see patterns in an image. By scanning kernels, or a section of the image, it can find recurring themes and pass that information on. These layers greatly improve the accuracy of any model dealing with multi-dimensional data like images.

Recurrent Layers:

Third, RNN is an abbreviation of Recurrent Neural Network, these types store the previous input and then refer back to it in the next prediction. This allows them to have memory. Using this memory they can simulate conversations based on previous input. This allows the model to see patterns over time, like with audio.

Thank you if you made it this far, we hope you learned something interesting. Please feel free to comment or ask questions on our subreddit, r/MakeAI.