fl4health.datasets.skin_cancer.preprocess_skin module¶
The following code is adapted from the preprocess_skin.py script from the medical_federated GitHub repository by Seongjun Yang et al.
Paper: https://arxiv.org/abs/2207.03075 Code: https://github.com/wns823/medical_federated.git - medical_federated/skin_cancer_federated/preprocess_skin.py
- derm7pt_image_path_func(row)[source]¶
Constructs the image path for the Derm7pt dataset.
- Parameters:
row (
Series
) – A row from the dataframe.- Return type:
- Returns:
The constructed image path.
- derm7pt_label_map_func(row)[source]¶
Maps the original label to the new label for the Derm7pt dataset.
- Parameters:
row (
Series
) – A row from the dataframe.- Return type:
- Returns:
The mapped label.
- ham_image_path_func(row)[source]¶
Constructs the image path for the HAM10000 dataset.
- Parameters:
row (
Series
) – A row from the dataframe.- Return type:
- Returns:
The constructed image path.
- ham_label_map_func(row)[source]¶
Maps the original label to the new label for the HAM10000 dataset.
- Parameters:
row (
Series
) – A row from the dataframe.- Return type:
- Returns:
The mapped label.
- pad_image_path_func(row)[source]¶
Constructs the image path for the PAD-UFES-20 dataset.
- Parameters:
row (
Series
) – A row from the dataframe.- Return type:
- Returns:
The constructed image path.
- pad_label_map_func(row)[source]¶
Maps the original label to the new label for the PAD-UFES-20 dataset.
- Parameters:
row (
Series
) – A row from the dataframe.- Return type:
- Returns:
The mapped label.
- process_client_data(dataframe, client_name, data_path, image_path_func, label_map_func, original_columns, official_columns)[source]¶
Processes and saves the client-specific dataset.
- Parameters:
dataframe (
DataFrame
) – The dataframe containing the client data.client_name (
str
) – The name of the client.data_path (
str
) – The base path to the dataset.image_path_func (
Callable
[[Series
],str
]) – A function that constructs the image path from a dataframe row.label_map_func (
Callable
[[Series
],str
]) – A function that maps the original label to the new label.original_columns (
list
[str
]) – The list of original columns for the dataset.official_columns (
list
[str
]) – The list of official columns for the dataset.
- Return type: