Derver
Applied machine learning / Information modelling

From complexity
to useful groups.

Deep Clustering

An experiment in learned representations.
A way to investigate the structure within unlabelled data.

Explore the study

01 / The technique

Learn the space.
Refine the groups.

Compress the observations.
Find an initial grouping.
Let both evolve together.

Clustering depends on how similarity is represented. Distances between raw measurements may miss relationships that become clearer in a learned representation. Deep Embedded Clustering (DEC) trains that representation and its cluster centres together, progressively adjusting the space in which observations are grouped.

The process begins by learning a compact description of each observation. An initial grouping then gives the model a direction: bring related observations into clearer focus and refine the boundaries between groups. No predefined category labels are needed for learning; similarity emerges through the interaction between the representation and the clustering objective.

From observations to a learned space and cluster assignments The process maps observations through an encoder into a compact latent space, then assigns them to groups. The representation and group centres are refined together. This is a schematic of the method. x f z q Inputs Encoder Latent space Groups
The learning procedure / Schematic
Coordinates in the learned space
10
Groups explored
10
KMeans initialisation restarts
20
Assignment-change stopping threshold
0.1%
  1. Learn a reconstruction

    Pretrain a denoising autoencoder layer by layer, then fine-tune it to reconstruct clean inputs. Keep the encoder; discard the decoder before clustering.

  2. Initialise the groups

    Run KMeans with 20 restarts on the pretrained embedding. Its centres provide the starting point for DEC.

  3. Assign softly, then sharpen

    A Student-t kernel turns distances to centres into soft assignments. Square these affinities, adjust by full-sample cluster frequencies and normalise to form an auxiliary target.

  4. Refine the representation

    Minimise KL divergence from the target to the assignments, updating the encoder and centres jointly. Refresh the target periodically; stop when fewer than 0.1% of assignments change, or report budget exhaustion.

The experiment in detail

The main experiment uses MNIST handwritten images, whose known identities allow the groups to be evaluated after fitting. The encoder maps 784 inputs through layers of 500, 500 and 2,000 units to ten latent coordinates. Pretraining uses 60,000 images, with 50,000 updates per shallow layer, 20% dropout and 100,000 full-autoencoder updates. DEC then groups all 70,000 images, using momentum SGD, batch size 256, learning rate 0.01 and a target refresh every 160 updates. The seed is 42. Ten clusters are specified in advance; their identities are learned without labels.

02 / Inspecting the representation

What does the
space retain?

Look beyond a cluster label.
Inspect the coordinates.
Test what survives their removal.

Each observation becomes a compact vector: a position in the learned space, a group assignment and a measure of how strongly it belongs to that group. Examining these together helps us ask which coordinates distinguish groups, where they overlap and how much structure survives in a smaller representation.

Three complementary checks make the representation easier to inspect. Coordinate rankings describe separation, cluster profiles reveal shared patterns, and subset comparisons test whether a few coordinates retain much of the useful information.

01 / Coordinate separationBetween and within groups

Rank each coordinate by between-cluster variance divided by within-cluster variance, using DEC’s own assignments. This describes the current groups. The ranking depends on the chosen axes, and high-scoring coordinates can repeat the same information.

02 / Cluster profilesAverages and confidence

Compare average latent signatures, cluster sizes and assignment confidence. Distinctive profiles can guide a closer review of what groups share and where they differ. Confidence describes the concentration of an assignment; understanding what the group means still benefits from domain knowledge.

03 / Subset ablationRemove coordinates

Rerun KMeans on selected coordinates of the fixed DEC embedding. Comparing the top three with the bottom three holds dimensionality constant. This tests the ranking descriptively; it does not retrain DEC or establish causal feature importance.

Earlier exploratory run / KMeans on a fixed learned representation
CoordinatesARIMatched accuracy
All ten0.67476.7%
Top three0.63275.6%
Bottom three0.61273.7%

The top three coordinates retain much of the observed agreement with reference categories. The bottom three also carry useful structure, suggesting that information is distributed across the space. This offers a practical way to investigate compact representations while keeping their joint contribution in view.

About this coordinate comparison

These exploratory figures come from an earlier experiment on 1,797 small handwritten-digit images, with 61 preprocessed inputs and a shorter training budget. The run reached its 1,000-update cap before assignment stability. It predates the reconstruction-loss correction and is separate from the main result below. The comparison is descriptive, on the fitted sample: rankings depend on the chosen axes, and coordinate subsets may carry overlapping information.

03 / What the experiment showed

A measured
improvement.

Start with a learned representation.
Refine it through clustering.
Measure what the extra step adds.

The comparison follows the method’s two stages: KMeans on the pretrained representation, then DEC refinement of the representation and centres together. Reference categories are used only after fitting to assess whether the resulting groups better reflect the underlying structure.

Before and after refinement / One run, seed 42
StageARINMIMatched accuracy
AE + KMeans0.70460.753681.79%
DEC0.81620.847487.23%

