ink_paris4_3d_4.8um_gambiarra
A residual 3D U-Net with ~24.5M parameters for ink detection in PHercParis4. It reads normalized 2.4 µm CT crops, pools them to 4.8 µm, and predicts one ink logit per output voxel. The released checkpoint is student update 25,000, used for full-volume inference.
Files
The model is in scrollprize/ink_paris4_3d_4.8um_gambiarra.
| File | Content |
|---|---|
model.safetensors |
Student weights at update 25,000 |
config.json |
Villa network configuration and input/output conventions |
RECIPE.md |
Training stages and hyperparameters |
LICENSE |
MIT license |
Weights SHA-256: a3986efb473364251af075bbcfa1a982a21a08106d7a5d48b9e954dfeca1a433.
Run inference
Use vesuvius.ink_detection.paris4_3d_gambiarra in ScrollPrize/villa. The package README has the training and full-volume inference commands. Use the ink-paris4-3d-gambiarra branch and set up Villa's Python 3.14 environment:
VILLA=/path/to/villa
cd "$VILLA/vesuvius"
uv sync --frozen --extra models --no-install-package volume-cartographer
source .venv/bin/activate
export PYTHONPATH="$VILLA/dinovol${PYTHONPATH:+:$PYTHONPATH}"
Download model.safetensors. Run inference on a small region with a CUDA GPU:
python -m vesuvius.ink_detection.paris4_3d_gambiarra.infer_volume \
--weights /path/to/model.safetensors --out runs/box --unit 256 \
--box 32381 7712 8064 32509 7840 8192
The command reads the public PHercParis4 level-0 CT. --box takes z0 y0 x0 z1 y1 x1 in 4.8 µm output voxels, with exclusive upper bounds. It selects whole work units that overlap the box. The output keeps the full-volume shape and coordinates.
Input and output conventions
- CT:
PHercParis4/volumes/20260411134726-2.400um-0.2m-78keV-masked.zarr/0/, 2.4 µm, uint8, ZYX. Use--ctfor a local copy of this level-0 array. - Normalization before pooling: for each 128³ native crop, compute p1 / p99 of its surrounding 256³ parent, clip and scale to [0, 1], then average-pool by 2 to 64³ at 4.8 µm. The CLI applies the same preprocessing used for training and full-volume inference.
- Network output: 64³ logits at 4.8 µm. Output index
jmaps to level-0 centre2*j + 0.5on each axis. - Dense inference: nominal stride 32 output voxels, adjusted to the volume dimensions; Gaussian blending with σ = 8 output voxels. The historical full-volume run used units of 2048 output voxels, batch 16, bf16 autocast and no test-time augmentation.
- Storage:
<out>/code.zarr/0is Zarr v2 uint8, withclip(floor(10 * logit) + 128, 1, 255)and zero for no prediction. These encoded logits are distinct from transformed uint8 display scores. - Interpretation:
sigmoid(logit)is an ink score, not a calibrated probability. No decision threshold is supplied.
Training
The stages below document how we developed the released checkpoint. They record the experiments and continuations used during discovery, not a recipe we recommend repeating. One DINO fine-tuning run followed by one student distillation run would likely be enough, but we have not tested that shorter recipe.
The teacher started from the public self-supervised DINO volume checkpoint, pretrained on CT that included PHercParis4. Teacher training had four stages: linear20k, scribble5k, scribble10k, and all_aug. Student training had two stages:
- The student trained from seed 27 for 20,000 updates with scribble labels and
scribble10ktargets. - Training continued for 5,000 updates with all 9,627 scribble samples and
all_augtargets at a constant learning rate of 3e-5. The run retained the weights, AdamW state, and unlabelled stream, and ended at update 25,000.
Each update uses 16 labelled and 16 unlabelled views, with BCE on scribble samples + 4 × labelled distillation BCE + 4 × unlabelled distillation BCE. See RECIPE.md for all stages.
The dataset contains 2,929 ink and 6,698 no-ink samples from labeled scribbles and individual clicks. Download paris4_ink_scribbles.vc3d.json from prefix ink_paris4_3d_4.8um_gambiarra/ in the ScrollPrize datasets bucket.
Early stages used a train/evaluation split. The final teacher and student trained on every released sample. The Villa commands use the complete JSON from the first stage.
License and attribution
Licensed under MIT. The model uses CT data, annotations, and software from the Vesuvius Challenge and the public DINO volume checkpoint linked above.