SSL Datamodules and Datasets

Datasets

class InnerEye.ML.SSL.datamodules_and_datasets.cifar_datasets.InnerEyeCIFAR10(root: str, return_index: bool, **kwargs: Any)[source]

Wrapper class around torchvision CIFAR10 class to optionally return the index on top of the image and the label in __getitem__ as well as defining num_classes property.

property num_classes: int
class InnerEye.ML.SSL.datamodules_and_datasets.cifar_datasets.InnerEyeCIFAR100(root: str, return_index: bool, **kwargs: Any)[source]

Wrapper class around torchvision CIFAR100 class class to optionally return the index on top of the image and the label in __getitem__ as well as defining num_classes property.

property num_classes: int
class InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets.CheXpert(root: str, remove_lateral_scans_from_dataset: bool = True, **kwargs: Any)[source]

Dataset class to load the CheXpert dataset.

For more details instructions about how to download the dataset and the expected data folder structure, please refer to the docs/self_supervised_models.md documentation.

Note: By default, we exclude lateral scans from the dataset, you can change this behavior by setting remove_lateral_scans_from_dataset to False when you initialize your dataset class.

class InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets.CovidDataset(root: str, return_index: bool, **kwargs: Any)[source]

Dataset class to load CovidDataset dataset as datamodule for monitoring SSL training quality directly on CovidDataset data. We use CVX03 against CVX12 as proxy task.

property num_classes: int
class InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets.InnerEyeCXRDatasetBase(root: str, train: bool, transform: Optional[Callable] = None, **kwargs: Any)[source]

Base class for a dataset with X-ray images and image-level target labels. Implements reading of dicom files as well as png.

class InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets.InnerEyeCXRDatasetWithReturnIndex(root: str, return_index: bool, **kwargs: Any)[source]

Any dataset used in SSL needs to inherit from InnerEyeDataClassBaseWithReturnIndex as well as VisionData. This class is just a shorthand notation for this double inheritance.

class InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets.NIHCXR(root: str, use_full_dataset_for_train_and_val: bool = True, **kwargs: Any)[source]

Dataset class to load the NIHCXR Chest-Xray dataset. For more details instructions about how to download the dataset and the expected data folder structure, please refer to the docs/self_supervised_models.md documentation.

Note: by default, the code uses the full data for training and validation (including the official test set). You can change this behavior by setting use_full_dataset_for_train_and_val to False when you initialize the class.

class InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets.RSNAKaggleCXR(root: str, return_index: bool, **kwargs: Any)[source]

Dataset class to load the RSNA Chest-Xray training dataset. For more details instructions about how to download the dataset and the expected data folder structure, please refer to the docs/self_supervised_models.md documentation.

Note we use all the data for train and val. No test data implemented.

property num_classes: int

Dataset Class Utils

class InnerEye.ML.SSL.datamodules_and_datasets.dataset_cls_utils.InnerEyeDataClassBaseWithReturnIndex(root: str, return_index: bool, **kwargs: Any)[source]

Class to be use with double inheritance with a VisionDataset. Overloads the __getitem__ function so that we can optionally also return the index within the dataset.

property num_classes: int

Datamodules

Transformation Utils