DEEP LEARNING LESSON 2 NEURAL NETWORKS

Input Layer

The input layer is the first layer of a neural network. It receives the data that we want the network to process. These input values represent the features of our data.

In simple words

The input layer is the entry point of a neural network. It takes the information we give to the model and passes that information to the next layer.

Where Is the Input Layer?

A basic neural network can be viewed as three main parts.

FIRST
Input Layer
MIDDLE
Hidden Layers
LAST
Output Layer

The input layer always comes first because the model needs data before it can process anything.

What Goes Into the Input Layer?

The input layer receives features. A feature is a piece of information about the data that the model can use.

For example, if we want to predict the price of a house, the features might be:

House Size
Number of Rooms
Number of Bathrooms
Location

These values are provided to the neural network through the input layer.

Example 1 — Predicting a House Price

Suppose we have a house with the following information:

Feature
Value
House Size
2,000 sq ft
Bedrooms
3
Bathrooms
2

The input information can be represented as numerical values such as:

[2000, 3, 2]

These values become the input to the neural network.

2000
3
2
Input Layer

Neural Networks Work With Numbers

Neural networks perform mathematical calculations, so the input data normally needs to be represented as numbers.

Some data is already numerical.

Age = 25
Salary = 50,000

But some data is not naturally numerical.

City = London
Color = Red

Those values need to be converted into numerical representations before being given to a neural network. This process is called encoding.

Don't confuse the input layer with data preparation

Data preparation happens before the model receives the data. The input layer receives the prepared numerical data.

Example 2 — Predicting Student Results

Suppose we want to predict whether a student will pass an exam.

We might use these features:

Hours Studied
Attendance
Previous Score

For one student, the input could look like:

[7, 90, 82]

The input layer receives these values.

Hours = 7
+
Attendance = 90
+
Score = 82
Input Layer

Does the Input Layer Make a Prediction?

No.

This is an important distinction. The input layer mainly represents the data entering the network. The actual processing happens in the neurons of the network.

Input Layer
Processing
Hidden Layers
Output

Simple way to remember

The input layer is like the entrance of a building. Information enters there, but the actual work happens inside.

How Many Inputs Do We Need?

The number of input features depends on the problem.

If our dataset has three features, the model receives three input values.

[7, 90, 82]

Here we have:

Input 1
Input 2
Input 3

If we have five features, there will be five input values.

[7, 90, 82, 3, 1]

So, in a simple tabular dataset, the number of input features determines the size of the input.

What About Images?

Images are also converted into numerical values. A computer represents an image using pixel values.

For example, a very small grayscale image could be represented as:

[
    [0, 255],
    [128, 64]
]

Each number represents the intensity of a pixel.

Image
Pixel Values
Neural Network Input

Later, when we study Convolutional Neural Networks, we will see how neural networks process image data more effectively.

What Is Input Shape?

The input shape describes the structure or number of values that the model expects as input.

For example, if each student has three features:

[Hours Studied, Attendance, Previous Score]

then the input contains three values.

Input shape = 3

When we later use Keras, we might define this as:

input_shape=(3,)

This tells the model that each training example contains three input features.

Complete Input Flow

RAW DATA
Student Information
PREPARED DATA
Numerical Features
INPUT
Input Layer
NEXT
Hidden Layer

The important point is that the input layer is the starting point of the neural network.

Input Features vs Input Layer

These two terms sound similar, but they are not the same thing.

Term
Meaning
Feature
A piece of information used as an input
Input Layer
The first part of the neural network that receives those inputs

For example:

Features:
Hours Studied
Attendance
Previous Score

        ↓

Input Layer

What Happens After the Input Layer?

Once the input data enters the network, it is passed to the neurons in the next layer.

Input Layer
Hidden Layer
More Processing
Output

In the next topic, we will focus specifically on Hidden Layers and understand why they are important.

QUICK CHECK

Check Your Understanding

What is the input layer?
It is the first layer of a neural network that receives the input data.

What does it receive?
It receives the features used by the model.

Does it make the final prediction?
No. It provides the input to the rest of the neural network.

If a dataset has 5 features, how many input values does one example contain?
Five input values.

NEXT TOPIC

Hidden Layers

Now we will look at the hidden layers and understand where the neural network processes information and learns patterns.