All of the processes are trained on Taiwan Computing Cloud (TWCC) and with an NVIDIA graphics card (NVIDIA V100). It is recommended to install latest drivers and use the GPU with 24+ GB of RAM.
-
Recommend: Install Miniconda for environment control.
-
Create a Conda environment for the platform:
python=3.10 torch=1.13.1+cu116
- Download the dataset from IEEEDataPort or Google Drive
- Create a new directory
DenTunder./data/, and put the dataset under./data/DenT/
-
If you want to train with your own data, please put your dataset
***inside./data/. target dataset and source dataset should be named as./data/***/train/targetand./data/***/train/source. -
Create your own testing set and validation set by running the following script:
python split_data.py
-
you should now see 3 folders inside the
./data/***(train, test, val), each consists of the foldertargetandsource.
- Download the
results.zipfrom latest release and unzip it ( Note: download allresults.z*together before unzip ) - Move the
checkpointsdirectory according to the structure of./results,./resultsis used to store the training results and as a variableresult_rootintroduced in the next section (result_root = ./results)
-
Open
./script/train.sh, and find the section below# variables target="target" # options: target / target_dna model="CusDenT" # options: (DenT) DenT, CusDenT(revision) data_root="../data" result_root="../results"
-
Modify
targetandmodelvariables (--random_seedand--use_multiheadsare the arguments forCusDenT) -
Go to
Line 5and replace the environment nameconda activate "[your environment]" -
Run
train.shcd script bash train.sh -
After the training progress, you should see the
result_dirlooks like the following structureresults/[target]/[model]_[target]_3D_15725_[num] | | --- checkpoints | | --- model_CusDenT_[n]_pth.tar | | --- ... | | --- model_CusDenT_best_pth.tar | | --- seg_results (empty) | --- [datetime]_args.toml | --- events.out.tfevents
- If your data is on the other place, you should modify
data_rootto redirect to the files - To save the results to the other place, please change
result_root
-
Open
./script/test.sh, and find the section below# variables target="target" # options: target / target_dna model="CusDenT" # options: (DenT) DenT, CusDenT(revision) data_root="../data" result_root="../results" record_dir="CusDenT_target_3D_15725_1" # change result dir
-
Modify
record_dir,targetandmodelvariablesrecord_dirshould be[model]_[target]_3D_15725_[num]targetandmodelshould match torecord_dir
-
Go to
Line 5and replace the environment nameconda activate "[your environment]" -
Run
test.shcd script bash test.sh -
After the process, you can find that predict images is generated in
seg_results/directory under[model]_[target]_3D_15725_[num]/
If tensorboard is installed, you can see the training progress with following actions
cd results
tensorboard --logdir . --port [port_num]-
Open
./script/calcu_score.sh, and find the section below# variables target="target" # options: target / target_dna model="CusDenT" # options: (DenT) DenT, CusDenT(revision) data_root="../data" result_root="../results" record_dir="CusDenT_target_3D_15725_1" # change result dir
-
Set variables as same as those in
test.sh -
Go to
Line 5and replace the environment nameconda activate "[your environment]" -
Run
calcu_score.shcd script bash calcu_score.sh -
Checkout the score
============================================================ |- class #0 : 0.92224 |- class #1 : 0.44280 |--> mean_iou: 0.682518 |- class #0 : 0.95955 |- class #1 : 0.61381 <--- Dice score of [target] |--> mean_dice: 0.786676
