Giter Site home page Giter Site logo

bhargavaganti / diabetic.retinopathy__deep.learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ss-is-master-chief/diabetic.retinopathy__deep.learning

0.0 0.0 0.0 1.42 MB

Detection of fundus in eyeball images for early detection of Diabetic Retinopathy using Deep Learning and classifying them into Not Present, Mild, Moderate, or Acute.

License: MIT License

Python 100.00%

diabetic.retinopathy__deep.learning's Introduction

Automatic Detection of Diabetic Retinopathy with Deep Learning

Detection of fundus in eyeball images for early detection of Diabetic Retinopathy using Deep Learning and classifying them into Not Present, Mild, Moderate, or Acute.

Running the script

Make sure you have the following libraries installed:

  • tqdm
  • tensorflow
  • keras
  • matplotlib
  • numpy
  • pandas
  • requests
  • colorama
  • scikit-learn
  • opencv

by running the following command:

pip install -r requirements.txt

Next, run the main script using the command:

python main.py

The main script downloads DIARETDB0 from the website if not already available in your current directory, and unzips it. A series of functions are called to normalise the images, annotate them for classes using a scoring function, create a dataframe, and finally pass it to our Convolutional Neural Network for training.

Training history can be visualised on Tensorboard using the following command:

tensorboard --logdir = ./logs

Running the script for 200 epochs gave us a baseline accuracy of 80%. Currently, we are working on improving our model to increase accuracy scores on the test dataset.

Scoring Function

The annotations are stored as .dot files in the downloaded data directory: diaretdb0_v_1_1/resources/images/diaretdb0_groundtruths/. The files contain annotations in the format: redsmalldots hemorrhages n/a n/a n/a which accounts for 5 levels of fundus in Diabetic Retinopathy images, in ascending order of severity.

We convert this annotation into a 5-bit binary number and then find its decimal equivalent as follows:

  • n/a is accepted as False or 0
  • Everything else is regarded as True or 1

Our scoring and class function adhere to the following rules:

Lower Limit Upper Limit Class
0 0 0
1 1 1
2 12 2
13 32 3

Example:

Image 2^0 2^1 2^2 2^3 2^4 Score Class
image113.dot n/a n/a n/a n/a n/a 0 0
image060.dot redsmalldots n/a n/a n/a n/a 1 1
image081.dot redsmalldots haemorrhages n/a n/a n/a 3 2
image011.dot redsmalldots haemorrhages hardexudates softexudates n/a 31 3

Visualising the Dataset

To visualise the dataset images, run:

python scripts/feature_extraction.py --img <IMAGE>

where <IMAGE> can have values as image001.png, image002.png till image130.png. Running the script should give you the results such as the following:

Example: python scripts/feature_extraction.png --img image011.png

The blood vessels have been separated from the exudates.

Tasks:

  • Image Preprocessing
  • Train Model
  • Annotation GUI using Tkinter
  • Unsupervised Clustering of images

Group Members:

diabetic.retinopathy__deep.learning's People

Contributors

ss-is-master-chief avatar wizishan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.