Skip to main content

What is Artificial Neural Network (Perceptron Model) ?

Updated 3 min readMarkdown
Part of seriesNeural Network
What is Artificial Neural Network (Perceptron Model) ?

To understand the topic, let us first understand what is Artificial Neuron. In school days we all have read about biological Neuron. It is a fundamental building block of our nervous system. This biological Neuron provides inspiration for Artificial Neural Networks (ANNs).

Biological (Single Building Block) : Neuron
Artificial (Single Building Block) : Perceptron

Biological Neuron Artificial Perceptron
Dendrites Inputs
Synapses Weights
Cell Body Weighted Summation
Axon Output

By now you must be thinking what does a "Perceptron" do?

Perceptron's primary purpose is to learn patterns from input data and make predictions or classification decisions. It takes multiple inputs, assigns weights to them, adds a bias, and applies an activation function to produce an output.

Let us understand it in Mathematical terms, its all about school days Linear Equation:

\(y = mx + c\)

\(y = m_1x_1 + m_2x_2 + \cdots + m_nx_n + c\)

\(y = \sum_{i=1}^{n} m_i x_i + c\)

I have represented Linear Equation in three different format for the readers to understand the equation easily. Similarly below is the predicted output equation for Perceptron Model (Single Neuron).

\(z=\sum_{i=1}^{n}w_ix_i+b\)

\({\hat y=f(w_1x_1+w_2x_2+\cdots+w_nx_n+b)}\)

Component Meaning
\(x_1,x_2,\ldots,x_n\) Input features
\(w_1,w_2,\ldots,w_n\) Weights representing the importance of inputs
b Bias that shifts the decision boundary
f Activation function
\(\hat y\) Predicted output

So by now you know mathematically how output is predicted via a Perceptron Model (Single Neuron)


Let us solve an example to further understand how output is predicted using Perceptron Model.

Example: Email Spam Detection

Suppose we want to classify whether an email is spam or not. We assume that the perceptron receives three inputs:

\(x_1\): Does the email contain the word "Money"?

\(x_2\): Does the email contain a suspicious link?

\(x_3\): Is the sender unknown?

Assume the perceptron has learned these weights:

\(w1= 0.5, w2= 0.8, w3= 0.3, b= -1\)

For an email where all the three inputs are true x1, x2, x3 = 1 (True):

\(z=(0.5\times1)+(0.8\times1)+(0.3\times1)-1\)

\(z=0.6\)

Applying the step activation function( 1 or 0 means prediction can most likely be true or false based on z value) :

\(\hat{y} = \begin{cases} 1, & \text{if } z \geq 0 \\ 0, & \text{if } z < 0 \end{cases}\)

Since z=0.6 hence the prediction is True (Spam most likely):

\({\hat y=1}\) (Spam)

Hence the perceptron predicted that the input email is a Spam.

After going through the mathematical example, you might be having two questions in your mind:

  1. What exactly is a bias?
  2. What is the meaning of assumption that perceptron has learned weights?

For now lets assume that Bias is important because it allows the perceptron to make predictions more flexibly, rather than depending only on the weighted inputs. I will cover these two questions in my next blog.


If you've made it this far, thank you so much for reading! 😊 If you found this article helpful, please consider bookmarking my blog. Your support would mean a lot and motivate me to keep sharing more! 🚀

No comments yet. Be the first to comment.

Neural Network

Part 1 of 2

This series focuses on building a clear, intuitive understanding of the fundamental concepts behind Neural Networks.

Up nextWhat exactly is 'bias' in a Perceptron model?Lets learn 'bias' with real world example

More from this blog