This is the repository with the code of experiments for the paper "First U-Net Layers Contain More Domain Specific Information Than The Last Ones"
https://arxiv.org/abs/2008.07357
ln -sfn ~/workspace/domain_adaptation_mri/damri ~/miniconda3/lib/python3.*/site-packages/
where *
is the version of your python.
git clone https://github.com/neuro-ml/deep_pipe.git
cd deep_pipe
git checkout 5c08d5759d51c0731cc636c2866bb3a538ffab7a
pip install -e .
git clone https://github.com/deepmind/surface-distance.git
pip install surface-distance/
Original repository: https://github.com/deepmind/surface-distance
There is a minor error in surface_distance/metrics.py
: the line 102
should be commented, please do it (might be already fixed by the time you are reading this_
- Python: 3.7.6
- Torch: 1.5.0
-
The path to your local copy of CC359 should be specified here:
config/assets/dataset/cc359.config
. You should placenotebook/meta.csv
in the same folder with the data. From the available inCC359
ground truths we used the "Silver standard" binary mask (https://sites.google.com/view/calgary-campinas-dataset/download) -
You should specify the 'device' on which you are going to run an experiment by setting the corresponding variable 'device', e.g., in
~/config/experiments/unet2d/unfreeze_first.config
-
To run a single experiment, please follow the steps below:
First, the experiment structure should be created:
dpipe-build /path/to/the/config /path/to/the/experiment
# e.g.
dpipe-build ~/config/experiments/unet2d/unfreeze_first.config ~/dart_results/unfreeze_first
where the first argument is the path to the .config
file and the second argument is the path to the folder where the experiment structure will be organized.
Then, to run an experiment please go to the experiment folder inside the created structure (i
corresponds to the particular experiment, i.e. to the particular source-target pair):
cd ~/dart_results/unfreeze_first/experiment_{i}
and call the following command to start the experiment:
dpipe-run ../resources.config
where resources.config
is the general .config
file of the experiment.
- Note that switching on/off the augmentation is controlled by
augm_fn
variable in the.config
files. The number of scans to fine-tune on is controlled byn_add_ids
, while the share of available slices from a certain scan byslice_sampling_interval