A small study of supervised vs. unsupervised representation learning on MNIST. Trains a convolutional autoencoder, an end-to-end classifier, and a linear probe over the frozen pre-trained encoder, then compares what each objective keeps in the latent space.
Full writeup with figures and discussion is in report.pdf.
| Full set (60k) | 100 labels | |
|---|---|---|
| End-to-end classifier | 98.1 % | 67.5 % |
| Linear probe on frozen reconstruction encoder | 88.0 % | 71.8 % |
With abundant labels, end-to-end training wins. With only 100 labels, unsupervised pre-training wins — the probe inherits features from 60k unlabelled images and only fits 170 parameters on top.
The reverse experiment (freeze the classifier's encoder, train a fresh decoder) reconstructs digits that look like class prototypes — the classifier's encoder has already discarded the within-class style the decoder would need.
pip install -r requirements.txt
jupyter notebook notebooks/mnist_representation_learning.ipynbMNIST downloads on first run. Runs in a few minutes on CPU.
.
├── README.md
├── report.pdf # full writeup with figures
├── report.tex # LaTeX source
├── requirements.txt
├── notebooks/
│ └── mnist_representation_learning.ipynb
└── figures/ # PNGs referenced by report.tex