Skip to content

Commit 27a1ce4

Browse files
author
Yifan Peng
authored
Merge pull request #3 from yfpeng/source_code
Add source code
2 parents 8566db0 + 0f73ede commit 27a1ce4

36 files changed

+5879
-3
lines changed

.gitignore

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
3+
deep-learning-models
4+
.pytest_cache/
5+
backup
6+
examples-local
7+
8+
### Python template
9+
# Byte-compiled / optimized / DLL files
10+
__pycache__/
11+
*.py[cod]
12+
*$py.class
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
19+
env/
20+
build/
21+
develop-eggs/
22+
dist/
23+
downloads/
24+
eggs/
25+
.eggs/
26+
lib/
27+
lib64/
28+
parts/
29+
sdist/
30+
var/
31+
wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
36+
# PyInstaller
37+
# Usually these files are written by a python script from a template
38+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
39+
*.manifest
40+
*.spec
41+
42+
# Installer logs
43+
pip-log.txt
44+
pip-delete-this-directory.txt
45+
46+
# Unit test / coverage reports
47+
htmlcov/
48+
.tox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*,cover
55+
.hypothesis/
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
local_settings.py
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# dotenv
91+
.env
92+
93+
# virtualenv
94+
.venv
95+
venv/
96+
ENV/
97+
98+
# Spyder project settings
99+
.spyderproject
100+
101+
# Rope project settings
102+
.ropeproject
103+
### JetBrains template
104+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
105+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
106+
107+
# User-specific stuff:
108+
.idea
109+
.idea/**/workspace.xml
110+
.idea/**/tasks.xml
111+
.idea/dictionaries
112+
113+
# Sensitive or high-churn files:
114+
.idea/**/dataSources/
115+
.idea/**/dataSources.ids
116+
.idea/**/dataSources.xml
117+
.idea/**/dataSources.local.xml
118+
.idea/**/sqlDataSources.xml
119+
.idea/**/dynamic.xml
120+
.idea/**/uiDesigner.xml
121+
122+
# Gradle:
123+
.idea/**/gradle.xml
124+
.idea/**/libraries
125+
126+
# Mongo Explorer plugin:
127+
.idea/**/mongoSettings.xml
128+
129+
## File-based project format:
130+
*.iws
131+
132+
## Plugin-specific files:
133+
134+
# IntelliJ
135+
/out/
136+
137+
# mpeltonen/sbt-idea plugin
138+
.idea_modules/
139+
140+
# JIRA plugin
141+
atlassian-ide-plugin.xml
142+
143+
# Crashlytics plugin (for Android Studio and IntelliJ)
144+
com_crashlytics_export_strings.xml
145+
crashlytics.properties
146+
crashlytics-build.properties
147+
fabric.properties
148+

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: python
2+
python:
3+
- "3.6"
4+
install:
5+
pip install -r requirements.txt
6+
7+
script:
8+
- py.test
9+
10+
notifications:
11+
email: false

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
This project adheres to the [Contributor Covenant Code of Conduct](http://contributor-covenant.org/).
6+
7+
# Maintainers
8+
9+
DeepSeeNet is maintained with :heart: by:
10+
11+
- **@yfpeng**
12+
13+
See also the list of [contributors](https://github.com/ncbi-nlp/DeepSeeNet/contributors) who participated in this project.

LICENSE.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PUBLIC DOMAIN NOTICE
2+
National Center for Biotechnology Information
3+
4+
This software/database is a "United States Government Work" under the terms of
5+
the United States Copyright Act. It was written as part of the author's
6+
official duties as a United States Government employee and thus cannot be
7+
copyrighted. This software/database is freely available to the public for use.
8+
The National Library of Medicine and the U.S. Government have not placed any
9+
restriction on its use or reproduction.
10+
11+
Although all reasonable efforts have been taken to ensure the accuracy and
12+
reliability of the software and data, the NLM and the U.S. Government do not and
13+
cannot warrant the performance or results that may be obtained by using this
14+
software or data. The NLM and the U.S. Government disclaim all warranties,
15+
express or implied, including warranties of performance, merchantability or
16+
fitness for any particular purpose.
17+
18+
Please cite the author in any work or product based on this material:
19+
20+
Peng Y, Dharssi S, Chen Q, Keenan T, Agron E, Wong W, Chew E, Lu Z. DeepSeeNet:
21+
A deep learning model for automated classification of patientbased age-related
22+
macular degeneration severity from color fundus photographs. Ophthalmology. 2018.
23+

README.rst

100644100755
Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,125 @@
55

66
-----------------------
77

8-
DeepSeeNet is a high-performance deep learning framework for grading of color fundus photographs using the AREDS simplified severity scale.
8+
DeepSeeNet is a high-performance deep learning framework for grading of color fundus photographs using the AREDS simplified severity scale. For more details, please see `<https://ncbi-nlp.github.io/DeepSeeNet/>`_.
9+
10+
11+
Getting Started with DeepSeeNet
12+
============================
13+
14+
These instructions will get you a copy of the project up and run on your local machine for development and testing purposes.
15+
The package should successfully install on Linux.
16+
17+
Installing
18+
----------
19+
20+
Prerequisites
21+
~~~~~~~~~~~~~
22+
23+
* python =3.6
24+
* tensorflow >=1.6.0
25+
* keras =2.1.5
26+
* Linux
27+
28+
Tensorflow can be downloaded from `https://www.tensorflow.org <https://www.tensorflow.org/>`_.
29+
30+
31+
Installing from source
32+
~~~~~~~~~~~~~~~~~~~~~~
33+
34+
1. Download the source code from GitHub: ``git clone https://github.com/ncbi-nlp/DeepSeeNet.git``
35+
2. Change to the directory of ``DeepSeeNet``
36+
3. Install required packages: ``pip install -r requirements.txt``
37+
4. Add the code directory to ``PYTHONPATH``: ``export PYTHONPATH=.:$PYTHONPATH``
38+
39+
40+
Using DeepSeeNet for grading simplified scores
41+
-------------------------------------------
42+
43+
The easiest way is to run the following command
44+
45+
.. code-block:: bash
46+
47+
$ python examples/predict_simplified_score.py data/left_eye.jpg data/right_eye.jpg
48+
...
49+
INFO:root:Loading the model: drusen
50+
INFO:root:Loading the model: advanced_amd
51+
INFO:root:Loading the model: pigment
52+
...
53+
INFO:root:Processing: data/left_eye.jpg
54+
INFO:root:Processing: data/right_eye.jpg
55+
...
56+
The simplified score: 2
57+
58+
The script will
59+
60+
1. Download the models from the ``DeepSeeNet`` repository
61+
2. Predict the simplified score based on the sample left and right eyes
62+
63+
More options (e.g., setting the models) can be obtained by running
64+
65+
.. code-block:: bash
66+
67+
$ python examples/predict_simplified_score.py --help
68+
69+
70+
Pretrained DeepSeeNet models
71+
----------------------------
72+
73+
Besides grading the simplified score, we also provide individual risk factor models. For example
74+
75+
.. code-block:: bash
76+
77+
$ python examples/predict_drusen.py data/left_eye.jpg
78+
...
79+
INFO:root:Loading the model: drusen
80+
...
81+
INFO:root:Processing: data/left_eye.jpg
82+
...
83+
Drusen size: large
84+
85+
86+
All models can be found at ``deepseenet``.
87+
88+
The pretrained models can be found at: `<https://github.com/ncbi-nlp/DeepSeeNet/releases/tag/0.1>`_
89+
90+
91+
Training DeepSeeNet model
92+
-------------------------
93+
94+
You can train the individual risk factor model too. For example
95+
96+
.. code-block:: bash
97+
98+
$ python examples/train.py data/pigment_label_sample.csv data/pigment_best_model.h5
99+
...
100+
Epoch 1/100
101+
2/2 [==============================] - 27s 14s/step - loss: 1.0103 - acc: 0.5148...
102+
...
103+
early stopping
104+
105+
106+
The program will read images and labels from a CSV file, train the model, and save the latest best model according to the ``val_acc``.
107+
108+
109+
Acknowledgments
110+
===============
111+
112+
This work was supported by the Intramural Research Programs of the National Institutes of Health, National Library of Medicine and National Eye Institute.
113+
114+
115+
Citing DeepSeeNet
116+
=================
117+
118+
If you're running the DeepSeeNet framework, please cite:
119+
120+
* Peng Y, Dharssi S, Chen Q, Keenan T, Agron E, Wong W, Chew E, Lu Z. DeepSeeNet: A deep learning model for automated classification of patientbased age-related macular degeneration severity from color fundus photographs. Ophthalmology. 2018 (Accepted).
121+
122+
123+
Disclaimer
124+
==========
125+
126+
This tool shows the results of research conducted in the Computational Biology Branch, NCBI. The information produced on this website is not intended for direct diagnostic use or medical decision-making without review and oversight by a clinical professional. Individuals should not change their health behavior solely on the basis of information produced on this website. NIH does not independently verify the validity or utility of the information produced by this tool. If you have questions about the information produced on this website, please see a health care professional. More information about NCBI's disclaimer policy is available.
127+
128+
9129

10-
(`Under construction <https://ncbi-nlp.github.io/DeepSeeNet/>`_)

data/left_eye.jpg

28.1 KB
Loading

data/pigment_label_sample.csv

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
51003/QUA/51003 QUA F2 RE LS.jpg,0
2+
51003/QUA/51003 QUA F2 LE LS.jpg,0
3+
51003/04/51003 04 F2 RE LS.jpg,0
4+
51003/04/51003 04 F2 LE LS.jpg,0
5+
51003/06/51003 06 F2 RE LS.jpg,0
6+
51003/06/51003 06 F2 LE LS.jpg,0
7+
51003/08/51003 08 F2 RE LS.jpg,0
8+
51003/08/51003 08 F2 LE LS.jpg,0
9+
51003/10/51003 10 F2 RE LS.jpg,0
10+
51003/10/51003 10 F2 LE LS.jpg,0
11+
51003/12/51003 12 F2 RE LS.jpg,0
12+
51003/12/51003 12 F2 LE LS.jpg,0
13+
51003/14/51003 14 F2 RE LS.jpg,0
14+
51003/14/51003 14 F2 LE LS.jpg,0
15+
51003/18/51003 18 F2 RE LS.jpg,0
16+
51003/18/51003 18 F2 LE LS.jpg,0
17+
51003/20/51003 20 F2 RE LS.jpg,0
18+
51003/20/51003 20 F2 LE LS.jpg,0
19+
51003/22/51003 22 F2 RE LS.jpg,0
20+
51003/22/51003 22 F2 LE LS.jpg,0
21+
51008/QUA/51008 QUA F2 RE LS.jpg,0
22+
51008/QUA/51008 QUA F2 LE LS.jpg,0
23+
51008/06/51008 06 F2 RE LS.jpg,0
24+
51008/06/51008 06 F2 LE LS.jpg,0
25+
51008/08/51008 08 F2 RE LS.jpg,0
26+
51008/08/51008 08 F2 LE LS.jpg,0
27+
51008/20/51008 20 F2 RE LS.jpg,1
28+
51008/20/51008 20 F2 LE LS.jpg,1
29+
51011/QUA/51011 QUA F2 RE LS.jpg,0
30+
51011/QUA/51011 QUA F2 LE LS.jpg,0
31+
51017/QUA/51017 QUA F2 LE LS.jpg,1
32+
51018/QUA/51018 QUA F2 RE LS.jpg,0
33+
51018/QUA/51018 QUA F2 LE LS.jpg,0
34+
51018/04/51018 04 F2 RE LS.jpg,0
35+
51018/04/51018 04 F2 LE LS.jpg,0
36+
51018/06/51018 06 F2 RE LS.jpg,0
37+
51018/06/51018 06 F2 LE LS.jpg,0
38+
51018/08/51018 08 F2 RE LS.jpg,0
39+
51018/08/51018 08 F2 LE LS.jpg,0
40+
51018/10/51018 10 F2 RE LS.jpg,0
41+
51018/10/51018 10 F2 LE LS.jpg,0
42+
51018/12/51018 12 F2 RE LS.jpg,0
43+
51018/12/51018 12 F2 LE LS.jpg,0
44+
51018/16/51018 16 F2 RE LS.jpg,0
45+
51018/16/51018 16 F2 LE LS.jpg,0
46+
51018/18/51018 18 F2 RE LS.jpg,1
47+
51018/18/51018 18 F2 LE LS.jpg,1
48+
51018/20/51018 20 F2 RE LS.jpg,0
49+
51018/20/51018 20 F2 LE LS.jpg,0
50+
51019/QUA/51019 QUA F2 RE LS.jpg,0

data/right_eye.jpg

27 KB
Loading

0 commit comments

Comments
 (0)