An artificial neural network (ANN) is a machine-learning model made of connected processing units called artificial neurons. A perceptron is the simplest artificial neuron: it calculates a weighted sum of its inputs and applies an activation function to produce an output.
How an ANN works
An ANN usually contains an input layer, one or more hidden layers, and an output layer. Connections carry numerical values between neurons, and each connection has a weight representing the importance of that input.
During training, the network compares its prediction with the expected output using a loss function. A learning algorithm then adjusts the weights and biases to reduce this error. Multiple hidden layers allow a network to learn complex, non-linear patterns.
| Component | Function |
|---|---|
| Input | Represents a feature in the training data |
| Weight | Controls the influence of an input |
| Bias | Shifts the neuron’s decision boundary |
| Activation function | Converts the weighted sum into an output |
| Layer | Organizes neurons at a particular processing stage |
How a perceptron works
For inputs , weights , and bias , the perceptron calculates:
A step activation function may then produce if , and otherwise.
For example, let , , , , and . Then:
Because , the output is .
A common misconception is that one perceptron can learn any pattern. A single perceptron creates only a linear decision boundary, so it cannot solve non-linearly separable problems such as XOR; a multilayer ANN is required.
IB exam technique
For A4.3 Machine learning approaches (HL only), define the ANN, identify inputs, weights, bias and activation function, and show the weighted-sum calculation. If asked to explain, connect weight adjustment during training to improved prediction accuracy.