Code of project for CISC881: attention-guided medical imaging classification, Implemented by Yuchuan Li
Anaconda is used for this implementation. Two enviromental set-up file could be found with the code.
- environment.yaml: exported by the Anaconda directly
conda env create -n [env_name] -f environment.yaml
- requirements.txt: exported by the pip directly
pip install -r requirements.txt
All of the functions here is validated on my PC with: Windows 10 Pro 21H1 Version 19043.1586, Windows Feature Experience Pack 120.2212.4170.0; CPU I9-10900K, GPU RTX 2080 Ti
2 datasets are used here. They are MedMNIST v2 and Chaoyang dataset. Fortunately, we do not need data pre-processing here.
- MedMNIST v2: It is easier here if you have done the environmental setup, the dataset would be downloaded automatically during the initial training process
- Chaoyang dataset: You need to fill the form on their official website and then download it.
Please carefully check the args in train.py and modify them for your needs. A general usage of it is:
set CUDA_VISIBLE_DEVICES=[CUDA_DEVICES] & python main.py --att [ATTENTION_MECHANISM] --dataset [DATASET] --batch-size [BATCH_SIZE] --learning-rate [LEARNING_RATE] --pretrained
The Visualization function is implemented based on the cache-mechanism A general usage of it is:
set CUDA_VISIBLE_DEVICES=[CUDA_DEVICES] & python visualization.py --dataset [DATASET] --att [ATTENTION_MECHANISM] --load [CHECKPOINT_DIR]