项目作者: SharifAmit

项目描述 :
[ICMLA'19] [Tensorflow] Classifying different Retinal Diseases using Deep Learning from Optical Coherence Tomography Images
高级语言: Python
项目地址: git://github.com/SharifAmit/OpticNet-71.git
创建时间: 2019-03-08T00:05:17Z
项目社区:https://github.com/SharifAmit/OpticNet-71

开源协议:MIT License

下载


ICMLA2019 OCT_Classification

PWC
PWC

A model for classifying different Retinal Diseases using Deep Learning from Optical Coherence Tomography Images. This code is part of the supplementary materials for the IEEE ICMLA 2019 for our paper Optic-net: A Novel Convolutional Neural Network for Diagnosis of Retinal Diseases from Optical Tomography Images. The paper has since been accpeted to IEEE ICMLA 2019 and will be preseneted in December 2019.

IEEE Xplore Digital Library

  1. https://ieeexplore.ieee.org/document/8999264

Arxiv Pre-print

  1. https://arxiv.org/abs/1910.05672

Citation

  1. @inproceedings{kamran2019optic,
  2. title={Optic-Net: A Novel Convolutional Neural Network for Diagnosis of Retinal Diseases from Optical Tomography Images},
  3. author={Kamran, Sharif Amit and Saha, Sourajit and Sabbir, Ali Shihab and Tavakkoli, Alireza},
  4. booktitle={2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA)},
  5. pages={964--971},
  6. year={2019}
  7. organization={IEEE}
  8. }

Pre-requisite

  • Ubuntu 18.04 / Windows 7 or later
  • NVIDIA Graphics card

Installation Instruction for Ubuntu

  • Download and Install Nvidia Drivers
  • Download and Install via Runfile Nvidia Cuda Toolkit 9.0
  • Download and Install Nvidia CuDNN 7.1 or later
  • Install Pip3 and Python3 enviornment
    1. sudo apt-get install pip3 python3-dev
  • Install Tensorflow-Gpu version-1.12 and Keras version-2.2.4
    1. sudo pip3 install tensorflow-gpu==1.12.1
    2. sudo pip3 install keras==2.2.4
  • N.B. If you don’t have GPU, you can also build Tensorflow-CPU
    1. sudo pip3 install tensorflow==1.12.1
    2. sudo pip3 install keras==2.2.4
  • Install packages from requirements.txt
    1. sudo pip3 -r requirements.txt

    Installation Instruction for Windows

  • Download and Install Nvidia Drivers
  • Download and Install Nvidia Cuda Toolkit 9.0
  • Download and Install Nvidia CuDNN 7.1 or later
  • Install Pip and Python3 environemnt from Web link
  • Install Tensorflow-Gpu version-1.12 and Keras version-2.2.4
    1. sudo pip3 install tensorflow-gpu==1.12.1
    2. sudo pip3 install keras==2.2.4
  • N.B. If you don’t have GPU, you can also build Tensorflow-CPU
    1. sudo pip3 install tensorflow==1.12.1
    2. sudo pip3 install keras==2.2.4
  • Install packages from requirements.txt
    1. sudo pip3 -r requirements.txt

Demo

  • Download the weight file for model trained on Kermany2018 Link
  • Download the weight file for model trained on Srinivasan2014 Link
  • Run the inference.py file with the below command
    1. python3 inference.py --imgpath='location of the testing image(single file)' --weights='location to the .h5 file' --dataset='Srinivasan2014 or Kermany2018'

