Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implementation of Medical Slice Transformer

License

mueller-franzes/MST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medical Slice Transformer: Improved Diagnosis and Explainability on 3D Medical Images with DINOv2

Please see our paper: https://doi.org/10.48550/arXiv.2411.15802

MST
Figure: Overview of the Model Architecture and Attention Flow.
(a) The Medical Slice Transformer framework processes individual MRI or CT slices using 2D image encoders, such as DINOv2, and then passes the encoded outputs through the Slice Transformer for downstream classification tasks.
(b) Visualization of attention mechanisms showing how the Slice Transformer assigns attention to specific slices and how within-slice attention is further refined to specific patches, resulting in a combined attention map highlighting regions of interest in the input volume.

Step 1: Setup

  • Clone this repository git clone https://github.com/mueller-franzes/MST
  • Run: conda env create -f environment.yaml
  • Run conda activate MST

Step 2: Setup Data

Option A: Public Data

Option B: Private Data

Step 3: Run Training

Option A: Use Trained Models

Skip training and download the weights from Zenodo.

Option B: Train Models

Run Script: scripts/main_train.py

  • Eg. python scripts/main_train.py --dataset LIDC --model ResNet
  • Use --model to select:
    • ResNet = 3D ResNet50,
    • ResNetSliceTrans = MST-ResNet,
    • DinoV2ClassifierSlice = MST-DINOv2

Step 4: Predict & Evaluate Performance

Run Script: scripts/main_predict.py

  • Eg. python scripts/main_predict.py --run_folder LIDC/ResNet
  • Use --get_attention to compute saliency maps
  • Use --get_segmentation to compute segmentation masks and DICE score
  • Use --use_tta to enable Test Time Augmentation

About

Implementation of Medical Slice Transformer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages