Skip to content

Rapid Diagonal Zigzag Mamba Network for Medical Image Segmentation

Notifications You must be signed in to change notification settings

lzeeorno/CZS-Ma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CZS-Ma: Comprehensive Zigzag Scan Mamba Network for Precise and Efficient Segmentation

0. Main Environments

conda create -n your_environment_name python=3.8
conda activate your_environment_name
pip install torch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu117
pip install packaging
pip install timm==0.4.12
pip install pytest chardet yacs termcolor
pip install submitit tensorboardX
pip install triton==2.0.0
pip install causal_conv1d==1.0.0  # causal_conv1d-1.0.0+cu118torch1.13cxx11abiFALSE-cp38-cp38-linux_x86_64.whl
pip install mamba_ssm==1.0.1  # mmamba_ssm-1.0.1+cu118torch1.13cxx11abiFALSE-cp38-cp38-linux_x86_64.whl
pip install scikit-learn matplotlib thop h5py SimpleITK scikit-image medpy yacs

Alternatively, you can use Autodl to quickly get started. Select state-spaces/mamba/mamba-ssm1.1.1_causal-convld1.1.3/v1 in the community mirror

1. Prepare the dataset

ISIC datasets

  • The ISIC17 and ISIC18 datasets, divided into a 7:3 ratio, can be found here {Baidu or GoogleDrive}.

  • After downloading the datasets, you are supposed to put them into './data/isic17/' and './data/isic18/', and the file format reference is as follows. (take the ISIC17 dataset as an example.)

  • './data/isic17/'

    • train
      • images
        • .png
      • masks
        • .png
    • val
      • images
        • .png
      • masks
        • .png

Synapse datasets

  • For the Synapse dataset, you could follow Swin-UNet to download the dataset, or you could download them from {Baidu}.

  • After downloading the datasets, you are supposed to put them into './data/Synapse/', and the file format reference is as follows.

  • './data/Synapse/'

    • lists
      • list_Synapse
        • all.lst
        • test_vol.txt
        • train.txt
    • test_vol_h5
      • casexxxx.npy.h5
    • train_npz
      • casexxxx_slicexxx.npz

2. Prepare the pre_trained weights

  • The weights of the pre-trained RDZMamba could be downloaded here or Baidu. After that, the pre-trained weights should be stored in './pretrained_weights/'.

3. Train the CZS-Mamba

cd RDZMamba-Rapid-Diagonal-Zigzag-Mamba-Network-for-Medical-Image-Segmentation-master
python train.py  # Train and test RDZMamba on the ISIC17 or ISIC18 dataset.
python train_synapse.py  # Train and test RDZMamba on the Synapse dataset.

4. Obtain the outputs

  • After trianing, you could obtain the results in './results/'

data download link:

https://drive.google.com/drive/folders/1KbVXgv4XnQ2dfGeq2NSWOBNDe-F32yrU?usp=sharing

About

Rapid Diagonal Zigzag Mamba Network for Medical Image Segmentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages