Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
library_name: pytorch
|
| 3 |
pipeline_tag: image-feature-extraction
|
| 4 |
license: cc-by-nc-sa-4.0
|
| 5 |
tags:
|
|
@@ -38,27 +38,19 @@ Given a preprocessed volume, the model returns a CLS token and a grid of patch t
|
|
| 38 |
|
| 39 |
- **Developed by:** Asa Gilmore, Dr. Ariel Rokem.
|
| 40 |
- **Model type:** 3D Vision Transformer (self-supervised feature encoder)
|
| 41 |
-
- **Architecture:** DINOv3 ViT, adapted to 3D
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
(
|
| 45 |
-
|
| 46 |
-
- **Input:** Single-channel ("grayscale") 3D volume, shape `1 × D × H × W`, resampled to
|
| 47 |
-
**1 mm isotropic** spacing and padded to a multiple of the patch size (16) per axis. Trained
|
| 48 |
-
with 128³ global / 48³ local crops (base pretrain + Gram-anchoring phases), later adapted to
|
| 49 |
-
192³ global / 64³ local crops in a high-resolution phase — see [Training Details](#training-details).
|
| 50 |
- **Output:** 792-dimensional embeddings: 1 CLS token + `(D/16)·(H/16)·(W/16)` patch tokens (no
|
| 51 |
register tokens). `model.forward_features(x)` returns a dict including
|
| 52 |
`x_norm_clstoken` (`B×792`) and `x_norm_patchtokens` (`B×N×792`).
|
| 53 |
-
- **
|
| 54 |
-
training itself used bf16 param dtype / fp32 reduce dtype under FSDP2 mixed precision).
|
| 55 |
-
- **License:** CC BY-NC-SA 4.0 (inherited from FOMO300K — see [Licensing](#licensing-and-attribution)). FILL_ME — confirm this is the license you intend before publishing; it is not yet stated anywhere else in this repo.
|
| 56 |
-
- **Trained from scratch:** Yes — no pretrained initialization of any kind
|
| 57 |
|
| 58 |
### Model Sources
|
| 59 |
|
| 60 |
-
- **Repository:** [`asagilmore/dinov3d`](https://github.com/asagilmore/dinov3d) (training/modeling code
|
| 61 |
-
- **Paper:** None — no technical report exists yet for this model. FILL_ME if one is written.
|
| 62 |
- **Architecture reference:** [DINOv3](https://arxiv.org/abs/2508.10104) (Siméoni et al., 2025)
|
| 63 |
|
| 64 |
### Relationship to DINOv3
|
|
@@ -75,11 +67,11 @@ under CC BY-NC-SA 4.0.
|
|
| 75 |
| Component | 2D DINOv3 | This model |
|
| 76 |
|---|---|---|
|
| 77 |
| Patch embedding | Conv2d, 16×16 | Conv3d, 16×16×16 (`in_chans=1`, single-channel MRI) |
|
| 78 |
-
| Positional encoding | 2-axis RoPE | 3-axis (D/H/W) axial RoPE
|
| 79 |
-
| Register tokens | 4 | 0
|
| 80 |
| Global/local crops | 2D multi-crop | 3D multi-crop: 128³ global / 48³ local (base + Gram phases), later 192³ / 64³ (high-res phase); 8 local crops per global crop |
|
| 81 |
-
| Color augmentation | color jitter, RGB mean/std normalization | none
|
| 82 |
-
| Objective terms | DINO + iBOT + Koleo + Gram anchoring | Same four terms, applied in stages
|
| 83 |
|
| 84 |
Data augmentation has also been reworked with domain specific augmentations for brain MRI,
|
| 85 |
more details on data augmentation can be found in the code repo.
|
|
@@ -100,12 +92,15 @@ The teacher checkpoints can be loaded following the inference instructions in th
|
|
| 100 |
and the sharded checkpoints can be used to restart training for fine-tuning experiments.
|
| 101 |
|
| 102 |
The teacher checkpoints can be found in the eval folder. We include all checkpoints captured
|
| 103 |
-
during training, but
|
| 104 |
evaluate performance over training iterations.
|
| 105 |
|
| 106 |
The ckpt directory contains the sharded checkpoints, which we include at the end of
|
| 107 |
each training phase.
|
| 108 |
|
|
|
|
|
|
|
|
|
|
| 109 |
---
|
| 110 |
|
| 111 |
## Training Details
|
|
@@ -113,10 +108,7 @@ each training phase.
|
|
| 113 |
### Training Data
|
| 114 |
|
| 115 |
**Dataset:** [FOMO-MRI/FOMO300K](https://huggingface.co/datasets/FOMO-MRI/FOMO300K)
|
| 116 |
-
(Cerri et al., 2026)
|
| 117 |
-
sources, spanning T1, MPRAGE, T2, T2*, FLAIR, SWI, T1c, PD, DWI, and ADC sequences, and
|
| 118 |
-
including both clinical- and research-grade acquisitions. It is a superset of OpenMind and
|
| 119 |
-
FOMO50K/FOMO60K.
|
| 120 |
|
| 121 |
We filtered the fomo300k dataset to include only single channel anatomical scans.
|
| 122 |
The repo contains a fomo300k.json file listing all subjects used.
|
|
@@ -130,11 +122,11 @@ FOMO300K is distributed as NIfTI without co-registration or skull-stripping.
|
|
| 130 |
- Padding: to the nearest multiple of patch size (16) per axis, filled with the volume's
|
| 131 |
minimum intensity value (`DivisiblePadd(..., mode="minimum")`)
|
| 132 |
- Intensity normalization: per-volume z-score (`NormalizeIntensityd(nonzero=True,
|
| 133 |
-
channel_wise=True)`), plus empty-signal filling (`SignalFillEmptyd`)
|
| 134 |
time when building the preprocessed dataset (`scripts/preproccess_fomo300k.py`), not
|
| 135 |
per-forward-pass
|
| 136 |
- Augmentations (training only): 3D multi-crop (128³ global / 48³ local scaled up to 192³/64³
|
| 137 |
-
in the high-res phase; crop scale ranges 0.32
|
| 138 |
sample), random flips. No color jitter (single-channel intensities, not RGB).
|
| 139 |
|
| 140 |
### Training Hyperparameters
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: pytorch
|
| 3 |
pipeline_tag: image-feature-extraction
|
| 4 |
license: cc-by-nc-sa-4.0
|
| 5 |
tags:
|
|
|
|
| 38 |
|
| 39 |
- **Developed by:** Asa Gilmore, Dr. Ariel Rokem.
|
| 40 |
- **Model type:** 3D Vision Transformer (self-supervised feature encoder)
|
| 41 |
+
- **Architecture:** DINOv3 ViT, adapted to 3D - See `vit3d_base` in dinov3d repo
|
| 42 |
+
- **Input:** Single-channel 3D volume, resampled to
|
| 43 |
+
1 mm isotropic spacing and padded to a multiple of the patch size (16). Trained
|
| 44 |
+
with 128^3 global / 48^3 local crops (base pretrain + Gram-anchoring phases), later adapted to
|
| 45 |
+
192^3 global / 64^3 local crops in a high-resolution phase - see [Training Details](#training-details).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
- **Output:** 792-dimensional embeddings: 1 CLS token + `(D/16)·(H/16)·(W/16)` patch tokens (no
|
| 47 |
register tokens). `model.forward_features(x)` returns a dict including
|
| 48 |
`x_norm_clstoken` (`B×792`) and `x_norm_patchtokens` (`B×N×792`).
|
| 49 |
+
- **License:** CC BY-NC-SA 4.0 (inherited from FOMO300K - see [Licensing](#licensing-and-attribution))
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
### Model Sources
|
| 52 |
|
| 53 |
+
- **Repository:** [`asagilmore/dinov3d`](https://github.com/asagilmore/dinov3d) (training/modeling code)
|
|
|
|
| 54 |
- **Architecture reference:** [DINOv3](https://arxiv.org/abs/2508.10104) (Siméoni et al., 2025)
|
| 55 |
|
| 56 |
### Relationship to DINOv3
|
|
|
|
| 67 |
| Component | 2D DINOv3 | This model |
|
| 68 |
|---|---|---|
|
| 69 |
| Patch embedding | Conv2d, 16×16 | Conv3d, 16×16×16 (`in_chans=1`, single-channel MRI) |
|
| 70 |
+
| Positional encoding | 2-axis RoPE | 3-axis (D/H/W) axial RoPE |
|
| 71 |
+
| Register tokens | 4 | 0 |
|
| 72 |
| Global/local crops | 2D multi-crop | 3D multi-crop: 128³ global / 48³ local (base + Gram phases), later 192³ / 64³ (high-res phase); 8 local crops per global crop |
|
| 73 |
+
| Color augmentation | color jitter, RGB mean/std normalization | none - single-channel intensities are z-score normalized once during preprocessing instead |
|
| 74 |
+
| Objective terms | DINO + iBOT + Koleo + Gram anchoring | Same four terms, applied in stages - see [Training Details](#training-details) |
|
| 75 |
|
| 76 |
Data augmentation has also been reworked with domain specific augmentations for brain MRI,
|
| 77 |
more details on data augmentation can be found in the code repo.
|
|
|
|
| 92 |
and the sharded checkpoints can be used to restart training for fine-tuning experiments.
|
| 93 |
|
| 94 |
The teacher checkpoints can be found in the eval folder. We include all checkpoints captured
|
| 95 |
+
during training, but recommend using the latest one, unless doing experiments to
|
| 96 |
evaluate performance over training iterations.
|
| 97 |
|
| 98 |
The ckpt directory contains the sharded checkpoints, which we include at the end of
|
| 99 |
each training phase.
|
| 100 |
|
| 101 |
+
The layout of the checkpoints follows from the original dinov3 outputs, so their repo can
|
| 102 |
+
be used as a rough reference for layout.
|
| 103 |
+
|
| 104 |
---
|
| 105 |
|
| 106 |
## Training Details
|
|
|
|
| 108 |
### Training Data
|
| 109 |
|
| 110 |
**Dataset:** [FOMO-MRI/FOMO300K](https://huggingface.co/datasets/FOMO-MRI/FOMO300K)
|
| 111 |
+
(Cerri et al., 2026)
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
We filtered the fomo300k dataset to include only single channel anatomical scans.
|
| 114 |
The repo contains a fomo300k.json file listing all subjects used.
|
|
|
|
| 122 |
- Padding: to the nearest multiple of patch size (16) per axis, filled with the volume's
|
| 123 |
minimum intensity value (`DivisiblePadd(..., mode="minimum")`)
|
| 124 |
- Intensity normalization: per-volume z-score (`NormalizeIntensityd(nonzero=True,
|
| 125 |
+
channel_wise=True)`), plus empty-signal filling (`SignalFillEmptyd`) - done once ahead of
|
| 126 |
time when building the preprocessed dataset (`scripts/preproccess_fomo300k.py`), not
|
| 127 |
per-forward-pass
|
| 128 |
- Augmentations (training only): 3D multi-crop (128³ global / 48³ local scaled up to 192³/64³
|
| 129 |
+
in the high-res phase; crop scale ranges 0.32-1.0 global, 0.05–0.32 local; 8 local crops per
|
| 130 |
sample), random flips. No color jitter (single-channel intensities, not RGB).
|
| 131 |
|
| 132 |
### Training Hyperparameters
|