swinv2-tiny-patch4-window8-256-galaxy10-decals-full-v2

microsoft/swinv2-tiny-patch4-window8-256 adapted to galaxy morphology classification on Galaxy10 DECaLS (10 classes) by full fine-tuning (all parameters updated), 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.

Results (held-out test set, 1,774 images)

Accuracy (%) Weighted F1 (%)
This checkpoint (seed 42, epoch 21 of 30) 83.71 83.16
Mean +/- s.d. over three seeds (42, 1, 2) 84.50 +/- 0.69 84.04 +/- 0.77

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.

Training protocol

  • Data: Galaxy10 DECaLS (17,736 images). The public test split (1,774 images) is the held-out test set; the public train split is divided, with stratification by class, into 14,188 training and 1,774 validation images (indices in the dataset repository above). The validation set is used only to select the epoch.
  • Recipe (identical for the 40 backbones): AdamW (betas 0.9/0.999, eps 1e-8, weight decay 0.1, gradient clipping 1.0), learning rate 5e-5, linear schedule with 10% warm-up, batches of 32 images with gradient accumulation over 8 steps (effective batch 256), 30 epochs, single precision (fp32, TF32 disabled), one GPU. Augmentation: random resized crop to the input resolution and random horizontal flip. Evaluation: resize and centre crop to 256x256 px, normalisation of the checkpoint's image processor. Seed 42 (seeds 1 and 2 give the mean and s.d. above).
  • Regime: full fine-tuning (all parameters updated). The head is a single linear layer with ten outputs.
  • Selection: epoch of minimum validation loss (epoch 21 here); the weights of this repository are those of that epoch.
  • Software: PyTorch 2.3.0, transformers 4.37.2, datasets 2.19.1, torchvision 0.18.0.

Per-epoch metrics (seed 42)

Epoch Val. loss Val. acc. Test acc. Test weighted F1
1 1.5548 47.13 46.84 41.06
2 0.9217 68.09 65.11 64.00
3 0.7521 75.25 74.24 73.00
4 0.6313 79.37 78.80 77.94
5 0.5991 80.89 79.20 78.35
6 0.5691 81.00 80.61 79.69
7 0.5566 81.34 79.65 78.96
8 0.5360 81.91 81.00 79.61
9 0.5187 83.65 82.36 81.58
10 0.4997 83.88 82.69 82.38
11 0.5057 83.54 82.75 81.86
12 0.4998 83.82 82.75 82.12
13 0.5046 83.43 82.92 82.08
14 0.5162 83.43 82.64 81.62
15 0.4880 83.31 83.60 83.08
16 0.4869 83.88 83.37 82.67
17 0.4726 84.72 83.99 83.43
18 0.4728 85.29 84.78 84.05
19 0.4671 85.46 85.12 84.50
20 0.4735 85.17 85.06 84.57
21 (selected) 0.4655 84.67 83.71 83.16
22 0.4728 85.23 84.39 84.13
23 0.4687 84.89 84.55 84.18
24 0.4975 84.05 84.39 83.93
25 0.4712 85.06 84.50 83.97
26 0.4716 85.12 84.72 84.24
27 0.4715 85.12 84.33 83.70
28 0.4734 85.34 84.67 84.15
29 0.4658 85.23 84.84 84.32
30 0.4660 85.29 84.67 84.16

How to use

from transformers import AutoImageProcessor, AutoModelForImageClassification
from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize

model = AutoModelForImageClassification.from_pretrained("matthieulel/swinv2-tiny-patch4-window8-256-galaxy10-decals-full-v2").eval()
processor = AutoImageProcessor.from_pretrained("matthieulel/swinv2-tiny-patch4-window8-256-galaxy10-decals-full-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

Integrity check

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 5.96e-06).

Citation

Paper under revision for Astronomy and Computing; citation to be completed upon publication.

Downloads last month
56
Safetensors
Model size
27.6M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for matthieulel/swinv2-tiny-patch4-window8-256-galaxy10-decals-full-v2

Finetuned
(143)
this model

Dataset used to train matthieulel/swinv2-tiny-patch4-window8-256-galaxy10-decals-full-v2

Collection including matthieulel/swinv2-tiny-patch4-window8-256-galaxy10-decals-full-v2

Evaluation results