Giter Site home page Giter Site logo

sebre's Introduction

alt text

SeBRe 2.0 PyTorch support (2023 - New)!

SeBRe (Segmenting Brain Regions) is a high-throughput Mask R-CNN [1]-based toolbox to generate brain atlas through deep learning by instance segmentation of complex brain regions.

arXiv preprint: SeBRe

The Colab version of SeBRe is available here to train and test on your custom dataset: Open In Colab

SeBRe 1.0 TensorFlow support!

Download:

Clone the SeBRe repository by running the following command in your terminal window:

git clone https://github.com/itsasimiqbal/SeBRe.git

Additionally, download the (.zip) files by visiting the following link:

https://drive.google.com/open?id=1g_894zM_mSJGfudzzfnw-ZpN-rQ4qQdz

You would need DATASETSubmit.zip, myDATASET.zip and SeBRe_FINAL_WEIGHTS.h5.zip to run the code in your machine. If you'd like to use the mouse and human brain atlas datasets used in our paper then also download and unzip SeBRe_Datasets.zip. Once you've downloaded your files then unzip them in your folder by running the following commands:

unzip DATASETSubmit.zip
unzip myDATASET.zip
unzip SeBRe_FINAL_WEIGHTS.h5.zip

Following are the Python/library versions on which the SeBRe 1.0 code is tested to work fine:

  • Python (3.5.2)
  • Tensorflow (1.6.0)
  • Keras (2.1.6)
  • skimage (0.13.0)
  • Numpy (1.13.3)
  • Scipy (1.2.2)

SeBRe demo:

The block diagram of our system is demonstrated below:

alt text

Run the notebook SeBRe_FINAL.ipynb to reproduce the results in SeBRe's paper. Make sure to install the necessary libraries in your machine before running the code. A step-by-step explanation of feature processing in SeBRe is provided in SeBRe_feature_processing.ipynb notebook.

To train SeBRe on your (custom) dataset:

1. Collect images of brain regions (or sub-regions) and place each of them in a separate folder with the following naming convention e.g. section_img_0.jpg, section_img_1.jpg, ...

2. Draw ground-truth (binary) masks on Regions of Interest (ROIs) e.g. cortex, hippocampus, etc. using an annotation software such as Napari [2] and assign a unique color code to each ROI. In the figure below, mouse brain section is shown before (a) and after (d) annotation by human expert. A zoomed-in examples of cortex (b) and hindbrain (c) are shown to precisely match the boundaries of masks with the corresponding ROIs. alt text

3. Run the notebook custom_dataset_create.ipynb to generate the binary (black and white) masks to train SeBRe deep neural network (DNN). The notebook will generate the file names in SeBRe-readable format, place them in the brain region corresponding folders e.g. section_masks_0/section_masks_0_m_1.png, sections_masks_0_m_2.png, ...

alt text

4. Modify and run the notebook SeBRe_training.ipynb to train the SeBRe DNN on your (custom) dataset.

5. Modify and run the notebook SeBRe_FINAL.ipynb to test the SeBRe DNN on your (custom) dataset.

References:

[1] https://arxiv.org/abs/1703.06870

[2] https://napari.org/

Cite:

If you use any part of this code for your work, please cite the following:

Asim Iqbal, Romesa Khan, and Theofanis Karayannis. "Developing a brain atlas through deep learning." 
Nature Machine Intelligence 1.6 (2019): 277-287.

sebre's People

Contributors

itsasimiqbal 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sebre's Issues

Coronal Segmentation

Hello All,
I noticed in the paper published in Nature that you guys performed testing on coronal scans.
Could I get in contact with someone to get the weights from training on the Allen Atlas?
Thanks!

Compatibility Issues

Hi, I am also trying to reproduce the results of your code and am having multiple compatibility issues. Would you be able to share the version of python you used and the versions of all the packages you used?

Keras package compatibility

Hi, I am trying to reproduce the results of your code but ran into some difficulty. May I know which tensorflow and keras packages you used in your code. I tried using keras 2.0.8 which comes with tensorflow 1.10.0 but encountered an error in the Supplementary Figure 4(b) section of the code in SeBRe_feature_processing.ipynb. I got an AssertionError when defining rpn.

~\SeBRe\model.py in run_graph(self, images, outputs)
   2448         outputs = OrderedDict(outputs)
   2449         for o in outputs.values():
-> 2450             assert o is not None

I'm very new to coding and python. Any help is appreciated. 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.