Git Product home page Git Product logo

bcdu-net's Introduction

Deep auto-encoder-decoder network for medical image segmentation with state of the art results on skin lesion segmentation, lung segmentation, and retinal blood vessel segmentation. This method applies bidirectional convolutional LSTM layers in U-net structure to non-linearly encode both semantic and high-resolution information with non-linearly technique. Furthermore, it applies densely connected convolution layers to include collective knowledge in representation and boost convergence rate with batch normalization layers. If this code helps with your research please consider citing the following papers:

R. Azad, M. Asadi, Mahmood Fathy and Sergio Escalera "Bi-Directional ConvLSTM U-Net with Densely Connected Convolutions ", ICCV, 2019, download link.

M. Asadi, R. Azad, Mahmood Fathy and Sergio Escalera "Multi-level Context Gating of Embedded Collective Knowledge for Medical Image Segmentation", The first two authors contributed equally. arXiv:2003.05056, 2020, download link.

Please consider starring us, if you found it useful. Thanks

Updates

Prerequisties and Run

This code has been implemented in python language using Keras libarary with tensorflow backend and tested in ubuntu OS, though should be compatible with related environment. following Environement and Library needed to run the code:

  • Python 3
  • Keras - tensorflow backend

Run Demo

For training deep model for each task, go to the related folder and follow the bellow steps:

Skin Lesion Segmentation

1- Download the ISIC 2018 train dataset from this link and extract both training dataset and ground truth folders inside the dataset_isic18.
2- Run Prepare_ISIC2018.py for data preperation and dividing data to train,validation and test sets.
3- Run train_isic18.py for training BCDU-Net model using trainng and validation sets. The model will be train for 100 epochs and it will save the best weights for the valiation set. You can also train U-net model for this dataset by changing model to unet, however, the performance will be low comparing to BCDU-Net.
4- For performance calculation and producing segmentation result, run evaluate.py. It will represent performance measures and will saves related figures and results in output folder.

Retina Blood Vessel Segmentation

1- Download Drive dataset from this link and extract both training and test folders in a folder name DRIVE (make a new folder with name DRIVE)
2- Run prepare_datasets_DRIVE.py for reading whole data. This code will read all the train and test samples and will saves them as a hdf5 file in the DRIVE_datasets_training_testing folder.
3- The next step is to extract random patches from the training set to train the model, to do so, Run save_patch.py, it will extract random patches with size 64*64 and will save them as numpy file. This code will use help_functions.py, spre_processing.py and extract_patches.py functions for data normalization and patch extraction.
4- For model training, run train_retina.py, it will load the training data and will use 20% of training samples as a validation set. The model will be train for 50 epochs and it will save the best weights for the valiation set.
4- For performance calculation and producing segmentation result, run evaluate.py. It will represent performance measures and will saves related figures and results in test folder.
Note: For image pre-processing and patch extraction we used this github's code.

Lung Segmentation

1- Download the Lung Segmentation dataset from Kaggle link and extract it.
2- Run Prepare_data.py for data preperation, train/test seperation and generating new masks around the lung tissues. 3- Run train_lung.py for training BCDU-Net model using trainng and validation sets (20 percent of the training set). The model will be train for 50 epochs and it will save the best weights for the valiation set. You can train either BCDU-net model with 1 or 3 densly connected convolutions.
4- For performance calculation and producing segmentation result, run evaluate_performance.py. It will represent performance measures and will saves related figures and results.

Quick Overview

Diagram of the proposed method

Structure of the Bidirection Convolutional LSTM that used in our network

Diagram of the proposed method

Structure of the BConvLSTM+SE that used in our network (MCGU-Net)

Feature encoder of the MCGU-Net

Results

For evaluating the performance of the proposed method, Two challenging task in medical image segmentaion has been considered. In bellow, results of the proposed approach illustrated.

Task 1: Retinal Blood Vessel Segmentation

Performance Comparision on Retina Blood Vessel Segmentation

In order to compare the proposed method with state of the art appraoches on retinal blood vessel segmentation, we considered Drive dataset.

