Retina blood vessel segmentation with a convolutional neural network

Overview

Retina blood vessel segmentation with a convolution neural network (U-net)

This repository contains the implementation of a convolutional neural network used to segment blood vessels in retina fundus images. This is a binary classification task: the neural network predicts if each pixel in the fundus image is either a vessel or not.
The neural network structure is derived from the U-Net architecture, described in this paper.
The performance of this neural network is tested on the DRIVE database, and it achieves the best score in terms of area under the ROC curve in comparison to the other methods published so far. Also on the STARE datasets, this method reports one of the best performances.

Methods

Before training, the 20 images of the DRIVE training datasets are pre-processed with the following transformations:

  • Gray-scale conversion
  • Standardization
  • Contrast-limited adaptive histogram equalization (CLAHE)
  • Gamma adjustment

The training of the neural network is performed on sub-images (patches) of the pre-processed full images. Each patch, of dimension 48x48, is obtained by randomly selecting its center inside the full image. Also the patches partially or completely outside the Field Of View (FOV) are selected, in this way the neural network learns how to discriminate the FOV border from blood vessels.
A set of 190000 patches is obtained by randomly extracting 9500 patches in each of the 20 DRIVE training images. Although the patches overlap, i.e. different patches may contain same part of the original images, no further data augmentation is performed. The first 90% of the dataset is used for training (171000 patches), while the last 10% is used for validation (19000 patches).

The neural network architecture is derived from the U-net architecture (see the paper). The loss function is the cross-entropy and the stochastic gradient descent is employed for optimization. The activation function after each convolutional layer is the Rectifier Linear Unit (ReLU), and a dropout of 0.2 is used between two consecutive convolutional layers.
Training is performed for 150 epochs, with a mini-batch size of 32 patches. Using a GeForce GTX TITAN GPU the training lasts for about 20 hours.

Results on DRIVE database

Testing is performed with the 20 images of the DRIVE testing dataset, using the gold standard as ground truth. Only the pixels belonging to the FOV are considered. The FOV is identified with the masks included in the DRIVE database.
In order to improve the performance, the vessel probability of each pixel is obtained by averaging multiple predictions. With a stride of 5 pixels in both height and width, multiple consecutive overlapping patches are extracted in each testing image. Then, for each pixel, the vessel probability is obtained by averaging probabilities over all the predicted patches covering the pixel.

The results reported in the ./test folder are referred to the trained model which reported the minimum validation loss. The ./test folder includes:

  • Model:
    • test_model.png schematic representation of the neural network
    • test_architecture.json description of the model in json format
    • test_best_weights.h5 weights of the model which reported the minimum validation loss, as HDF5 file
    • test_last_weights.h5 weights of the model at last epoch (150th), as HDF5 file
    • test_configuration.txt configuration of the parameters of the experiment
  • Experiment results:
    • performances.txt summary of the test results, including the confusion matrix
    • Precision_recall.png the precision-recall plot and the corresponding Area Under the Curve (AUC)
    • ROC.png the Receiver Operating Characteristic (ROC) curve and the corresponding AUC
    • all_*.png the 20 images of the pre-processed originals, ground truth and predictions relative to the DRIVE testing dataset
    • sample_input_*.png sample of 40 patches of the pre-processed original training images and the corresponding ground truth
    • test_Original_GroundTruth_Prediction*.png from top to bottom, the original pre-processed image, the ground truth and the prediction. In the predicted image, each pixel shows the vessel predicted probability, no threshold is applied.

The following table compares this method to other recent techniques, which have published their performance in terms of Area Under the ROC curve (AUC ROC) on the DRIVE dataset.

Method AUC ROC on DRIVE
Soares et al [1] .9614
Azzopardi et al. [2] .9614
Osareh et al [3] .9650
Roychowdhury et al. [4] .9670
Fraz et al. [5] .9747
Qiaoliang et al. [6] .9738
Melinscak et al. [7] .9749
Liskowski et al.^ [8] .9790
this method .9790

