Abstract
Deep learning models in medical imaging often struggle with distribution shifts when deployed across different clinical sites. Test-time adaptation (TTA) offers a solution by updating models on-the-fly using only test data. However, standard TTA methods utilize a fixed learning rate, which is sub-optimal for varying degrees of image discrepancy. We introduce DLTTA (Dynamic Learning Rate for Test-time Adaptation), a framework that estimates the distribution shift of each individual test image via a memory bank and dynamically adjusts the learning rate. This approach ensures aggressive adaptation for novel images and stability for familiar ones, achieving state-of-the-art results across multiple medical imaging tasks.
Introduction
The deployment of medical AI is frequently hindered by "distribution shift"—differences in scanners, protocols, and patient populations that alter the appearance of data. While Unsupervised Domain Adaptation (UDA) can mitigate this, it requires access to source training data and large batches of target data, which are often unavailable due to privacy and latency constraints.
Test-time Adaptation (TTA) addresses these issues by adapting the model directly on test samples. Yet, existing TTA methods like Tent or TTT use a static learning rate for every image. This "one-size-fits-all" approach is problematic: an image with a significant appearance shift requires a larger update, whereas an image similar to the training set should trigger minimal changes to prevent "parameter drift" and preserve accuracy on previously learned features.
Methods
DLTTA introduces a plug-and-play mechanism to dynamically adjust the learning rate ($\eta$) based on the estimated discrepancy of each test sample. The framework consists of two core components:
- Memory Bank-based Discrepancy Estimation: The system maintains a memory bank of recent feature-prediction pairs. For each new test image, the model retrieves the most semantically similar examples. It then calculates the Kullback–Leibler (KL) divergence between the current model's prediction and a reference prediction derived from these neighbors. This value, $L_{DIV}$, acts as a proxy for how much the new image deviates from the model's current knowledge.
- Adaptive Learning Rate Adjustment: The learning rate is calculated as $\eta = \alpha \cdot L_{DIV}$. When discrepancy is high, the learning rate increases to bridge the domain gap; when it is low, the rate decreases to maintain model stability.
Experimental Results
The researchers evaluated DLTTA across three distinct medical imaging challenges: Retinal OCT Segmentation (cross-device shift), Histopathological Image Classification (cross-institution shift), and Prostate 3D MRI Segmentation (multi-site shift).
Key findings include:
- Superior Accuracy: On the Retinal OCT task, DLTTA achieved an average Dice score of 83.41%, outperforming the baseline (74.01%) and the previous state-of-the-art, Tent (81.50%).
- Robust Classification: In histopathology, DLTTA reached 91.49% accuracy on unseen datasets, rivaling complex UDA methods that require significantly more data.
- Efficiency and Stability: DLTTA achieves these results with just one gradient update per image. Furthermore, making the learning rate dynamic surprisingly improved stability, as it prevented the "over-correction" often seen in fixed-rate models on easy samples.
Discussion and Conclusion
DLTTA demonstrates that individual images within a "new" dataset vary wildly in their degree of shift, and a dynamic learning rate is essential for optimal adaptation. By linking the step size to a real-time discrepancy measure, the model becomes less sensitive to initial hyperparameter tuning and more robust to diverse clinical environments.
While the current implementation faces a minor "cold start" problem—requiring a few initial images to populate the memory bank—future work may involve using representative "anchor" features from the training set to provide immediate discrepancy estimates. Overall, DLTTA provides a highly efficient, privacy-preserving, and effective framework for real-time clinical model adaptation.
Summary updated