Measuring Representation Quality
You'll learn: How to evaluate whether your self-supervised contrastive learning model has actually learned useful representations.
The Evaluation Challenge
After training a contrastive learning model, you have an encoder that transforms inputs into feature vectors—but how good are those representations? Unlike supervised learning where you can directly measure accuracy, self-supervised learning doesn't train on labels. You need separate evaluation methods to assess representation quality.
Three Core Evaluation Approaches
Linear Probing
What it is: Freeze your pretrained encoder completely and train only a simple linear classifier on top using labeled data from your downstream task.
Why it matters: If a linear layer alone achieves high performance, your representations are already well-separated and meaningful. This tests whether the hard work of feature extraction is done—only simple decision boundaries remain.
Think of it like: You've organized a messy library (unsupervised), and now someone asks you to find all mystery books (supervised task). If they're already grouped together, finding them is trivial.
Fine-Tuning
What it is: Initialize your model with pretrained weights, then continue training the entire network (encoder + task head) on labeled data.
Why it matters: This tests whether your representations provide a good starting point. Better pretraining should require fewer labeled examples and converge faster than training from scratch.
Downstream Task Performance
What it is: Test your representations on multiple real-world tasks (classification, detection, segmentation) and compare against baselines.
Why it matters: The ultimate test—do your representations generalize across diverse problems? High performance across many tasks indicates truly general-purpose features.
Practical Reality
You typically report results from all three methods. Linear probing shows representational quality, fine-tuning shows practical utility, and downstream task diversity demonstrates generalization.
Key Takeaway: Representation quality is measured indirectly through linear probing (frozen encoder), fine-tuning (adapting encoder), and performance across diverse downstream tasks—not during contrastive pretraining itself.