^ different definition of FOV

Running the experiment on DRIVE

The code is written in Python, it is possible to replicate the experiment on the DRIVE database by following the guidelines below.

Prerequisities

The neural network is developed with the Keras library, we refer to the Keras repository for the installation.

This code has been tested with Keras 1.1.0, using either Theano or TensorFlow as backend. In order to avoid dimensions mismatch, it is important to set "image_dim_ordering": "th" in the ~/.keras/keras.json configuration file. If this file isn't there, you can create it. See the Keras documentation for more details.

The following dependencies are needed:

  • numpy >= 1.11.1
  • PIL >=1.1.7
  • opencv >=2.4.10
  • h5py >=2.6.0
  • ConfigParser >=3.5.0b2
  • scikit-learn >= 0.17.1

Also, you will need the DRIVE database, which can be freely downloaded as explained in the next section.

Training

First of all, you need the DRIVE database. We are not allowed to provide the data here, but you can download the DRIVE database at the official website. Extract the images to a folder, and call it "DRIVE", for example. This folder should have the following tree:

DRIVE
│
└───test
|    ├───1st_manual
|    └───2nd_manual
|    └───images
|    └───mask
│
└───training
    ├───1st_manual
    └───images
    └───mask

We refer to the DRIVE website for the description of the data.

It is convenient to create HDF5 datasets of the ground truth, masks and images for both training and testing. In the root folder, just run:

python prepare_datasets_DRIVE.py

The HDF5 datasets for training and testing will be created in the folder ./DRIVE_datasets_training_testing/.
N.B: If you gave a different name for the DRIVE folder, you need to specify it in the prepare_datasets_DRIVE.py file.

Now we can configure the experiment. All the settings can be specified in the file configuration.txt, organized in the following sections:
[data paths]
Change these paths only if you have modified the prepare_datasets_DRIVE.py file.
[experiment name]
Choose a name for the experiment, a folder with the same name will be created and will contain all the results and the trained neural networks.
[data attributes]
The network is trained on sub-images (patches) of the original full images, specify here the dimension of the patches.
[training settings]
Here you can specify:

  • N_subimgs: total number of patches randomly extracted from the original full images. This number must be a multiple of 20, since an equal number of patches is extracted in each of the 20 original training images.
  • inside_FOV: choose if the patches must be selected only completely inside the FOV. The neural network correctly learns how to exclude the FOV border if also the patches including the mask are selected. However, a higher number of patches are required for training.
  • N_epochs: number of training epochs.
  • batch_size: mini batch size.
  • nohup: the standard output during the training is redirected and saved in a log file.

After all the parameters have been configured, you can train the neural network with:

python run_training.py

If available, a GPU will be used.
The following files will be saved in the folder with the same name of the experiment:

  • model architecture (json)
  • picture of the model structure (png)
  • a copy of the configuration file
  • model weights at last epoch (HDF5)
  • model weights at best epoch, i.e. minimum validation loss (HDF5)
  • sample of the training patches and their corresponding ground truth (png)

Evaluate the trained model

The performance of the trained model is evaluated against the DRIVE testing dataset, consisting of 20 images (as many as in the training set).

The parameters for the testing can be tuned again in the configuration.txt file, specifically in the [testing settings] section, as described below:
[testing settings]

  • best_last: choose the model for prediction on the testing dataset: best = the model with the lowest validation loss obtained during the training; last = the model at the last epoch.
  • full_images_to_test: number of full images for testing, max 20.
  • N_group_visual: choose how many images per row in the saved figures.
  • average_mode: if true, the predicted vessel probability for each pixel is computed by averaging the predicted probability over multiple overlapping patches covering the same pixel.
  • stride_height: relevant only if average_mode is True. The stride along the height for the overlapping patches, smaller stride gives higher number of patches.
  • stride_width: same as stride_height.
  • nohup: the standard output during the prediction is redirected and saved in a log file.

The section [experiment name] must be the name of the experiment you want to test, while [data paths] contains the paths to the testing datasets. Now the section [training settings] will be ignored.

