Module 4 artificial neural network
Module 4 artificial neural network
1. The human nervous system helps us sense the world — we can see, hear, smell, and understand our
surroundings because of it.
2. It allows us to perceive who we are, what we are doing, and where we are.
3. It also helps us to remember, recognize, and connect things around us — this process is called learning.
4. The system is made up of functional units called nerve cells, commonly known as neurons.
o The brain
Types of Neurons
o Sensory Neurons
Collect information from different parts of the body (like skin, eyes, ears, etc.)
Send that information to the CNS
o Motor Neurons
Receive commands from the CNS or other neurons
Send signals to muscles or body parts to take action
o Interneurons
Found only in the CNS
Connect one neuron to another neuron
Help in processing and relaying information within the CNS
Function of a Neuron
o To receive information
▪ Another neuron
1. A biological neuron is the basic unit of the nervous system that processes and transmits information.
o Dendrites
o Axon
o Synapse
4. Dendrites
5. Axon
o The axon carries the processed signal from the soma to other neurons.
6. Synapse
7. A neuron gets fired when the total input it receives crosses a certain threshold value.
8. Once fired, it transmits signals to the next neuron through the synapse.
10. These spikes carry the message from one neuron to another.
11. A single neuron can receive input from one or many other neurons.
13. The neural network processes the input information and gives an output response — this is how learning and
decisions happen in the brain.
o Inputs
1. The first mathematical model of a biological neuron was proposed by McCulloch & Pitts in 1943.
2. This model mimics how a biological neuron works using a simple two-step process.
Two Key Steps in the Model
o If the sum exceeds a certain threshold, the neuron gets fired (produces output).
o x1,x2,...,xn
o w1,w2,...,wn
o Net-sum=∑xi⋅wi
1.AND Function:
o Example:
▪ Input: 1, 1 → Output: 1
▪ Input: 1, 0 → Output: 0
2.OR Function:
o Example:
▪ Input: 1, 0 → Output: 1
▪ Input: 0, 0 → Output: 0
3.The weights and threshold values in this model are fixed and not learnable.
o It cannot represent complex functions like XOR, which require learning or more layers.
1. An Artificial Neural Network (ANN) is a model that imitates the human brain.
2. It is designed to simulate human intelligence, especially the learning and decision-making process.
Structure of ANN
3. An ANN is represented as a directed graph:
4. The connections (edges) are called connection links and carry signals between neurons.
Layers in an ANN
6. Each connection between neurons in different layers has a synaptic weight (also called connection weight).
7. The input layer receives the input signals and passes them to the hidden layer neurons.
o Compute the weighted sum of inputs: ∑(xi⋅wi)+bias\sum (x_i \cdot w_i) + \text{bias}∑(xi⋅wi)+bias
9. If the weighted sum exceeds the threshold, the neuron fires and passes the output forward.
Final Output
11. The output layer neuron gives the final result of the network based on all the processing done in previous
layers.
What an activation function is
An activation function is a mathematical rule that each neuron in a neural network uses to convert its total input signal
into an output signal.
• They are mainly used in simple binary perceptrons for straightforward “yes/no” decisions.
• They introduce curves (non-linearity) into the mapping, enabling the network to model intricate relationships.
• They typically squash inputs into bounded ranges like (0, 1) or (–1, 1).
• They are essential when working with high-dimensional or complex data such as audio signals, video frames,
and images.
• Sigmoid (Logistic) Function: 𝑓(𝑥)=1/(1+e^(–x)), maps inputs smoothly into (0, 1).
• ReLU (Rectified Linear Unit): 𝑓(𝑥)=max(0, x), combines simplicity with fast training in deep networks.
Perceptron and Learning Theory (10.12) – Easy Explanation
• The Perceptron was the first neural network model, designed by Frank Rosenblatt in 1958.
• It is a linear binary classifier used in supervised learning, meaning it learns from labeled data.
• Rosenblatt modified the McCulloch & Pitts Neuron model by combining it with the Hebbian learning rule.
• He proposed that artificial neurons can learn the correct weights and thresholds from data on their own.
• He developed a learning algorithm that helps the model automatically adjust its weights during training.
1. Inputs from other neurons – The neuron receives a set of input values.
2. Weights and bias – Each input is multiplied by a weight, and a bias is added.
3. Net sum – The model calculates the weighted sum of all inputs + bias.
4. Activation function – It processes the net sum to produce the final output (usually 0 or 1).
• So, the model receives inputs x1,x2,...,xn with corresponding weights w1,w2,..., wn,
and a bias term is added.
Net sum=(w1⋅x1)+(w2⋅x2)+…+(wn⋅xn)+bias
• This total is then passed through an activation function to determine the output.
10.4.1 XOR Problem
• A Perceptron model can solve only those Boolean functions that are linearly separable.
• In 1969, Minsky and Papert pointed out a limitation in perceptrons using the XOR problem as an example.
Understanding XOR
0 0 0
0 1 1
1 0 1
1 1 0
• This function cannot be separated by a straight line, which means it is not linearly separable.
• The failure of the single-layer perceptron with XOR led to the development of the Multi-Layer Perceptron
(MLP).
• Initially, MLPs were not successful due to the absence of a proper learning algorithm.
Introduction of Backpropagation
• In 1986, Rumelhart and McClelland developed a general backpropagation algorithm for multi-layered
perceptrons.
• This algorithm allowed neural networks to learn from errors by adjusting weights layer by layer.
Modern Impact
• With backpropagation, Artificial Neural Networks (ANNs) and Deep Neural Networks (DNNs) started solving
complex, non-linear problems.
• The MLP model thus became a powerful tool, capable of handling non-linearly separable problems like XOR
and many others.
• Neural networks learn by adjusting their weights to reduce the error between:
• It is a supervised learning method where weights are updated based on the error (delta).
• The goal is to minimize the cost function, which measures how far the network's output is from the desired
output.
• The cost (or error) function shows how well the model is performing.
Training Error=1/2∑d∈T(Od−O^d)2
Where:
• T = Training dataset
• Works by moving in the negative direction of the gradient (slope) of the cost function.
Connection to Backpropagation
• Backpropagation uses delta learning + gradient descent to train Multi-Layer Perceptrons (MLPs).
• Artificial Neural Networks (ANNs) are made up of many neurons arranged in layers.
o Network structure
o Activation function used
• Neurons are arranged in layers, and data flows only in the forward direction (no loops).
Key Features:
• Simple to design
• Easy to maintain
• Fast in execution
Applications:
Fully connected neural networks are the ones in which all the neurons in a layer are connected to all other neurons in
the next layer.
Key Features:
• Fully connected: Every neuron in one layer connects to all neurons in the next layer.
o Forward direction: Inputs are multiplied by weights → sent to activation function → output goes to
next layer.
o Backward direction: If output is wrong, error is backpropagated to adjust weights and biases.
Learning Process:
• The network learns from training data by adjusting weights and biases using the backpropagation algorithm.
Applications:
• Useful for:
o Complex classification
o Speech recognition
o Medical diagnosis
o Forecasting
Limitations:
The output signals can be sent back to the neurons in the same layer or to the neurons in the preceding layers.
Key Feature:
Advantages of ANN
o Can learn and recognize complex patterns just like how humans solve problems.
o Scales well with large datasets and often performs better than other learning models.
Limitations of ANN
o Needs processors with parallel processing capability, especially when training for many epochs.
o Each node and layer needs good CPU/GPU performance, which is tough for very large networks.
3. Complicated to Develop
5. Computationally Expensive
o Needs more memory, processing power, and time than traditional learning techniques.
1. Training is Difficult
o Training a neural network is one of the most challenging tasks in ANN development.
2. Overfitting or Underfitting
o If the training dataset is not proper, the model may:
▪ Overfit (learn too much from training data and fail on new data)
o Models trained on simulated or limited data may not work well on real-world applications.
o ANNs need a lot of data to become robust and reliable, especially for real-time applications.