Code Monkey home page Code Monkey logo

diabetic-retinopathy-lesion-segmentation-with-unet's Introduction

IDRiD_sub1_EX

2018 the IDRiD challenge sub1(hard exudates segmentation) using unet based on tensorflow and tensorlayer

task description

from: https://idrid.grand-challenge.org/Segmentation/

The purpose of this challenge is to directly compare the methods developed for automatic segmentation of retinal lesions.

Background

Diabetic Retinopathy is referred as a clinical diagnosis, depicted by the presence (see Fig.) of one or more several retinal lesions like microaneurysms (MA), hemorrhages (HE), hard exudates (EX), and soft exudates (SE).

Diabetic Retinopathy

Segmentation of individual or multiple lesion associated with diabetic retinopathy. The sub-challenge can be divided in four different tasks; participants can submit results for at least one of the following tasks:

  1. Microaneurysms Segmentation
  2. Hemorrhage Segmentation
  3. Soft Exudates Segmentation
  4. Hard Exudates Segmentation

Task

Segmentation of individual or multiple lesion associated with diabetic retinopathy. The sub-challenge can be divided in four different tasks; participants can submit results for at least one of the following tasks:

  1. Microaneurysms Segmentation
  2. Hemorrhage Segmentation
  3. Soft Exudates Segmentation
  4. Hard Exudates Segmentation

Data

It consists of 81 images with pixel level annotation for different abnormalities like MA, HE, SE and EX.

TRAINING SET TESTING SET
MA - 54 MA - 27
EX - 54 EX - 27
HE - 53 HE - 27
SE - 26 SE - 14

In this repository, I just use the "EX" class for simplicity, actually I use only one type of data to train at a time, and The data will be placed in the following format.

├── Data
│   ├── images
│       ├── training
│       ├── validation
│   ├── annotations
│       ├── training
│       ├── validation

The data needs to go to the competition website to download ( https://idrid.grand-challenge.org/Data_Download/ ), I just show one sample for example, the left one is the original image, the right one is the corresponding groud truth.

data

Result Submission

Intensity image with particular abnormality segmented as foreground and rest part of an image as background. It will be utilized to evaluate Sensitivity (SN), Specificity (SP) and Positive Predictive Value (PPV) at different threshold values. Participants may submit results for multiple lesions but they have to submit for each lesion separately. Note: While submission, upload gray-scale images (in .jpg format without changing the original file name) obtained using your method described in the short paper.

Performance Evaluation

This challenge evaluates the performance of the algorithms for lesion segmentation using the available binary masks. It is done by computing area under Precision (Positive Predictive Value) and Sensitivity (Recall) curve. The curve is obtained by thresholding the results at 33 equally spaced instances. i.e. [0,0.03125,0.0625,…,1]. The area under precision-recall (AUPR) is used to obtain a single score.

In this section, The area under precision-recall (AUPR) needs you to know what is precision recall curve (PRC), about the concepts of PRC, I write it in my blog, plz see: https://anonymoussss.github.io/2018/07/31/2x2-Tables-SN-SP-PPV-NPV-OR-RR/

Train

just run

python unet.py

Result

the model effect will be shown at each epoch by tensorboard , including the train curves, test curves, the oiginal image, corresponding gt and prediction.

pixel auccurcy

pixel auccurcy

AUPR on test datasets

AUPR on test datasets

from left to right: original image, gt image, prediction image

prediction comparation

final result

AUC PRC
0.975 700

diabetic-retinopathy-lesion-segmentation-with-unet's People

Contributors

anonymoussss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

diabetic-retinopathy-lesion-segmentation-with-unet's Issues

how to evaluate the result?

Hello,
I have trained the model, but I don't know how to visualize the testing results just like the 'readme' shows. I'm new to it, thanks for any help!

how to change the input to gray images?

Hello! I want to change the training input to gray images, and I have put the images in the correct directory. I change line 195 in unet.py from:
image = tf.placeholder(tf.int32,[None,IMG_SIZE,IMG_SIZE, 3], name='image')
to:
image = tf.placeholder(tf.int32,[None,IMG_SIZE,IMG_SIZE, 1], name='image')
Then I got the error:
######################################################################
Traceback (most recent call last):
File "unet.py", line 344, in
tf.app.run()
File "/home/ilab/anaconda3/envs/seg36/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "unet.py", line 246, in main
tra_positive_prob, train_err, _ = sess.run([train_positive_prob, train_loss_op,train_op], feed_dict=feed_dict)
File "/home/ilab/anaconda3/envs/seg36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/home/ilab/anaconda3/envs/seg36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1128, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (3, 512, 512) for Tensor 'Cast:0', which has shape '(?, 512, 512, 1)'
#####################################################################
I have been stuck here for days and don't know what is wrong. Thanks in advance for your help!!

ValueError: Cannot feed value of shape (0,) for Tensor 'Cast:0', which has shape '(?, 512, 512, 3)'

hello!
When I run your code. I got the following error:

#----------------------------------------------------------------------------------
Traceback (most recent call last):
File "unet.py", line 319, in
tf.app.run()
File "/home/ilab/anaconda3/envs/seg36/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "unet.py", line 246, in main
tra_positive_prob, train_err, _ = sess.run([train_positive_prob, train_loss_op,train_op], feed_dict=feed_dict)
File "/home/ilab/anaconda3/envs/seg36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/home/ilab/anaconda3/envs/seg36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1128, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (0,) for Tensor 'Cast:0', which has shape '(?, 512, 512, 3)'
#----------------------------------------------------------------------------------------------------

I don't know what to do with that. Please help... By the way, what's the proper version of the tensorlayer and tensorflow?

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.