Skip to content

DiffMIC: Dual-Guidance Diffusion Network for Medical Image Classification

Notifications You must be signed in to change notification settings

Math-ML-X/DiffMIC

 
 

Repository files navigation

DiffMIC

DiffMIC is a project to adapt Diffusion Probabilistic Models to general medical image classification by dual-granularity conditional guidance. The method is elaborated in the paper DiffMIC: Dual-Guidance Diffusion Network for Medical Image Classification.

A Quick Overview

News

  • 23-06-05. This paper has been early accepted by MICCAI 2023. Code is coming and welcome to taste it.
  • 23-06-06. This project is still quickly updating 🌝. Check TODO list to see what will be released next.

Requirement

conda env create -f environment.yml

Datasets

  1. Download HAM10000 or APTOS2019 dataset. Your dataset folder under "your_data_path" should be like:

dataset/isic2018/

 images/...
 
 ISIC2018_Task3_Training_GroundTruth.csv
 
 isic2018_train.pkl

 isic2018_test.pkl

dataset/aptos/

 train/...
 
 train.csv
 
 aptos_train.pkl

 aptos_test.pkl

.pkl file contains the list of data whose element is a dictionary with the format as {'img_root':image_path,'label':label}

Run

  1. For Training! run: bash training_scripts/run_isic.sh where the first command line is used python main.py --device ${DEVICE_ID} --thread ${N_THREADS} --loss ${LOSS} --config configs/${TASK}.yml --exp $EXP_DIR/${MODEL_VERSION_DIR} --doc ${TASK} --n_splits ${N_SPLITS}

  2. For Testing! run: bash training_scripts/run_isic.sh where the second command line is used python main.py --device ${DEVICE_ID} --thread ${N_THREADS} --loss ${LOSS} --config $EXP_DIR/${MODEL_VERSION_DIR}/logs/ --exp $EXP_DIR/${MODEL_VERSION_DIR} --doc ${TASK} --n_splits ${N_SPLITS} --test --eval_best

The configuration for each of the above-listed tasks (including data file location, training log and evaluation result directory settings, neural network architecture, optimization hyperparameters, etc.) are provided in the corresponding files in the configs directory

TODO LIST

  • Release PMG2000 dataset and config
  • Release HAM10000, APTOS2019 dataloaders and configs
  • Dataset splits
  • Release training scripts
  • Release evaluation
  • Upload the checkpoints of HAM10000, APTOS2019
  • configuration

Be a part of DiffMIC !

Welcome to contribute to DiffMIC. Any technique that can improve the performance or speed up the algorithm is appreciated🙏. I am writing DiffMIC V2, aiming at top journals. I'm glad to list the contributors as my co-authors🤗.

Thanks

Code is largely based on XzwHan/CARD, CompVis/stable-diffusion, MedSegDiff, nyukat/GMIC

Cite

If you find this code useful, please cite

@article{yang2023diffmic,
  title={DiffMIC: Dual-Guidance Diffusion Network for Medical Image Classification},
  author={Yang, Yijun and Fu, Huazhu and Aviles-Rivero, Angelica and Sch{\"o}nlieb, Carola-Bibiane and Zhu, Lei},
  journal={arXiv preprint arXiv:2303.10610},
  year={2023}
}

About

DiffMIC: Dual-Guidance Diffusion Network for Medical Image Classification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Shell 1.1%