Skip to content

Clustering, density estimation, and anomaly detection · Deep clustering · UCL069 · Training method

Joint Unsupervised Learning (JULE)

Couple agglomerative image clustering with convolutional representation learning. It begins with fine groups and uses progressive merges to provide evolving unsupervised training signals.

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Couple agglomerative image clustering with convolutional representation learning. It begins with fine groups and uses progressive merges to provide evolving unsupervised training signals.

Question / hypotheses

Can an unlabeled objective improve both representation quality and the stability or usefulness of clusters? This entry defines an estimation or optimization objective, not an intrinsic null/alternative hypothesis test.

Architecture / computational structure

A CNN coupled to an agglomerative merge process and cluster-driven representation loss.

Assumptions

Erroneous early merges can propagate into learned features. Pair/triplet sampling and affinity definitions are integral to the algorithm and cannot be replaced silently.

Formula / computational definition

Optimize min⁡y,θL(y,θ∣X)\min_{y,\theta}L(y,\theta\mid X) by alternating cluster and representation updates. The paper's approximate sample-level loss is −λ/(Kc−1)∑i,j,k[γA(xi,xj)−A(xi,xk)]-\lambda/(K_c-1)\sum_{i,j,k}[\gamma A(x_i,x_j)-A(x_i,x_k)], where i,ji,j share a cluster, kk is a nearby negative, AA is affinity, KcK_c a neighborhood parameter, and γ\gamma reflects weighting from the merge process. Its recurrence describes clustering operations, not a conventional sequence-model RNN architecture.

Parameters and notation

Learned or fitted quantities: CNN weights, evolving affinity structure, and cluster memberships. User-set hyperparameters/design choices: Choose CNN, initial overclustering, affinity graph, merge schedule, target cluster count, triplet weighting, and optimization settings. Tune these against the stated objective and stability/validation criteria; do not select settings on the final evaluation set.

Fitting, fine-tuning, and adaptation

Alternate affinity-driven agglomerative merges with updates of CNN weights under the specified weighted loss. A modern port must preserve merge schedules and sampling. For transfer, test frozen features before partial unfreezing; reinitialize the target-domain clustering process rather than assuming old image clusters remain valid.

How to use and calibrate

Follow cluster quality and feature quality throughout merging, assess multiple initializations, and evaluate transfer to a separate task. Compare with the same agglomerative procedure on fixed representations.

Example application

Jointly cluster an unlabeled image archive while learning visual features. Define the reference population, measurement units, and success criterion before fitting; investigate whether discovered groups or alerts reflect the intended phenomenon.

Interpretation / pitfalls

Watch out

The reported result is conditional on the representation and objective. A stable partition can reflect nuisance structure such as batch, collection site, or missingness. Confirm the interpretation in original variables and an independent sample.

Python and R code examples

Author code uses the older Torch ecosystem; a modern Python or R port requires reproducing the merge logic and weighted loss. The paired component evaluates the paper's approximate weighted-triplet expression from supplied positive/negative affinities; it does not construct the graph, derive merge weights, or train the CNN.

Component: JULE approximate weighted-triplet expression from supplied affinities. Python: executed successfully; R: not executed (Rscript unavailable). These small fixtures establish the arithmetic operation, not full-method accuracy or reproduction of paper results.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — JULE approximate weighted-triplet expression from supplied affinities. · needs numpy

import numpy as np
positive_affinity=np.array([.9,.85,.8]); negative_affinity=np.array([.2,.3,.1])
gamma=.8; lam=1.; Kc=3
result=-lam/(Kc-1)*np.sum(gamma*positive_affinity-negative_affinity)
print(result)
R

Component demo, not a trained model — JULE approximate weighted-triplet expression from supplied affinities.

positive_affinity=c(.9,.85,.8); negative_affinity=c(.2,.3,.1)
gamma=.8; lambda=1; Kc=3
result=-lambda/(Kc-1)*sum(gamma*positive_affinity-negative_affinity)
print(result)

Sources

From the CodeSplash reference, entry UCL069.