/blood-vessels-segmentation-unet

Retinal blood vessel segmentation using convolutional neural network (u-net) and image processing techniques.

Primary LanguageJupyter Notebook

vessels

Retinal blood vessel segmentation using convolutional neural network (u-net) and image processing techniques.

Prerequisites

Use conda's spec file in order to create identical environment on your local machine:

cd vessels
conda create --name myenv --file dependencies.yml
conda activate myenv

Then run:

jupyter notebook

Simple classification using image processing techniques

  1. Original image:

rgb

  1. Transformation to grayscale:

gray

  1. CLAHE (Constrast-limited adaptive histogram equalization):

clahe

  1. Gamma correction:

gamma

  1. cv2.fastNlMeansDenoising:

denoised

  1. Ridge detection:

ridges

  1. Mask:

masked

  1. Median filter:

median

  1. Threshold:

thresh

  1. Results:

simple1

simple2

simple3

Simple classificator evaluation:

simple-cm

simple-roc

Classification using U-Net architecture

U-Net architecture is widely used in medical field when it comes to image segmentation. We train the network with small and random image crops sized 64 x 64 pixels, and for each of them we get 1 if it's classified as a blood vessel or 0 if's not. The training took 100 epochs, 125 steps each with the batch size equal to 16 random image crops. We used Google Colab in order to train our model (Nvidia Tesla K80). The training took no longer than 40 minutes. Some of the results are presented below:

cnn1

cnn2

cnn3

cnn-cm

cnn-roc