When people hear Artificial Intelligence, they often imagine something incredibly complicated.
A chatbot answering questions.
A computer recognizing faces.
An AI generating images.
A self-driving system identifying objects on a road.
A language model predicting the next word in a sentence.
Underneath many of these systems is a powerful computational idea:
Neural networks are mathematical models inspired loosely by the way biological nervous systems process information.
But don't let the biological analogy confuse you.
A modern neural network is fundamentally a mathematical computation made from parameters, functions, and layers.
The basic building blocks are:
Neuron
↓
Weights
↓
Bias
↓
Activation Function
↓
Layer
↓
Neural Network
Once you understand these components, concepts such as Deep Learning, Transformers, Computer Vision, and Large Language Models become much easier to understand.
Let's build the idea from the ground up.
A neural network is a mathematical model composed of interconnected computational units—often called neurons—organized into layers.
A very simple neural network might look like:
Input Layer
↓
Hidden Layer
↓
Output Layer
A larger network could look like:
Input
↓
Layer 1
↓
Layer 2
↓
Layer 3
↓
Layer 4
↓
Output
Each layer transforms the information it receives.
Traditional programming generally looks like:
Rules + Data
↓
Program
↓
Output
For example, imagine writing a program to identify spam emails.
You might manually create rules:
IF email contains "FREE MONEY"
spam
IF email contains suspicious links
spam
But real-world data is messy.
Spam can be written in countless ways.
Instead of manually defining every rule, Machine Learning allows a model to learn useful patterns from examples.
Training Data
↓
Neural Network
↓
Learned Parameters
↓
Predictions
Let's start with a single neuron.
x₁ ── w₁ ──┐
│
x₂ ── w₂ ──┤
├──→ Neuron → Output
x₃ ── w₃ ──┤
│
b
The neuron receives inputs.
Each input has an associated weight.
The neuron combines them, adds a bias, and applies an activation function.
Mathematically:
z = w₁x₁ + w₂x₂ + w₃x₃ + b
Then:
a = f(z)
where f is the activation function.
An artificial neuron is a mathematical function that receives inputs and produces an output.
The basic process is:
Inputs
↓
Multiply by weights
↓
Add values
↓
Add bias
↓
Activation function
↓
Output
A neuron isn't intelligent by itself.
Its power comes from combining huge numbers of these computations.
Inputs represent the information given to the network.
Suppose we want to predict whether someone will purchase a product.
Our inputs might be:
x₁ = Age
x₂ = Income
x₃ = Time spent on website
x₄ = Previous purchases
These values are passed into the network.
Each input has a corresponding weight.
For example:
Age → w₁
Income → w₂
Website Time → w₃
Previous Orders → w₄
Weights determine how strongly different inputs influence the neuron's calculation.
For example:
Income → large positive weight
could mean income has a strong positive influence on the neuron's output in the learned model.
But remember:
The meaning of an individual weight depends on the architecture, data representation, and surrounding network.
Weights are learned parameters.
The programmer doesn't normally specify the perfect values manually.
During training:
Initial Weights
↓
Prediction
↓
Loss
↓
Backpropagation
↓
Gradient
↓
Updated Weights
This process repeats many times.
Bias is another trainable parameter.
A simplified neuron calculates:
z = wx + b
Without the bias, the neuron has less flexibility.
Bias allows the activation function to shift.
You can think of it as an adjustable offset.
For example:
z = wx + b
Changing b changes where the activation begins responding strongly.
Let's say:
x₁ = 2
x₂ = 4
and:
w₁ = 0.5
w₂ = 0.8
with:
b = 1
Then:
z = (2 × 0.5) + (4 × 0.8) + 1
Therefore:
z = 1 + 3.2 + 1
z = 5.2
The neuron then passes 5.2 through an activation function.
Why do we need an activation function?
Because without appropriate non-linear transformations, stacking multiple linear layers would still produce an overall linear transformation.
Activation functions introduce non-linearity.
Common activation functions include:
ReLU stands for:
Rectified Linear Unit
Its formula is:
f(x) = max(0, x)
So:
x = -5 → 0
x = -1 → 0
x = 0 → 0
x = 2 → 2
x = 7 → 7
ReLU became one of the most important activation functions in Deep Learning.
The sigmoid function maps values approximately into the range:
0 → 1
Its mathematical form is:
σ(x) = 1 / (1 + e⁻ˣ)
For example:
Large negative → close to 0
0 → 0.5
Large positive → close to 1
Sigmoid is historically important and remains useful in specific situations, particularly when an output needs to represent a probability-like value for binary classification.
Tanh maps values approximately into:
-1 → +1
It is defined as:
tanh(x)
It was widely used in older neural-network architectures and remains relevant in certain settings.
GELU stands for:
Gaussian Error Linear Unit
GELU is commonly used in modern Transformer architectures.
It provides a smooth non-linear transformation and has become an important activation function in modern Deep Learning.
Softmax is commonly used to convert a vector of logits into values that sum to 1.
For example:
Cat → 0.70
Dog → 0.20
Horse → 0.10
The values can be interpreted as a probability distribution over classes under the model's classification setup.
Suppose we have:
x = 3
w = 2
b = 1
Then:
z = wx + b
Therefore:
z = (2 × 3) + 1
z = 7
If we use ReLU:
ReLU(7) = 7
The neuron outputs:
7
One neuron isn't enough for most interesting tasks.
So we create multiple neurons.
┌→ Neuron 1 →┐
Input ────┼→ Neuron 2 →┼→ Next Layer
├→ Neuron 3 →┤
└→ Neuron 4 →┘
Each neuron can have its own:
This allows different neurons to learn different transformations.
A layer is a collection of neurons operating together.
For example:
Input
↓
[Neuron 1]
[Neuron 2]
[Neuron 3]
[Neuron 4]
↓
Next Layer
A neural network typically contains:
Input Layer
↓
Hidden Layers
↓
Output Layer
The input layer receives the features.
For an image:
Pixel 1
Pixel 2
Pixel 3
...
Pixel N
For a text model, the raw text is first transformed into tokens and then into numerical representations before being processed by the network.
For a house-price model:
Area
Bedrooms
Location Features
Age
...
Layers between the input and output are called hidden layers.
For example:
Input
↓
Hidden Layer 1
↓
Hidden Layer 2
↓
Hidden Layer 3
↓
Output
The word "hidden" simply means these internal representations aren't directly the input or final output.
The output layer produces the model's final output.
For binary classification:
Probability = 0.87
For multi-class classification:
Cat = 0.80
Dog = 0.15
Horse = 0.05
For regression:
Predicted House Price = ₹72 lakh
The output structure depends on the task.
When information travels from the input toward the output, this is called forward propagation or the forward pass.
Input
↓
Layer 1
↓
Layer 2
↓
Layer 3
↓
Output
Every layer transforms the representation.
For a layer, the computation can be represented compactly as:
z = Wx + b
Then:
a = f(z)
where:
x = input vectorW = weight matrixb = bias vectorf = activation functiona = output activationThis simple equation is repeated across layers.
Conceptually:
a₁ = f(W₁x + b₁)
a₂ = f(W₂a₁ + b₂)
a₃ = f(W₃a₂ + b₃)
Finally:
Output = g(W₄a₃ + b₄)
This is the mathematical structure behind a basic feed-forward neural network.
Now comes the learning process.
Suppose the network predicts:
Dog = 0.90
But the actual answer is:
Cat
The prediction is poor.
The model calculates a loss.
Then:
Loss
↓
Backpropagation
↓
Gradients
↓
Optimizer
↓
Parameter Updates
This was the subject of our previous article.
The loss function tells us how poorly the model performed.
For classification, cross-entropy is commonly used.
For regression, Mean Squared Error is one possible choice:
MSE = (1/n) Σ(y - ŷ)²
The specific loss function depends on the problem.
Backpropagation calculates how the loss changes with respect to the network's parameters.
Conceptually:
Forward:
Input
↓
Hidden
↓
Output
↓
Loss
Backward:
Loss
↓
Output
↓
Hidden
↓
Input-side parameters
This gives us gradients.
The optimizer uses those gradients to update parameters.
For a weight:
w_new = w_old - η(∂L/∂w)
where:
w = weightL = lossη = learning rateThis process repeats across many training examples and batches.
The complete picture is:
Data
↓
Neural Network
↓
Forward Pass
↓
Prediction
↓
Loss Function
↓
Backpropagation
↓
Gradients
↓
Optimizer
↓
Updated Parameters
↓
Repeat
This is the core training loop.
Suppose we're building an email spam classifier.
Input:
Email
Features or representations are processed through the network.
Output:
Spam → 0.94
Not Spam → 0.06
The model chooses or scores the classes based on its output.
Neural networks can also predict continuous numerical values.
For example:
Input:
House features
Output:
₹84,50,000
Unlike classification, the output isn't necessarily a class probability.
It can be a continuous value.
A single linear transformation has limited expressive power.
Consider:
y = wx + b
This describes a linear relationship.
Real-world patterns are often far more complicated.
By combining layers with non-linear activations, neural networks can represent complex functions.
For example:
Input
↓
Linear Transformation
↓
Non-Linearity
↓
Linear Transformation
↓
Non-Linearity
↓
Output
Stacking these transformations gives the network much greater expressive power.
So what makes a neural network deep?
Generally, a neural network with multiple layers of learned representations is called a Deep Neural Network (DNN).
Conceptually:
Input
↓
Layer 1
↓
Layer 2
↓
Layer 3
↓
Layer 4
↓
Layer 5
↓
Output
The term "deep" refers primarily to the depth of the computational architecture.
This is one of the most powerful ideas in Deep Learning.
Imagine an image model.
Early layers might learn useful low-level patterns such as:
Edges
Later layers can combine these into:
Shapes
Then:
Parts
Then:
Objects
This is a simplified conceptual picture rather than a universal rule for every architecture, but it illustrates hierarchical representation learning.
Consider:
Layer 1:
y = W₁x + b₁
Layer 2:
z = W₂y + b₂
Without non-linear activations, these linear transformations can be combined into another linear transformation.
So simply stacking linear layers doesn't provide the expressive power we want.
With:
y = f(W₁x + b₁)
and:
z = g(W₂y + b₂)
the network can represent much more complex functions.
This distinction is extremely important.
Learned during training.
Examples:
Usually chosen by the practitioner or training system.
Examples:
So:
Parameters → Learned
Hyperparameters → Configured
An epoch generally represents one complete pass through the training dataset.
Suppose:
Dataset = 10,000 examples
Batch Size = 100
Then approximately:
100 batches = 1 epoch
If we train for:
20 epochs
the model processes the dataset approximately 20 times.
A batch is a subset of training examples processed together.
For example:
Dataset:
1,000,000 examples
Batch:
32 examples
The network processes a batch, calculates gradients, and updates its parameters.
Then it processes another batch.
A neural network can become very good at fitting its training data while performing poorly on unseen data.
For example:
Training Accuracy = 99%
Validation Accuracy = 72%
This may indicate overfitting.
The goal isn't simply:
Memorize training examples.
The goal is:
Learn patterns that generalize to unseen examples.
Various techniques can help control overfitting.
Examples include:
Regularization introduces constraints or changes to training that can improve generalization.
Dropout randomly disables some activations during training.
Conceptually:
Neuron → Active
Neuron → Disabled
Neuron → Active
Neuron → Disabled
Neuron → Active
This encourages the network not to rely too heavily on specific pathways.
Dropout is mainly a training-time technique.
Weight decay penalizes large parameter values as part of the training objective or update mechanism, depending on the optimizer implementation.
Conceptually:
Prediction Loss
+
Parameter Penalty
↓
Total Objective
This can help control model complexity.
The biological inspiration is useful for intuition.
But modern neural networks are not literal digital copies of biological brains.
A neural network consists of mathematical operations implemented using computers.
The "neuron" analogy is a conceptual starting point.
Now let's zoom out.
A single neuron:
Inputs
↓
Weights
↓
Bias
↓
Activation
↓
Output
Many neurons:
Layer
Many layers:
Neural Network
Specialized architectures:
CNN
Transformer
RNN
Vision Transformer
...
Large-scale systems:
Foundation Models
Large Language Models
Multimodal Models
The building blocks become increasingly sophisticated.
Convolutional Neural Networks, or CNNs, became extremely important in computer vision.
They are particularly designed to exploit spatial structure in images.
A simplified pipeline might look like:
Image
↓
Convolution
↓
Feature Maps
↓
Pooling / Downsampling
↓
More Layers
↓
Classification
Modern computer vision also makes extensive use of Transformer-based architectures.
Language models use neural networks to process sequences of tokens.
Modern large language models are commonly based on the Transformer architecture.
A simplified view:
Text
↓
Tokenization
↓
Embeddings
↓
Transformer Layers
↓
Output Probabilities
During training:
Prediction
↓
Loss
↓
Backpropagation
↓
Gradient
↓
Parameter Update
A Large Language Model can contain an enormous number of learned parameters.
A simplified conceptual architecture is:
Tokens
↓
Embeddings
↓
Transformer Block
↓
Transformer Block
↓
Transformer Block
↓
...
↓
Output Layer
↓
Next-Token Probabilities
The model doesn't store a traditional database of every possible response.
Instead, training adjusts parameters so the network learns statistical and representational patterns from its training objective and data.
It learns parameter values.
Those parameters allow the network to transform inputs into useful outputs.
During training:
Random / Initial Parameters
↓
Optimization
↓
Better Parameters
↓
Better Predictions
The word "learn" describes this optimization process.
A neuron doesn't necessarily correspond cleanly to something like:
"This neuron = cats"
Representations in neural networks can be distributed and highly context-dependent.
More depth can increase representational capacity, but it can also make training and computation more difficult.
Architecture matters.
Typically, weights are learned through optimization during training.
The model updates parameters.
Forward
→ Loss
→ Backward
→ Update
The model typically uses fixed parameters to generate predictions.
Input
↓
Forward Pass
↓
Output
Neural networks process numerical representations through learned mathematical transformations.
Human cognition and neural-network computation are fundamentally different phenomena.
A neural network is a parameterized computational model made of interconnected layers that transform input data into outputs.
A neuron is a mathematical unit that combines inputs using weights and a bias and typically applies an activation function.
Weights are learned parameters that determine how strongly inputs influence computations.
A bias is a learned parameter that provides an adjustable offset in a neuron's computation.
They introduce non-linearity, allowing networks to model complex functions rather than simply collapsing into one overall linear transformation.
A hidden layer is an intermediate layer between the input and output layers.
Deep Learning generally refers to Machine Learning based on neural networks with multiple layers of learned representations.
It typically makes predictions, calculates a loss, computes gradients through backpropagation, and updates parameters using an optimizer.
They are loosely inspired by biological neural systems, but modern artificial neural networks are mathematical models and are not literal brain simulations.
Yes. Modern Large Language Models use neural-network architectures, particularly Transformer-based architectures.
A neural network may look incredibly complicated when you see millions or billions of parameters.
But the fundamental idea starts with something surprisingly small:
Input
↓
Weight
↓
Bias
↓
Activation
↓
Output
Then we repeat that idea:
One neuron
↓
Many neurons
↓
One layer
↓
Many layers
↓
Deep Neural Network
↓
Specialized architecture
↓
Modern AI
And the learning process we discussed in the previous two articles completes the picture:
Neural Network
↓
Forward Pass
↓
Prediction
↓
Loss
↓
Backpropagation
↓
Gradients
↓
Optimizer
↓
Updated Parameters
↓
Repeat
This simple loop, scaled to enormous datasets and architectures, sits at the foundation of much of modern AI.
But there is one major question left.
We've learned what neurons, weights, biases, layers, and activations are.
Now we need to understand something even more fundamental:
How does a neural network turn raw numbers into meaningful features?
That takes us directly into one of the most important ideas in modern Machine Learning:
Pixels to Perfection Design that Impresses