  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}.
