peal.data.custom_datasets.SkinConDataset

class peal.data.custom_datasets.SkinConDataset[source]

Bases: Image2MixedDataset

Fitzpatrick17k skin lesions with the skin tone as confounder.

On first use the spycoder/fitzpatrick metadata is loaded, the SkinCon annotation csv is downloaded, and every image whose md5hash appears in the annotations is fetched from its source url (with retries) and stored as imgs/<md5hash>.png. data.csv gets the columns img, label, confounder, the label being malignant vs. not (from three_partition_label) and the confounder a dark skin type (Fitzpatrick scale 4 or higher). Images whose url fails are skipped.

Parameters:
  • config (DataConfig) – Uses dataset_path.

  • **kwargs – Forwarded to Image2MixedDataset.

Methods

Attributes

__init__(config, **kwargs)[source]

Fetch metadata, annotations and images if the dataset is not present.