Application Program Interface (API)¶
Data Manipulation¶
Data loading code |
|
Common utilities |
|
Image transformations for our pipelines |
Datasets¶
Retinography¶
DRIVE dataset for Vessel Segmentation |
|
STARE dataset for Vessel Segmentation |
|
CHASE-DB1 dataset for Vessel Segmentation |
|
HRF dataset for Vessel Segmentation |
|
IOSTAR (training set) for Vessel and Optic-Disc Segmentation |
|
REFUGE for Optic Disc and Cup Segmentation |
|
Drishti-GS1 for Optic Disc and Cup Segmentation |
|
RIM-ONE r3 (training set) for Cup Segmentation |
|
DRIONS-DB (training set) for Optic Disc Segmentation |
|
DRHAGIS dataset for Vessel Segmentation |
Chest X-Ray¶
Montgomery County dataset for Lung Segmentation |
|
Japanese Society of Radiological Technology dataset for Lung Segmentation |
|
Shenzhen No.3 People’s Hospital dataset for Lung Segmentation |
Engines¶
Defines functionality for the evaluation of predictions |
|
Implementation of the AdaBound optimizer <https://github.com/Luolc/AdaBound/blob/master/adabound/adabound.py>. |
Neural Network Models¶
A network model that prefixes a z-normalization step to any other module |
|
Little W-Net |
|
Loss implementations |
|
Toolbox¶
Preset Configurations¶
Preset configurations for baseline systems
This module contains preset configurations for baseline FCN architectures and datasets.
Models¶
DRIU Network for Vessel Segmentation |
|
DRIU Network for Vessel Segmentation with Batch Normalization |
|
DRIU Network for Vessel Segmentation using SSL and Batch Normalization |
|
DRIU Network for Optic Disc Segmentation |
|
DRIU Network for Vessel Segmentation using SSL |
|
HED Network for image segmentation |
|
MobileNetV2 U-Net model for image segmentation |
|
MobileNetV2 U-Net model for image segmentation using SSL |
|
Residual U-Net for image segmentation |
|
U-Net for image segmentation |
|
Little W-Net for image segmentation |
Datasets¶
Standard configurations for dataset setup
- bob.ip.binseg.configs.datasets.RANDOM_ROTATION = [RandomRotation(p=0.5,degrees=[-15.0, 15.0], interpolation=bilinear, expand=False, fill=0)]¶
Shared data augmentation based on random rotation only
- bob.ip.binseg.configs.datasets.RANDOM_FLIP_JITTER = [RandomHorizontalFlip(p=0.5), RandomVerticalFlip(p=0.5), ColorJitter(p=0.5,brightness=[0.7, 1.3], contrast=[0.7, 1.3], saturation=[0.98, 1.02], hue=[-0.02, 0.02])]¶
Shared data augmentation transforms without random rotation
- bob.ip.binseg.configs.datasets.make_subset(l, transforms, prefixes=[], suffixes=[])[source]¶
Creates a new data set, applying transforms
Note
This is a convenience function for our own dataset definitions inside this module, guaranteeting homogenity between dataset definitions provided in this package. It assumes certain strategies for data augmentation that may not be translatable to other applications.
- Parameters
l (list) – List of delayed samples
transforms (list) – A list of transforms that needs to be applied to all samples in the set
prefixes (list) – A list of data augmentation operations that needs to be applied before the transforms above
suffixes (list) – A list of data augmentation operations that needs to be applied after the transforms above
- Returns
subset – A pre-formatted dataset that can be fed to one of our engines
- Return type
- bob.ip.binseg.configs.datasets.augment_subset(s, rotation_before=False)[source]¶
Creates a new subset set, with data augmentation
Typically, the transforms are chained to a default set of data augmentation operations (random rotation, horizontal and vertical flips, and color jitter), but a flag allows prefixing the rotation specially (useful for some COVD training sets).
Note
This is a convenience function for our own dataset definitions inside this module, guaranteeting homogenity between dataset definitions provided in this package. It assumes certain strategies for data augmentation that may not be translatable to other applications.
- Parameters
s (bob.ip.binseg.data.utils.SampleListDataset) – A dataset that will be augmented
rotation_before (py:class:bool, Optional) – A optional flag allowing you to do a rotation augmentation transform before the sequence of transforms for this dataset, that will be augmented.
- Returns
subset – A pre-formatted dataset that can be fed to one of our engines
- Return type
- bob.ip.binseg.configs.datasets.make_dataset(subsets, transforms)[source]¶
Creates a new configuration dataset from dictionary and transforms
This function takes as input a dictionary as those that can be returned by
bob.ip.binseg.data.dataset.JSONDataset.subsets()
, orbob.ip.binseg.data.dataset.CSVDataset.subsets()
, mapping protocol names (such astrain
,dev
andtest
) tobob.ip.binseg.data.sample.DelayedSample
lists, and a set of transforms, and returns a dictionary applyingbob.ip.binseg.data.utils.SampleListDataset
to these lists, and our standard data augmentation if atrain
set exists.For example, if
subsets
is composed of two sets namedtrain
andtest
, this function will yield a dictionary with the following entries:__train__
: Wraps thetrain
subset, includes data augmentation (note: datasets with names starting with_
(underscore) are excluded from prediction and evaluation by default, as they contain data augmentation transformations.)train
: Wraps thetrain
subset, without data augmentationtrain
: Wraps thetest
subset, without data augmentation
Note
This is a convenience function for our own dataset definitions inside this module, guaranteeting homogenity between dataset definitions provided in this package. It assumes certain strategies for data augmentation that may not be translatable to other applications.
- Parameters
subsets (dict) – A dictionary that contains the delayed sample lists for a number of named lists. If one of the keys is
train
, our standard dataset augmentation transforms are appended to the definition of that subset. All other subsets remain un-augmented. If one of the keys isvalidation
, then this dataset will be also copied to the__valid__
hidden dataset and will be used for validation during training. Otherwise, if novalid
subset is available, we set__valid__
to be the same as the unaugmentedtrain
subset, if one is available.transforms (list) – A list of transforms that needs to be applied to all samples in the set
- Returns
dataset – A pre-formatted dataset that can be fed to one of our engines. It maps string names to
bob.ip.binseg.data.utils.SampleListDataset
’s.- Return type
Example CSV-based custom filelist dataset |
|
CHASE-DB1 dataset for Vessel Segmentation (first-annotator protocol) |
|
CHASE-DB1 dataset for Vessel Segmentation (second-annotator protocol) |
|
CHASE-DB1 cross-evaluation dataset |
|
CHASE-DB1 cross-evaluation dataset with matched resolution |
|
COVD-CHASEDB1 for Vessel Segmentation |
|
COVD-CHASE-DB1 + SSL for Vessel Segmentation |
|
DRIVE dataset for Vessel Segmentation (default protocol) |
|
DRIVE dataset for Vessel Segmentation (second annotation: test only) |
|
DRIVE cross-evaluation dataset |
|
DRIVE cross-evaluation dataset with matched resolution |
|
COVD-DRIVE for Vessel Segmentation |
|
COVD-DRIVE + SSL for Vessel Segmentation |
|
HRF dataset for Vessel Segmentation (default protocol) |
|
HRF cross-evaluation dataset |
|
HRF cross-evaluation dataset with matched resolution |
|
HRF dataset for Vessel Segmentation (default protocol) |
|
COVD-HRF for Vessel Segmentation |
|
COVD-HRF + SSL for Vessel Segmentation |
|
IOSTAR dataset for Vessel Segmentation (default protocol) |
|
IOSTAR vessel cross-evaluation dataset |
|
IOSTAR vessel cross-evaluation dataset with matched resolution |
|
IOSTAR dataset for Optic Disc Segmentation (default protocol) |
|
COVD-IOSTAR for Vessel Segmentation |
|
COVD-IOSTAR + SSL for Vessel Segmentation |
|
STARE dataset for Vessel Segmentation (annotator AH) |
|
STARE dataset for Vessel Segmentation (annotator VK) |
|
STARE cross-evaluation dataset |
|
STARE cross-evaluation dataset with matched resolution |
|
COVD-STARE for Vessel Segmentation |
|
COVD-STARE + SSL (training set) for Vessel Segmentation |
|
REFUGE dataset for Optic Cup Segmentation (default protocol) |
|
REFUGE dataset for Optic Disc Segmentation (default protocol) |
|
RIM-ONE r3 for Optic Cup Segmentation (expert #1 annotations) |
|
RIM-ONE r3 for Optic Cup Segmentation (expert #2 annotations) |
|
RIM-ONE r3 for Optic Disc Segmentation (expert #1 annotations) |
|
RIM-ONE r3 for Optic Disc Segmentation (expert #2 annotations) |
|
DRISHTI-GS1 dataset for Cup Segmentation (agreed by all annotators) |
|
DRISHTI-GS1 dataset for Cup Segmentation (agreed by any annotator) |
|
DRISHTI-GS1 dataset for Optic Disc Segmentation (agreed by all annotators) |
|
DRISHTI-GS1 dataset for Optic Disc Segmentation (agreed by any annotator) |
|
DRIONS-DB for Optic Disc Segmentation (expert #1 annotations) |
|
DRIONS-DB for Optic Disc Segmentation (expert #2 annotations) |
|
DRHAGIS dataset for Vessel Segmentation (default protocol) |
|
Montgomery County dataset for Lung Segmentation (default protocol) |
|
Japanese Society of Radiological Technology dataset for Lung Segmentation (default protocol) |
|
Shenzhen dataset for Lung Segmentation (default protocol) |
|
Shenzhen dataset for Lung Segmentation (default protocol) |