Methods Year F1-scores Sensivity Specificaty Accuracy AUC
Chen etc. all Hybrid Features 2014 - 0.7252 0.9798 0.9474 0.9648
Azzopardi et. all Trainable COSFIRE filters 2015 - 0.7655 0.9704 0.9442 0.9614
Roychowdhury and et. all Three Stage Filtering 2016 - 0.7250 0.9830 0.9520 0.9620
Liskowsk etc. allDeep Model 2016 - 0.7763 0.9768 0.9495 0.9720
Qiaoliang et. all Cross-Modality Learning Approach 2016 - 0.7569 0.9816 0.9527 0.9738
Ronneberger and et. all U-net 2015 0.8142 0.7537 0.9820 0.9531 0.9755
Alom etc. all Recurrent Residual U-net 2018 0.8149 0.7726 0.9820 0.9553 0.9779
Oktay et. all Attention U-net 2018 0.8155 0.7751 0.9816 0.9556 0.9782
Alom et. all R2U-Net 2018 0.8171 0.7792 0.9813 0.9556 0.9784
Azad et. all Proposed BCDU-Net 2019 0.8222 0.8012 0.9784 0.9559 0.9788

Retinal blood vessel segmentation result on test data

Retinal Blood Vessel Segmentation result 1 Retinal Blood Vessel Segmentation result 2 Retinal Blood Vessel Segmentation result 3

Skin Lesion Segmentation

Performance Evalution on the Skin Lesion Segmentation task

Methods Year F1-scores Sensivity Specificaty Accuracy PC JS
Ronneberger and etc. all U-net 2015 0.647 0.708 0.964 0.890 0.779 0.549
Alom et. all Recurrent Residual U-net 2018 0.679 0.792 0.928 0.880 0.741 0.581
Oktay et. all Attention U-net 2018 0.665 0.717 0.967 0.897 0.787 0.566
Alom et. all R2U-Net 2018 0.691 0.726 0.971 0.904 0.822 0.592
Azad et. all Proposed BCDU-Net 2019 0.847 0.783 0.980 0.936 0.922 0.936
Azad et. all MCGU-Net 2020 0.895 0.848 0.986 0.955 0.947 0.955

Skin Lesion Segmentation results

Skin Lesion Segmentation result 1 Skin Lesion Segmentation result 1 Skin Lesion Segmentation result 1 Skin Lesion Segmentation result 1

Lung Segmentation

Performance Evalution on the Lung Segmentation task

Methods Year F1-scores Sensivity Specificaty Accuracy AUC JS
Ronneberger and etc. all U-net 2015 0.9658 0.9696 0.9872 0.9872 0.9784 0.9858
Alom et. all Recurrent Residual U-net 2018 0.9638 0.9734 0.9866 0.9836 0.9800 0.9836
Alom et. all R2U-Net 2018 0.9832 0.9944 0.9832 0.9918 0.9889 0.9918
Azad et. all Proposed BCDU-Net 2019 0.9904 0.9910 0.9982 0.9972 0.9946 0.9972

Lung Segmentation results

Lung Segmentation result 1 Lung Segmentation result 2 Lung Segmentation result 3

Cell Nuclei Segmentation

Cell Nuclei Segmentation results

Cell Nuclei Segmentation results

Model weights

You can download the learned weights for each task in the following table.

Task Dataset Learned weights
Retina Blood Vessel Segmentation Drive BCDU_net_D3
Skin Lesion Segmentation ISIC2018 BCDU_net_D3
Lung Segmentation Lung kaggle BCDU_net_D3

Query

All implementation done by Reza Azad. For any query please contact us for more information.

rezazad68@gmail.com

bcdu-net's People

Contributors

ahmadsalimi avatar rezazad68 avatar

Stargazers

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

bcdu-net's Issues

where is the Bi-direction conv LSTM...??

I already saw your code and your answer about other person's issue.
"
you can use the following code to include bi-directional ConvLSTM:
LSTM_f = layers.ConvLSTM2D(filters = 128, kernel_size=(3, 3), padding='same', return_sequences = False, go_backwards = False, kernel_initializer = 'he_normal')(X)
LSTM_b = layers.ConvLSTM2D(filters = 128, kernel_size=(3, 3), padding='same', return_sequences = False, go_backwards = True, kernel_initializer = 'he_normal')(X)
Bi_rep = layers.Add()([LSTM_f, LSTM_b])
"

There is no Bi-direction convLSTM2d. so If i want to use bi-directional convlstm2d, Do I just typo that your code LSTM_f and LSTM_b ??

