Contrastive Adapter Training and Consensus Knowledge Distillation for Multi-Source-Free Domain Adaptation in Skin Cancer Diagnosis
Organizations: University of Windsor, Department of Electrical and Computer Engineering · Queen’s University, Department of Electrical and Computer Engineering
Abstract
Skin cancer diagnosis, particularly differentiating melanoma from benign nevi, is challenging due to the visual similarity between lesions. Although convolutional neural networks (CNNs) and vision transformers (ViTs) have shown promising performance, their effectiveness often deteriorates on data from heterogeneous clinical sources. Conventional domain adaptation methods address domain shift but require access to source data during adaptation, which is often infeasible due to privacy regulations. Multi-source-free unsupervised domain adaptation (MSFDA) addresses this limitation by leveraging multiple labeled source domains to generalize to an unlabeled target domain without requiring access to source data. However, existing MSFDA methods rely on full backbone fine-tuning, leading to catastrophic forgetting and overfitting on small clinical datasets, and address domain shift at the aggregation stage without establishing a shared domain-invariant feature space. Furthermore, their reliance on hard pseudo-labels or confidence-weighted aggregation introduces noisy supervision signals under domain shift. To address these limitations, we propose CAT-CKD, consisting of two components: (1) contrastive adapter training (CAT), which trains lightweight ConvPass adapters within a frozen ViT backbone using supervised contrastive learning (SCL) to establish a shared domain-invariant feature space before source-specific model training, and (2) consensus knowledge distillation (CKD), which aggregates logits from multiple source models into a consensus supervisory signal and adapts a student model on unlabeled target data using KL divergence. Experiments on five publicly available skin lesion datasets show that CAT-CKD achieves an average AUROC of 86.1%, outperforming existing MSFDA methods while requiring only 4.3M trainable parameters. The code is available at https://github.com/A-Abedi/CAT_CKD.
Figures & tables
| Dataset | Melanoma | Nevus |
|---|---|---|
| ISIC 2018 [ 7 , 44 ] | 1113 | 6705 |
| ISIC 2020 [ 41 ] | 584 | 5193 |
| PAD-UFES-20 [ 36 ] | 52 | 244 |
| Derm7pt-Derm [ 26 ] | 90 | 256 |
| Derm7pt-Clinic [ 26 ] | 90 | 256 |
| Model | MS | SF | ISIC 2018 | ISIC 2020 | PAD-UFES-20 | Derm7pt-Derm | Derm7pt-Clinic | Avg. |
|---|---|---|---|---|---|---|---|---|
| Source Only | ||||||||
| ADDA [ 45 ] | ||||||||
| DANN [ 12 ] | ||||||||
| MDAN [ 60 ] | ||||||||
| DECISION [ 1 ] | ||||||||
| EAAF [ 38 ] |
| Model Configuration | # Parameters |
|---|---|
| EAAF [ 38 ] | 98.2M |
| DECISION [ 1 ] | 96.1M |
| DANN [ 12 ] | 53.0M |
| ADDA [ 45 ] | 26.0M |
| MDAN [ 60 ] | 11.1M |
| Bi-ATEN [ 30 ] | 10.6M |
| Model | ISIC 2018 | ISIC 2020 | PAD-UFES-20 | Derm7pt-Derm | Derm7pt-Clinic | Avg. |
|---|---|---|---|---|---|---|
| Ours | 90.8 | 90.5 | 75.8 | 89.7 | 84.0 | 86.1 |
| Ours w/o CAT | 87.5 | 90.1 | 72.3 | 78.6 | 78.0 | 81.3 |
| Ours w/o CAT, w/ Full backbone finetuning | 78.6 | 90.1 | 64.5 | 65.9 | 75.4 | 74.9 |
| Ours w/o CKD | 86.0 | 59.5 | 53.4 | 73.2 | 74.2 | 69.3 |
| Ours w/o KL Divergence | 85.7 | 61.2 | 53.3 | 72.1 | 73.5 | 69.2 |
| Model | ISIC 2018 | ISIC 2020 | PAD-UFES-20 | Derm7pt-Derm | Derm7pt-Clinic | Avg. |
|---|---|---|---|---|---|---|
| Hard-label CKD | 87.4 | 86.9 | 71.3 | 87.7 | 83.7 | 83.4 |
| Soft-label CKD (Ours) | 90.8 | 90.5 | 75.8 | 89.7 | 84.0 | 86.1 |
| Model | ISIC 2018 | ISIC 2020 | PAD-UFES-20 | Derm7pt-Derm | Derm7pt-Clinic | Avg. |
|---|---|---|---|---|---|---|
| CAT(w/ Houlsby [ 18 ] )-CKD | 90.7 | 73.7 | 68.0 | 91.2 | 84.6 | 81.6 |
| CAT(w/ Pfeiffer [ 39 ] )-CKD | 89.7 | 77.9 | 74.1 | 91.7 | 81.0 | 82.8 |
| CAT(w/ Convpass [ 25 ] )-CKD (Ours) | 90.8 | 90.5 | 75.8 | 89.7 | 84.0 | 86.1 |
| Model | ISIC 2018 | ISIC 2020 | PAD-UFES-20 | Derm7pt-Derm | Derm7pt-Clinic | Avg. |
|---|---|---|---|---|---|---|
| Confidence-weighted averaging [ 6 ] | 91.2 | 75.7 | 70.8 | 90.7 | 86.2 | 82.9 |
| Margin-based weighting [ 42 ] | 90.8 | 75.0 | 73.1 | 90.7 | 85.3 | 83.0 |
| Entropy-weighted averaging [ 31 ] | 89.1 | 84.4 | 72.2 | 89.6 | 84.1 | 83.9 |
| CKD (Ours) | 90.8 | 90.5 | 75.8 | 89.7 | 84.0 | 86.1 |
Source-Free Domain Adaptation
Source-Free Domain Adaptation transfers models to new data distributions without access to the original training examples.
See all 73 papers