Run testing by:

python run_testing.py

If available, a GPU will be used.
The following files will be saved in the folder with same name of the experiment:

  • The ROC curve (png)
  • The Precision-recall curve (png)
  • Picture of all the testing pre-processed images (png)
  • Picture of all the corresponding segmentation ground truth (png)
  • Picture of all the corresponding segmentation predictions (png)
  • One or more pictures including (top to bottom): original pre-processed image, ground truth, prediction
  • Report on the performance

All the results are referred only to the pixels belonging to the FOV, selected by the masks included in the DRIVE database

Results on STARE database

This neural network has been tested also on another common database, the STARE. The neural network is identical as in the experiment with the DRIVE dataset, however some modifications in the code and in the methodology were necessary due to the differences between the two datasets.
The STARE consists of 20 retinal fundus images with two sets of manual segmentation provided by two different observers, with the former one considered as the ground truth. Conversely to the DRIVE dataset, there is no standard division into train and test images, therefore the experiment has been performed with the leave-one-out method. The training-testing cycle has been repeated 20 times: at each iteration one image has been left out from the training set and then used for the test.
The pre-processing is the same applied for the DRIVE dataset, and 9500 random patches of 48x48 pixels each are extracted from each of the 19 images forming the training set. Also the area outside the FOV has been considered for the patch extraction. From these patches, 90% (162450 patches) are used for training and 10% (18050 patches) are used for validation. The training parameters (epochs, batch size...) are the same as in the DRIVE experiment.
The test is performed each time on the single image left out from the training dataset. Similarly to the DRIVE dataset, the vessel probability of each pixel is obtained by averaging over multiple overlapping patches, obtained with a stride of 5 pixels in both width and height. Only the pixels belonging to the FOV are considered. This time the FOV is identified by applying a color threshold in the original images, since no masks are available in the STARE dataset.

The following table shows the results (in terms of AUC ROC) obtained over the 20 different trainings, with the stated image used for test.

STARE image AUC ROC
im0239.ppm .9751
im0324.ppm .9661
im0139.ppm .9845
im0082.ppm .9929
im0240.ppm .9832
im0003.ppm .9856
im0319.ppm .9702
im0163.ppm .9952
im0077.ppm .9925
im0162.ppm .9913
im0081.ppm .9930
im0291.ppm .9635
im0005.ppm .9703
im0235.ppm .9912
im0004.ppm .9732
im0044.ppm .9883
im0001.ppm .9709
im0002.ppm .9588
im0236.ppm .9893
im0255.ppm .9819

AVERAGE: .9805 +- .0113

The folder ./STARE_results contains all the predictions. Each image shows (from top to bottom) the pre-processed original image of the STARE dataset, the ground truth and the corresponding prediction. In the predicted image, each pixel shows the vessel predicted probability, no threshold is applied.

The following table compares this method to other recent techniques, which have published their performance in terms of Area Under the ROC curve (AUC ROC) on the STARE dataset.

Method AUC ROC on STARE
Soares et al [1] .9671
Azzopardi et al. [2] .9563
Roychowdhury et al. [4] .9688
Fraz et al. [5] .9768
Qiaoliang et al. [6] .9879
Liskowski et al.^ [8] .9930
this method .9805

^ different definition of FOV

Bibliography

[1] Soares et al., “Retinal vessel segmentation using the 2-d Gabor wavelet and supervised classification,” Medical Imaging, IEEE Transactions on, vol. 25, no. 9, pp. 1214–1222, 2006.

[2] Azzopardi et al., “Trainable cosfire filters for vessel delineation with application to retinal images,” Medical image analysis, vol. 19, no. 1, pp. 46–57, 2015.

[3] Osareh et al., “Automatic blood vessel segmentation in color images of retina,” Iran. J. Sci. Technol. Trans. B: Engineering, vol. 33, no. B2, pp. 191–206, 2009.

