All Projects → yihui-he → U Net

yihui-he / U Net

Licence: mit
U-Net: Convolutional Networks for Biomedical Image Segmentation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to U Net

Livianet
This repository contains the code of LiviaNET, a 3D fully convolutional neural network that was employed in our work: "3D fully convolutional networks for subcortical segmentation in MRI: A large-scale study"
Stars: ✭ 143 (-61.76%)
Mutual labels:  deep-neural-networks, image-segmentation, convolutional-networks, medical-imaging
CNN-DICOM-Segmentation
DICOM Image Segmentation with CNNs in Tensorflow
Stars: ✭ 87 (-76.74%)
Mutual labels:  medical-imaging, image-segmentation
SemiDenseNet
Repository containing the code of one of the networks that we employed in the iSEG Grand MICCAI Challenge 2017, infant brain segmentation.
Stars: ✭ 55 (-85.29%)
Mutual labels:  medical-imaging, convolutional-networks
Brain-MRI-Segmentation
Smart India Hackathon 2019 project given by the Department of Atomic Energy
Stars: ✭ 29 (-92.25%)
Mutual labels:  medical-imaging, image-segmentation
Ml Workspace
Machine Learning (Beginners Hub), information(courses, books, cheat sheets, live sessions) related to machine learning, data science and python is available
Stars: ✭ 221 (-40.91%)
Mutual labels:  deep-neural-networks, convolutional-networks
Deep Unet For Satellite Image Segmentation
Satellite Imagery Feature Detection with SpaceNet dataset using deep UNet
Stars: ✭ 227 (-39.3%)
Mutual labels:  deep-neural-networks, image-segmentation
survey-computer-vision-2021
2021年计算机视觉技术综述分类汇总
Stars: ✭ 54 (-85.56%)
Mutual labels:  medical-imaging, image-segmentation
Paper Note
📚 记录一些自己读过的论文与笔记
Stars: ✭ 22 (-94.12%)
Mutual labels:  convolutional-networks, image-segmentation
Fire Detection Cnn
real-time fire detection in video imagery using a convolutional neural network (deep learning) - from our ICIP 2018 paper (Dunnings / Breckon) + ICMLA 2019 paper (Samarth / Bhowmik / Breckon)
Stars: ✭ 340 (-9.09%)
Mutual labels:  deep-neural-networks, convolutional-networks
VNet
Prostate MR Image Segmentation 2012
Stars: ✭ 54 (-85.56%)
Mutual labels:  medical-imaging, image-segmentation
Keras Unet
Helper package with multiple U-Net implementations in Keras as well as useful utility tools helpful when working with image semantic segmentation tasks. This library and underlying tools come from multiple projects I performed working on semantic segmentation tasks
Stars: ✭ 196 (-47.59%)
Mutual labels:  deep-neural-networks, image-segmentation
Cascaded Fcn
Source code for the MICCAI 2016 Paper "Automatic Liver and Lesion Segmentation in CT Using Cascaded Fully Convolutional NeuralNetworks and 3D Conditional Random Fields"
Stars: ✭ 296 (-20.86%)
Mutual labels:  deep-neural-networks, medical-imaging
Tf Adnet Tracking
Deep Object Tracking Implementation in Tensorflow for 'Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning(CVPR 2017)'
Stars: ✭ 162 (-56.68%)
Mutual labels:  deep-neural-networks, convolutional-networks
ResUNetPlusPlus-with-CRF-and-TTA
ResUNet++, CRF, and TTA for segmentation of medical images (IEEE JBIHI)
Stars: ✭ 98 (-73.8%)
Mutual labels:  medical-imaging, image-segmentation
P2pala
Page to PAGE Layout Analysis Tool
Stars: ✭ 147 (-60.7%)
Mutual labels:  deep-neural-networks, image-segmentation
FCN-CTSCAN
A small TensorFlow project created to test some machine learning problems
Stars: ✭ 17 (-95.45%)
Mutual labels:  medical-imaging, image-segmentation
Kiu Net Pytorch
Official Pytorch Code of KiU-Net for Image Segmentation - MICCAI 2020 (Oral)
Stars: ✭ 134 (-64.17%)
Mutual labels:  deep-neural-networks, medical-imaging
Glasses
High-quality Neural Networks for Computer Vision 😎
Stars: ✭ 138 (-63.1%)
Mutual labels:  deep-neural-networks, convolutional-networks
angiodysplasia-segmentation
Wining solution and its further development for MICCAI 2017 Endoscopic Vision Challenge Angiodysplasia Detection and Localization
Stars: ✭ 76 (-79.68%)
Mutual labels:  medical-imaging, image-segmentation
coursera-ai-for-medicine-specialization
Programming assignments, labs and quizzes from all courses in the Coursera AI for Medicine Specialization offered by deeplearning.ai
Stars: ✭ 80 (-78.61%)
Mutual labels:  medical-imaging, image-segmentation

