Segmentation Configs

Basic Models

class InnerEye.ML.configs.segmentation.BasicModel2Epochs.BasicModel2Epochs(**kwargs: Any)[source]
get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

name = 'BasicModel2Epochs'
param = <param.parameterized.Parameters object>
class InnerEye.ML.configs.segmentation.BasicModel2Epochs.BasicModelForEnsembleTest[source]

A copy of the basic model for PR builds, to use for running in a cross validation job.

name = 'BasicModelForEnsembleTest'
param = <param.parameterized.Parameters object>
pretraining_run_checkpoints: Optional[Any]
class InnerEye.ML.configs.segmentation.BasicModel2Epochs1Channel.BasicModel2Epochs1Channel[source]
name = 'BasicModel2Epochs1Channel'
param = <param.parameterized.Parameters object>
pretraining_run_checkpoints: Optional[Any]
class InnerEye.ML.configs.segmentation.BasicModel2EpochsMoreData.BasicModel2EpochsMoreData[source]

A clone of the basic PR build model, that has more training data, to avoid PyTorch throwing failures because each rank does not have enough data to train on.

get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

name = 'BasicModel2EpochsMoreData'
param = <param.parameterized.Parameters object>
pretraining_run_checkpoints: Optional[Any]

HelloWorld

class InnerEye.ML.configs.segmentation.HelloWorld.HelloWorld(**kwargs: Any)[source]

This is a very basic model that is pre-configured to train on the CPU for 2 epochs on a dummy dataset ../Tests/ML/test_data/dataset.csv

The aim of this config is to demonstrate how to: 1) Subclass SegmentationModelBase which is the base config for all segmentation model configs 2) Configure the UNet3D implemented in this package 3) Configure Azure HyperDrive based parameter search

  • This model can be trained from the commandline: python InnerEye/runner.py –model=HelloWorld

  • If you want to test that your AzureML workspace is working, please follow the instructions in

<repo_root>/docs/hello_world_model.md.

In this example, the model is trained on 1 input image channels “channel1”, and predicts 2 foreground classes region, region_1.

get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

get_parameter_search_hyperdrive_config(run_config: ScriptRunConfig) HyperDriveConfig[source]

Specify an Azure HyperDrive configuration. Further details are described in the tutorial https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-tune-hyperparameters A reference is provided at https://docs.microsoft.com/en-us/python/api/azureml-train-core/azureml.train .hyperdrive?view=azure-ml-py

Parameters:

run_config – The configuration for running an individual experiment.

Returns:

An Azure HyperDrive run configuration (configured PyTorch environment).

name = 'HelloWorld'
param = <param.parameterized.Parameters object>

Head and Neck

class InnerEye.ML.configs.segmentation.HeadAndNeckBase.HeadAndNeckBase(ground_truth_ids: List[str], ground_truth_ids_display_names: Optional[List[str]] = None, colours: Optional[List[Tuple[int, int, int]]] = None, fill_holes: Optional[List[bool]] = None, roi_interpreted_types: Optional[List[str]] = None, class_weights: Optional[List[float]] = None, slice_exclusion_rules: Optional[List[SliceExclusionRule]] = None, summed_probability_rules: Optional[List[SummedProbabilityRule]] = None, num_feature_channels: Optional[int] = None, **kwargs: Any)[source]

Head and Neck radiotherapy image segmentation model.

This configuration needs to be supplied with a value for azure_dataset_id that refers to your dataset. You may also supply a value for num_structures, feature_channels or any other feature. For example, with the appropriate dataset, this would build the model whose results are reported in the InnerEye team’s paper:

class HeadAndNeckPaper(HeadAndNeckBase):
    def __init__(self):
        super().__init__(
            azure_dataset_id="foo_bar_baz",
            num_structures=10
        )
get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

name = 'HeadAndNeckBase'
param = <param.parameterized.Parameters object>
class InnerEye.ML.configs.segmentation.HeadAndNeckPaper.HeadAndNeckPaper(num_structures: Optional[int] = None, **kwargs: Any)[source]

Head and Neck model, as used in the paper.

name = 'HeadAndNeckPaper'
param = <param.parameterized.Parameters object>
pretraining_run_checkpoints: Optional[Any]

Prostate

class InnerEye.ML.configs.segmentation.ProstateBase.ProstateBase(ground_truth_ids: List[str], ground_truth_ids_display_names: Optional[List[str]] = None, colours: Optional[List[Tuple[int, int, int]]] = None, fill_holes: Optional[List[bool]] = None, roi_interpreted_types: Optional[List[str]] = None, class_weights: Optional[List[float]] = None, largest_connected_component_foreground_classes: Optional[List[str]] = None, **kwargs: Any)[source]

Prostate radiotherapy image segmentation model.

get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Return an adjusted split

name = 'ProstateBase'
param = <param.parameterized.Parameters object>
class InnerEye.ML.configs.segmentation.ProstatePaper.ProstatePaper(**kwargs: Any)[source]

Prostate radiotherapy image segmentation model, as in the paper.

name = 'ProstatePaper'
param = <param.parameterized.Parameters object>
pretraining_run_checkpoints: Optional[Any]

Hippocampus

class InnerEye.ML.configs.segmentation.Hippocampus.Hippocampus(**kwargs: Any)[source]

Hippocampus segmentation in MR scans.

get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

name = 'Hippocampus'
param = <param.parameterized.Parameters object>

Lung

class InnerEye.ML.configs.segmentation.Lung.Lung(**kwargs: Any)[source]

Lung CT image segmentation model Target structures are: Esophagus, Heart, Left and Right Lungs, and Spinal cord

get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

name = 'Lung'
param = <param.parameterized.Parameters object>

Glioblastoma

class InnerEye.ML.configs.segmentation.GbmBase.GbmBase(**kwargs: Any)[source]

Glioblastoma malignant brain tumour segmentation in MR scans.

get_model_train_test_dataset_splits(dataset_df: DataFrame) DatasetSplits[source]

Computes the training, validation and test splits for the model, from a dataframe that contains the full dataset.

Parameters:

dataset_df – A dataframe that contains the full dataset that the model is using.

Returns:

An instance of DatasetSplits with dataframes for training, validation and testing.

name = 'GbmBase'
param = <param.parameterized.Parameters object>