Skip to main content

Utilities for 3D CNNs in PyTorch

Project description

PyPI GitHub Workflow Status Read the Docs

elektronn3

A PyTorch-based library for working with 3D and 2D convolutional neural networks, with focus on semantic segmentation of volumetric biomedical image data.

Quick overview of elektronn3's code structure:

  • elektronn3.training: Utilities for training, monitoring, visualization and model evaluation. Provides a flexible Trainer class that can be used for arbitrary PyTorch models and Data sets.
  • elektronn3.data: Data loading and augmentation code for semantic segmentation and other dense prediction tasks. The main focus is on 3D (volumetric) biomedical image data stored as HDF5 files, but most of the code also supports 2D and n-dimensional data.
  • elektronn3.inference: Code for deployment of trained models and for efficient tiled inference on large input volumes.
  • elektronn3.models: Neural network architectures for segmentation and other pixel-wise prediction tasks. models.unet.UNet provides a highly flexible PyTorch model class inspired by 3D U-Net that works in 2D and 3D and supports custom depths, data anisotropy handling, batch normalization and many more configurable features.
  • elektronn3.modules: Modules (in the sense of torch.nn.Module) for building neural networks and loss functions.
  • examples: Scripts that demonstrate how the library can be used for biomedical image segmentation.

elektronn3's modular codebase makes it easy to extend/replace parts of it with your own code: For example, you can use the training tools included in elektronn3.training with your own data sets, augmentation methods, network models etc. or use the data loading and augmentation code of elektronn3.data with your own training code. The neural network architectures in elektronn3.models can also be freely used with custom training and/or data loading code.

Documentation can be found at elektronn3.readthedocs.io.

For a roadmap of planned features, see the "enhancement" issues on the tracker.

Requirements

  • Linux (support for Windows, MacOS and other systems is not planned)
  • Python 3.6 or later
  • PyTorch 1.6 or later (earlier versions may work, but are untested)
  • For other requirements see requirements.txt

Setup

Ensure that all of the requirements listed above are installed. We recommend using conda or a virtualenv for that. To install elektronn3 in development mode, run

git clone https://github.com/ELEKTRONN/elektronn3 elektronn3-dev
pip install -e elektronn3-dev

To update your installation, just git pull in your clone directory.

If you are not familiar with virtualenv and conda or are not sure about some of the required steps, you can find a more detailed setup guide here

Training

For a quick test run, first ensure that the neuro_data_cdhw data set is in the expected path:

wget https://github.com/ELEKTRONN/elektronn.github.io/releases/download/neuro_data_cdhw/neuro_data_cdhw.zip
unzip neuro_data_cdhw.zip -d ~/neuro_data_cdhw

To test training with our custom U-Net-inspired architecture in elektronn3, you can run:

python3 train_unet_neurodata.py

Using Tensorboard

Tensorboard logs are saved in ~/e3training/ by default, so you can track training progress by running a tensorboard server there:

tensorboard --logdir ~/e3training/

Then you can view the visualizations at http://localhost:6006.

Contributors

The elektronn3 project is being developed by the ELEKTRONN team. Jörgen Kornfeld is academic advisor to this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elektronn3-0.1.1.tar.gz (180.4 kB view details)

Uploaded Source

Built Distribution

elektronn3-0.1.1-py3-none-any.whl (193.9 kB view details)

Uploaded Python 3

File details

Details for the file elektronn3-0.1.1.tar.gz.

File metadata

  • Download URL: elektronn3-0.1.1.tar.gz
  • Upload date:
  • Size: 180.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for elektronn3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ffe028fb1df4a94a2310183f02479155456dbec54aa043572b80c8c223a61908
MD5 0de81c2b9ea5d0b13de6a84503a572c7
BLAKE2b-256 d99c7ec132bcbfc63b10c56d9358cb6c0b1c51382a0e6713afa182a51bec77af

See more details on using hashes here.

File details

Details for the file elektronn3-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: elektronn3-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 193.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for elektronn3-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d31faeb5609e66579b7d34d785aaa830750f2232276b1400c95f2aad73a1bf6a
MD5 9e16646b8562e4d0d369cec99a1fcc3d
BLAKE2b-256 262de3d65ad1b0e89905341586173407b757aff9ed14af301b28185fadd4b476

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page