[4] Roychowdhury et al., “Blood vessel segmentation of fundus images by major vessel extraction and subimage classification,” Biomedical and Health Informatics, IEEE Journal of, vol. 19, no. 3, pp. 1118–1128, 2015.

[5] Fraz et al., "An Ensemble Classification-Based Approach Applied to Retinal Blood Vessel Segmentation", IEEE Transactions on Biomedical Engineering, vol. 59, no. 9, pp. 2538-2548, 2012.

[6] Qiaoliang et al., "A Cross-Modality Learning Approach for Vessel Segmentation in Retinal Images", IEEE Transactions on Medical Imaging, vol. 35, no. 1, pp. 109-118, 2016.

[7] Melinscak et al., "Retinal vessel segmentation using deep neural networks", In Proceedings of the 10th International Conference on Computer Vision Theory and Applications (VISIGRAPP 2015), (2015), pp. 577–582.

[8] Liskowski et al., "Segmenting Retinal Blood Vessels with Deep Neural Networks", IEEE Transactions on Medical Imaging, vol. PP, no. 99, pp. 1-1, 2016.

Acknowledgements

This work was supported by the EU Marie Curie Initial Training Network (ITN) “REtinal VAscular Modelling, Measurement And Diagnosis" (REVAMMAD), Project no. 316990.

License

This project is licensed under the MIT License

Copyright (c) 2016 Daniele Cortinovis, Orobix Srl (www.orobix.com).

