Table of Contents
Fetching ...

Class-N-Diff: Classification-Induced Diffusion Model Can Make Fair Skin Cancer Diagnosis

Nusrat Munia, Abdullah Imran

TL;DR

The paper tackles fairness gaps in skin cancer diagnosis by integrating a classifier into a diffusion-based generative model. It presents Class-N-Diff, a latent-space Diffusion Transformer framework that jointly learns image synthesis and disease classification, guided by a gating mechanism between the classifier and denoising process. Empirical results show improved generative quality (lower FID) and diversity (reduced MS-SSIM) alongside stronger, more robust classification across diverse skin tones, validating the benefit of joint learning. The approach enables realistic synthetic data generation that supports fairer, more accurate downstream diagnosis and points to avenues for expanding to multiple demographic attributes.

Abstract

Generative models, especially Diffusion Models, have demonstrated remarkable capability in generating high-quality synthetic data, including medical images. However, traditional class-conditioned generative models often struggle to generate images that accurately represent specific medical categories, limiting their usefulness for applications such as skin cancer diagnosis. To address this problem, we propose a classification-induced diffusion model, namely, Class-N-Diff, to simultaneously generate and classify dermoscopic images. Our Class-N-Diff model integrates a classifier within a diffusion model to guide image generation based on its class conditions. Thus, the model has better control over class-conditioned image synthesis, resulting in more realistic and diverse images. Additionally, the classifier demonstrates improved performance, highlighting its effectiveness for downstream diagnostic tasks. This unique integration in our Class-N-Diff makes it a robust tool for enhancing the quality and utility of diffusion model-based synthetic dermoscopic image generation. Our code is available at https://github.com/Munia03/Class-N-Diff.

Class-N-Diff: Classification-Induced Diffusion Model Can Make Fair Skin Cancer Diagnosis

TL;DR

The paper tackles fairness gaps in skin cancer diagnosis by integrating a classifier into a diffusion-based generative model. It presents Class-N-Diff, a latent-space Diffusion Transformer framework that jointly learns image synthesis and disease classification, guided by a gating mechanism between the classifier and denoising process. Empirical results show improved generative quality (lower FID) and diversity (reduced MS-SSIM) alongside stronger, more robust classification across diverse skin tones, validating the benefit of joint learning. The approach enables realistic synthetic data generation that supports fairer, more accurate downstream diagnosis and points to avenues for expanding to multiple demographic attributes.

Abstract

Generative models, especially Diffusion Models, have demonstrated remarkable capability in generating high-quality synthetic data, including medical images. However, traditional class-conditioned generative models often struggle to generate images that accurately represent specific medical categories, limiting their usefulness for applications such as skin cancer diagnosis. To address this problem, we propose a classification-induced diffusion model, namely, Class-N-Diff, to simultaneously generate and classify dermoscopic images. Our Class-N-Diff model integrates a classifier within a diffusion model to guide image generation based on its class conditions. Thus, the model has better control over class-conditioned image synthesis, resulting in more realistic and diverse images. Additionally, the classifier demonstrates improved performance, highlighting its effectiveness for downstream diagnostic tasks. This unique integration in our Class-N-Diff makes it a robust tool for enhancing the quality and utility of diffusion model-based synthetic dermoscopic image generation. Our code is available at https://github.com/Munia03/Class-N-Diff.
Paper Structure (10 sections, 4 equations, 3 figures, 3 tables)

This paper contains 10 sections, 4 equations, 3 figures, 3 tables.

Figures (3)

  • Figure 1: Proposed Class-N-Diff: Classification model induced class-conditioned transformer-based diffusion model that jointly performs classification and image generation. The encoder maps an input image to a latent space where the diffusion process adds noise, and the Denoising Transformer (DiT) reconstructs clean representations guided by class-aware attention. The ResNet-101 classifier provides class-conditioning and supervision via cross-entropy loss, enabling both accurate prediction and realistic dermoscopic image synthesis.
  • Figure 2: Sample images from (a) ISIC real dataset, (b) generated by DiT without classification model (Setting 1), (c)-(f) generated by the proposed Class-N-Diff (Settings 2-5). For each one, the first row corresponds to benign cases and the second row corresponds to malignant cases.
  • Figure 3: Class-N-Diff Generative performance evaluation: Visualization of the density plots (I) and Principal Components (PCs) (II) to compare the real ISIC data and the synthetic data generated by (a) DiT without classification model (Setting 1), (b)-(e) generated by DiT with classification model (Setting 2-5).