tempfile.tif: Cannot read TIFF header.

I tried to run "python prepare_datasets_DRIVE.py" and got the error.

original image: 21_training.tif
tempfile.tif: Cannot read TIFF header.
Traceback (most recent call last):
File "prepare_datasets_DRIVE.py", line 82, in
imgs_train, groundTruth_train, border_masks_train = get_datasets(original_imgs_train,groundTruth_imgs_train,borderMasks_imgs_train,"train")
File "prepare_datasets_DRIVE.py", line 46, in get_datasets
imgs[i] = np.asarray(img)
TypeError: float() argument must be a string or a number, not 'TiffImageFile'

No license, no copyright notice is included in the project

Dear Reza,

We would like to use some of your project's features in an application we plan to release under the permissive open source Apache v2.0 license, but I found no copyright or license notice in the project repository. Can you clarify this information and make it appear in your source code? Without it, it is impossible to legally use your source code, because copyright law strictly applies and prohibits any reuse.

If you don't have any idea about this, you'll find detailed information in the Github documentation and on the Open Source Guides:

Thank you very much for your work and thank you in advance for your clarifications.

Sébastien

Concern about metrics

I noticed you are flattening the whole batch like this.

This way, a pair of masks where the Dice Coefficient is close to 0 like below won't be penalized heavily, as the metric is being averaged over pixels, not over images.

image

training

i use the DRIVE dataset ,but why my training result value is the same。
#################################################
Epoch 1/50
160000/160000 [==============================] - 10087s 63ms/step - loss: 0.3565 - acc: 0.8929 - val_loss: 0.3562 - val_acc: 0.8855
Epoch 2/50
160000/160000 [==============================] - 11281s 71ms/step - loss: 0.3405 - acc: 0.8929 - val_loss: 0.3562 - val_acc: 0.8855
Epoch 3/50
160000/160000 [==============================] - 12124s 76ms/step - loss: 0.3405 - acc: 0.8929 - val_loss: 0.3561 - val_acc: 0.8855
Epoch 4/50
160000/160000 [==============================] - 15388s 96ms/step - loss: 0.3405 - acc: 0.8929 - val_loss: 0.3562 - val_acc: 0.8855
Epoch 5/50
160000/160000 [==============================] - 19182s 120ms/step - loss: 0.3405 - acc: 0.8929 - val_loss: 0.3563 - val_acc: 0.8855

######################

Multimodality input: T1, T2, etc.

Good day to you. Is it possible to pass more than single channel (grayscale) arrays to model. I would like to train on my own dataset with MRI images: T1-wrighted, T2-weighted, T2 TIRM, DWI, SWI. All of images have same shape (512, 512, 1) and want to encode them as (512, 512, 5) input.
Should I modify model exept input_size=(512, 512, 5) param of BCDU_net_D3 function?