Comments
  • Regarding using this solution to solve another type of semantic segmentation problem

    Regarding using this solution to solve another type of semantic segmentation problem

    Hi, Thanks for sharing the code. I have a general question regarding the type of semantic segmentation task you are trying to solve.

    In addition to the retina blood vessel segmentation, another popular segmentation task is discussed in https://www.kaggle.com/c/ultrasound-nerve-segmentation The ground truth labelled area is usually like this one.

    test

    It seems to me that, for the retina study, the labelled area is ground truth image is more like a tree structure with a lot of small branches; while for this ultra-sound study, the labelled area is always a single block. Even though both of them belong to the semantic segmentation problem, the characteristics of labelled area are different with each other. My question is that, will the net architecture you designed here be a good fit for Kaggle study? Do you have any specific suggestion, which kind of modification can be made, when adopting your solution for that kaggle problem?

    opened by wenouyang 5
  • ValueError:

    ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 0, 24, 128), (None, 0, 24, 64)]

    up1 = merge([UpSampling2D(size=(2, 2))(conv3), conv2], mode='concat', concat_axis=1) File "/usr/local/lib/python2.7/dist-packages/keras/legacy/layers.py", line 460, in merge name=name) File "/usr/local/lib/python2.7/dist-packages/keras/legacy/layers.py", line 111, in init node_indices, tensor_indices) File "/usr/local/lib/python2.7/dist-packages/keras/legacy/layers.py", line 191, in _arguments_validation 'Layer shapes: %s' % (input_shapes)) ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 0, 24, 128), (None, 0, 24, 64)]

    my keras version is 2.0.4 and i also change the keras.json file. I try my best, and can not deal with this problem

    opened by baodingge 4
  • Incompatible with Keras 2

    Incompatible with Keras 2

    I was running the repo on keras 1 and it worked fine. Now while upgrading keras from version 1 to 2 some incompatibility issues have arisen. Is there any plan to make it compatible with keras 2

    opened by sumsuddin 4
  • Data output

    Data output

    Hi, I have some questions about the data output. I applied your model to another data set ,but I want to know how to achieve Multi-classification task,I hope you can give me some suggestions.Moreover,my data set need information of color,and I don't know how to process it,I hope you can give me guidance. Any insightful suggestions are very appreciate!

    opened by LingQiu 4
  • Equation used in `is_patch_inside_FOV` function

    Equation used in `is_patch_inside_FOV` function

    Can you please explain how did you reach to the following equation

    y_ = y - int(img_h/2)  # origin (0,0) shifted to image center
    R_inside = 270 - int(patch_h*1.42) #radius is 270 (from DRIVE db docs), minus the patch diagonal (assumed it is a square #this is the limit to contain the full patch in the FOV
    radius = np.sqrt((x_*x_)+(y_*y_))
    

    According to me it the equation should be R_inside = 270 - int(patch_h/1.42) #Half of diagonal

    opened by jain-anshul 4
  • Filter size error

    Filter size error

    Hi,

    Thanks for making this code available. I wanted to give this a quick look. I am on Mac OS, installed latest Keras and Tensorflow. Tried on python 3.5 after 2to3 for mostly the print statements.

    Here is the error I am getting:

    Using TensorFlow backend. I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.dylib locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.dylib locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.dylib locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.1.dylib locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.dylib locally

    train images/masks shape: (20, 1, 565, 565) train images range (min-max): 0.0 - 1.0 train masks are within 0-1

    patches per full image: 9500

    train PATCHES images/masks shape: (190000, 1, 48, 48) train PATCHES images range (min-max): 0.0 - 1.0 I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] OS X does not support NUMA - returning NUMA node zero I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties: name: GeForce GT 650M major: 3 minor: 0 memoryClockRate (GHz) 0.9 pciBusID 0000:01:00.0 Total memory: 1023.69MiB Free memory: 25.46MiB I tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:838] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GT 650M, pci bus id: 0000:01:00.0) Traceback (most recent call last): File "./src/retinaNN_training.py", line 107, in model = get_unet(n_ch, patch_height, patch_width) #the U-net model File "./src/retinaNN_training.py", line 34, in get_unet conv1 = Convolution2D(32, 3, 3, activation='relu', border_mode='same')(inputs) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/keras/engine/topology.py", line 514, in call self.add_inbound_node(inbound_layers, node_indices, tensor_indices) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/keras/engine/topology.py", line 572, in add_inbound_node Node.create_node(self, inbound_layers, node_indices, tensor_indices) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/keras/engine/topology.py", line 149, in create_node output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0])) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/keras/layers/convolutional.py", line 466, in call filter_shape=self.W_shape) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1579, in conv2d x = tf.nn.conv2d(x, kernel, strides, padding=padding) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 394, in conv2d data_format=data_format, name=name) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op op_def=op_def) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2319, in create_op set_shapes_for_outputs(ret) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1711, in set_shapes_for_outputs shapes = shape_func(op) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 246, in conv2d_shape padding) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 184, in get2d_conv_output_size (row_stride, col_stride), padding_type) File "/Users/ilknur/anaconda/lib/python3.5/site-packages/tensorflow/python/framework/common_shapes.py", line 149, in get_conv_output_size "Filter: %r Input: %r" % (filter_size, input_size)) ValueError: Filter must not be larger than the input: Filter: (3, 3) Input: (1, 48)

    opened by ilknuricke 4
  • ZeroDivisionError

    ZeroDivisionError

    Traceback (most recent call last): File "./src/retinaNN_predict.py", line 212, in precision = float(confusion[1,1])/float(confusion[1,1]+confusion[0,1]) ZeroDivisionError: float division by zero ===============This is my configration.txt=============== [data paths] path_local = ./DRIVE_datasets_training_testing/ train_imgs_original = DRIVE_dataset_imgs_train.hdf5 train_groundTruth = DRIVE_dataset_groundTruth_train.hdf5 train_border_masks = DRIVE_dataset_borderMasks_train.hdf5 test_imgs_original = DRIVE_dataset_imgs_test.hdf5 test_groundTruth = DRIVE_dataset_groundTruth_test.hdf5 test_border_masks = DRIVE_dataset_borderMasks_test.hdf5

    [experiment name] name = my_test201609112025

    [data attributes]

    Dimensions of the patches extracted from the full images

    patch_height = 48 patch_width = 48

    [training settings]

    number of total patches:

    N_subimgs = 40

    if patches are extracted only inside the field of view:

    inside_FOV = False

    Number of training epochs

    N_epochs = 100 batch_size = 32

    number of full images for the validation (max 20)

    full_images_to_test = 20

    if running with nohup

    nohup = False

    [testing settings]

    Choose the model to test: best==epoch with min loss, last==last epoch

    best_last = best

    number of full images for the test (max 20)

    full_images_to_test = 20

    How many original-groundTrutuh-prediction images are visualized in each image

    N_group_visual = 1

    Compute average in the prediction, improve results but require more patches to be predicted

    average_mode = False

    Only if average_mode==True. Stride of the average, lower value require more patches to be predicted

    stride_height = 45 stride_width = 45

    if running with nohup

    nohup = False

    What should I do? Thanks for any help.

    opened by pythonokai 4
  • If dividing pic into many N_subimgs is better than using whole pic to train?

    If dividing pic into many N_subimgs is better than using whole pic to train?

    Did u do some experiments?

    And if the g-net is from any paper?(u-net and g-net,which is better?)

    I don't really understand the mean of "patches_masks_train = masks_Unet(patches_masks_train)"... in masks_Unet: masks = np.reshape(masks,(masks.shape[0],im_him_w)) new_masks = np.empty((masks.shape[0],im_him_w,2)) I think each line in new_masks is a pic ,but what about "2"?

    THANKS.

    opened by Bonsen 3
  • when excute the run_testing.py ,i have a problem,it said ========  Evaluate the results ======================= Calculating results only inside the FOV: y scores pixels: 2429685 (radius 270: 270*270*3.14==228906), including background around retina: 6599200 (584*565==329960) y true pixels: 2429685 (radius 270: 270*270*3.14==228906), including background around retina: 6599200 (584*565==329960) Traceback (most recent call last):   File precision, recall, thresholds = precision_recall_curve(y_true, y_scores) File "/home/liushixin/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 441, in precision_recall_curve sample_weight=sample_weight) File "/home/liushixin/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 318, in _binary_clf_curve raise ValueError("{0} format is not supported".format(y_type)) ValueError: continuous format is not supported">

    when excute the run_testing.py ,i have a problem,it said ======== Evaluate the results ======================= Calculating results only inside the FOV: y scores pixels: 2429685 (radius 270: 270*270*3.14==228906), including background around retina: 6599200 (584*565==329960) y true pixels: 2429685 (radius 270: 270*270*3.14==228906), including background around retina: 6599200 (584*565==329960) Traceback (most recent call last): File "./src/retinaNN_predict.py", line 183, in precision, recall, thresholds = precision_recall_curve(y_true, y_scores) File "/home/liushixin/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 441, in precision_recall_curve sample_weight=sample_weight) File "/home/liushixin/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 318, in _binary_clf_curve raise ValueError("{0} format is not supported".format(y_type)) ValueError: continuous format is not supported

    ======== Evaluate the results ======================= Calculating results only inside the FOV: y scores pixels: 2429685 (radius 270: 2702703.14==228906), including background around retina: 6599200 (584565==329960) y true pixels: 2429685 (radius 270: 2702703.14==228906), including background around retina: 6599200 (584565==329960) Traceback (most recent call last): File "./src/retinaNN_predict.py", line 183, in precision, recall, thresholds = precision_recall_curve(y_true, y_scores) File "/home/liushixin/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 441, in precision_recall_curve sample_weight=sample_weight) File "/home/liushixin/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 318, in _binary_clf_curve raise ValueError("{0} format is not supported".format(y_type)) ValueError: continuous format is not supported anyone can give some advice?

    opened by ruda0214 2
  • run 'python run_training.py' error

    run 'python run_training.py' error

    when i run 'python run_training.py',the error is:

    1. Create directory for the results (if not already existing) Dir already existing copy the configuration file in the results folder

    2. Run the training on GPU with nohup nohup: ignoring input and redirecting stderr to stdout

    opened by rockywind 2
  •  Error when checking model target: expected activation_1 to have 3 dimensions, but got array with shape (30, 1, 160, 160)

    Error when checking model target: expected activation_1 to have 3 dimensions, but got array with shape (30, 1, 160, 160)

    I'm new to deep learning, I have this error, it is clearly the target images needs to be in different shape. However, since I'm doing augmentation using (.flow_from_directory) for both the images and the masks. How can I reshape target (mask) to be as same as activation results? Notice I getting generator after augmentation. Any idea?

    permute_1 (Permute) (None, 25600, 2) 0 reshape_1[0][0]


    activation_1 (Activation) (None, 25600, 2) 0 permute_1[0][0]

    your help is greatly appreciated. Thanks.

    opened by saeedalahmari3 2
  • Any subsequent image repair work

    Any subsequent image repair work

    Hello, thank you for your work. After I repeated your project, I found that there were many breakpoints. Do you do any subsequent breakpoint repair work?

    opened by Yilp 0
  • Trouble with model architecture

    Trouble with model architecture

    Thanks for sharing your work. Like others, I have trouble with model archtechture that you provide. Please Check it. Thanks ValueError: ('Unrecognized keyword arguments:', dict_keys(['input_dtype'])) TypeError: ('Keyword argument not understood:', 'concat_axis')

    I really appreciate it if you answer these questions. Thanks very much.

    opened by Mr-Akbari 0
  • Process finished with exit code -1073740791 (0xC0000409)

    Process finished with exit code -1073740791 (0xC0000409)

    when I run the prepare_datasets_DRIVE.py, the console window show "Process finished with exit code -1073740791 (0xC0000409)". what can i do to fix this bug.

    opened by Young-Edwards 1
  • Why i am getting less performance than yours?

    Why i am getting less performance than yours?

    Hi, I run the code published in this repo, but i didn't get the same performance as mentioned in Performance.txtfile. i just copied and pasted the code and corrected some typos like putting ( ) for print function and just made it run. i used Colab Pro in the implementation and the results of DRIVE dataset is as follow:

    Area under the ROC curve: 0.9745132983506472
    Area under Precision-Recall curve: 0.9005084432534444
    Global Accuracy: 0.9542264313839384
    Specificity: 0.9833227875108509
    Sensitivity: 0.7547351419287491
    Precision: 0.8684320607463418
    Jaccard similarity score: 0.6772917155378523
    F1 score (F-measure): 0.807601574924213 
    

    Also, i tried to load the test_best_weights.h5 to see the prediction's of your trained model (without retraining from scratch), but i also get the below error while reading test_architecture.json file, so i couldn't even load your trained model and evaluated.

    ValueError: ('Unrecognized keyword arguments:', dict_keys(['input_dtype']))

    Please, what should i do to get the same performance as yours ? Any help is appreciated. Thanks

    opened by AliSaeed86 0
