Diffusion Model Driven Test-Time Image Adaptation for Robust Skin Lesion Classification
Ming Hu, Siyuan Yan, Peng Xia, Feilong Tang, Wenxue Li, Peibo Duan, Lin Zhang, Zongyuan Ge
TL;DR
This work tackles the problem of distribution shift in skin lesion classification by shifting the adaptation focus from model updates to test-time input adaptation. It introduces Diffusion-Driven Adaptation (DDA), which trains a diffusion model on source data and uses it to project target inputs back toward the source distribution during testing, paired with a structural guidance mechanism to preserve class information. A self-ensembling scheme blends predictions from original and adapted inputs to automatically balance reliance on adaptation, improving robustness across corruptions, architectures, and data regimes. Evaluations on ImageNet-C benchmarks demonstrate that DDA achieves superior robustness compared to model-based and other diffusion-based baselines, with practical advantages in portability across targets and stability under varying data regimes. The approach offers a scalable, source-free, test-time solution that can augment real-world deployment of skin-disease classifiers, albeit with computation considerations and potential biases to monitor.
Abstract
Deep learning-based diagnostic systems have demonstrated potential in skin disease diagnosis. However, their performance can easily degrade on test domains due to distribution shifts caused by input-level corruptions, such as imaging equipment variability, brightness changes, and image blur. This will reduce the reliability of model deployment in real-world scenarios. Most existing solutions focus on adapting the source model through retraining on different target domains. Although effective, this retraining process is sensitive to the amount of data and the hyperparameter configuration for optimization. In this paper, we propose a test-time image adaptation method to enhance the accuracy of the model on test data by simultaneously updating and predicting test images. We modify the target test images by projecting them back to the source domain using a diffusion model. Specifically, we design a structure guidance module that adds refinement operations through low-pass filtering during reverse sampling, regularizing the diffusion to preserve structural information. Additionally, we introduce a self-ensembling scheme automatically adjusts the reliance on adapted and unadapted inputs, enhancing adaptation robustness by rejecting inappropriate generative modeling results. To facilitate this study, we constructed the ISIC2019-C and Dermnet-C corruption robustness evaluation benchmarks. Extensive experiments on the proposed benchmarks demonstrate that our method makes the classifier more robust across various corruptions, architectures, and data regimes. Our datasets and code will be available at \url{https://github.com/minghu0830/Skin-TTA_Diffusion}.