P.S. Sorry for my english :(.

train_retina.py error

Hello, I try to use Retina Blood Vessel Segmentation. I would like to ask you what should I do when I run train_retina.py and have this error. I hope you can see my question.
image

skimage.transform.resize is slower than scipy.misc.imresize

while training for the skin images data set on Google Colab I came across errors in a data preparation section. where this line:
img = np.double(sc.imresize(img, [height, width, channels], interp='bilinear', mode = 'RGB'))

and this line:
img2 = np.double(sc.imresize(img2, [height, width], interp='bilinear'))

showed errors, as scipy.misc.imresize is deprecated in newer versions of scipy. What I did is I used skimage.transform.resize instead of scipy.misc.imresize, that's what is recommended, as:

img = np.double(resize(img, (height, width, channels)))

Here I have imported resize from skimage.transform
and
img2 = np.double(resize(img2, (height, width)))

It worked. But the problem is the data reading process has become very slow as compared to the scipy.misc.imresize. I had tested it before on old version of scipy.misc.imresize. Any help in this regard would be very much appreciated. Thanks!

no model.compile but model.fit is work。

Excuse me .Thanks once again for awesome work. when I learn the code ,I find it doesn't have model.compile ,but model.fit is work。can you help me to understand the loss and the optimizers?

evaluate problem

i first run the skin lesion project and succeed
then i try to change my own dataset, it is .nii format, and i train model have the following picture
11
but when i evaluate a nii(and it is in my validation), but it evaluate the same value at every pixel, i have no idea how to fix it
222
can you help me please, thx!

Issue in Prepare_Data.py

Hi,

I was trying to implement lung segmentation from the repo. As mentioned, I downloaded the dataset from Kaggle. I processed the data and the npy files are now being saved inside the processed_data folder under Lung Segmentation. In order to train the network, I was trying to use train.py file, but ran into an error that states:

File "train_lung.py", line 20, in
tr_data = np.expand_dims(tr_data, axis=3)
File "<array_function internals>", line 6, in expand_dims
File "/home/achoudhury/biomedseg/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 597, in expand_dims
axis = normalize_axis_tuple(axis, out_ndim)
File "/home/achoudhury/biomedseg/lib/python3.6/site-packages/numpy/core/numeric.py", line 1358, in normalize_axis_tuple
axis = tuple([normalize_axis_index(ax, ndim, argname) for ax in axis])
File "/home/achoudhury/biomedseg/lib/python3.6/site-packages/numpy/core/numeric.py", line 1358, in
axis = tuple([normalize_axis_index(ax, ndim, argname) for ax in axis])
numpy.AxisError: axis 3 is out of bounds for array of dimension 2

Can you please help me with it?

Thank you so much!

Multiple issue while running the code

1: Skin Lesion dataset download link is not active.
2: In prepare_dataset_DRIVE.py of retina blood vessel segmentation folder this script is not running properly.

AssertionError while running evaluate.py on ratinal data set

print(patches_imgs_test.shape)
(214200, 64, 64, 1)

predicted images size :
(214200, 64, 64, 1)

if average_mode == True:
    pred_imgs = **recompone_overlap**(pred_patches, new_height, new_width, stride_height, stride_width)# predictions
    orig_imgs = my_PreProc(test_imgs_orig[0:pred_imgs.shape[0],:,:,:])    #originals
    gtruth_masks = masks_test  #ground truth masks

else:
    pred_imgs = recompone(pred_patches,13,12)       # predictions
    orig_imgs = recompone(patches_imgs_test,13,12)  # originals
    gtruth_masks = recompone(patches_masks_test,13,12)**

**Traceback (most recent call last):

  File "C:\Users\BIOIMA~1\AppData\Local\Temp/ipykernel_25740/3778051638.py", line 2, in <module>
    pred_imgs = **recompone_overlap**(pred_patches, new_height, new_width, stride_height, stride_width)# predictions

  File "C:\Users\Bioimaging\shrirang_IPW\conference\data\DRIVE\BCDU-Net-master\Retina Blood Vessel Segmentation\extract_patches.py", line 266, in recompone_overlap
    assert (preds.shape[1]==1 or preds.shape[1]==3)  #check the channel is 1 or 3

AssertionError**

I think here the error is occuring because of this >> recompone_overlap

Too many indicies in array

Train_img      = Data_train[0:alpha,:,:]
Test_img       = Data_train[alpha:en_d,:,:]

Train_mask     = Mask_train[0:alpha,:,:]
Test_mask      = Mask_train[alpha:en_d,:,:]

Train_maska     = Maska_train[0:alpha,:,:]
Test_maska      = Maska_train[alpha:en_d,:,:]

FOV_tr     = FOV_train[0:alpha,:,:]
FOV_te      = FOV_train[alpha:en_d,:,:]

in module Prepare_data.py

There is a problem with the result of visual lung segmentation

Dear author, thank you very much for opening up your code.
I want to get the visualization results after lung segmentation. After I read the DCM file with simpleitk library, the results are shown in the figure below
image
Obviously, this result is wrong.
model = M.BCDU_net_D3(input_size = (512,512,1))
model.load_weights('./weight/weight_lungD3.hdf5')
vol = sitk.ReadImage('IM000090.dcm')
volarray = sitk.GetArrayFromImage(vol)
pre = model.predict(volarray)

This is the code I use. How do you visualize it, or what do you use as the input of the model?

About the prepare_data.py

Can you tell me the meaning of Data_train, Mask_train, Maska_train,FOV_train obtained through Prepare_data.py?

performance evaluation

In file "evaluate_performance.py ", you flatten all tesing data to an array, and fed it into jaccard_similarity_score,f1_score and so on. However, the general practice is to evaluate each input data and then average them. The results of the two methods are quite different, although the accuracy is the same.

How ConvLSTM2D is learning the spatio-temporal information from individual image?

As you have mentioned ConvLSTM2D is used for Spatio-temporal information.
image

But I am confused, is this model really going to learn the temporal information? There are two reasons for it.

  • Your datasets are images and not videos.
  • And you are using a Convolutional layer in your encoder and decoder but Bi-Directional ConvLSTM in skip connection.

image

Can you share your findings? Does this really work?

Reference:
Temporal Information
Stackoverflow answer

patch problem

i use CT dataset, i found the label with value of 1 is less than 0.003 in whole CT picture ,the i use patch method.
i have 250 CT pictures,and size is 256256 , the i divide into 6464 , 220 CT into 198006464 patch for train, and 30 CT into 27006464 for valadation
i tried your D3model and Unet model, and i also tried binary_crossentropy loss, dice loss and GDL, first i use the learning rate 0.0001, but loss first declined but quickly increased in the first epoch
the i decrease lr like 0.0005, 0.00001, but it didn't work.
and i found your unet model only maxpooling 3 times, i tried the 32 layers Unet with 4 times maxpooling, i found lr 0.0001 for 256256 didn't work , i tried 0.00001 works.
so i don't konw how to select the lr for pathes of 64
64 CT, i think enitial lr 0.00001 is small ,can you help me ,thx!

No such file or directory: 'data_test.npy'

do I have to train the model? I just run the "evaluate.py" in folder "Skin Lesion Segmentation" and it reports an error:

FileNotFoundError: [Errno 2] No such file or directory: 'data_test.npy'

so , is this file generated during the trainning process?

Test your model on PNG retina images

Hi

I would like to run your pre-trained model on some retina images from a different dataset.

Your evaluate model seems to be dependent on some hdf5 structure. Is there a simple method you could propose to make segmentation prediction possible from some .png images?

Michael

JS score may be inaccurate on skin lesion segmentation task!

I found that in Skin Lesion Segmentation task, you used 'jaccard_similarity_score' function to evaluate ‘JS’ score in your code. After version 0.23, sklearn used 'jaccard_score' instead of it, because "the current Jaccard implementation is ridiculous for binary and multiclass problems, returning accuracy"(scikit-learn/scikit-learn#13151). So your JS score may be inaccurate, after my verification, the actual score should be about 0.76

Retina weights

Hello sir,

Thank you very much for this great repository. I used pretrained models for DRIVE dataset but i received a wrong mask. I have done the image grayscale before input and then I take this result. Αm i doing something wrong?
retina

Thank you in advance

Two problems, help, Mr REZEZAD

1)jaccard_similarity_score from package sklearn.metrics used in your codes should be old and the results maybe wrong. After Sklearn Version 0.32 , jaccard_similarity_score is replaced by jaccard_score, the testing results become lower. When binary segmentation, jaccard_similarity_score == Accuracy.
2)The unet model is hard to train and there is no validation accuracy improvment when training on my GPUS:
815/1815 [==============================] - 79s 44ms/step - loss: 0.6670 - acc: 0.7923 - val_loss: 0.6779 - val_acc: 0.8619
Epoch 2/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.0440 - acc: 0.7923 - val_loss: 1.6138 - val_acc: 0.8619
Epoch 3/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1744 - acc: 0.7923 - val_loss: 1.6138 - val_acc: 0.8619
Epoch 4/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1744 - acc: 0.7923 - val_loss: 1.6138 - val_acc: 0.8619
Epoch 5/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1742 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 6/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 7/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 8/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619

