A CycleGAN model trained on Diverse Dermatology Images (DDI) from Daneshjou et al. (https://doi.org/10.1126/sciadv.abq6147), to transform dermatological images between Fitzpatrick I-II and V-VI categories, aimed at generalizing dermatological image analysis. The cGAN implementation was adapted from Aitor Ruano.
This tool demonstrates data augmentation techniques for improving dataset diversity and model generalization across different demographic populations. While not intended for production use, this proof-of-concept implementation explores the potential benefits and limitations of this approach to data augmentation.
- Clone the repository:
git clone https://github.com/advafaeian/cyclegan-fitzpatrick.git cd cyclegan-fitzpatrick - Install the required packages:
pip install -r requirements.txt
- Download the DDI dataset from here.
- Extract the content in a folder named
ddi_dataset. - Generate training dataset consisting of Fitzpatrick I-II and V-VI images:
python prepare_dataset.py
To train the CycleGAN model, use the following commands:
# Initialize the Visdom server for monitoring
python -m visdom.server
# To start training from scratch
python train.py --dataroot ./ddi_dataset/train --cuda
# To resume training from the current weights
python train.py --dataroot ./ddi_dataset/train --resume --epoch 400 --n_epochs 600 --cudaThe following data are from the second 200 epochs. The data from the first 200 epochs can be found here.
After training or using the current weights, you can generate transformed result images by running:
python generate.py --dataroot './test_images'Here are some example results from the model using images from the ISIC dataset:

- CycleGAN for the original implementation.
- CycleGAN Clean Version for the refined implementation.
- Diverse Dermatology Images for the datasets used for training.
- Roxana Daneshjou et al. ,Disparities in dermatology AI performance on a diverse, curated clinical image set.Sci. Adv.8,eabq6147(2022).DOI:10.1126/sciadv.abq6147
- Test images from the ISIC dataset, attributed to Hospital Italiano de Buenos Aires, used under the CC-BY license.




