The code was written by Natasha Basimova, Nikita Mokrov, Ilya Selnitskiy and Ilya Zakharkin.
- Linux or macOS
- Python 3
- CPU or NVIDIA GPU + CUDA
We tested the performance of the proposed networks on the data from Alzheimer’s Disease Neuroimaging Initiative (ADNI) project that provides a dataset of structural MRI scans. For dowload data you need to get access. Then go to dataset. Filter all data with this parameters:
- Weighting: 1T
- Acquision Type: 3D
- Filed Strength: 3 Tesla
- Slice Thickness: 1mm
We use this dataset to test our models’ performance for a task of classifying MRI scans of subjects with Alzheimers disease (AD), early and late mild cognitive impairment (EMCI and LMCI), and normal cohort (CN).
- Clone this repo:
git clone https://github.com/izaharkin/mri-alzheimer
cd mri-alzheimer
- Install python 3.6 and all necessary requirements:
- For pip users, please type the command
pip install -r requirements.txt
. - Also you should install fsl-lib for skull cutting
- For pip users, please type the command
- For getting good perfomance of model, prepocess data by cutting skull and run:
python3 brainiac/data_preprocessing/brain_extraction.py
And also you should run two notebooks: Data Processing and Process Cut Data.
- Train classification model:
#!./scripts/train_cyclegan.sh
python3 train.py --model ResNet152
-
All logs and the pretrained model are saved at unique folder
./trained_model/{model}/{other parameters}
aslog{number}.log
andmodel_epoch{number}.log
. To view training results and loss plots, run notebook LogParser -
For getting all changeble parameters run:
python3 train.py --help
For example:
- Standart train parameters:
--num_epoch 200 --batch_size 4 --optimizer Adam --lr 3e-5 --weight_decay 1e-3
- Use augmntation (random rotation and noise):
--use_augmentation True
- Use sampling (oversampling and undersampling):
--use_sampling True --sampling_type over
- Apply a pre-trained model:
--use_pretrain True --path_pretrain PATH
For visualization we use popular methond GradCAM with implementation. You can find it in notebook Visualisation GradCAM