Skip to content

mathilde-b/TTA

Repository files navigation

Test-Time Adaptation with Shape Moments for Image Segmentation

Mathilde Bateson, Hervé Lombaert, Ismail Ben Ayed @ETS Montréal

Code of our submission at MICCAI 2022 and its ongoing journal extension.

Please cite our paper if you find it useful for your research.



@inproceedings{BatesonTTA,
	address = {Cham},
	author = {Bateson, Mathilde and Lombaert, Herve and Ben Ayed, Ismail},
	booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI 2022},
	editor = {Wang, Linwei and Dou, Qi and Fletcher, P. Thomas and Speidel, Stefanie and Li, Shuo},
	pages = {736--745},
	publisher = {Springer Nature Switzerland},
	title = {Test-Time Adaptation with Shape Moments for Image Segmentation},
	year = {2022}}

Visual comparison

Requirements

Non-exhaustive list:

  • python3.6+
  • Pytorch 1.0
  • nibabel
  • Scipy
  • NumPy
  • Matplotlib
  • Scikit-image
  • zsh
  • tqdm
  • pandas
  • scikit-image

Data scheme

datasets

For instance

data
    prostate_source/
	    train/
		IMG/
		    Case10_0.png
		    ...
		GT/
		    Case10_0.png
		    ...
		...
	    val/
		IMG/
		    Case11_0.png
		    ...
		GT/
		    Case11_0.png
		    ...
		...
    prostate_target/
	    test/
		IMG/
		    Case10_0.png
		    ...
		GT/
		    Case10_0.png
		    ...
		...

The network takes png or nii or nii.gz files as an input. The gt folder contains gray-scale images of the ground-truth, where the gray-scale level is the number of the class (0,1,...K).

results

results/
    prostate/
        fs/
            best_epoch_3d/
                val/
                    Case11_0.png
                    ...
            iter000/
                val/
            ...
        tta/
            ...
        params.txt # saves all the argparse parameters of the model 
	best_3d.pkl # best model saved
	last.pkl # last epoch
        IMG_target_metrics.csv # metrics over time, csv
        3dbestepoch.txt # number and 3D Dice of the best epoch 
        ...
    whs/
        ...
archives/
    $(REPO)-$(DATE)-$(HASH)-$(HOSTNAME)-sfda.tar.gz
    $(REPO)-$(DATE)-$(HASH)-$(HOSTNAME)-prostate.tar.gz

Interesting bits

The losses are defined in the losses.py file.

Related Implementation and Dataset

Note

The model and code are available for non-commercial research purposes only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published