What is a Neural Network?
Table of Contents + −
In the previous tutorial, we learned about Machine Learning and its three common approaches:
- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning
We also saw that Deep Learning is a type of Machine Learning that uses neural networks.
But what exactly is a neural network?
Let’s understand it from the beginning.
🤔 Why Do We Need Neural Networks?
Let’s take a simple example.
Suppose we want a computer to identify whether an image contains a cat.
An image may contain thousands or even millions of individual pieces of information called pixels.
A simple image might look like this:
The problem is that we don’t want to manually write rules for every possible cat.
For example:
IF ears are pointedAND eyes are hereAND nose looks like thisAND fur looks like thisTHEN catThis becomes extremely difficult.
Instead, we want the computer to learn useful patterns from examples.
Neural networks help us do this.
🕸️ What is a Neural Network?
A neural network is a machine-learning model made up of connected layers of small processing units called neurons.
It takes information as input, processes it through multiple layers, and produces an output.
A very simple neural network looks like this:
Don’t worry about the word neuron yet.
We’ll understand it step by step.
🕸️ What is a Neuron?
A neuron is a small mathematical unit inside a neural network.
It receives some inputs, processes them, and produces an output.
For example:
You can think of a neuron as a small decision-making unit.
It takes several values, performs a calculation, and passes the result to the next part of the network.
💡 A Simple Example
Suppose we want to predict whether a student will pass an exam.
We could provide information such as:
Hours studiedAttendancePrevious marksThese become inputs to the model.
The neural network learns how these inputs are related to the result.
🕸️ The Layers of a Neural Network
A neural network normally contains multiple layers.
The three basic types are:
- Input layer
- Hidden layers
- Output layer
Let’s look at them.
1. Input Layer
The input layer receives the information given to the model.
For our student example:
Input Layer
Hours studiedAttendancePrevious marksFor an image model, the input could be pixel values.
For a language model, the input will eventually be represented using tokens.
So the input depends on the problem we are solving.
🧱 2. Hidden Layers
After receiving the input, the information moves through one or more hidden layers.
These layers perform calculations and gradually learn useful patterns.
We call them “hidden” because they are inside the model and are not directly visible as inputs or outputs.
📌 3. Output Layer
The final layer produces the result.
For example:
For our student example:
For an image:
For a price prediction:
🧱 Putting the Layers Together
A simple neural network can be represented like this:
In a real neural network, there can be many more neurons and many more layers.
⚙️ How Does a Neural Network Learn?
This is the most important part.
Suppose we want to train a neural network to identify cats.
We provide many training examples:
The network initially doesn’t know what a cat looks like.
It makes predictions.
Maybe it sees a picture and predicts:
But suppose the correct answer is Cat.
The model needs to adjust itself.
It does this repeatedly during training.
After many examples and many adjustments, the model can become much better at making predictions.
📌 What Does the Network Actually Learn?
This is an interesting question.
Suppose we train a neural network to recognise faces.
The network doesn’t necessarily learn a simple rule like:
“This person has black hair.”
Instead, different parts of the network can learn different patterns.
For example, early layers may learn simple visual patterns:
EdgesLinesShapesLater layers may learn more complex patterns:
EyesNoseMouthEven later layers may combine these patterns:
FaceSo we can think of it as:
This becomes especially powerful when we have many layers.
🧱 What is Deep Learning?
Now we can understand the term Deep Learning.
A neural network with many layers can learn increasingly complex patterns.
This type of Machine Learning is called Deep Learning.
A simplified view:
Deep Learning became extremely important because it allowed computers to work much better with complex data such as:
- Images
- Audio
- Video
- Text
🤔 Why Did Deep Learning Become So Popular?
Deep Learning itself is not completely new.
What changed was the availability of:
More data
Companies started collecting huge amounts of digital data.
More computing power
Modern GPUs made it possible to perform large numbers of calculations much faster.
Better algorithms
Researchers developed better ways to train neural networks.
Together:
This helped produce major improvements in image recognition, speech recognition, language processing, and many other areas.
⚙️ Neural Networks and Images
Let’s look at an image example.
Imagine a picture of a cat.
The computer doesn’t see:
“This is a cat.”
It initially receives numerical information representing the image.
A simplified view is:
The neural network learns useful patterns from those numbers.
⚙️ Neural Networks and Language
Neural networks can also process language.
Suppose we give the model:
“The capital of India is…”
The system needs to process the words and understand their relationships.
Modern language models use much more sophisticated neural-network architectures to do this.
And this brings us to one of the most important developments in modern AI:
⚡ Transformers
You may have heard terms such as:
- ChatGPT
- Large Language Models
- GPT
- Gemini
- Claude
- Llama
Many modern language models are based on an architecture called the Transformer.
Before Transformers, other neural-network architectures were commonly used for language-related tasks.
Transformers changed the way models process relationships between words and pieces of text.
We’ll cover Transformers separately, so don’t worry about the details yet.
🧩 The Bigger Picture
At this point, our AI map looks like this:
This is the path that eventually leads us toward Generative AI and Large Language Models.
⚖️ Neural Network vs Human Brain
You may hear people say:
“Neural networks are based on the human brain.”
There is some inspiration from biological neurons, but we should not think that an artificial neural network works exactly like the human brain.
A biological neuron is a real cell.
An artificial neuron is essentially a mathematical calculation.
So it is better to think of neural networks as:
Mathematical models loosely inspired by the idea of connected neurons.
🧩 Key Points
Let’s summarise.
-
What is a Neural Network?
A neural network is a machine-learning model made up of connected processing units called neurons.
-
Basic structure
-
How does it learn?
-
What is Deep Learning?
Deep Learning is a type of Machine Learning that uses neural networks with multiple layers to learn complex patterns.
🧩 Where We Are Now
We have built the foundation:
Now we are ready to understand one of the biggest developments that made today’s Generative AI possible.
We’ll go one level deeper and understand how deep neural networks learn, what layers, weights, activation functions, loss, and backpropagation mean—still using simple examples before introducing the mathematics.