No history yet

Introduction to Neural Networks

The Brain as a Blueprint

Artificial neural networks are inspired by the structure of the human brain. Our brains are vast networks of interconnected cells called neurons. These neurons pass signals to one another, allowing us to learn, recognize patterns, and make decisions. An artificial neural network mimics this process using digital, or artificial, neurons.

Instead of biological signals, these networks process data. They're designed to find patterns in information, much like we do. A network might learn to recognize a cat in a photo by analyzing thousands of cat pictures, identifying common features like pointy ears and whiskers. This structure of interconnected nodes makes them powerful tools for complex tasks.

Lesson image

Meet the Neuron

The fundamental building block of a neural network is a single artificial neuron, also called a node. Think of it as a small computational unit. A neuron receives one or more inputs, performs a simple calculation, and then passes the result on as its output.

Neuron

noun

A node in a neural network that receives input data, processes it, and passes an output to other neurons.

Each input connection has a weight, a number that represents its importance. An input with a higher weight has more influence on the neuron's output. The neuron sums up all these weighted inputs. It also adds a bias, which is a constant value that helps adjust the final output. The bias allows the neuron to shift its activation, making the network more flexible.

Think of it like this: weights determine how much each input matters, and the bias acts like a baseline starting point for the neuron's activity.

Layers of Understanding

A single neuron isn't very powerful. The real magic happens when they are organized into layers. A typical neural network has at least three types of layers:

  • Input Layer: This is the network's front door. It receives the initial data. For example, if you're analyzing images that are 28x28 pixels, the input layer would have 784 neurons, one for each pixel.
  • Hidden Layers: These are the layers between the input and output. A network can have one or many hidden layers. This is where most of the computation happens. Each neuron in a hidden layer receives inputs from the previous layer and passes outputs to the next. The more hidden layers a network has, the more complex the patterns it can learn. Networks with many hidden layers are called deep neural networks.
  • Output Layer: This is the final layer. It produces the network's result. For a classification task (e.g., "cat" or "dog"), the output layer might have two neurons, one for each category. For a prediction task (e.g., predicting a house price), it might have just one neuron that outputs a single number.
Lesson image

The Activation Function

After a neuron calculates its weighted sum of inputs plus the bias, it passes this value through an activation function. This function's job is to introduce non-linearity into the network. Without it, a neural network, no matter how many layers it has, would just be a simple linear equation. It couldn't learn complex relationships in data, like the nuances of language or the curves in an image.

Think of an activation function as a gatekeeper. It decides whether a neuron should be "activated" or not based on the weighted sum it received. It transforms the neuron's output into a more useful format. For instance, some functions squash the output into a range between 0 and 1, which can be interpreted as a probability.

σ(z)=11+ez\sigma(z) = \frac{1}{1 + e^{-z}}

By applying these simple rules across hundreds or thousands of interconnected neurons arranged in layers, a neural network can learn to approximate incredibly complex functions. It's this combination of simple parts working together that gives neural networks their power.

Quiz Questions 1/5

What is the fundamental building block of an artificial neural network?

Quiz Questions 2/5

What is the primary role of an activation function?

These core components are the foundation upon which all neural network training and prediction is built.