Loading…
Loading…
microsoft/swinv2-small-patch4-window16-256 adapted to galaxy morphology classification on Galaxy10 DECaLS (10 classes) by head-only fine-tuning (backbone frozen, linear head trained), under the revised protocol of the paper When foundation models meet astronomical data (Astronomy and Computing, revised version, 2026). One of the 80 configurations (40 pretrained backbones x two adaptation regimes) of the collection Vision Foundation Models Benchmark.
This repository contains the complete model: the backbone weights are those of the base checkpoint (frozen during training, including the statistics of its normalisation layers) and the classification head is the trained one.
| Accuracy (%) | Weighted F1 (%) | |
|---|---|---|
| This checkpoint (seed 42, epoch 30 of 30) | 49.10 | 46.73 |
| Mean +/- s.d. over three seeds (42, 1, 2) | 49.30 +/- 0.18 | 46.95 +/- 0.19 |
Scores are computed at the epoch of minimum validation loss. The per-epoch metrics of all runs, the tables of the paper and the data split are in the dataset vision-foundation-models-benchmark-runs.
| Epoch | Val. loss | Val. acc. | Test acc. | Test weighted F1 |
|---|---|---|---|---|
| 1 | 2.2529 | 12.91 | 13.42 | 8.05 |
| 2 | 2.0854 | 26.21 | 27.45 | 17.73 |
| 3 | 1.9346 | 32.24 | 33.71 | 27.01 |
| 4 | 1.8181 | 36.19 | 38.05 | 32.48 |
| 5 | 1.7461 | 38.22 | 40.81 | 35.59 |
| 6 | 1.6883 | 40.59 | 43.01 | 38.40 |
| 7 | 1.6477 | 41.43 | 42.95 | 37.90 |
| 8 | 1.6189 | 42.16 | 43.97 | 39.33 |
| 9 | 1.5934 | 42.95 | 44.48 | 40.28 |
| 10 | 1.5699 | 43.57 | 45.94 | 42.01 |
| 11 | 1.5548 | 43.91 | 45.72 | 41.91 |
| 12 | 1.5370 | 44.76 | 46.51 | 43.48 |
| 13 | 1.5235 | 44.87 | 46.96 | 43.65 |
| 14 | 1.5146 | 46.11 | 47.13 | 44.07 |
| 15 | 1.5085 | 45.55 | 47.13 | 44.02 |
| 16 | 1.4935 | 46.05 | 47.58 | 44.45 |
| 17 | 1.4874 | 46.62 | 47.80 | 44.63 |
| 18 | 1.4804 | 46.67 | 48.37 | 45.51 |
| 19 | 1.4748 | 47.01 | 48.42 | 45.64 |
| 20 | 1.4724 | 46.51 | 47.75 | 45.03 |
| 21 | 1.4675 | 46.79 | 48.08 | 45.28 |
| 22 | 1.4627 | 47.41 | 48.37 | 45.67 |
| 23 | 1.4592 | 46.96 | 48.25 | 45.56 |
| 24 | 1.4561 | 47.24 | 48.82 | 46.32 |
| 25 | 1.4534 | 47.52 | 49.21 | 46.85 |
| 26 | 1.4510 | 47.63 | 49.21 | 46.86 |
| 27 | 1.4502 | 47.69 | 49.32 | 47.01 |
| 28 | 1.4493 | 47.69 | 49.27 | 46.88 |
| 29 | 1.4486 | 47.80 | 49.04 | 46.62 |
| 30 (selected) | 1.4486 | 47.75 | 49.10 | 46.73 |
from transformers import AutoImageProcessor, AutoModelForImageClassification
from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize
model = AutoModelForImageClassification.from_pretrained("matthieulel/swinv2-small-patch4-window16-256-galaxy10-decals-head-v2").eval()
processor = AutoImageProcessor.from_pretrained("matthieulel/swinv2-small-patch4-window16-256-galaxy10-decals-head-v2")
# Pre-processing used in the paper: resize and centre-crop to 256x256 px, then the processor's normalisation
transform = Compose([Resize(256), CenterCrop((256, 256)), ToTensor(), Normalize(processor.image_mean, processor.image_std)])
# logits = model(pixel_values=transform(image).unsqueeze(0)).logits
The model stored in this repository was reloaded and run on the first 96 test images: predictions identical to the saved logits of the selected epoch for 100.0% of them (maximum absolute logit difference 2.62e-06).
Paper under revision for Astronomy and Computing; citation to be completed upon publication.
microsoft/swinv2-small-patch4-window16-256