Deep Learning Tutorial for Kaggle Ultrasound Nerve Segmentation competition, using Keras

This tutorial shows how to use Keras library to build deep neural network for ultrasound image nerve segmentation. More info on this Kaggle competition can be found on https://www.kaggle.com/c/ultrasound-nerve-segmentation.

This deep neural network achieves ~0.57 score on the leaderboard based on test images, and can be a good staring point for further, more serious approaches.

The architecture was inspired by U-Net: Convolutional Networks for Biomedical Image Segmentation.


Overview

Data

Provided data is processed by data.py script. This script just loads the images and saves them into NumPy binary format files .npy for faster loading later.

Pre-processing

The images are not pre-processed in any way, except resizing to 64 x 80. Since the images are pretty noisy, I expect that some thoughtful pre-processing could yield better performance of the model.

Output images (masks) are scaled to [0, 1] interval.

Model

The provided model is basically a convolutional auto-encoder, but with a twist - it has skip connections from encoder layers to decoder layers that are on the same "level". See picture below (note that image size and numbers of convolutional filters in this tutorial differs from the original U-Net architecture).

img/u-net-architecture.png

This deep neural network is implemented with Keras functional API, which makes it extremely easy to experiment with different interesting architectures.

Output from the network is a 64 x 80 which represents mask that should be learned. Sigmoid activation function makes sure that mask pixels are in [0, 1] range.

Training

The model is trained for 20 epochs, where each epoch took ~30 seconds on Titan X. Memory footprint of the model is ~800MB.

After 20 epochs, calculated Dice coefficient is ~0.68, which yielded ~0.57 score on leaderboard, so obviously this model overfits (cross-validation pull requests anyone? ;)).

Loss function for the training is basically just a negative of Dice coefficient (which is used as evaluation metric on the competition), and this is implemented as custom loss function using Keras backend - check dice_coef() and dice_coef_loss() functions in train.py for more detail. Also, for making the loss function smooth, a factor smooth = 1 factor is added.

The weights are updated by Adam optimizer, with a 1e-5 learning rate. During training, model's weights are saved in HDF5 format.


How to use

Dependencies

This tutorial depends on the following libraries:

  • cv2 (OpenCV)
  • Theano and/or Tensorflow
  • Keras >= 1.0

Also, this code should be compatible with Python versions 2.7-3.5.

Prepare the data

In order to extract raw images and save them to .npy files, you should first prepare its structure. Make sure that raw dir is located in the root of this project. Also, the tree of raw dir must be like:

-raw
 |
 ---- train
 |    |
 |    ---- 1_1.tif
 |    |
 |    ---- …
 |
 ---- test
      |
      ---- 1.tif
      |
      ---- …
  • Now run python data.py.

Running this script will create train and test images and save them to .npy files.

Define the model

  • Check out get_unet() in train.py to modify the model, optimizer and loss function.

Train the model and generate masks for test images

  • Run python train.py to train the model.

Check out train_predict() to modify the number of iterations (epochs), batch size, etc.

After this script finishes, in imgs_mask_test.npy masks for corresponding images in imgs_test.npy should be generated. I suggest you examine these masks for getting further insight of your model's performance.

Generate submission

  • Run python submission.py to generate the submission file submission.csv for the generated masks.

Check out function submission() and run_length_enc() (thanks woshialex) for details.

About Keras

Keras is a minimalist, highly modular neural networks library, written in Python and capable of running on top of either TensorFlow or Theano. It was developed with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research.

Use Keras if you need a deep learning library that:

allows for easy and fast prototyping (through total modularity, minimalism, and extensibility). supports both convolutional networks and recurrent networks, as well as combinations of the two. supports arbitrary connectivity schemes (including multi-input and multi-output training). runs seamlessly on CPU and GPU. Read the documentation Keras.io

Keras is compatible with: Python 2.7-3.5.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].