Training on Kermany2018 Dataset

  • Please cite the paper if you use their data
    1. @article{kermany2018identifying,
    2. title={Identifying medical diagnoses and treatable diseases by image-based deep learning},
    3. author={Kermany, Daniel S and Goldbaum, Michael and Cai, Wenjia and Valentim, Carolina CS and Liang, Huiying and Baxter, Sally L and McKeown, Alex and Yang, Ge and Wu, Xiaokang and Yan, Fangbing and others},
    4. journal={Cell},
    5. volume={172},
    6. number={5},
    7. pages={1122--1131},
    8. year={2018},
    9. publisher={Elsevier}
    10. }
  1. https://data.mendeley.com/datasets/rscbjbr9sj/3
  • Folder structure for training given below. Please make sure it matches with your local repository.
    1. ├── data
    2. | ├──OCT2017
    3. | ├──train
    4. | ├──CNV
    5. | ├──DME
    6. | ├──DRUSEN
    7. | └──NORMAL
    8. | ├──test
    9. | ├──CNV
    10. | ├──DME
    11. | ├──DRUSEN
    12. | └──NORMAL
    13. ├── src
    14. ├── LICENSE
    15. ├── README.md
    16. ├── data_preprocess_sri2014.py
    17. ├── inference.py
    18. ├── requirements.txt
    19. ├── test.py
    20. └── train.py
  • Type this in terminal to run the train.py file
    1. python3 train.py --dataset=Kermany2018 --datadir=data/OCT2017 --batch=4 --epoch=30 --logdir=optic-net-oct2017-log --snapshot_name=optic-net-oct2017
  • There are different flags to choose from. Not all of them are mandatory
  1. '--dataset', type=str, required=True, help='Choosing between 2 OCT datasets', choices=['Srinivasan2014','Kermany2018']
  2. '--batch', type=int, default=8
  3. '--input_dim', type=int, default=224
  4. '--datadir', type=str, required=True, help='path/to/data_directory'
  5. '--epoch', type=int, default=30
  6. '--logdir', type=str
  7. '--weights', type=str,default=None, help='Resuming training from previous weights'
  8. '--snapshot_name',type=str, default=None, help='Name the saved snapshot'

Training on Srinivasan2014 Dataset

  • Please cite the paper if you use their data
    1. @article{sri2014,
    2. title={Fully automated detection of diabetic macular edema and dry age-related macular degeneration from optical coherence tomography images},
    3. author={Srinivasan, Pratul P and Kim, Leo A and Mettu, Priyatham S and Cousins, Scott W and Comer, Grant M and Izatt, Joseph A and Farsiu, Sina},
    4. journal={Biomedical optics express},
    5. volume={5},
    6. number={10},
    7. pages={3568--3577},
    8. year={2014},
    9. publisher={Optical Society of America}
    10. }
    1. http://people.duke.edu/~sf59/Srinivasan_BOE_2014_dataset.htm

Folder Structure Rearrangement

  • The folder stucture for this dataset needs to be rearranged. We have provided a .py file to rearrange the structure and also, create the necessary directories and sub-directories. Please run the python file data_preprocess_sri2014.py. In cmd/terminal type the below command. Run it as it is or tinker with it, if you wanna change the directory.
  1. python3 data_preprocess_sri2014.py
  • The structure will look like this before the rearrangement.
    1. |──2014_BOE_Srinivasan
    2. | ├──Publication_Dataset
    3. | ├──AMD1
    4. | ├──AMD2
    5. | ├──DME1
    6. | ├──DME2
    7. | .....
    8. | .....
    9. | └──NORMAL15
    10. | └──TIFFs
    11. | └──8bitTIFFs
    12. ├── src
    13. ├── LICENSE
    14. ├── README.md
    15. ├── data_preprocess_sri2014.py
    16. ├── inference.py
    17. ├── requirements.txt
    18. ├── test.py
    19. └── train.py
  • And it will look like this afterwards.
    1. ├── data
    2. | ├──Srinivasan2014
    3. | ├──Train
    4. | ├──AMD
    5. | ├──DME
    6. | └──NORMAL
    7. | ├──Test
    8. | ├──AMD
    9. | ├──DME
    10. | └──NORMAL
    11. ├── src
    12. ├── LICENSE
    13. ├── README.md
    14. ├── data_preprocess_sri2014.py
    15. ├── inference.py
    16. ├── requirements.txt
    17. ├── test.py
    18. └── train.py
  • Type this in terminal to run the train.py file
    1. python3 train.py --dataset=Srinivasan2014 --datadir=data/Srinivasan2014 --batch=4 --epoch=30 --logdir=optic-net-sri2014-log --snapshot_name=optic-net-sri2014
  • There are different flags to choose from. Not all of them are mandatory
  1. '--dataset', type=str, required=True, help='Choosing between 2 OCT datasets', choices=['Srinivasan2014','Kermany2018']
  2. '--batch', type=int, default=8
  3. '--input_dim', type=int, default=224
  4. '--datadir', type=str, required=True, help='path/to/data_directory'
  5. '--epoch', type=int, default=30
  6. '--logdir', type=str
  7. '--weights', type=str,default=None, help='Resuming training from previous weights'
  8. '--snapshot_name',type=str, default=None, help='Name the saved snapshot'

License

The code is released under the MIT License, you can read the license file included in the repository for details.