Owner
Orobix
Orobix
The open source code of SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation.

SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation(ICPR 2020) Overview This code is for the paper: Spatial Attention U-Net for Retinal V

Changlu Guo 151 Dec 28, 2022
Retinal Vessel Segmentation with Pixel-wise Adaptive Filters (ISBI 2022)

Retinal Vessel Segmentation with Pixel-wise Adaptive Filters (ISBI 2022) Introdu

anonymous 14 Oct 27, 2022
Official code of Retinal Vessel Segmentation with Pixel-wise Adaptive Filters and Consistency Training

Official code of Retinal Vessel Segmentation with Pixel-wise Adaptive Filters and Consistency Training (ISBI 2022)

anonymous 7 Feb 10, 2022
Final project for machine learning (CSC 590). Detection of hepatitis C and progression through blood samples.

Hepatitis C Blood Based Detection Final project for machine learning (CSC 590). Dataset from Kaggle. Using data from previous hepatitis C blood panels

Jennefer Maldonado 1 Dec 28, 2021
Single Red Blood Cell Hydrodynamic Traps Via the Generative Design

Rbc-traps-generative-design - The generative design for single red clood cell hydrodynamic traps using GEFEST framework

Natural Systems Simulation Lab 4 Jun 16, 2022
This is a model made out of Neural Network specifically a Convolutional Neural Network model

This is a model made out of Neural Network specifically a Convolutional Neural Network model. This was done with a pre-built dataset from the tensorflow and keras packages. There are other alternative libraries that can be used for this purpose, one of which is the PyTorch library.

null 9 Oct 18, 2022
Code for "FPS-Net: A convolutional fusion network for large-scale LiDAR point cloud segmentation".

FPS-Net Code for "FPS-Net: A convolutional fusion network for large-scale LiDAR point cloud segmentation", accepted by ISPRS journal of Photogrammetry

null 15 Nov 30, 2022
A PyTorch implementation for V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation

A PyTorch implementation of V-Net Vnet is a PyTorch implementation of the paper V-Net: Fully Convolutional Neural Networks for Volumetric Medical Imag

Matthew Macy 606 Dec 21, 2022
This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of Coordinate Independent Convolutional Networks.

Orientation independent Möbius CNNs This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of

Maurice Weiler 59 Dec 9, 2022
CoSMA: Convolutional Semi-Regular Mesh Autoencoder. From Paper "Mesh Convolutional Autoencoder for Semi-Regular Meshes of Different Sizes"

Mesh Convolutional Autoencoder for Semi-Regular Meshes of Different Sizes Implementation of CoSMA: Convolutional Semi-Regular Mesh Autoencoder arXiv p