Epoch 00008: ReduceLROnPlateau reducing learning rate to 9.999999747378752e-06.
Epoch 9/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 10/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 11/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 12/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 13/100
1815/1815 [==============================] - 70s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 14/100
1815/1815 [==============================] - 70s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 15/100
1815/1815 [==============================] - 70s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
.....
Epoch 00029: ReduceLROnPlateau reducing learning rate to 1.0000000116860975e-08.
Epoch 30/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 31/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 32/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 33/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 34/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 35/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 36/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619

Epoch 00036: ReduceLROnPlateau reducing learning rate to 9.999999939225292e-10.
Epoch 37/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 38/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 39/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 40/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 41/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 42/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 43/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619

Epoch 00043: ReduceLROnPlateau reducing learning rate to 9.999999717180686e-11.
Epoch 44/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 45/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 46/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
Epoch 47/100
1815/1815 [==============================] - 71s 39ms/step - loss: 2.1737 - acc: 0.7923 - val_loss: 1.6127 - val_acc: 0.8619
and finally, the evaluation results are very bad:
Area under the ROC curve: 0.5

Area under Precision-Recall curve: 0.6370608990009015

Confusion matrix: Custom threshold (for positive) of 0.5
[[24737000 0]
[ 9341720 0]]
Global Accuracy: 0.7258782019981971
Specificity: 1.0
Sensitivity: 0.0
Precision: 0

