Machine Learning

Neural Network Learning

Understanding forward propagation, backpropagation, and weight updates in artificial neural networks.

Neural Network Learning

Overview

Artificial Neural Networks (ANNs) are computing systems inspired by the biological neural networks that constitute animal brains. Learning in these networks involves adjusting the weights and biases of connections between artificial neurons to minimize the difference between predicted and actual outcomes. This process is driven by the backpropagation algorithm, which calculates the gradient of a loss function with respect to the network's weights, and gradient descent, which updates the weights to minimize this loss.

Definition

A multi-layer perceptron (MLP) consists of an input layer, one or more hidden layers, and an output layer. For a given node j in layer l, the activation aj[l] is computed as:

zj[l] = Σi (wji[l] · ai[l-1]) + bj[l]
aj[l] = σ(zj[l])
where:
wji[l] = weight from node i in layer l-1 to node j in layer l
bj[l] = bias of node j in layer l
σ(·) = non-linear activation function (e.g., Sigmoid, ReLU)

The loss function L measures the discrepancy between the network's output and the true label. The weights are updated using gradient descent:

wji[l] ← wji[l] - η · (∂L / ∂wji[l])
where η is the learning rate.

Key Concepts

Forward Propagation

Forward propagation is the process of passing input data through the network layer by layer to generate a prediction. Data flows strictly in one direction: from the input layer, through the hidden layers, to the output layer. At each node, a linear combination of inputs is calculated and passed through an activation function.

Backpropagation

Backpropagation (short for "backward propagation of errors") is the mechanism used to calculate the gradient of the loss function with respect to each weight. It applies the chain rule of calculus starting from the output layer and moving backwards to the input layer. This allows the network to assign "blame" for the overall error to individual weights, enabling targeted updates.

Activation Functions

Without activation functions, a neural network, no matter how deep, would simply be equivalent to a single linear regression model. Activation functions introduce non-linearity, allowing the network to learn complex patterns like the XOR function. Common choices include:

  • Sigmoid: Maps values to the range (0, 1). Historically popular but prone to the vanishing gradient problem.
  • ReLU (Rectified Linear Unit): f(x) = max(0, x). Computationally efficient and mitigates vanishing gradients, making it the default choice for deep networks.
  • Tanh: Maps values to (-1, 1). Often preferred over sigmoid as its outputs are zero-centered.

Historical Context

The conceptual foundation of artificial neural networks dates back to 1943 when Warren McCulloch and Walter Pitts modeled a simple artificial neuron. In 1958, Frank Rosenblatt invented the Perceptron, an algorithm for pattern recognition based on a two-layer learning computer network. However, early networks were limited because they could only solve linearly separable problems.

A major breakthrough occurred in 1986 when David Rumelhart, Geoffrey Hinton, and Ronald Williams published a paper demonstrating that backpropagation could train multi-layer neural networks to solve complex, non-linear problems (like XOR). This sparked a renaissance in neural network research, laying the groundwork for the modern deep learning revolution fueled by massive datasets and GPU computing.

Applications

  • Computer Vision: Image classification, object detection, and facial recognition using Convolutional Neural Networks (CNNs).
  • Natural Language Processing: Machine translation, sentiment analysis, and large language models (LLMs) like GPT using Transformer architectures.
  • Medical Diagnosis: Analyzing medical imagery (X-rays, MRIs) to identify tumors or other anomalies with superhuman accuracy.
  • Autonomous Vehicles: Processing real-time sensor data (cameras, LiDAR) to navigate and make driving decisions.

Related Concepts

  • Gradient Descent — the optimization algorithm used to update network weights.
  • Perceptron — the simplest precursor to multi-layer neural networks.
  • Linear Regression — neural networks can be viewed as complex, stacked extensions of linear models.

Experience it interactively

Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Neural Network Learning module.

Try Neural Network Learning on Riano →

More in Machine Learning