# Biological vs artificial neurons

> An artificial neuron keeps one idea from biology — sum weighted inputs and fire if the total is high — and drops spikes, timing and chemistry.

Source: https://www.mlfoundry.in/learn/biological-vs-artificial-neurons  
Section: Deep Learning › Deep Learning Fundamentals  
Level: core · 7 min read · updated 2026-10-09

**An artificial neuron:** is a function $y=f\big(\sum_i w_i x_i+b\big)$: multiply each input by a weight, add them up with a bias, and pass the total through a fixed nonlinearity $f$. It is a deliberately crude model of a brain cell. It keeps the idea of integrating many inputs and responding when the total is high, and it throws away almost everything else.

## What a real neuron does

A cortical neuron receives signals on its **dendrites**, branching fibres that collect input from thousands of other cells. Each contact point is a **synapse**. When the upstream cell fires, the synapse releases neurotransmitter, which nudges the receiving cell's voltage up (excitatory) or down (inhibitory). How big the nudge is depends on the synapse's strength.

These nudges spread to the **soma** (cell body) and add up. At rest, the inside of the cell sits near $-70$ mV. If the summed input pushes the voltage at the **axon hillock** past a threshold of about $-55$ mV, the cell fires an **action potential**: an all-or-none spike, about 1 ms long, that travels down the **axon** to the next cells. Below threshold, nothing is sent.

The artificial neuron is that sentence turned into arithmetic: **weighted sum, then threshold.**

The mapping the artificial neuron keeps.

| Biology | Artificial neuron | Role |
| --- | --- | --- |
| dendrites | inputs $x_i$ | receive signals from upstream units |
| synaptic strength (excitatory / inhibitory) | weight $w_i$ (positive / negative) | how much, and in which direction, each input counts |
| summing of potentials in the soma | $z=\sum_i w_i x_i+b$ | combine all inputs into one number |
| resting level vs firing threshold | bias $b$ (a threshold $\theta$ is $b=-\theta$) | how much input is needed to respond |
| axon hillock: fire or not | activation $f(z)$ | turn the total into an output |
| axon and its terminals | output $y$, fanned out to the next layer | send the result on |

## McCulloch–Pitts: the first formal neuron (1943)

$$
y=\begin{cases}1 & \text{if } \sum_i w_i x_i \ge \theta\\ 0 & \text{otherwise}\end{cases}\qquad x_i\in\{0,1\}
$$

- $x_i$: binary input: upstream neuron firing (1) or silent (0)
- $w_i$: fixed connection weight, set by hand (no learning yet)
- $\theta$: firing threshold
- $y$: binary output: fire or stay silent

Warren McCulloch and Walter Pitts showed that networks of such units can compute any Boolean function, so in principle a brain made of them could carry out any logical computation. In their model an active inhibitory input vetoes firing outright. The weights were fixed by the designer. Rosenblatt's perceptron (1958) added a rule for **learning** them from examples.

One unit, two inputs, both weights 1. Only the threshold changes: $\theta=2$ gives AND, $\theta=1$ gives OR.

| $x_1$ | $x_2$ | $\sum w_i x_i$ | AND ($\theta=2$) | OR ($\theta=1$) |
| --- | --- | --- | --- | --- |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 2 | 1 | 1 |

## The modern artificial neuron

$$
z=\sum_{i=1}^{n} w_i x_i + b,\qquad y=f(z)
$$

- $x_i$: real-valued input (a pixel, or the output of another neuron)
- $w_i$: learned weight; any real number, either sign
- $b$: learned bias; shifts the threshold
- $z$: pre-activation, the analogue of the summed membrane potential
- $f$: activation: step, sigmoid, ReLU, …

The hard step of McCulloch–Pitts has a derivative of zero everywhere it is defined, so gradient descent cannot train it. Modern networks swap in a smooth or piecewise-linear $f$. The sigmoid $\sigma(z)=1/(1+e^{-z})$ can be read as a **firing rate** between 0 and 1, which is closer to how neuroscientists summarise a spike train than a single 0/1 output.

> Figure: Hover any part on either side to see its counterpart. Drag the inputs xᵢ and weights wᵢ (green = excitatory, red = inhibitory) and watch the soma and Σ respond. It opens on the worked example below: z = 0.48, so the step unit fires. Raise the inhibitory input x₂ past 0.6 and it goes silent. Switch to sigmoid and the output becomes a graded 0.618, read on the bottom strip as a 62 Hz spike train. The network passes one real number; a real neuron would send 18 discrete spikes in that 300 ms window.

**Worked example: three inputs**

