Interactive Perceptron Demo

Learn how perceptrons work by watching an AI distinguish between 🍌 bananas and 🍎 apples! See the math in action and understand the foundation of neural networks.

Make a Prediction

Decision Boundary

Elongation →
Yellowness →
(0,0)
(0,1)
(1,0)
(1,1)
(0.5,0)
(0.5,1)
(0,0.5)
(1,0.5)
Banana
Apple
Decision Line
Banana Region
Apple Region
Wrong Banana (red border)
Wrong Apple (yellow border)
Current Weights
Yellowness:
2.000
Elongation:
2.500
Bias:
-1.200

Perceptron Weights

2.000
-2.00.0+2.0
2.500
-2.00.0+2.0
-1.200
-2.00.0+2.0
Learning Rate:0.10
Threshold:0.50
💡 Tips:
  • • Higher yellowness weight → prefers yellow fruits (bananas)
  • • Higher elongation weight → prefers elongated fruits (bananas)
  • • Bias shifts the decision boundary up or down
  • • Watch the decision line move as you adjust weights!