Code Monkey home page Code Monkey logo

segcaps.pytorch's Introduction

Capsules for Object Segmentation

A barebones CUDA-enabled PyTorch implementation of the segcaps architecture in the paper "Capsules for Object Segmentation" by Rodney LaLonde and Ulas Bagci.

Condensed Abstract

Convolutional neural networks (CNNs) have shown remarkable results over the last several years for a wide range of computer vision tasks. A new architecture recently introduced by Sabour et al., referred to as a capsule networks with dynamic routing, has shown great initial results for digit recognition and small image classification. Our work expands the use of capsule networks to the task of object segmentation for the first time in the literature. We extend the idea of convolutional capsules with locally-connected routing and propose the concept of deconvolutional capsules. Further, we extend the masked reconstruction to reconstruct the positive input class. The proposed convolutional-deconvolutional capsule network, called SegCaps, shows strong results for the task of object segmentation with substantial decrease in parameter space. As an example application, we applied the proposed SegCaps to segment pathological lungs from low dose CT scans and compared its accuracy and efficiency with other U-Net-based architectures. SegCaps is able to handle large image sizes (512 x 512) as opposed to baseline capsules (typically less than 32 x 32). The proposed SegCaps reduced the number of parameters of U-Net architecture by 95.4% while still providing a better segmentation accuracy.

Paper written by by Rodney LaLonde and Ulas Bagci. For more information, please check out the paper here.

Requirements

  • Python 3
  • PyTorch
  • TorchVision
  • TorchNet
  • Visdom

Usage

Step 1 Adjust the number of training epochs, batch sizes, etc. inside my_train.py.

Step 2 Start training. you can choose your own dataset.

$ python my_train.py

TODO

  • test the acc in the dataset

Credits

Primarily referenced these two TensorFlow and Keras implementations:

  1. Official Keras implementation by Rodney LaLonde and Ulas Bagci
  2. TensorFlow implementation by @iwyoo

Contact/Support

email:[email protected]

segcaps.pytorch's People

Contributors

immrma 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

Watchers

 avatar  avatar  avatar  avatar

segcaps.pytorch's Issues

About the "self.conv_2"?

Thanks for your code,but I have a question about the "self.conv_2".In the capsule_net.py, it didn't seem to work in the project.

Dataset dir format

How the root dir have to be formatted?
how the data dir should look like ?
please mention

Extension to 3D datasets

Hello,

I'm working on a 3D dataset (MRI scans), and I'd like to try SegCaps. Do you think your implementation can be used for 3D segmentation ?

Thank you,
Clément

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.