Test-Time Adaptation with Calibration of Medical Image Classification Nets for Label Distribution Shift

Wenao Ma, Cheng Chen, Shuang Zheng, Jing Qin, Huimao Zhang, Qi Dou

Introduction

Deep learning models in medical imaging frequently encounter performance degradation when deployed across different clinical centers. A primary cause is label distribution shift, where the prevalence of disease stages in a new hospital differs significantly from the training population. For example, a model trained in a general screening center may fail when applied to a specialized diagnostic clinic where advanced disease stages are more common. This paper introduces TTADC (Test-time Adaptation with Distribution Calibration), a framework designed to handle arbitrary and unknown label shifts at deployment without requiring labeled test data.

Methodology

The TTADC framework operates in two distinct phases: training-time distribution calibration and test-time consistency-driven adaptation.

Phase 1: Learning Diverse Experts

During training, instead of a single classifier, the model learns a "committee" of $K$ classifiers (where $K$ corresponds to the number of classes). Using Distribution Calibration, each classifier is trained to specialize in a scenario where one specific class dominates the distribution. This is achieved through a calibrated loss function that simulates these "one-dominating-class" distributions. Furthermore, the model employs ordinal encoding to capture the inherent progression of disease stages (e.g., predicting if a stage is $\ge X$), which provides more robust features than standard one-hot encoding.

Phase 2: Test-Time Dynamic Aggregation

At deployment, the model encounters unlabeled test images. To determine the optimal weighting ($w_i$) for the diverse classifiers, TTADC utilizes Consistency-Driven Adaptation. For each test image, two augmented versions (e.g., via rotation or noise) are generated. The classifier weights are then updated to maximize the cosine similarity between the predictions of these two versions. The core intuition is that if the ensemble is well-adapted to the local distribution, its predictions should remain stable under minor data perturbations.

Overview of the TTADC framework, showing the training phase with distribution calibration (left) and the test-time adaptation phase with consistency-driven aggregation (right).

Experimental Results

The proposed method was evaluated on two 3D CT tasks: Liver Fibrosis Staging and COVID-19 Severity Prediction.

Performance Gains

TTADC consistently outperformed standard baselines and state-of-the-art adaptation methods such as TENT and BALMS. In the Liver Fibrosis task, TTADC achieved a significant boost in the Obuchowski Index (OI), improving it by 3.3% over the baseline on the most challenging external test set. Accuracy also saw a substantial increase from 40.7% to 50.7%. For COVID-19 severity prediction, TTADC reached a 71.1% AUC, surpassing other long-tailed recognition methods.

Quantitative comparison of TTADC against baseline methods across two tasks, alongside ablation studies and sensitivity analysis of the calibration parameter λ.

Robustness and Sensitivity

Ablation studies demonstrated that both the Learning Diverse Classifiers (+LDC) and Test-Time Adaptation (+TTA) components contribute significantly to the final performance. Sensitivity analysis of the calibration parameter $\lambda$ showed that a value of 2.0 generally yielded optimal results across different test centers, indicating the method's stability.

Conclusion

TTADC provides a robust solution for medical image classification under label distribution shift. By training a diverse set of experts and adapting their aggregation at test time through prediction consistency, the model effectively bridges the gap between training and deployment distributions. While the current implementation requires a batch of test images to estimate the local distribution, future work could explore streaming scenarios and broader applications in non-ordinal classification and segmentation.

Summary updated

BibTeX
@inproceedings{ma2022test,
  author = {Wenao Ma and Cheng Chen and Shuang Zheng and Jing Qin and Huimao Zhang and Qi Dou},
  title = {{Test-Time Adaptation with Calibration of Medical Image Classification Nets for Label Distribution Shift}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2022},
  doi = {10.1007/978-3-031-16437-8\_30},
}

Loading related content...

Figure