Views
No views yet

1git clone git@github.com:LucaLumetti/UNetTransplant.git
2cd UNetTransplant1python -m venv env
2source env/bin/activate
3pip install -r requirements.txt1#!/bin/bash
2
3BASE_ABDOMEN="https://huggingface.co/Lumett/UNetTransplant/resolve/main/Abdomen"
4BASE_TOOTHFAIRY="https://huggingface.co/Lumett/UNetTransplant/resolve/main/ToothFairy"
5
6abdomen_files=(
7 Pretrain_AMOS.pth
8 TaskVector_Kidney_Abdomen.pth
9 TaskVector_Liver_Abdomen.pth
10 TaskVector_Spleen_Abdomen.pth
11 TaskVector_Stomach_Abdomen.pth
12)
13
14toothfairy_files=(
15 Pretrain_Cui.pth
16 TaskVector_Canals_ToothFairy2.pth
17 TaskVector_Mandible_ToothFairy2.pth
18 TaskVector_Teeth_ToothFairy2.pth
19 TaskVector_Pharynx_ToothFairy2.pth
20)
21
22echo "🩻 Downloading Abdomen files..."
23for file in "${abdomen_files[@]}"; do
24 wget -c "${BASE_ABDOMEN}/${file}"
25done
26
27echo "🦷 Downloading ToothFairy files..."
28for file in "${toothfairy_files[@]}"; do
29 wget -c "${BASE_TOOTHFAIRY}/${file}"
30donemain.py. It requires specifying the type of experiment and a configuration file that defines dataset, model, optimizer, and training parameters.python main.py --experiment <EXPERIMENT_TYPE> --config <CONFIG_PATH> [--expname <NAME>] [--override <PARAMS>]--experiment: Specifies the type of experiment to run."PretrainExperiment" → Pretrains the model from scratch."TaskVectorTrainExperiment" → Trains a task vector using a pretrained checkpoint.--config: Path to the configuration file, which defines dataset, model, and training settings.--expname (optional): Custom experiment name. If not provided, the config filename is used.--override (optional): Allows overriding config values at runtime. Example:python main.py --experiment PretrainExperiment --config configs/default.yaml --override DataConfig.BATCH_SIZE=4 OptimizerConfig.LR=0.01DataConfig): Path, batch size, patch size, and datasets used.BackboneConfig & HeadsConfig): Architecture, checkpoints, and initialization.OptimizerConfig): Learning rates, weight decay, and momentum.LossConfig): Defines the loss function used.TrainConfig): Number of epochs, checkpoint saving, and resume options.python main.py --experiment PretrainExperiment --config configs/miccai2025/pretrain_stable.yamlpython main.py --experiment TaskVectorTrainExperiment --config configs/miccai2025/finetune.yaml --override BackboneConfig.PRETRAIN_CHECKPOINTS="/path/to/checkpoint.pth"configs folder.@incollection{lumetti2025u,
title={U-Net Transplant: The Role of Pre-training for Model Merging in 3D Medical Segmentation},
author={Lumetti, Luca and Capitani, Giacomo and Ficarra, Elisa and Grana, Costantino and Calderara, Simone and Porrello, Angelo and Bolelli, Federico and others},
booktitle={Medical Image Computing and Computer Assisted Intervention--MICCAI 2025},
year={2025}
}