Jaccard similarity score: 0.0

F1 score (F-measure): 0.0

So strange!

There is no label under the test folder downloaded from DRIVE

Hi! Thank you for publishing your code.
When I run prepare_datasets_DRIVE.py in the DRIVE dataset, I found that the test does not contain label, but your program requires the input variable "groundTruth_imgs_test". The test I downloaded contains only images and mask.

Assertion Error

imgs max: 0.0
imgs min: 0.0
Traceback (most recent call last):
File "prepare_datasets_DRIVE.py", line 82, in
imgs_train, groundTruth_train, border_masks_train = get_datasets(original_imgs_train,groundTruth_imgs_train,borderMasks_imgs_train,"train")
File "prepare_datasets_DRIVE.py", line 67, in get_datasets
assert(np.max(groundTruth)==255 and np.max(border_masks)==255)
AssertionError
kindly tell me how to resolve this? just tried to run prepare_datasets_DRIVE.py

Bidirectional ConvLSTM

Thank you for your sharing, and i still confused about the differences between the two coding scheme of bi-directional ConvLSTM .
One is what you discribed before:

LSTM_f = layers.ConvLSTM2D(filters = 128, kernel_size=(3, 3), padding='same', return_sequences = False, go_backwards = False, kernel_initializer = 'he_normal')(X)

LSTM_b = layers.ConvLSTM2D(filters = 128, kernel_size=(3, 3), padding='same', return_sequences = False, go_backwards = True, kernel_initializer = 'he_normal')(X)

Bi_rep = layers.Add()([LSTM_f, LSTM_b])

The other is using the Bidirectional wrapper:

Bidirectional(ConvLSTM2D(filters = 128, kernel_size=(3, 3), padding='same', kernel_initializer='he_normal', return_sequences=True))(X)''.

Could you tell if the second statement is correct, and if there are some differences between them? Than you for your reply!

Semantic bug in the implementation

I believe using go_backwards=True does not make a ConvLSTM bidirectional. It just makes the input reversed. Instead, there should be a Bidirectional layer wrapping around the ConvLSTM to do the job. This way there would be two separate outputs for forward and backward cells. I'm not sure if those should be concatenated or averaged based on the model proposed in the paper. For the first option we have to make the number output channels half, so that the dimensions stay constant.

Pretrained Weights for Inference Only

Hello, thanks for this nice repo.

I was wondering, can I access a pretrained model just to make inference on new images?

From reading the README it seems that I'll need to run the training pipeline first before being able to infer on new images.

I think it would be useful for a lot of people to directly access pretrained weights, would you consider sharing them?

Thanks!

TypeError: ('Keyword argument not understood:', 'input')

Hello, sir! I hope you are doing well.
While training the model for the skin data set i came across this error:

TypeError: ('Keyword argument not understood:', 'input')

I am training on google colab; the error refers to:
error pic

Your help in this regard would be highly appreciated.
Looking forward for your kind response,
Asif Ahmad

BCDU_net_D1 BCDU_net_D3 differences

Hi!
First of all, thank you very much for sharing your code.

Coud you tell me what is the difference between BCDU_net_D1 and BCDU_net_D3 networks?
I've tried to use BCDU_net_D3 but I have the next error:
OOM when allocating tensor with shape[2,5,256,256,64]

Could you help me?
Thank you very much!

Scoring Run time too high

It tried implementing this repo.
For scoring the test dataset, it is taking around 90 mins.

Attached is the screenshot.

Can you please help in order to identify the issue ?

Regards,
Gaurav

Prerequisities

Dear rezazad68 , can you tell the tensorflow and keras version? Thanks.

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.