U-Net Segmentation
There are no manual galaxy masks in Galaxy10, so segmentation is weakly supervised: an Otsu-based teacher produces three-class pseudo-labels, and a U-Net is trained to reproduce and regularise them.
Pseudo-labels (the “teacher”)
OtsuSegmenter (background percentile 5) builds a galaxy mask by Otsu threshold, hole filling and largest-component selection, then splits it:
| Class | Definition |
|---|---|
| 0 — background | outside the galaxy mask |
| 1 — disk | galaxy mask, below the 80th percentile of galaxy pixel brightness |
| 2 — “bulge” | pixels above that percentile |
Class 2 is by construction the brightest 20 % of the galaxy's pixels, so the Otsu bulge fraction is 0.200 for every morphology class. It is not a physical bulge/disk decomposition. The U-Net learns this brightness criterion; its predicted bulge fraction (median 0.100) correlates only very weakly with colour (see Physical Interpretation).
Pseudo-label pixel shares on the training set: 9.5% background, 72.4% disk, 18.1% bulge; class weights in the loss compensate the imbalance.
Model and training
U-Net (Ronneberger et al. 2015) with four encoder levels (64 → 512 filters), a 1,024-filter bottleneck with dropout 0.3 and bilinear up-sampling. Loss: 0.5 × Dice + 0.5 × cross-entropy (label smoothing 0.05, class weights 0.3 / 1.5 / 3.0). AdamW, learning rate 1 × 10⁻⁴, 20 epochs, FP16, best epoch by validation mean IoU.
Results
_facts/astrovision/FACTS_INDEX.md §3 and shown when hovering over a number.| Pixel class (test) | Precision | Recall | F1 |
|---|---|---|---|
| Background | 0.722 | 0.611 | 0.662 |
| Disk | 0.825 | 0.935 | 0.876 |
| “Bulge” | 0.730 | 0.396 | 0.513 |
The mIoU is measured against the Otsu pseudo-labels, not against human masks, so it quantifies how well the network reproduces its teacher. The comparison table in the project README (random ≈ 0.167, Otsu ≈ 0.500, “+4 % over the teacher”) has no counterpart in the notebook outputs and is not reproduced here: the teacher scored against itself is trivially perfect. The network misses most of the “bulge” pixels (recall 39.6%) because a quantile threshold is a noisy target at the pixel level.
By morphology class, the U-Net mIoU ranges from 0.355 (Cigar Shaped Smooth) to 0.517 (Unbarred Tight Spiral).
Other segmenters
DINOv2PatchSegmenter clusters patch features with k-means (k = 3, 4, 5 tried in the notebook) — a label-free alternative, shown qualitatively. SAMSegmenter (Segment Anything) is optional and was not run: its checkpoint was absent in the recorded notebook.






