Synthetic Melanoma Image Generation and Evaluation Using Generative Adversarial Networks
Authors: Pei-Yu Lin, Yidan Shen, Neville Mathew, Renjie Hu, Siyu Huang, Courtney M. Queen, Cameron E. West, Ana Ciurea, +1 more
Organizations: Department of Engineering Technology, University of Houston, Sugar Land, TX 77479, USA · Department of Electrical and Computer Engineering, University of Houston, Houston, TX 77204, USA · Department of Information Science Technology, University of Houston, Sugar Land, TX 77479, USA · School of Computing, Clemson University, Clemson, SC 29634, USA · Department of Public Health, Texas Tech University, Abilene, TX 79601, USA · Department of Dermatology and Pathology, Texas Tech University, Abilene, TX 79601, USA · Department of Dermatology, University of Texas MD Anderson Cancer Center, Houston, TX 77030, USA · Department of Biomedical Engineering, University of Houston, Houston, TX 77204, USA
Melanoma is the most lethal form of skin cancer, and early detection is critical for improving patient outcomes. Although dermoscopy combined with deep learning has advanced automated skin-lesion analysis, progress is hindered by limited access to large, well-annotated datasets and by severe class imbalance, where melanoma images are substantially underrepresented. To address these challenges, we present the first systematic benchmarking study comparing four GAN architectures-DCGAN, StyleGAN2, and two StyleGAN3 variants (T/R)-for high-resolution melanoma-specific synthesis. We train and optimize all models on two expert-annotated benchmarks (ISIC 2018 and ISIC 2020) under unified preprocessing and hyperparameter exploration, with particular attention to R1 regularization tuning. Image quality is assessed through a multi-faceted protocol combining distribution-level metrics (FID), sample-level representativeness (FMD), qualitative dermoscopic inspection, downstream classification with a frozen EfficientNet-based melanoma detector, and independent evaluation by two board-certified dermatologists. StyleGAN2 achieves the best balance of quantitative performance and perceptual quality, attaining FID scores of 24.8 (ISIC 2018) and 7.96 (ISIC 2020) at gamma=0.8. The frozen classifier recognizes 83% of StyleGAN2-generated images as melanoma, while dermatologists distinguish synthetic from real images at only 66.5% accuracy (chance = 50%), with low inter-rater agreement (kappa = 0.17). In a controlled augmentation experiment, adding synthetic melanoma images to address class imbalance improved melanoma detection AUC from 0.925 to 0.945 on a held-out real-image test set. These findings demonstrate that StyleGAN2-generated melanoma images preserve diagnostically relevant features and can provide a measurable benefit for mitigating class imbalance in melanoma-focused machine learning pipelines.
Figures & tables
Figure 1: Iterative GAN training: the generator and discriminator undergo concurrent adversarial training.
Figure 2: DCGAN architecture showing the generator and discriminator networks, including layer configuration, upsampling and strided convolutions, and output activations.
Figure 3: StyleGAN2 architecture illustrating the generator and discriminator networks. In the generator, (a) denotes the learned affine transformation used for style modulation, (b) represents the learned per-channel scaling factor, and ⊕ indicates element-wise addition. In the discriminator, (c) denotes the final classification stage.
Metric
DCGAN
StyleGAN2
StyleGAN3-T
StyleGAN3-R
FID ↓
66.49
31.58
246.42
26.47
FMD ↓
695.93
50.08
41.37
49.21
Table 1: Performance comparison across architectures at γ=8 . Lower FID and FMD values correspond to better performance ( ↓ ).
γ
FID (ISIC 2018)
FID (ISIC 2020)
0.8
24.8
7.96
1.6
27.4
9.48
8.0
31.6
9.91
10.0
33.2
10.4
Table 2: FID scores for StyleGAN2 under different R1 regularization strengths ( γ ) on the ISIC 2018 and ISIC 2020 datasets. Lower γ values yield lower FID scores ( ↓ ).
Figure 4: ( a ) Real melanoma and images produced by ( b ) StyleGAN2 and ( c ) StyleGAN3-R. The zoomed inset highlights mesh- or grid-like artifacts present in StyleGAN3-R outputs.
Figure 5: FID score as a function of training images (thousands) for each architecture. StyleGAN2 shows consistent improvement with additional data, while StyleGAN3-T plateaus at substantially higher FID values.
Figure 6: Representative synthetic images from ( a ) DCGAN, ( b ) StyleGAN3-T, ( c ) StyleGAN3-R, and ( d ) StyleGAN2, compared with ( e ) real melanoma images used for training.
DCGAN
StyleGAN2
StyleGAN3-T
StyleGAN3-R
Parameters (M), G+D
4 + 1
30 + 29
25 + 29
25 + 29
Training time (hours)
0.9
2.8
9.2
9.2
Table 3: Model size and training time for each GAN architecture on ISIC 2018.
Figure 7: Confusion matrices for the frozen external classifier on ( a ) the Real set (real melanoma vs. real benign) and ( b ) the Synthetic set (StyleGAN2-generated melanoma vs. real benign). The classifier recognizes 83% of synthetic melanomas as melanoma.
Training Data
Accuracy (%) †
Melanoma AUC
Melanoma F1
Real-only
85.07
0.9252
0.1682
Real + Synthetic
98.27
0.9445
0.2586
Table 4: Classifier performance on the held-out real-image test set. The test set contains 1960 benign and 40 melanoma images, reflecting real-world class imbalance.
Metric
Dermatologist 1
Dermatologist 2
Human Mean
Discriminator
Overall Accuracy
71.0% ( p ¡ 0.001)
62.0% ( p ¡ 0.001)
66.5%
59.5%
Real Accuracy
51.0%
70.0%
60.5%
35.0%
Synthetic Accuracy
91.0%
54.0%
72.5%
84.0%
Accepted as Real †
9.0%
46.0%
27.5%
16.0%
Table 5: Performance comparison of human raters and the StyleGAN2 discriminator on the real-versus-synthetic classification task ( n=200 images).
Comparison
Cohen’s κ
p -Value
Agreement
Dermatologist 1 vs. Dermatologist 2
0.173
0.009
Slight
Dermatologist 1 vs. Discriminator
0.042
0.482
Slight
Dermatologist 2 vs. Discriminator
0.082
0.187
Slight
Table 6: Inter-rater agreement (Cohen’s κ ) for the real-versus-synthetic classification task.
Accurate dermatological diagnosis naturally necessitates equitable performance across diverse populations, yet a systematic lack of expertly annotated images, especially for underrepresented skin tones and rare diseases, impedes progress toward measurably fair methods. We introduce cgDDI (Controllable Generation of Diverse Dermatological Imagery), a hybrid framework that (1) synthesizes realistic healthy skin samples without disturbing other input properties, (2) maps single-sample rare lesions onto novel skin-tones and locations non-parametrically, and (3) allows for efficient parametric generation with as few as 10 training samples. The framework supports both human and automated segmentation masking, enabling scalability to datasets without pre-made lesion masks. We grow a 656-image dataset by more than 400x and validate across two datasets: biopsy-confirmed Diverse Dermatology Images (DDI) and expert-verified Fitzpatrick17k (F17k). On the DDI benchmark, we achieve malignancy classification accuracy of 86.4% under synthetic-only training and 90.9% state-of-the-art performance with real data fine-tuning, alongside leading fairness metrics. Cross-dataset experiments show +13.9% accuracy improvements on unseen F17k data despite minimal disease overlap. We openly release 266k+ synthetic images, code, and generative models to further support fairness research at https://github.com/hectorcarrion/ControllableGenDDI.
Héctor Carrión, Narges Norouzi
University of California, Santa Cruz, USA · University of California, Berkeley, USA
Despite recent advances in deep generative modeling, skin lesion classification systems remain constrained by the limited availability of large, diverse, and well-annotated clinical datasets, resulting in class imbalance between benign and malignant lesions and consequently reduced generalization performance. We introduce DermaFlux, a rectified flow-based text-to-image generative framework that synthesizes clinically grounded skin lesion images from natural language descriptions of dermatological attributes. Built upon Flux.1, DermaFlux is fine-tuned using parameter-efficient Low-Rank Adaptation (LoRA) on a large curated collection of publicly available clinical image datasets. We construct image-text pairs using synthetic textual captions generated by Llama 3.2, following established dermatological criteria including lesion asymmetry, border irregularity, and color variation. Extensive experiments demonstrate that DermaFlux generates diverse and clinically meaningful dermatology images that improve binary classification performance by up to 6% when augmenting small real-world datasets, and by up to 9% when classifiers are trained on DermaFlux-generated synthetic images rather than diffusion-based synthetic images. Our ImageNet-pretrained ViT fine-tuned with only 2,500 real images and 4,375 DermaFlux-generated samples achieves 78.04% binary classification accuracy and an AUC of 0.859, surpassing the next best dermatology model by 8%.
Generative augmentation is often proposed as a remedy for small medical-image datasets, but synthetic images are only useful when they improve downstream task performance. "Augmentation" here means synthetic supplementation: GAN-generated samples added to the real training pool, not geometric or photometric transforms of existing images. Twelve class-plane StyleGAN2-ADA generators were trained on constrained BRISC 2025 partitions to test whether their output, with or without InceptionV3 feature-space filtering, improves held-out tumour classification across three classifier families: a random forest (RF) on InceptionV3 features, a compact two-headed convolutional neural network (CNN), and MobileViTV2, a mobile hybrid convolutional-transformer. Each was evaluated at 1:1 and 1:2 real-to-synthetic ratios. An independent GPT-5.5 blind test placed gated real-versus-synthetic discrimination at 57.73% (95% CI: 54.48--60.92%) on the model-legible subset -- modestly above chance. The RF classifier did not benefit from the synthetic MRIs. The CNN showed consistent mean gains that did not survive Holm correction. MobileViTV2 showed the clearest benefit: filtered 1:1 augmentation improved tumour classification accuracy by 1.02% absolute (95% CI: 0.54--1.54%; Holm-corrected p = 0.0104). A secondary efficiency analysis found that every augmented CNN condition selected its checkpoint 42--64% earlier than baseline, while compute-matched MobileViTV2 runs reached selection after 50--67% fewer real-data epochs. Overall, augmentation utility was found to be architecture- and ratio-dependent, not guaranteed by visual fidelity alone.