MCPcopy Index your code
hub / github.com/SLDGroup/MERIT

github.com/SLDGroup/MERIT @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,141 symbols 3,047 edges 75 files 193 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MERIT

This is the implementation of Multi-scale Hierarchical Vision Transformer with Cascaded Attention Decoding for Medical Image Segmentation, MIDL 2023 Video.

Md Mostafijur Rahman, Radu Marculescu

The University of Texas at Austin

🔍 Check out our CVPR 2024 paper! EMCAD

🔍 Check out our CVPRW 2024 paper! PP-SAM

🔍 Check out our WACV 2024 paper! G-CASCADE

🔍 Check out our WACV 2023 paper! CASCADE

Architectures

Qualitative Results on Synapse Multi-organ dataset

Usage:

Recommended environment:

Python 3.8
Pytorch 1.11.0
torchvision 0.12.0

Please use pip install -r requirements.txt to install the dependencies.

Data preparation:

  • Synapse Multi-organ dataset: Sign up in the official Synapse website and download the dataset. Then split the 'RawData' folder into 'TrainSet' (18 scans) and 'TestSet' (12 scans) following the TransUNet's lists and put in the './data/synapse/Abdomen/RawData/' folder. Finally, preprocess using python ./utils/preprocess_synapse_data.py or download the preprocessed data and save in the './data/synapse/' folder. Note: If you use the preprocessed data from TransUNet, please make necessary changes (i.e., remove the code segment (line# 88-94) to convert groundtruth labels from 14 to 9 classes) in the utils/dataset_synapse.py.

  • ACDC dataset: Download the preprocessed ACDC dataset from Google Drive and move into './data/ACDC/' folder.

Pretrained model:

You should download the pretrained MaxViT models from Google Drive, and then put it in the './pretrained_pth/maxvit/' folder for initialization.

Training:

cd into MERIT

For Synapse Multi-organ training run CUDA_VISIBLE_DEVICES=0 python -W ignore train_synapse.py

For ACDC training run CUDA_VISIBLE_DEVICES=0 python -W ignore train_ACDC.py

Testing:

cd into MERIT 

For Synapse Multi-organ testing run CUDA_VISIBLE_DEVICES=0 python -W ignore test_synapse.py

For ACDC testing run CUDA_VISIBLE_DEVICES=0 python -W ignore test_ACDC.py

Acknowledgement

We are very grateful for these excellent works timm, CASCADE, PraNet, Polyp-PVT and TransUNet, which have provided the basis for our framework.

Citations

@inproceedings{rahman2023multi,
  title={Multi-scale Hierarchical Vision Transformer with Cascaded Attention Decoding for Medical Image Segmentation},
  author={Rahman, Md Mostafijur and Marculescu, Radu},
  booktitle={Medical Imaging with Deep Learning (MIDL)},
  month={July},
  year={2023}
}

Core symbols most depended-on inside this repo

_assert
called by 41
lib/models_timm/layers/trace_utils.py
_cfg
called by 38
lib/maxxvit_4out.py
_create_maxxvit
called by 38
lib/maxxvit_4out.py
_cfg
called by 38
lib/models_timm/maxxvit.py
_create_maxxvit
called by 38
lib/models_timm/maxxvit.py
get
called by 32
lib/models_timm/features.py
_cfg
called by 28
lib/models_timm/convnext.py
_create_convnext
called by 28
lib/models_timm/convnext.py

Shape

Method 532
Function 400
Class 209

Languages

Python100%

Modules by API surface

lib/models_timm/maxxvit.py125 symbols
lib/maxxvit_4out.py125 symbols
lib/models_timm/mlp_mixer.py55 symbols
lib/models_timm/levit.py52 symbols
lib/models_timm/vision_transformer_relpos.py50 symbols
lib/models_timm/layers/activations_me.py47 symbols
lib/models_timm/convnext.py47 symbols
lib/models_timm/layers/evo_norm.py40 symbols
lib/models_timm/layers/activations.py35 symbols
lib/models_timm/helpers.py33 symbols
lib/networks.py32 symbols
lib/models_timm/features.py27 symbols

For agents

$ claude mcp add MERIT \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact