A PyTorch implementation for V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation

Overview

A PyTorch implementation of V-Net

Vnet is a PyTorch implementation of the paper V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation by Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. Although this implementation is still a work in progress, I'm seeing a respectable 0.355% test error rate and a Dice coefficient of .9825 segmenting lungs from the LUNA16 data set after 249 epochs. The official implementation is available in the faustomilletari/VNet repo on GitHub.

This implementation relies on the LUNA16 loader and dice loss function from the Torchbiomed package.

Differences with the official version

This version uses batch normalization and dropout. Lung volumes in CTs are ~10% of the scan volume - a not too unreasonable class balance. For this particular test application I've added the option of using NLLoss instead of the Dice Coefficient.

What does the PyTorch compute graph of Vnet look like?

You can see the compute graph here, which I created with make_graph.py, which I copied from densenet.pytorch which in turn was copied from Adam Paszke's gist.

Credits

The train.py script was derived from the one in the densenet.pytorch repo.

Comments
  • Preprocess for LUNA16 dataset?

    Preprocess for LUNA16 dataset?

    Hi, I'm a quite a newer to LUNA16 dataset,and I seems your code need some preprocess for LANA16 dataset, I can see you list some functions in lana16.py,but I have no idea how to use it(e.g.fisrt to do so?and next what?),could you give me some simple process about it? Thanks a lot!

    opened by lilhope 3
  • no gpu run

    no gpu run

    hi , I was wondering if the code can be run without a gpu?

    build vnet Traceback (most recent call last): File "train.py", line 384, in main() File "train.py", line 145, in main model = nn.parallel.DataParallel(model, device_ids=gpu_ids) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 58, in init self.module.cuda(device_ids[0]) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 143, in cuda return self._apply(lambda t: t.cuda(device_id)) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 114, in _apply module._apply(fn) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 114, in _apply module._apply(fn) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 120, in _apply param.data = fn(param.data) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 143, in return self._apply(lambda t: t.cuda(device_id)) File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/_utils.py", line 56, in _cuda with torch.cuda.device(device): File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/cuda/init.py", line 136, in enter _lazy_init() File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/cuda/init.py", line 96, in _lazy_init _check_driver() File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/torch/cuda/init.py", line 70, in _check_driver http://www.nvidia.com/Download/index.aspx""") AssertionError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver

    Can it just be used with cpu. Many thanks, Best, Andrew

    opened by AIAdventures 3
  • Concatenation operation in InputTransition

    Concatenation operation in InputTransition

    If my understanding is right, the concatenation in the InputTransition block should be applied along dim=1 instead of dim=0, because the second dimension is channel. i.e.

    # split input in to 16 channels
    x16 = torch.cat((x, x, x, x, x, x, x, x,
                     x, x, x, x, x, x, x, x), 0)
    

    should be

    # split input in to 16 channels
    x16 = torch.cat((x, x, x, x, x, x, x, x,
                     x, x, x, x, x, x, x, x), 1)
    
    opened by RongzhaoZhang 3
  • dataloader for LUNA16

    dataloader for LUNA16

    Hi, Thanks for sharing i see that you have implemented a dataloader for dealing with the LUNA16 dataset, but I did not found it the the repo. Can you please guide me where I can find it.

    Thanks Saeed

    opened by saeedizadi 1
  • About the lunge segmentation mask file of your training ?

    About the lunge segmentation mask file of your training ?

    hi, my dear friend~ So nice to meet you! My problem is that in LUNA2016 there is no lunge segmentation mask file for training, how do you get that? segment by yourself or some other ways? Thank you!!!

    opened by l35633 1
  • OutputTransition

    OutputTransition

    After the final upTransition, input is 32 channels and should be processed through the 111 filter directly according to the image. but you first process the input through the kernel(555) and then kernel(111).So I can't understand why you do the extra step(kernel size 555), maybe I am wrong, please reply for me ,if you are free, thx

    opened by LiB98 0
  • Questions about implementation still actual ?

    Questions about implementation still actual ?

    Awesome and huge work, thank you a lot. I understand that original paper author confused you with network structure diagram (me too actually), but your implementation also have your own addons like dropouts and batch normalizations. Is it ok for me to ask a question about one thing in you code or you are already out of the game?))

    opened by andreys42 0
  • Question about up-convolution block

    Question about up-convolution block

    Here in line 106: https://github.com/mattmacy/vnet.pytorch/blob/a00c8ea16bcaea2bddf73b2bf506796f70077687/vnet.py#L106

    Should it be xcat = self.ops(xcat) instead? Thank you in advance!

    opened by xzhhzx 2
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

MIC-DKFZ 1.2k Jan 4, 2023
U-Net Implementation: Convolutional Networks for Biomedical Image Segmentation" using the Carvana Image Masking Dataset in PyTorch

U-Net Implementation By Christopher Ley This is my interpretation and implementation of the famous paper "U-Net: Convolutional Networks for Biomedical

Christopher Ley 1 Jan 6, 2022
Pytorch Code for "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation"

Medical-Transformer Pytorch Code for the paper "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation" About this repo: This repo

Jeya Maria Jose 615 Dec 25, 2022
Unofficial implementation of Point-Unet: A Context-Aware Point-Based Neural Network for Volumetric Segmentation

Point-Unet This is an unofficial implementation of the MICCAI 2021 paper Point-Unet: A Context-Aware Point-Based Neural Network for Volumetric Segment

Namt0d 9 Dec 7, 2022
An implementation of the research paper "Retina Blood Vessel Segmentation Using A U-Net Based Convolutional Neural Network"

Retina Blood Vessels Segmentation This is an implementation of the research paper "Retina Blood Vessel Segmentation Using A U-Net Based Convolutional

Srijarko Roy 23 Aug 20, 2022
Neural networks applied in recognizing guitar chords using python, AutoML.NET with C# and .NET Core

Chord Recognition Demo application The demo application is written in C# with .NETCore. As of July 9, 2020, the only version available is for windows

Andres Mauricio Rondon Patiño 24 Oct 22, 2022
Official and maintained implementation of the paper "OSS-Net: Memory Efficient High Resolution Semantic Segmentation of 3D Medical Data" [BMVC 2021].

OSS-Net: Memory Efficient High Resolution Semantic Segmentation of 3D Medical Data Christoph Reich, Tim Prangemeier, Özdemir Cetin & Heinz Koeppl | Pr

Christoph Reich 23 Sep 21, 2022
Another pytorch implementation of FCN (Fully Convolutional Networks)

FCN-pytorch-easiest Trying to be the easiest FCN pytorch implementation and just in a get and use fashion Here I use a handbag semantic segmentation f

Y. Dong 158 Dec 21, 2022
PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)

pytorch-fcn PyTorch implementation of Fully Convolutional Networks. Requirements pytorch >= 0.2.0 torchvision >= 0.1.8 fcn >= 6.1.5 Pillow scipy tqdm

Kentaro Wada 1.6k Jan 7, 2023
Another pytorch implementation of FCN (Fully Convolutional Networks)

FCN-pytorch-easiest Trying to be the easiest FCN pytorch implementation and just in a get and use fashion Here I use a handbag semantic segmentation f

Y. Dong 158 Dec 21, 2022
Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks

SA-Net: Shuffle Attention for Deep Convolutional Neural Networks (paper) By Qing-Long Zhang and Yu-Bin Yang [State Key Laboratory for Novel Software T

Qing-Long Zhang 199 Jan 8, 2023
RGBD-Net - This repository contains a pytorch lightning implementation for the 3DV 2021 RGBD-Net paper.

[3DV 2021] We propose a new cascaded architecture for novel view synthesis, called RGBD-Net, which consists of two core components: a hierarchical depth regression network and a depth-aware generator network.

Phong Nguyen Ha 4 May 26, 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
Code for A Volumetric Transformer for Accurate 3D Tumor Segmentation

VT-UNet This repo contains the supported pytorch code and configuration files to reproduce 3D medical image segmentaion results of VT-UNet. Environmen

Himashi Amanda Peiris 7 Dec 3, 2021
U-2-Net: U Square Net - Modified for paired image training of style transfer

U2-Net: U Square Net Modified for paired image training of style transfer This is an unofficial repo making use of the code which was made available b

Doron Adler 43 Oct 3, 2022
Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation

Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation. Generally, MAS methods register multiple atlases, i.e., medical images with corresponding labels, to a target image;

NanYoMy 13 Oct 9, 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
The official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang Gong, Yi Ma. "Fully Convolutional Line Parsing." *.

F-Clip — Fully Convolutional Line Parsing This repository contains the official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang

Xili Dai 115 Dec 28, 2022