1. Inputs $x=(0.9,\,0.2,\,0.6)$, weights $w=(0.8,\,-1.2,\,0.5)$, bias $b=-0.3$. Input 2 is inhibitory.
2. Weighted terms: $0.8\cdot0.9=0.72$, $\;-1.2\cdot0.2=-0.24$, $\;0.5\cdot0.6=0.30$.
3. Sum: $z=0.72-0.24+0.30-0.30=0.48$.
4. Step: $z\ge 0$, so $y=1$ (fires). ReLU: $y=\max(0,\,0.48)=0.48$.
5. Sigmoid: $y=1/(1+e^{-0.48})=0.618$. Read as a rate with a 100 Hz ceiling, that is about 62 Hz.
6. To silence the step unit, strengthen the inhibitory input: $z=0.72-1.2\,x_2$, which is negative once $x_2>0.6$. At $x_2=0.65$, $z=-0.06$ and $y=0$. (Lowering $w_2$ alone would need $w_2<-3.6$.)

```python
import torch

x = torch.tensor([0.9, 0.2, 0.6])
w = torch.tensor([0.8, -1.2, 0.5])
b = torch.tensor(-0.3)

z = w @ x + b                 # tensor(0.4800)
print((z >= 0).float())       # step:    1.0
print(torch.sigmoid(z))       # sigmoid: 0.6177
print(torch.relu(z))          # ReLU:    0.4800

# A layer is many such neurons sharing the same inputs:
layer = torch.nn.Linear(3, 128)   # 128 neurons, each with 3 weights + 1 bias
```

## Where the analogy breaks

| Aspect | Biological neuron | Artificial neuron |
| --- | --- | --- |
| Signal | discrete spikes; information in rate and precise timing | one real number per forward pass |
| Time | continuous dynamics; potentials leak and decay over milliseconds | no time at all (outside recurrent models); one synchronous step |
| Connections | roughly $10^4$ synapses per cortical neuron; $\sim\!86$ billion neurons in a human brain | as many as the layer has inputs; a large model has billions of weights in total |
| Dendrites | compute nonlinearly on their own; single human cortical neurons can compute XOR in their dendrites (Gidon et al., 2020) | a plain linear sum |
| Sign of output | a given neuron is excitatory or inhibitory, not both (Dale's principle) | any weight can take either sign and flip during training |
| Learning | local rules: synapses change from the activity of the two cells they join (Hebbian learning, spike-timing plasticity) | backpropagation: a global error signal sent backwards through exact copies of the forward weights |
| Energy | whole brain runs on about 20 W | training a large model takes megawatt-hours |

> **One real neuron is a whole network:** Beniaguev, Segev and London (2021) trained deep networks to reproduce the spike output of a detailed model of a single cortical pyramidal neuron. Matching it with millisecond precision took a temporal convolutional network 5 to 8 layers deep. A unit in a neural network is far simpler than the cell it is named after.

> **"Works like the brain":** Deep learning borrowed a metaphor, not a mechanism. Modern architectures (backprop, attention, normalization layers) were chosen because they train well on GPUs, not because the brain does them. Do not use the biological story to argue that a model understands, or to predict how it will behave.

**Question:** In the artificial neuron, which quantity plays the role of synaptic strength?

- A. the input $x_i$
- B. the weight $w_i$
- C. the pre-activation $z$
- D. the output $y$

**Answer:** B. the weight $w_i$ — A synapse sets how strongly, and with which sign, an upstream signal affects the cell. That is the weight $w_i$. The input $x_i$ is the upstream signal itself, $z$ is the summed potential, and $y$ is what travels down the axon.

**Question:** A McCulloch–Pitts unit has two binary inputs with weights 1 and 1. Which threshold makes it compute OR?

- A. $\theta=0$
- B. $\theta=1$
- C. $\theta=2$
- D. $\theta=3$

**Answer:** B. $\theta=1$ — OR must fire whenever at least one input is 1, i.e. when the sum is 1 or 2, and stay silent at sum 0. $\theta=1$ does exactly that. $\theta=0$ fires even for (0,0), $\theta=2$ gives AND, and $\theta=3$ never fires.

**Key points**

- Dendrites → inputs, synapses → weights, soma → weighted sum, axon hillock → activation, axon → output.
- McCulloch–Pitts (1943): binary inputs, fixed weights, hard threshold; enough for any Boolean function.
- Modern neurons use real values and smooth activations so they can be trained by gradient descent.
- Real neurons spike, integrate over time, have ~10⁴ synapses with nonlinear dendrites, and learn with local rules.
- Treat the brain as the source of the metaphor, not as a specification.

---

From MLFoundry (https://www.mlfoundry.in). The web page adds interactive figures and diagrams.
