What are input, hidden, and output layers in a neural network?
A neural network is commonly described as having input, hidden, and output layers. These terms describe different stages in the flow of information through the network.
Input Layer
↓
Hidden Layer 1
↓
Hidden Layer 2
↓
Output LayerThe input layer receives the data, hidden layers transform it into useful internal representations, and the output layer produces the model's final prediction or representation.
1. Input layer
The input layer represents the features supplied to the neural network.
Suppose a model predicts the price of a house using four features:
House area ──────┐
Bedrooms ────────┤
Property age ────┼──→ Neural network
Location score ──┘The input vector might be:
x = [1500, 3, 8, 0.75]Each value represents one input feature after whatever preprocessing the model requires.
For an image, inputs might originate from pixel values. For text, the network may receive token embeddings. The exact form depends on the architecture.
2. Hidden layers
A hidden layer sits between the input and output stages and performs learned transformations.
A simple fully connected hidden layer can be written as:
h = f(Wx + b)Where:
xis the input vector.Wis a matrix of learned weights.bis a learned bias vector.fis an activation function.his the resulting hidden representation.
With several hidden layers:
Input
↓
Hidden Layer 1
↓
Hidden Layer 2
↓
Hidden Layer 3
↓
OutputEach layer receives a representation and transforms it for the next stage.
The word hidden does not mean the layer is secret. It means its values are internal to the model rather than being the original input or the final output.
What do hidden layers learn?
During training, the parameters in hidden layers are adjusted so the network learns representations useful for minimizing its objective.
For an image-recognition model, different stages may learn representations associated with increasingly complex visual patterns.
A simplified intuition is:
Pixels
↓
Simple visual patterns
↓
More complex patterns
↓
Task-relevant representation
↓
PredictionThis hierarchy is not guaranteed to map neatly to human-defined concepts, but it illustrates how deeper networks can compose transformations across layers.
3. Output layer
The output layer produces the final values required by the task.
Its design depends strongly on the problem.
Binary classification
A model answering a two-class question might produce a single score transformed with a sigmoid function:
Network
↓
Output neuron
↓
Probability-like valueMulticlass classification
For several mutually exclusive classes, the output may contain one logit per class, often followed by softmax when probabilities are required.
Cat score
/
Network ── Dog score
\
Bird scoreRegression
A house-price model might output one numerical prediction:
Network → Predicted priceSome tasks require multiple output values instead.
Example of information flow
Consider a network that recognizes handwritten digits:
Image pixels
↓
INPUT LAYER
Represents image values
↓
HIDDEN LAYER 1
Transforms input representation
↓
HIDDEN LAYER 2
Builds a more task-specific representation
↓
OUTPUT LAYER
Scores digits 0–9
↓
Predicted digitDuring a forward pass, information moves through these stages to generate the prediction.
During training, backpropagation computes gradients through the network so the optimizer can update trainable parameters.
Are all neural networks organized the same way?
No. The input-hidden-output terminology is easiest to visualize with a standard feed-forward network, but modern architectures can contain more specialized structures.
Examples include:
- CNNs with convolutional layers
- RNNs with recurrent connections
- Transformers with attention and feed-forward blocks
- Autoencoders with encoder and decoder components
- Graph neural networks with message-passing layers
Even in these architectures, the general idea remains useful: data enters the model, passes through learned internal transformations, and produces an output.
Summary
- Input layer: Represents data supplied to the model, such as pixels, numerical features, or embeddings.
- Hidden layers: Learn intermediate transformations and representations using operations such as dense, convolutional, recurrent, or attention-based computations.
- Output layer: Produces the task-specific result, such as class scores, probabilities, or numerical predictions.
In short, the input layer receives the model's data, hidden layers transform that information through learned parameters, and the output layer produces the result required by the task.
Learning Sequence
Deep Learning Curriculum
Explore Related Questions
Deepen your understanding across related Deep Learning topics.