No history yet

Introduction to Neural Networks

What is a Neural Network?

At its heart, a neural network is a computing system inspired by the human brain. It's designed to recognize patterns in data, much like how we learn to recognize faces, sounds, and objects. The main purpose of a neural network is to find relationships in data that are too complex or subtle for a human programmer to explicitly code. Instead of being given a set of rules to follow, the network learns from examples.

Lesson image

Think of it like teaching a child to identify a cat. You don't list out rules like "has pointy ears, four legs, and a tail." Instead, you show them pictures of cats. Over time, the child's brain automatically figures out the key features. Neural networks learn in a similar, albeit much more mathematical, way.

The core idea is to learn, not to be programmed. A neural network adjusts itself based on the data it sees, finding its own way to solve a problem.

From Biology to AI

The concept isn't new. The first ideas emerged in the 1940s, when scientists Warren McCulloch and Walter Pitts proposed a simple mathematical model of a biological neuron. They wanted to see if they could create a network of these artificial neurons that could learn and make decisions.

Early models were very simple. Frank Rosenblatt's Perceptron in the 1950s was a major step, creating a machine that could learn to classify simple shapes. However, limitations in computing power and theory led to a period known as the "AI winter," where progress and funding slowed. It wasn't until the resurgence of new techniques and powerful computers in the 2000s that neural networks truly began to flourish, leading to the AI boom we see today.

Lesson image

The key difference between biological and artificial networks is in their medium. Our brains use biological neurons—living cells that communicate with electrochemical signals. Artificial neural networks use artificial neurons, or nodes, which are mathematical functions. The connections are not physical synapses but numerical weights that determine the strength of the signal passing between nodes.

While biological networks are incredibly complex and efficient, artificial networks are mathematical approximations that excel at specific, narrowly defined tasks when given lots of data.

The Building Block: A Single Neuron

To understand the whole network, we first need to look at a single artificial neuron, also called a node. It’s the fundamental processing unit. A neuron takes in one or more inputs, processes them, and produces an output.

Here’s how it works:

  1. Inputs and Weights: Each input (xx) coming into the neuron has an associated weight (ww). This weight determines the input's importance. A higher weight means the input has more influence on the neuron's output.

  2. Summation: The neuron sums up all the weighted inputs. It's a simple calculation: (x1×w1)+(x2×w2)+...(x_1 \times w_1) + (x_2 \times w_2) + ...

  3. Activation Function: The result of the summation is then passed through an activation function. This is the key step. The activation function decides whether the neuron should be "activated" or "fire," and what its output signal should be. It introduces non-linearity, which allows the network to learn complex patterns.

neuron

noun

A fundamental processing unit of a neural network that receives inputs, processes them, and produces an output.

A common type of activation function is the Sigmoid function, which squishes any input value into a range between 0 and 1. If the weighted sum is very high, the output will be close to 1. If it's very low, the output will be close to 0.

f(z)=11+ezf(z) = \frac{1}{1 + e^{-z}}

Think of it as a dimmer switch. It's not just on or off; it can be partially on. This allows for nuance in the network's calculations. The activation function is what makes a neuron more than just a simple calculator.

Putting It All Together

A single neuron isn't very powerful. The magic happens when you connect many of them together in layers. A typical neural network has an input layer, one or more hidden layers, and an output layer.

Lesson image

Information flows from left to right:

  • Input Layer: Receives the raw data. For an image, this might be the pixel values. Each node in this layer represents a feature of the input.
  • Hidden Layers: These are the intermediate layers where most of the computation happens. The outputs of one layer become the inputs for the next. Each layer learns to recognize different features. Early layers might detect simple things like edges or colors, while deeper layers combine these to recognize more complex patterns like eyes, noses, or shapes.
  • Output Layer: Produces the final result. For a cat identifier, it might have one node that outputs a value between 0 (not a cat) and 1 (a cat).

By connecting neurons in this layered structure, a neural network can learn incredibly complex, hierarchical patterns from data without being explicitly told what to look for.

Ready to check your understanding of these foundational ideas?

Quiz Questions 1/5

What is the primary purpose of a neural network?

Quiz Questions 2/5

In an artificial neuron, what is the role of the activation function?

This is just the beginning. We've seen what a neural network is, where the idea came from, and how its basic components—neurons, weights, and activation functions—work together. The real power comes from how these networks learn by adjusting their weights, a process we'll explore later.