Perceptron (Neural Networks)

Declared dead in 1957, today the basic building block of every deep learning model. In action here.

IntroductionUnderstanding the Neuron

Welcome! A perceptron is the simplest neural network - a single artificial neuron. It takes inputs (x₁, x₂), weighs them (w₁, w₂), adds a bias (b), and then decides: 1 or 0.

Classification Plane

Classification Plane: 1/4 Correctly Classified, Accuracy 25%. w₁=0.50, w₂=0.50, The Neuron bias=0.00.

○ Class 0 (○)● Class 1 (●) Decision Boundary

The Neuron

x₁x₂bw₁=0.50w₂=0.50Σσ0
  • w₁, w₂Weights weight each input. The larger the weight, the more that input sways the decision — together they set the tilt of the boundary line.
  • bThe bias shifts the boundary line. It decides how easily the neuron outputs a 1, independent of the inputs.
  • ΣΣ adds up all weighted inputs plus the bias: w₁·x₁ + w₂·x₂ + b. This single value (z) drives the decision.
  • σσ is the activation: if the sum z > 0 the neuron fires (1), otherwise it outputs 0. Here a hard step function.
Controls
Learning journey

Look at the neuron on the right: inputs flow in, get weighted and summed up.

Accuracy25%Correctly Classified1/4

What happens on the field

A single artificial neuron learns to separate two groups of points — just by moving a boundary. Here is what you see while it does.

What you see
A square field with points in two kinds: empty circles (○) and filled circles (●). A straight line runs across the field — the dividing line. It splits the field into two halves, one for each kind.
What happens
With every learning step the line tilts and shifts a little. When a point sits on the wrong side, the line turns toward it. Step by step the line moves into the position where both kinds are cleanly separated.
What you can do
Drag the line by its two handles with the mouse, or let the neuron learn on its own: step by step or automatically. A slider sets the pace, and you can switch between the tasks AND, OR and XOR.
What to watch for
This is how the simplest artificial neuron learns — not by thinking, but only by moving a single boundary. For XOR it never works: no straight line can separate those points.

Definition

What is a Perceptron?

Analogy

Imagine a bouncer at an exclusive club. He looks at a checklist with various criteria: Is the person on the guest list? Are they wearing appropriate clothing? Do they have an invitation?

Each criterion has a different importance (weight). The guest list might count more than the clothing. The bouncer adds up all the weighted points, and if the sum exceeds a certain threshold, he says 'YES, come in!' - otherwise 'NO, stay out!'. That's exactly how a perceptron works.

The perceptron is the simplest neural network - a single artificial neuron. It takes inputs, weighs them, sums them up, and then decides: Yes (1) or No (0).

The Weights (w₁, w₂)

Weights determine how important each input is. Positive weights strengthen, negative weights weaken the influence. The combination of weights determines the direction of the decision line.

The Bias (b)

The bias shifts the decision line. A positive bias makes it easier to output 1; a negative one makes it harder. It's like a 'default setting' for the neuron.

The Activation Function (σ)

The activation function makes the final decision: If the weighted sum is greater than 0, the neuron outputs 1 (fires). If it's less than or equal to 0, it outputs 0 (doesn't fire).

TheoryHistoryPseudo-CodeStep by StepFlow Diagram

The first artificial neuron

The perceptron is the ancestor of all neural networks. It is a mathematical model of a single neuron, invented in 1957 by Frank Rosenblatt. Despite its simplicity, it contains all fundamental concepts of machine learning: inputs, weights, summation, and activation.

Mathematical Foundation

The perceptron calculates a weighted sum of its inputs: z = w₁x₁ + w₂x₂ + ... + wₙxₙ + b. Here, x are the input values, w are the weights (which determine how important each input is), and b is the bias (a shift constant). The output is 1 if z > 0, otherwise 0.

What can the perceptron do?

  • Linear Classification: Separation of two classes by a straight line (or hyperplane)
  • Logical Functions: AND and OR can be perfectly represented
  • Simple Pattern Recognition: Can distinguish between two simple patterns

The Fundamental Limitation

The perceptron can only solve linearly separable problems. The XOR problem (Exclusive Or) is the classic counterexample: The points lie diagonally and cannot be separated by a single straight line. This realization led to the AI Winter in 1969.

Learning Rule

The perceptron learns through the perceptron learning algorithm: For each misclassified point, the weights are adjusted: w_new = w_old + η × (y - ŷ) × x, where η is the learning rate, y is the expected and ŷ is the predicted result.

Try it yourself! Move the decision boundary in the demo and observe how the classification changes.

Check

Test Your Knowledge

Not completed

What does a perceptron do?

Select one answer

Answer Key: 1) C · 2) B · 3) D · 4) A · 5) C

Plain Language

This preview is in Plain Language. The whole portal is also available in Plain Language. You can change the language at the top. Or use the button below. Our Plain Language texts are AI-assisted and editorially reviewed. They follow the core principles of easy-to-read language, but they are not certified Easy Read: a review panel of people with learning difficulties does not test them.

Preview: The first AI neuron

What is a perceptron?

A perceptron is a calculation unit. It is the simplest model of an artificial neuron. The perceptron takes numbers in. It calculates with them. The result is 0 or 1.

How you use the demo

Look at the diagram. It shows points in two groups. A line separates the groups. Move the line with the mouse. Does the model sort all points correctly?

What you learn

The perceptron is the origin of all AI networks. It has a limit. It can only solve simple tasks. More difficult patterns need larger networks.