Skip to content

12.7 What Is Hidden in a Hidden Layer?

At this point, we understand how a neural network performs its computations.

Each layer calculates a weighted sum, applies an activation function, and passes the resulting values to the next layer.

Mathematically, the process is straightforward.

Conceptually, however, an important question remains:

What do the neurons in the hidden layers actually learn?

Unlike the input neurons, hidden neurons are not assigned predefined biological meanings.

No neuron is explicitly told

“You should detect chloroplast transit peptides.”

or

“You should recognize transmembrane helices.”

Instead, the network starts with randomly initialized weights.

During training, these weights are gradually adjusted until the network solves the prediction task as accurately as possible.

Remarkably, biologically meaningful internal representations emerge automatically from this optimization process.

This phenomenon is one of the defining characteristics of deep learning.


To understand this idea, let us again consider the problem of predicting protein localization.

Suppose the input layer contains features such as

  • amino acid composition,
  • average hydrophobicity,
  • N-terminal charge,
  • sequence length,
  • and the occurrence of short sequence motifs.

These are relatively simple measurements that can be calculated directly from the protein sequence.

A logistic regression model would combine these features directly to make a prediction.

A neural network behaves differently.

Instead of immediately producing the final prediction, it first transforms these input features into a new internal representation.

The neurons in the hidden layer learn combinations of the original features that are particularly informative for distinguishing different classes of proteins.

Importantly, these combinations are not designed by the researcher.

They are discovered automatically during training.


From simple properties to biological concepts

Section titled “From simple properties to biological concepts”

Imagine a hidden neuron that receives information about

  • hydrophobicity,
  • amino acid composition,
  • and the presence of positively charged residues.

During training, this neuron may gradually learn to respond strongly whenever these features occur in a characteristic combination.

Eventually, its activation may become highly correlated with the presence of a mitochondrial targeting peptide.

Another neuron may become sensitive to long hydrophobic stretches that resemble transmembrane helices.

A third neuron may recognize amino acid patterns characteristic of chloroplast transit peptides.

Notice what has happened.

None of these biological concepts were explicitly programmed into the network.

The hidden neurons discovered them because recognizing these patterns improved the final prediction.

In this sense, hidden neurons act as feature detectors.

Each neuron learns to recognize one useful characteristic of the input data.


The real power of deep learning becomes apparent when several hidden layers are combined.

The first hidden layer usually detects relatively simple patterns.

For protein sequences, these might include

  • individual amino acid properties,
  • local sequence motifs,
  • hydrophobic regions,
  • or charged amino acid clusters.

The second hidden layer receives these newly learned features as its input.

Rather than detecting amino acids directly, it can now recognize combinations of previously identified patterns.

For example,

  • several hydrophobic regions may indicate a membrane protein,
  • combinations of positively charged residues and sequence motifs may indicate a mitochondrial targeting peptide,
  • while characteristic amino acid distributions may distinguish different protein families.

Deeper layers continue this process.

Each successive layer combines the representations learned by the previous one into increasingly abstract biological concepts.

The network therefore constructs a hierarchy of representations, progressing from simple biochemical properties to complex biological functions.


An example: predicting protein localization

Section titled “An example: predicting protein localization”

The process can be illustrated schematically.

The input layer receives relatively simple sequence-derived features.

For example,

  • N-terminal charge,
  • hydrophobicity,
  • amino acid composition,
  • sequence motifs.

The first hidden layer may learn detectors for

  • hydrophobic helices,
  • positively charged regions,
  • specific amino acid patterns.

The second hidden layer combines these patterns into higher-level biological concepts such as

  • chloroplast transit peptides,
  • mitochondrial targeting peptides,
  • membrane insertion signals.

Finally, the output layer predicts

  • chloroplast,
  • mitochondrion,
  • secretory pathway,
  • cytoplasm,
  • or another cellular compartment.

The remarkable aspect of this process is that only the final localization labels are provided during training.

The intermediate biological concepts emerge automatically because they help solve the prediction problem.


This ability to construct useful internal representations is known as representation learning.

Rather than requiring researchers to design every relevant feature manually, the network discovers increasingly informative features directly from the training data.

This represents a fundamental shift in machine learning.

Traditional approaches rely heavily on human expertise to determine which features should be extracted.

Neural networks instead learn

  • which features are useful,
  • how these features should be combined,
  • and which representations are most informative for the prediction task.

Representation learning is one of the major reasons why deep learning has achieved such remarkable success across many scientific disciplines.


Hidden layers are not always interpretable

Section titled “Hidden layers are not always interpretable”

Although examples such as targeting peptides are highly intuitive, it is important to recognize that hidden neurons do not always correspond to easily interpretable biological concepts.

Some neurons learn representations that can be related directly to known biological mechanisms.

Others detect complex statistical regularities that are difficult—or perhaps impossible—for humans to interpret.

Furthermore, meaningful representations are often distributed across many neurons rather than being encoded by a single one.

A biological concept such as “chloroplast targeting” may therefore emerge from the collective activity of dozens or hundreds of neurons.

This distributed representation is one reason why modern neural networks often appear as “black boxes.”

Their predictions are frequently highly accurate, yet understanding exactly how the internal representations are organized remains an active area of research.

Consequently, interpretable artificial intelligence has become an important field within machine learning, aiming to make these learned representations more transparent.


The concept of hidden representations extends far beyond protein localization.

Image recognition networks first detect edges, then shapes, then complete objects.

Speech recognition networks progress from simple sound frequencies to phonemes, words, and eventually complete sentences.

Large language models transform individual words into increasingly abstract semantic representations.

AlphaFold learns representations that capture evolutionary constraints, residue interactions, and structural relationships within proteins.

In every case, the same principle applies.

Deep learning succeeds because it does not merely learn the final prediction.

It learns the intermediate representations that make the prediction possible.

This ability distinguishes neural networks from nearly all classical machine learning methods introduced in the previous chapters.


Hidden layers transform simple input features into increasingly informative internal representations. During training, hidden neurons automatically learn feature detectors that recognize biologically meaningful patterns, even though these concepts are never explicitly programmed into the network. As additional hidden layers are added, these simple patterns are combined into increasingly abstract representations. This process, known as representation learning, is one of the defining characteristics of modern deep learning and explains much of its extraordinary predictive power.


  1. Why are hidden neurons called “hidden”?
  2. Why are hidden representations not programmed explicitly by the researcher?
  3. What is meant by a feature detector?
  4. How do deeper layers build upon the representations learned by earlier layers?
  5. Explain the concept of representation learning in your own words.
  6. Why are hidden representations often difficult to interpret biologically?
  7. Give examples of hierarchical representation learning in protein sequences, images, or language.
  8. Why is representation learning one of the defining innovations of modern deep learning?