Different Brains for Different Jobs
Just like we use different parts of our brain for different tasks — talking, seeing, remembering — AI also has different types of brains called neural networks.
Each one is good at a specific kind of work!
Artificial Neural Network (ANN) — The basic neural network
ANN is the simplest form of neural network.
It is the foundation. CNN and RNN are advanced versions of ANN.
Structure
Input Layer
Hidden Layer(s)
Output Layer
Working
Data moves only forward
Input → Hidden → Output
No memory
Each input is treated independently
ANN works like a smart calculator.
Give inputs → it processes → gives output.
Example
Predict student result
Inputs:
Attendance
Marks
Output:
Pass / Fail
When to use ANN
Use ANN when your data is:
Pure numbers
Tabular (Excel-like)
Examples:
Marks prediction
Salary estimation
Loan approval
Key points
✔ Used for numeric/tabular data
✔ No memory
✔ Simple prediction & classification
✔ Base model of neural networks
Advantages of ANN
Simple to understand
Easy to implement
Works well for numeric data
Fast for small problems
Disadvantages of ANN
Cannot understand images
No memory of past data
Cannot handle sequences
Convolutional Neural Network (CNN) — Neural Network for Images
What is CNN?
CNN is ANN specially designed for images.
It adds special layers:
Convolution layer (extracts features)
Pooling layer (reduces size)
Fully connected layer (decision)
CNN learns:
edges → shapes → objects
Step 1- Convolution Layer — “Finding Features”
Imagine you are looking at a photo of a cat.
What do you see first?
Edges
Lines
Corners
CNN also looks at small parts of the image and tries to detect edges and patterns.
The image is made of pixels.
CNN uses small filters (like tiny windows).
These filters slide over the image.
They detect simple patterns like:
Vertical edges
Horizontal edges
Corners
So:
First layer learns → edges
Next layers learn → shapes
Final layers learn → full object
Convolution layer acts like an eye that scans small parts of the image.
Step 2-Pooling Layer — “Reducing Size”
After finding edges, we don’t need every small detail.
Imagine you have a very clear photo of a cat (lots of pixels).
Now you reduce the image quality — fewer pixels — but you can STILL tell it’s a cat.
That is exactly what pooling does.
Pooling:
Reduces number of pixels
Removes small details
Keeps main features (ears, eyes, face shape)
So:
Big detailed image → smaller simpler image
but
object is still recognizable.
CNN doesn’t need every tiny pixel.
It only needs important parts to decide “this is a cat”.
That shrinking step = Pooling Layer.
Just like we can recognize a cat even in a low-resolution photo, CNN uses pooling to reduce image size while keeping important features.
Pooling is like lowering image quality — smaller size, same meaning.
Step3- Fully Connected Layer — “Final Decision”
After CNN finds edges and shapes, the fully connected layer combines all this information and decides what the object is.
Fully connected layer is the decision-maker of CNN.
It works like ANN — it takes all extracted features and gives the final output (cat / dog / etc.).
So in short,
Convolution finds features, pooling reduces size, fully connected decides the class.
Advantages of CNN
Understands pixels & spatial patterns
Automatically extracts features
Very accurate for images
Needs less preprocessing
Disadvantages of CNN
Needs large datasets
Computationally heavy
Not suitable for sequences
Training takes time
Recurrent Neural Network (RNN) — Neural Network with Memory
Traditional neural network(ANN) is as shown in 1st fig , 2nd and 3rd is of RNN
It clearly shows:
Traditional Neural Network
RNN (with loop)
RNN Unfolded (across time)
Part (a) Traditional Neural Network
This is a normal neural network (ANN).
It takes input → processes → gives output.
Then it forgets everything.
Example:
If input = “I”
It gives output.
But when “am” comes, it does NOT remember “I”.
Each input is independent.
Part (b) RNN (with loop)
Here we add a loop in the hidden layer.
That loop means:
The hidden layer sends information to itself for the next step.
This loop represents memory.
So when “am” comes,
RNN still remembers “I”.
Part (c) RNN Unfolded
Now point to the third diagram.
This is the same RNN, but shown step-by-step over time.
Sentence:
I → am → very → happy
At each time step:
Time 0
Input₀ = “I”
Hidden state stores “I”
Time 1
Input₁ = “am”
Hidden state now stores “I am”
Time 2
Input₂ = “very”
Hidden state stores “I am very”
Time 3
Output₃ = “happy”
RNN is a neural network that remembers previous inputs and uses them to make the current prediction.
In the diagram, Each black circle is the same network repeated at different time steps.
It shares the same weights, but processes different inputs sequentially.
It is used when order matters.
If I say:
“I am very ____”
Can you fill the blank?
They say: happy / tired / hungry
How did you guess?
Because you remembered:
“I”
“am”
“very”
So your brain used previous words.
ANN cannot do this.
RNN CAN.
How RNN works
RNN does this:
Previous input + Current input → Output
So every time:
It takes new data
PLUS old memory
This memory is called hidden state.
Step-by-step sentence example
Sentence:
I am very happy
RNN reads one word at a time:
Step 1:
Input = “I”
Memory now = “I”
Step 2:
Input = “am”
RNN uses:
“I” + “am”
Memory now = “I am”
Step 3:
Input = “very”
RNN uses:
“I am” + “very”
Memory now = “I am very”
Step 4:
Predict next word:
RNN says:
“happy”
Because it remembered everything before.
Key Difference
ANN:
Only current input
RNN:
Current input + past input
Summary table
Network
Uses past data?
ANN
No
CNN
No
RNN
Yes
RNN is a neural network that remembers previous inputs and uses them for current prediction. It is used for sequence and time-series data.
RNN is ANN with memory.
Why RNN exists?
Because ANN cannot handle:
❌ Sentences
❌ Speech
❌ Stock prices
❌ Weather data
Advantages of RNN
Has Memory
RNN remembers previous inputs.
So it can understand:
Sentences
Speech
Time-series data
Example:
“I am very ___”
RNN uses past words to predict the next word.
Handles Sequential Data
RNN works well when order matters.
Used for:
Language translation
Speech recognition
Stock price prediction
Weather forecasting
Same Network Used Repeatedly
RNN uses:
Same weights
Same structure
for every time step.
This makes it:
Efficient
Consistent in learning patterns.
Disadvantages of RNN
Cannot Remember Long Sequences Properly
RNN can remember recent information easily,
but it slowly forgets information from far in the past.
I grew up in Nagpur and now I live in ___
Nagpur.
Humans remember “Nagpur” even though it appeared early.
But basic RNN often cannot.
Why?
Because that information has to travel through many steps.
Best analogy
One student whispers a message to another,
that student whispers to next,
and so on…
After many students, the message becomes weak or wrong.
That’s exactly what happens in RNN.
Early information gets weaker at every step.
What is actually happening?
During training, RNN sends error backward through many steps.
At each step the error becomes smaller and smaller.
Finally, it becomes almost zero.
When error becomes almost zero:
network cannot learn from old data.
So RNN forgets.
Training is Slow
Because data is processed:
one step at a time.
No parallel processing like CNN.
3. Poor Performance on Very Long Data
For long sentences or long time-series:
Accuracy drops
Memory fades
