farabio¶
farabio is a minimal PyTorch toolkit for out-of-the-box deep learning support in biomedical imaging. out-of-the-box deep learning support in biomedical imaging.
Features:
Biomedical datasets
Common DL models
Flexible trainers (in progress)
Overview¶
Getting started¶
How to install¶
1. Activate conda environment¶
$ conda create -n myenv python=3.8
$ conda activate myenv
2. Install farabio¶
A. With pip:¶
$ pip install farabio -f https://download.pytorch.org/whl/torch_stable.html
B. Setup from source:¶
$ git clone https://github.com/tuttelikz/farabio.git && cd farabio
$ python -m pip install --upgrade pip setuptools wheel
$ pip install . -f https://download.pytorch.org/whl/torch_stable.html
Reference¶
data
Package¶
biodatasets
Module¶
biodatasets
module provides classes to load public biomedical datasets
in a PyTorch friendly manner.
ChestXrayDataset
class¶
- class farabio.data.biodatasets.ChestXrayDataset(root: str = '.', download: bool = False, mode: str = 'train', shape: int = 256, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, show: bool = True)[source]¶
PyTorch friendly ChestXrayDataset class
Dataset is loaded using Kaggle API. For further information on raw dataset and pneumonia detection, please refer to [1].
References
Examples
>>> valid_dataset = ChestXrayDataset(root=_path, download=True, mode="val", show=True)
DSB18Dataset
class¶
- class farabio.data.biodatasets.DSB18Dataset(root: str = '.', download: bool = False, mode: str = 'train', shape: int = 512, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, show: bool = True)[source]¶
PyTorch friendly DSB18Dataset class
Dataset is loaded using Kaggle API. For further information on raw dataset and nuclei segmentation, please refer to [1].
References
Examples
>>> train_dataset = DSB18Dataset(_path, transform=None, download=False, show=True)
HistocancerDataset
class¶
- class farabio.data.biodatasets.HistocancerDataset(root: str = '.', mode: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False, show: bool = True)[source]¶
PyTorch friendly HistocancerDataset class
Dataset is loaded using Kaggle API. For further information on raw dataset and tumor classification, please refer to [1].
References
Examples
>>> train_dataset = HistocancerDataset(root=".", download=False, mode="train")
RANZCRDataset
class¶
- class farabio.data.biodatasets.RANZCRDataset(root: str = '.', mode: str = 'train', shape: int = 256, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False, show: bool = True)[source]¶
PyTorch friendly RANZCRDataset class
Dataset is loaded using Kaggle API. For further information on raw dataset and catheters presence, please refer to [1].
References
Examples
>>> train_dataset = RANZCRDataset(_path_ranzcr, show=True, shape=512)
RetinopathyDataset
class¶
- class farabio.data.biodatasets.RetinopathyDataset(root: str = '.', mode: str = 'train', shape: int = 256, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False, show: bool = True)[source]¶
PyTorch friendly RetinopathyDataset class
Dataset is loaded using Kaggle API. For further information on raw dataset and blindness detection, please refer to [1].
References
Examples
>>> train_dataset = RetinopathyDataset(".", mode="train", show=True)
Handbook¶
Overview¶
Deep learning has transformed many aspects of industrial pipelines recently. Scientists involved in biomedical imaging research are also benefiting from the power of AI to tackle complex challenges. Although academic community has widely accepted image processing tools, such as scikit-image, ImageJ, there is still a need for a tool which integrates deep learning into biomedical image analysis. We propose a minimal, but convenient Python package based on PyTorch with biomedical datasets, common deep learning models, and extended by flexible trainers.
What can I do with this package?¶
Load public biomedical datasets
Load common deep learning models
Do basic image preprocessing and transformations
Customize training loops to your own needs
Package structure¶
![graph farabioOverview {
node [shape=box, colorscheme=set32 , style=rounded];
farabio -- core;
farabio -- data;
farabio -- models;
farabio -- utils;
farabio [fillcolor=1, style="rounded"]
core [fillcolor=2, style="rounded"]
data [fillcolor=2, style="rounded"]
models [fillcolor=2, style="rounded"]
utils [fillcolor=2, style="rounded"]
}](_images/graphviz-f7c2a07e0fc535fd8860802ccb7b007d6d668470.png)
How to contribute?¶
You can contribute to this package by reporting issues and/or by sending pull request.
If you find a bug, please report it by opening an issue on Git.
Machine learning for Biomedical Engineers¶
Table of Contents
Activation functions¶
Binary Step¶
(Source code, png, hires.png, pdf)

Piecewise Linear¶
(Source code, png, hires.png, pdf)

Bipolar¶
(Source code, png, hires.png, pdf)

Bipolar Sigmoid¶
(Source code, png, hires.png, pdf)

Hyperbolic Tangent, TanH¶
(Source code, png, hires.png, pdf)

Arctangent, ArcTan¶
(Source code, png, hires.png, pdf)

Rectified Linear Units, ReLU¶
(Source code, png, hires.png, pdf)

Leaky Rectified Linear Units, Leaky ReLU¶
(Source code, png, hires.png, pdf)

Exponential Linear Units, ELU¶
(Source code, png, hires.png, pdf)

Changelog¶
Recent Changes¶
fix on spacings by San Askaruly at 2021-08-18 08:56:55
hide members except visu_batch in biodatasets by San Askaruly at 2021-08-17 18:14:16
biodatasets images change in docs by San Askaruly at 2021-08-17 17:56:41
- Commit
Warning
There were uncommitted changes when this was compiled.FAQ¶
How to install pip package to python that uses conda?
Solution from Github issue.
How do i know on which GPU is my model?
Solution from Stackoverflow answer.