DEEP LEARNING LESSON 2 NEURAL NETWORKS

What Is a Neural Network?

A neural network is a machine learning model made of connected units called neurons. It takes input data, processes that data through one or more layers, and produces an output or prediction.

In simple words

A neural network is a system that learns patterns from examples and uses those learned patterns to make predictions on new data.

A Simple Real-World Example

Imagine that we want a computer to determine whether an email is spam or not spam.

We can give the model information about an email, such as:

Number of Links
Number of Images
Certain Words

The neural network processes this information and produces an output.

Email Data
Neural Network
Spam / Not Spam

The Basic Structure of a Neural Network

A basic neural network contains three main parts: an input layer, one or more hidden layers, and an output layer.

INPUT LAYER
Feature 1
Feature 2
Feature 3
HIDDEN LAYER
Neuron
Neuron
Neuron
OUTPUT LAYER
Prediction

1. Input Layer

The input layer receives the information that we want the neural network to process.

For example, if we are predicting whether a house is expensive, the inputs could be:

House Size
Number of Rooms
Location

These inputs are called features.

2. Hidden Layers

Hidden layers are where the network processes the input and learns useful patterns.

A neural network can have one hidden layer or many hidden layers.

Input
Hidden Layer 1
Hidden Layer 2
Output

The more complex the problem, the more layers and neurons a model may need. However, adding more layers does not automatically make a model better.

3. Output Layer

The output layer produces the final result of the neural network.

Network Processing
Final Prediction

The output depends on the problem we are solving.

Two examples

Image classification: Cat or Dog

House price prediction: $350,000

What Are Neurons?

A neuron is a small computational unit inside a neural network.

A neuron receives values, processes them, and produces an output.

Input Values
Neuron
Output

A layer can contain many neurons working together.

INPUT
Input 1
Input 2
Input 3
NEURONS
Neuron 1
Neuron 2
Neuron 3
OUTPUT
Result

How Does a Neural Network Learn?

The network starts with parameters that are not yet good enough to make accurate predictions.

It makes predictions, compares those predictions with the correct answers, and adjusts its parameters to reduce the error.

Training Data
Prediction
Measure Error
Update Parameters
Repeat

This process happens many times during training. Over time, the network can learn useful patterns from the training data.

A Very Simple Example

Suppose a neural network is trying to predict whether a student will pass an exam.

We provide:

Hours Studied = 7
Attendance = 90%

The neural network processes these inputs and might produce:

Prediction = 0.92

If we interpret values close to 1 as "Pass", the model is predicting that the student will probably pass.

Hours = 7
+
Attendance = 90%
Neural Network
Pass: 0.92

Why Is It Called a "Neural Network"?

The name comes from the fact that its structure is loosely inspired by the way biological neurons are connected.

But don't take this analogy too literally.

Important

Artificial neural networks are mathematical models. They are inspired by biological neurons, but they do not work exactly like the human brain.

Neural Networks and Machine Learning

A neural network is one type of machine learning model.

MACHINE LEARNING
Linear Regression
Decision Trees
KNN
Neural Networks
DEEP LEARNING
Neural Networks
CNN
RNN
Transformers

Deep Learning generally refers to using neural networks with multiple layers to learn complex patterns from data.

A Simple Way to Think About It

Data
Neural Network
Learned Patterns
Prediction

The network is not given every possible answer. Instead, it learns patterns from examples and uses those patterns to make predictions on new data.

What You Should Remember

A neural network is a machine learning model made of connected neurons arranged into layers. Data enters through the input layer, is processed by hidden layers, and produces a result through the output layer.

QUICK CHECK

Check Your Understanding

What is a neural network?
A machine learning model made of connected computational units called neurons.

What does the input layer do?
It receives the input features.

What happens in hidden layers?
The network processes information and learns patterns from the data.

What does the output layer do?
It produces the final prediction or result.

NEXT TOPIC

Input Layer

Next, we will look specifically at the input layer and understand how data enters a neural network.