+5.44 percentage points

Observed gain in matched accuracy over the pretrained KMeans initialisation. ARI and NMI improve as well, supporting closer agreement with the reference categories in this run.

Matched accuracy finds the best one-to-one mapping between groups and reference categories. ARI compares pairwise group membership with a correction for chance; NMI measures shared information. Together, they provide complementary views of how well the learned groups correspond to known structure.

DEC updates before stopping
8,160
Assignments changed at last refresh
0.09%

The process reaches its assignment-stability criterion after 8,160 updates. By the final refresh, just 0.09% of assignments change. Improved category agreement and stable assignments give two useful perspectives on what the refinement achieved.

How to read these results

The main experiment groups 70,000 MNIST images and evaluates them against their known identities after fitting. These are results for one seed and refresh setting on the fitted population. Repeating the comparison across seeds, periods and new data would help establish how consistently the improvement carries into a particular application.

04 / Commercial possibilities

Where could this
be useful?

Reveal patterns beneath the surface.
See new possibilities.
Turn understanding into action.

Complex data often holds relationships that familiar categories leave unseen. Learning how observations belong together could reveal emerging customer needs, recurring operational challenges or new ways to organise knowledge. The opportunity is to turn that hidden structure into a clearer view of where to act next.

01 / Behavioural segmentation

Look beyond broad customer categories to patterns across visits, purchases and service use. Learned groups could reveal emerging needs or overlooked journeys, opening the way to more relevant onboarding, better-timed support and more thoughtful service offers.

Bring these patterns into customer research, explore representative accounts and design focused trials. The aim is to connect a richer understanding of behaviour with improvements people can experience.

02 / Knowledge and service operations

Turn a growing collection of documents, support requests or product feedback into a landscape of related themes. Grouping suitable text representations could surface connections across teams, make expertise easier to find and bring recurring issues into focus sooner.

Pair the learned structure with human review and domain-appropriate representations. Search quality, triage decisions and time saved offer practical ways to see where the approach makes work easier.

03 / Industrial pattern discovery

Explore the different ways a process behaves through sensor windows, production traces or inspection images. Learned groups could help engineers recognise operating regimes, connect similar cases and uncover conditions worth investigating.

Domain specialists can turn those patterns into hypotheses about quality, efficiency or maintenance. Checking them against later observations and existing monitoring provides a path towards more informed process decisions.

From an embedding to a useful service

Start with a decision that better understanding could improve. Shape the representation around the available data, compare alternative groupings and review the patterns with people who know the domain. A focused pilot can then connect promising structure to measurable outcomes, from more useful services to faster discovery and better operational choices.

Have a collection whose
structure is hard to see?
Let’s frame the question.

Applied machine learning / Information modelling

Deep
Clustering.

From complexity to useful groups.

The technique

Deep Embedded Clustering learns a representation and cluster centres together. Pretrain a denoising autoencoder, initialise centres with KMeans, then refine both using soft assignments, frequency-adjusted targets and KL divergence.

The space becomes part of the learning process: related observations can be brought into clearer focus as the groups evolve. The number of clusters is specified; their identities are learned without category labels.

The experiment in detail

The main experiment uses 70,000 MNIST handwritten images, with pretraining on 60,000. The encoder maps 784 inputs to ten coordinates, and ten clusters are specified. Known identities are used only for evaluation after fitting.

Inspecting the representation

Coordinate separation, cluster profiles and subset comparisons help reveal what the learned space retains. Removing coordinates tests whether a smaller representation preserves much of the useful structure.

In an earlier exploratory comparison, matched accuracy is 76.7% using all ten coordinates, 75.6% using the top three and 73.7% using the bottom three. Information appears to be distributed across the space.

About this coordinate comparison

This earlier, shorter experiment uses 1,797 small handwritten-digit images and predates the reconstruction-loss correction. It reached its training cap before assignment stability. The figures describe a fixed embedding on the fitted sample and are separate from the main result.

What the experiment showed

Matched accuracy rises from 81.79% for autoencoder + KMeans to 87.23% after DEC: a 5.44 percentage-point increase. ARI rises from 0.7046 to 0.8162, and NMI from 0.7536 to 0.8474.

The refinement also reaches assignment stability after 8,160 updates. These are encouraging observations from one run; further comparisons can establish how consistently the improvement carries into a particular application.

How to read these results

The main experiment groups 70,000 MNIST images. Category agreement is evaluated after fitting on that same population, with one seed and refresh setting. Repeated runs and new data would help assess consistency and generalisation.

↘ Original DEC paper / Xie et al., 2016

Commercial possibilities

Learned groups could reveal emerging customer needs, connect related knowledge and help engineers recognise operating patterns. They offer a way to see beyond familiar categories and discover new opportunities within complex data.

Domain expertise and focused pilots can turn those patterns into more relevant services, faster discovery and better operational decisions. Start with a useful question, then measure the difference the resulting action makes.

Let’s frame the question.

↘ Back to Derver