Artificial neuron models
Artificial neuron models: clear definitions and formulas for McCulloch–Pitts, perceptron and Adaline neurons, activation functions, worked numerical examples, common exam mistakes and quick checks.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Artificial neuron models are the building blocks of neural networks. Engineers use them to design classifiers and function approximators (for pattern recognition, control, signal processing). Understanding these models (how inputs, weights, bias and activation combine) is essential before studying learning rules and network architectures such as perceptrons, multilayer networks and Adaline-based systems.
Key ideas
Start from simple concepts and build up the models used in soft computing.
Input: an independent value provided to the neuron; typically written as x_i. Inputs are usually dimensionless (unitless) when modelling logic or normalized features.
Weight: w_i is a scalar multiplier applied to input x_i. It represents the strength and sign of influence of x_i on the neuron.
Bias: b is a constant added to the weighted sum. Equivalently, a bias is the weight w_0 on a constant input x_0 = 1. The bias shifts the activation threshold.
Net input (also called net or activation potential/induced local field): net = Σ_i w_i·x_i + b. This is the linear combination of inputs and bias that the neuron evaluates.
Activation function (also called transfer function or squashing function): a function φ(net) that converts the net input into the neuron output y. The activation function can be binary (step), linear, or continuous and nonlinear (sigmoid, tanh, ReLU). Define before use: activation function φ.
Output: y = φ(net) is the neuron response. For a binary neuron (McCulloch–Pitts or perceptron with step activation), the output is typically 0/1 or −1/+1.
Formal models (exact definitions universities expect):
McCulloch–Pitts neuron (formal definition):
- A McCulloch–Pitts neuron is a formal binary neuron defined by inputs x_i ∈ {0,1}, weights w_i ∈ {0,1} (originally), a threshold θ, and an output defined by the step rule: output y = 1 if Σ_i w_i·x_i ≥ θ; otherwise y = 0.
- Assumptions: Boolean inputs and fixed integer weights in the original model; used to model logical functions.
Perceptron (formal definition):
- A perceptron is a computational unit with real-valued weights w_i, bias b, net input net = Σ_i w_i·x_i + b and a binary activation function (usually the Heaviside step). Output y = 1 if net ≥ 0, else y = 0 (or ±1 depending on convention).
- The perceptron learning rule (batch or online) updates weights to reduce classification error for linearly separable data. (The detailed convergence theorem is taught with perceptron learning rule; check conditions in your course notes.)
Adaline (Adaptive Linear Neuron) (formal definition):
- Adaline computes net = Σ_i w_i·x_i + b and uses a linear activation for error calculation; the weights are updated using the least mean squares (LMS) rule minimizing the mean squared error between the desired target and the net value (not the thresholded output). This distinguishes Adaline from perceptron.
- Assumptions: continuous-valued inputs, squared error cost, small learning rate for convergence.
Activation functions (definitions; give exact formulae later in Formulas):
- Step (Heaviside): binary thresholding; used in McCulloch–Pitts and simple perceptrons.
- Sign: outputs −1 or +1 according to sign of net (0 at net = 0 by convention).
- Linear: identity function y = net (used when no nonlinearity needed).
- Logistic sigmoid: smooth S-shaped function mapping net to (0,1) used for continuous outputs.
- Tanh: maps net to (−1, +1); scaled sigmoid.
- ReLU: rectified linear unit, y = max(0, net); common in modern deep networks but still useful to know here.
Diagram to draw (if exam asks for a neuron sketch):
- Draw a circle labelled Σ (summing junction). From the left, draw n arrows into Σ labelled x_1, x_2, ..., x_n. Beside each arrow write the corresponding weight w_1, w_2, ..., w_n. From a small box labelled 1 draw an arrow to Σ and label the weight b (or w_0). From Σ draw an arrow right into a box labelled φ (the activation function). From φ draw one arrow to the right labelled y (output). Under the diagram write net = Σ_i w_i·x_i + b and y = φ(net).
Remarks on behaviour and use:
- A single perceptron can only learn linearly separable decision boundaries. For nonlinearly separable tasks you need multilayer networks (covered in other topics such as multilayer perceptrons and backpropagation).
- Adaline uses continuous error and gradient-descent style updates; perceptron uses discrete error (target − output) for updates.
Formulas
Each formula is on its own line followed by symbol meanings, SI units and when it applies.
net = Σ_i w_i · x_i + b
- net: net input (dimensionless in typical neural models); w_i: weight (dimensionless scalar); x_i: input (dimensionless or unit of feature); b: bias (same units as net). Applies to all linear neuron models.
y = φ(net)
- y: output of the neuron (dimensionless); φ: activation function (defined below). Applies generally.
φ_step(net) = { 1 if net ≥ 0; 0 if net < 0 }
- Heaviside step activation. Output dimensionless. Used in perceptron/McCulloch–Pitts. For a threshold θ, use y = H(net − θ) (equivalently set b = −θ so the threshold is at 0).
φ_sign(net) = { +1 if net > 0; 0 if net = 0; −1 if net < 0 }
- Sign activation; used where outputs are ±1 (0 at net = 0 by this convention).
φ_linear(net) = net
- Identity activation; used in Adaline for error computation (before thresholding).
φ_sigmoid(net) = 1 / (1 + e^(−net))
- Logistic sigmoid; net dimensionless; output in (0,1). Used for smooth binary outputs and in differentiable networks.
φ_tanh(net) = (e^(net) − e^(−net)) / (e^(net) + e^(−net))
- Hyperbolic tangent; output in (−1, +1).
φ_relu(net) = max(0, net)
- Rectified linear unit; output ≥ 0.
Derivative often used in learning (for differentiable φ):
d/dnet φ_sigmoid(net) = φ_sigmoid(net) · (1 − φ_sigmoid(net))
- Derivative of logistic sigmoid; used in gradient-based learning. Applies when using logistic activation.
d/dnet φ_tanh(net) = 1 − [φ_tanh(net)]^2
- Derivative of tanh; often used when outputs are in (−1, +1).
Perceptron learning rule (online update):
w_i ← w_i + η · (d − y) · x_i
b ← b + η · (d − y)
- η: learning rate (dimensionless, small positive scalar); d: desired target (0/1 or −1/+1 depending on convention); y: perceptron output (0/1 or −1/+1). Applies when using perceptron update; note that (d − y) is integer in binary case.
Adaline (LMS) update (gradient descent on squared error, online):
w_i ← w_i + η · (d − net) · x_i
b ← b + η · (d − net)
- Here error uses (d − net) (difference between target and linear output). Applies when training Adaline using instantaneous gradient descent (LMS).
Notes on units: Neural model variables are usually dimensionless or carry the unit of the input feature if features are not normalized. Learning rate η is dimensionless. Bias and weights share the unit structure needed to make net dimensionally consistent.
Worked examples
Example 1 — McCulloch–Pitts neuron (binary logic)
Problem: A McCulloch–Pitts neuron has two binary inputs x1, x2 ∈ {0,1}, weights w1 = 1, w2 = 1 and threshold θ = 1.5. For inputs x1 = 1, x2 = 1 compute the output.
Steps:
- Formula:
net = w1·x1 + w2·x2. - Substitute numbers:
net = 1·1 + 1·1 = 2(dimensionless). - Apply threshold rule: output y = 1 if net ≥ θ, else 0. Here net = 2 ≥ 1.5 so y = 1.
Final answer: y = 1.
Example 2 — Perceptron single update (online)
Problem: Initial weights w = [−0.4, 0.2], bias b = 0, learning rate η = 0.1. Training sample x = [1, 1], desired d = 1. Use perceptron activation y = 1 if net ≥ 0 else 0. Compute net, output and updated weights and bias.
Steps:
- Formula for net:
net = w1·x1 + w2·x2 + b. net = (−0.4)·1 + 0.2·1 + 0 = −0.4 + 0.2 = −0.2.- Activation: net < 0 so y = 0.
- Perceptron update:
w_i ← w_i + η·(d − y)·x_iandb ← b + η·(d − y).- (d − y) = 1 − 0 = 1.
- w1 ← −0.4 + 0.1·1·1 = −0.4 + 0.1 = −0.3.
- w2 ← 0.2 + 0.1·1·1 = 0.2 + 0.1 = 0.3.
- b ← 0 + 0.1·1 = 0.1.
Final answer: Updated w = [−0.3, 0.3], b = 0.1 (dimensionless).
Example 3 — Adaline single LMS update
Problem: Initial weights w = [0.1, −0.2], bias b = 0.05, learning rate η = 0.01. Training sample x = [1, 2], desired d = 0.5. Use Adaline update rule (LMS) w ← w + η·(d − net)·x.
Steps:
- Compute net:
net = 0.1·1 + (−0.2)·2 + 0.05 = 0.1 − 0.4 + 0.05 = −0.25. - Error term:
d − net = 0.5 − (−0.25) = 0.75. - Weight updates:
- Δw1 = 0.01·0.75·1 = 0.0075 => w1_new = 0.1 + 0.0075 = 0.1075.
- Δw2 = 0.01·0.75·2 = 0.015 => w2_new = −0.2 + 0.015 = −0.185.
- Bias update Δb = 0.01·0.75 = 0.0075 => b_new = 0.05 + 0.0075 = 0.0575.
Final answer: Updated w = [0.1075, −0.185], b = 0.0575 (dimensionless).
Common mistakes
- Using a too-large learning rate η causing divergence (especially for Adaline/LMS).
- Attempting to use gradient / derivative of non-differentiable step function; step has no useful derivative for gradient-based learning.
- Not normalising inputs: large input magnitudes can slow or prevent convergence.
- For perceptron, assuming it can solve nonlinearly separable problems (it cannot); a single-layer perceptron only separates linearly separable classes.
- Arithmetic mistakes in simple net calculation (double-check signs of weights and bias).
For your exam
Kinds of questions that appear on this topic:
- Definitions: define perceptron, McCulloch–Pitts neuron, Adaline, activation function, bias, net input.
- Short notes: compare perceptron and Adaline; list activation functions and their uses.
- Derivations: derive perceptron update rule and show one step of weight update; derive Adaline (LMS) gradient update for squared error.
- Numericals: compute net and output for given weights and inputs; perform one or two online updates for perceptron or Adaline (carry units or state variables are unitless).
- Diagrams: draw and label a single neuron block (summing junction, weights, bias, activation).
What a full-marks answer includes:
- Precise definitions with bold naming (if required), correct formulas, correct assumptions stated (e.g., inputs binary or real-valued), and clean step-by-step algebra for derivations.
- For numerical problems: write the formula first, substitute numbers with units (or state dimensionless), show intermediate arithmetic, and box the final answer.
- For comparison questions: mention the key distinguishing property (perceptron uses thresholded output for update; Adaline uses linear net for error and gradient-based update) and implications for learning.
Quick check
- What is the formula for net input of a neuron?
- Give the perceptron weight update formula (online case).
- State one important difference between perceptron and Adaline updates.
Answers: net = Σ_i w_i·x_i + b; w_i ← w_i + η·(d − y)·x_i, b ← b + η·(d − y); perceptron uses (d − y) with thresholded y while Adaline uses (d − net) (error on linear output).
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?