3rd Lecture

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Lecture 3

Perceptron 
Perceptron 

• Perceptron is a building block of an Artificial


Neural Network.
• Initially, in the mid of 19th century, Mr. Frank
Rosenblatt invented the Perceptron for
performing certain calculations to detect input
data capabilities or business intelligence.
• Perceptron is a linear Machine Learning
algorithm used for supervised learning for
various binary classifiers.
What is the Perceptron model in Machine Learning?

• Perceptron is also understood as an Artificial Neuron


or neural network unit that helps to detect certain
input data computations in business intelligence.
• Perceptron model is also treated as one of the best
and simplest types of Artificial Neural networks.
• However, it is a supervised learning algorithm of binary
classifiers.
• Hence, we can consider it as a single-layer neural
network with four main parameters, i.e., input values,
weights and Bias, net sum, and an activation function.
Binary classifier 

• Binary classifiers can be considered as linear


classifiers.
• In simple words, we can understand it as
a classification algorithm that can predict
linear predictor function in terms of weight
and feature vectors.
Basic Components of Perceptron
Input Nodes or Input Layer:
This is the primary component of Perceptron which accepts
the initial data into the system for further processing. Each
input node contains a real numerical value.

Wight and Bias:


Weight parameter represents the strength of the
connection between units. This is another most important
parameter of Perceptron components. Weight is directly
proportional to the strength of the associated input neuron
in deciding the output. Further, Bias can be considered as
the line of intercept in a linear equation.
Activation Function
The activation function determines the output of a perceptron based on the weighted
sum of inputs. Popular activation functions include the step function, sigmoid function,
and ReLU function. The activation function is crucial in determining the decision
boundary, which separates inputs into different classes.
Sigmoid Function

A popular activation function that produces


a smooth output between 0 and 1.

1 2 3

Step Function ReLU Function

A simple activation function that produces A powerful activation function that


output 1 if the input is greater than a overcomes limitations of other functions for
threshold, and 0 otherwise. deep neural networks.
Perceptron Learning Algorithm
The Perceptron learning algorithm is an iterative process of adjusting weights to improve the
accuracy of predicted outputs. The delta rule is used to update the weights based on the difference
between predicted and expected outputs. The perceptron learns by observing the correct
classification of training examples and iteratively adjusting its weights to improve accuracy.
Delta Rule

The difference between predicted and


expected outputs is used to update the
weights.

1 2 3

Iterative Weight Updates Examples

We iterate through training examples and The perceptron learns by observing correct
update weights based on errors in each classifications of training examples.
epoch.
How does Perceptron work?

• In Machine Learning, Perceptron is considered as a single-


layer neural network that consists of four main parameters
named input values (Input nodes), weights and Bias, net
sum, and an activation function.
• The perceptron model begins with the multiplication of all
input values and their weights, then adds these values
together to create the weighted sum.
• Then this weighted sum is applied to the activation
function 'f' to obtain the desired output.
• This activation function is also known as the step
function and is represented by 'f'.
• This step function or Activation function plays
a vital role in ensuring that output is mapped
between required values (0,1) or (-1,1).
• It is important to note that the weight of input
is indicative of the strength of a node.
• Similarly, an input's bias value gives the ability
to shift the activation function curve up or
down.
Perceptron model works in two important
steps as follows:
Step-1
In the first step first, multiply all input values with
corresponding weight values and then add them to
determine the weighted sum. Mathematically, we
can calculate the weighted sum as follows:
∑wi*xi = x1*w1 + x2*w2 +…wn*xn
Add a special term called bias 'b' to this weighted
sum to improve the model's performance.
∑wi*xi + b
Step 2
In the second step, an activation function is
applied with the above-mentioned weighted
sum, which gives us output either in binary form
or a continuous value as follows:
Y = f(∑wi*xi + b)
Types of Perceptron Models

• Single-layer Perceptron Model


• Multi-layer Perceptron model
Single Layer Perceptron Model:

• This is one of the easiest Artificial neural


networks (ANN) types.
• A single-layered perceptron model consists
feed-forward network and also includes a
threshold transfer function inside the model.
• The main objective of the single-layer
perceptron model is to analyze the linearly
separable objects with binary outcomes.
• In a single layer perceptron model, its
algorithms do not contain recorded data, so it
begins with inconstantly allocated input for
weight parameters.
• Further, it sums up all inputs (weight).
• After adding all inputs, if the total sum of all
inputs is more than a pre-determined value,
the model gets activated and shows the
output value as +1.
• If the outcome is same as pre-determined or
threshold value, then the performance of this
model is stated as satisfied, and weight
demand does not change.
Characteristics of Perceptron

• Perceptron is a machine learning algorithm for supervised


learning of binary classifiers.
• In Perceptron, the weight coefficient is automatically learned.
• Initially, weights are multiplied with input features, and the
decision is made whether the neuron is fired or not.
• The activation function applies a step rule to check whether
the weight function is greater than zero.
• The linear decision boundary is drawn, enabling the
distinction between the two linearly separable classes +1 and
-1.
• If the added sum of all input values is more than the threshold
value, it must have an output signal; otherwise, no output will
be shown.
Applications
Spam Detection: The perceptron model can be trained to classify emails as spam or non-spam
based on various features such as keywords, sender information, and email structure.

Sentiment Analysis: Given a text document or a sentence, the perceptron model can be used
to determine the sentiment expressed, such as positive, negative, or neutral. This is valuable
for applications like social media monitoring, customer feedback analysis, and review
classification.

Image Classification: The perceptron model can be applied to classify images into different
categories. For example, it can be used to distinguish between images of cats and dogs based
on features extracted from the images.

Fraud Detection: By training on historical transaction data, the perceptron model can learn to
detect fraudulent activities in real-time. It can flag suspicious transactions or identify patterns
indicative of fraudulent behavior.
Limitations of Perceptron Model

• The output of a perceptron can only be a


binary number (0 or 1) due to the hard limit
transfer function.
• Perceptron can only be used to classify the
linearly separable sets of input vectors. If
input vectors are non-linear, it is not easy to
classify them properly.
Conclusion

• In this class, you have learned how Perceptron models are the
simplest type of artificial neural network which carries input and
their weights, the sum of all weighted input, and an activation
function.
• Perceptron models are continuously contributing to Artificial
Intelligence and Machine Learning, and these models are
becoming more advanced.
• Perceptron enables the computer to work more efficiently on
complex problems using various Machine Learning technologies.
• The Perceptron's are the fundamentals of artificial neural
networks, and everyone should have in-depth knowledge of
perceptron models to study deep neural networks.

You might also like