Skip to content

M-3LAB/K-CROSS

Repository files navigation

KAID

KAID implementation

Preliminary

Dependency

conda install pytorch=1.8.1 torchvision torchaudio cudatoolkit=10.1 -c pytorch
pip3 install -r requirements.txt

Generate dataset

python3 data_preprecess/brats2021.py

Prepare statistics for FID metric. See ./fid_stats/gen_fid_stats.py for details.

python3 ./fid_stats/gen_fid_stats.py --dataset 'ixi'  --source-domain 't2' --target-domain 'pd' --gpu-id 0

Options. See ./configuration/config.py for details.

--fid [default=true]
--noise-type 'slight'/'severe' [default='normal'] 
--identity [default=true]
--diff-privacy [default=true]
--debug --save-img --single-img-infer 
--save-model --load-model --load-model-dir './work_dir/centralized/ixi/Tue Jan 11 20:18:31 2022'

Centralized Training

BraTS2021 ['t1', 't2', 'flair']

python3 centralized_training.py --dataset 'brats2021' --model 'cyclegan' --source-domain 't1' --target-domain 'flair' --data-path '/disk1/medical/brats2021/training' --valid-path '/disk1/medical/brats2021/validation'

IXI ['t2', 'pd']

python3 centralized_training.py --dataset 'ixi' --model 'cyclegan' --source-domain 'pd' --target-domain 't2' --data-path '/disk1/medical/ixi' --valid-path '/disk1/medical/ixi'  

KAID Training

python3 kaid.py --dataset 'ixi' --source-domain 'pd' --target-domain 't2' -g 1  --data-path '/disk/medical/ixi' --valid-path '/disk/medical/ixi' --nirps-path '/disk/medical/nirps_dataset' --train --num-epochs 30 --method 'normal'  

KAID Validation

python3 kaid.py --dataset 'ixi' --source-domain 'pd' --target-domain 't2' -g 1  --data-path '/disk/medical/ixi' --valid-path '/disk/medical/ixi'  --nirps-path '/disk/medical/nirps_dataset' --validate --method 'normal' --diff 'l2'

NIRPS Dataset Build Up

IXI ['t2', 'pd']

python3 generate_nirps_dataset.py --dataset 'ixi' --data-path '/disk/medical/ixi' --valid-path '/disk/medical/ixi' --model 'cyclegan' --source-domain 't2' --target-domain 'pd' -g 3 --num-epoch 30

BraTS2021 ['t1', 't2', 'flair']

python3 genrrate_nirps_dateset.py --dataset 'brats2021' --data-path '/disk/medical/brats2021/training' --valid-path '/disk/medical/brats2021/validation' --model 'cyclegan' --source-domain 't1' --target-domain 't2' -g 2 --num-epoch 30

Implementations of Data Processing

Sereval modes are described in the new settings of FedMed.

To reveal the real-world sitation in hosptials, datastream is organized as follows.

Load NIPRS Dataset, Generate Error Map, and Calculate Base Score for Human Judgement

python3 generate_nirps_err_map.py

Human Judgement

python3 artificial_scoring_system.py

Metric Consistency

python3 metric_consistency.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages