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.