Git Product home page Git Product logo

semantic-segmentation-of-retinal-fundus-vasculature's Introduction

U-Net Vessel Segmentation

U-Net output

Introduction

Semantic segmentation technqiues attempt to label every pixel of an input image a set of n classes. This code implements the U-Net architecture developed by Ronneberger, Fischer and Brox for use in segmentating anatomical regions in medical images. In this implemention the network is trained and evaluated on High-Resolution Funcdus Images compiled for use by the Friedrich-Alexander-Universität Erlangen-Nürnberg. After training the model was able to achieve a Dice coefficient of 0.92 on the test data set.

To Run

Clone the repo, and move to the main directory.

cd ~/U-Net-Vessel-Segmentation/src

Install the dependencies.

$ pip install -r requirements.txt

If running for the first time run:

python main.py --make_dataset and optionally --augment_data

The operation --make_dataset creates the data directory structure and downloads the image files and their expert labeled annotations.

Data augmentation, which is highly recommended, includes up/down and left/right reflection as well as random non-linear warping of the raw images. After augmentation number of samples increases from 45 to 270. For each input image the the same transformations are applied to the annotated images for use in training and evaluation. After this process the transformed images are saved, so this step only needs to be performed once.

To Train

python main.py --train

Optional settings include:

--n_points: Number of points from each cloud to sample for training/testing. Required for mini-batch training.

--batch_size: Batch size for training/testing

--n_epochs: Number of passes through training set.

--early_stopping_max_checks: Stop early when loss does not improve for max_checks.

--learning_rate: Learning rate for Adam Optimizer. This is the initial learning rate. The rate will is halved every 50 epochs.

To Test

Testing requires saved model after training.

To run test:

python main.py --infer --load_checkpoint <saved_model_name>.ckpt

The labeled output images will be saved in ~/U-Net-Vessel-Segmentation/data/output/

semantic-segmentation-of-retinal-fundus-vasculature's People

Contributors

bschneller avatar

Watchers

 avatar  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.