Fraunhofer SCAI 10 Oct 11, 2022
EPSANet:An Efficient Pyramid Split Attention Block on Convolutional Neural Network

EPSANet:An Efficient Pyramid Split Attention Block on Convolutional Neural Network This repo contains the official Pytorch implementaion code and conf

Hu Zhang 175 Jan 7, 2023
Implementation of character based convolutional neural network

Character Based CNN This repo contains a PyTorch implementation of a character-level convolutional neural network for text classification. The model a

Ahmed BESBES 248 Nov 21, 2022
Scripts for training an AI to play the endless runner Subway Surfers using a supervised machine learning approach by imitation and a convolutional neural network (CNN) for image classification

About subwAI subwAI - a project for training an AI to play the endless runner Subway Surfers using a supervised machine learning approach by imitation

null 82 Jan 1, 2023
Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network

Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network This repository is the official implementation of Speech Separati

Kai Li (李凯) 116 Nov 9, 2022
Meta graph convolutional neural network-assisted resilient swarm communications

Resilient UAV Swarm Communications with Graph Convolutional Neural Network This repository contains the source codes of Resilient UAV Swarm Communicat

null 62 Dec 6, 2022
Convolutional neural network web app trained to track our infant’s sleep schedule using our Google Nest camera.

Machine Learning Sleep Schedule Tracker What is it? Convolutional neural network web app trained to track our infant’s sleep schedule using our Google

g-parki 7 Jul 15, 2022
Pytorch implementation of Cut-Thumbnail in the paper Cut-Thumbnail:A Novel Data Augmentation for Convolutional Neural Network.

Cut-Thumbnail (Accepted at ACM MULTIMEDIA 2021) Tianshu Xie, Xuan Cheng, Xiaomin Wang, Minghui Liu, Jiali Deng, Tao Zhou, Ming Liu This is the officia

null 3 Apr 12, 2022
Code repo for "RBSRICNN: Raw Burst Super-Resolution through Iterative Convolutional Neural Network" (Machine Learning and the Physical Sciences workshop in NeurIPS 2021).

RBSRICNN: Raw Burst Super-Resolution through Iterative Convolutional Neural Network An official PyTorch implementation of the RBSRICNN network as desc

Rao Muhammad Umer 6 Nov 14, 2022
Some code of the implements of Geological Modeling Using 3D Pixel-Adaptive and Deformable Convolutional Neural Network

3D-GMPDCNN Geological Modeling Using 3D Pixel-Adaptive and Deformable Convolutional Neural Network PyTorch implementation of "Geological Modeling Usin

null 5 Nov 21, 2022