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.
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:
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:
The input information can be represented as numerical values such as:
[2000, 3, 2]
These values become the input to the neural network.
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.
But some data is not naturally numerical.
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:
For one student, the input could look like:
[7, 90, 82]
The input layer receives these values.
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.
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:
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.
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
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.
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.
In the next topic, we will focus specifically on Hidden Layers and understand why they are important.
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.