No history yet

Introduction to Neural Networks

Inspired by the Brain

A neural network is a computational system designed to recognize patterns in data. The concept is inspired by the human brain, which is a vast network of interconnected cells called neurons.

Think of a neural network not as a single brilliant mind, but as a team of simple-minded specialists. Each specialist looks at one tiny piece of information and passes its conclusion to the next specialist in line. By working together in layers, this team can solve remarkably complex problems, like identifying a cat in a photo or translating languages.

Lesson image

These networks don't come pre-programmed with rules for every task. Instead, they learn by example. You show them thousands of cat photos, and over time, they figure out the patterns that define a cat on their own. This learning ability is what makes them so powerful.

Anatomy of a Network

Every neural network is built from a few key components. The most fundamental is the artificial neuron, often just called a node. A single neuron is a simple calculation unit. It receives one or more inputs, processes them, and produces an output.

Lesson image

Each input connection has a weight, which is just a number. This weight tells the neuron how important that input is. A higher weight means the signal is stronger. The neuron adds up all the weighted inputs, adds another special number called a bias, and then passes the result through an activation function to produce its final output.

Think of weights as volume knobs for each input, and the bias as a way to tune the neuron's overall sensitivity.

Neurons don't work alone. They are organized into layers. A simple network has at least three types of layers:

  • Input Layer: This is the network's front door. It takes in the raw data, like the pixels of an image or the words in a sentence. Each neuron in this layer represents a single feature of the input data.
  • Hidden Layers: These are the layers between the input and output. This is where most of the processing happens. A network can have one hidden layer or many. Networks with multiple hidden layers are what we call "deep" neural networks.
  • Output Layer: This is the final layer. It produces the result, such as a prediction or a classification. The number of neurons here depends on the task. For a yes/no question, you might have one neuron. For identifying digits 0-9, you'd have ten.
Lesson image

Making a Decision

After a neuron sums up its weighted inputs, it doesn't just pass that number along. It uses an activation function to decide what its output should be. This function introduces non-linearity, which is crucial for learning complex patterns. Without it, a neural network, no matter how many layers it has, would behave like a much simpler model.

One of the simplest activation functions is the Sigmoid function. It squishes any input value into a range between 0 and 1. This is useful for the output layer when you need a probability.

σ(x)=11+ex\sigma(x) = \frac{1}{1 + e^{-x}}

Another very common one, especially in hidden layers, is the Rectified Linear Unit, or ReLU. Its rule is simple: if the input is positive, the output is the same as the input. If it's negative, the output is zero. This simplicity makes it computationally efficient and helps networks learn faster.

f(x)=max(0,x)f(x) = \max(0, x)

These functions act like decision-makers inside each neuron. They determine whether a neuron "fires" and what signal it sends to the next layer.

The process of learning, called training, is essentially a massive process of trial and error. The network makes a guess, compares its guess to the correct answer, and then slightly adjusts all its weights and biases to make a better guess next time. This happens millions of times, gradually tuning the network until it becomes accurate at its task.

Quiz Questions 1/6

What is the fundamental building block of a neural network, responsible for receiving inputs, processing them, and producing an output?

Quiz Questions 2/6

In a neural network designed to identify handwritten digits from 0 to 9, how many neurons would you typically find in the output layer?

This foundational structure of neurons, layers, and activation functions is the basis for almost all modern artificial intelligence systems.