DINOv2 — Fine-tuned
Key results
_facts/astrovision/FACTS_INDEX.md §3 and shown when hovering over a number.Recipe
| Item | Value |
|---|---|
| Backbone | DINOv2 ViT-B/14 (torch.hub, dinov2_vitb14), CLS token → LayerNorm → Dropout(0.3) → Linear(768→10) |
| Phase 1 | linear probe on cached features (about 20 s) initialises the head — validation balanced accuracy 55.0% |
| Phase 2 | full fine-tuning, 10 epochs, learning rate 5 × 10⁻⁶, weight decay 1 × 10⁻⁴, batch size 32, FP16 mixed precision |
| Augmentation | resize 256, random crop 224, flips, rotation 180°, colour jitter |
The learning rate is deliberately very low: large rates destabilise a ViT that is already well initialised. The head is initialised from the probe so the first epochs do not spend their gradient on a random classifier. The class DINOv2Classifier is defined in notebook 04 (not in src/astrovision/models.py).
Per-class recall
Most classes exceed 0.85 recall. The weak ones are Disturbed (0.53, often confused with loose spirals and in-between smooth galaxies), Cigar Shaped Smooth (0.72, confused with In-between Round Smooth) and Unbarred Loose Spiral (0.78). Per-class values are read from the exported confusion matrix (two decimals).
What changes inside the network
Before fine-tuning, attention of the CLS token is partly drawn to bright background stars; afterwards it covers the galaxy structure (qualitative, figure below; see Attention & Grad-CAM).
The validation maximum (84.7%, epoch 6) is higher than the final test balanced accuracy (83.9%); the validation curve is noisy (it dips in the middle of training), so differences of one to two points between models on 2,660 test images should not be over-interpreted. One training run per model, no seeds repeated.


