The Mean is the Mirage: Entropy-Adaptive Model Merging under Heterogeneous Domain Shifts in Medical Imaging
Organizations: School of Computation, Information and Technology, Technical University of Munich, Germany · Institute of Machine Learning in Biomedical Imaging, Helmholtz Munich, Germany · relAI – Konrad Zuse School of Excellence in Reliable AI · Munich Center for Machine Learning (MCML) · Institute of Pathology, Technical University of Munich, Germany · School of Biomedical Engineering and Imaging Sciences, King’s College London, UK
Abstract
Model merging under unseen test-time distribution shifts often renders naive strategies, such as mean averaging unreliable. This challenge is especially acute in medical imaging, where models are fine-tuned locally at clinics on private data, producing domain-specific models that differ by scanner, protocol, and population. When deployed at an unseen clinical site, test cases arrive in unlabeled, non-i.i.d. batches, and the model must adapt immediately without labels. In this work, we introduce an entropy-adaptive, fully online model-merging method that yields a batch-specific merged model via only forward passes, effectively leveraging target information. We further demonstrate why mean merging is prone to failure and misaligned under heterogeneous domain shifts. Next, we mitigate encoder classifier mismatch by decoupling the encoder and classification head, merging with separate merging coefficients. We extensively evaluate our method with state-of-the-art baselines using two backbones across nine medical and natural-domain generalization image classification datasets, showing consistent gains across standard evaluation and challenging scenarios. These performance gains are achieved while retaining single-model inference at test-time, thereby demonstrating the effectiveness of our method.
Figures & tables
| 5 Medical Datasets | ||||||||||
| MiDog | Organs | Histo | ISIC Skin | Messidor | ||||||
| Method | B32 | B16 | B32 | B16 | B32 | B16 | B32 | B16 | B32 | B16 |
| Offline Model merging | ||||||||||
| Ensemble | 89.24 | 89.22 | 69.87 | 73.71 | 92.16 | 89.87 | 86.89 | 86.24 | 49.75 | 54.58 |
| DiWA ( Rame et al., 2022 ) | 89.65 | 89.07 | 66.93 | 71.26 | 89.48 | 89.48 | 85.60 | 85.82 | 49.50 | 52.81 |
| Online Model merging | ||||||||||
| 4 Natural Vision Datasets | ||||||||
| PACS | VLCS | Office-Home | Terra | |||||
| Method | B32 | B16 | B32 | B16 | B32 | B16 | B32 | B16 |
| Offline Model merging | ||||||||
| Ensemble | 80.46 | 84.00 | 78.51 | 77.21 | 74.20 | 77.83 | 30.42 | 41.22 |
| DiWA ( Rame et al., 2022 ) | 83.91 | 84.72 | 77.54 | 77.67 | 75.46 | 78.44 | 27.64 | 40.43 |
| Online Model merging | ||||||||
| Coefficients strategy | Mean accuracy | |||
| Method | Entropy only (Eq. 4 ) | Decoupled head coef (Eq. 9 ) | PACS | Organs |
| Entropy-Adaptive | ✓ | 85.23 0.2 | 69.81 0.2 | |
| ✓ | 84.27 0.2 | 67.80 0.3 | ||
| ✓ | ✓ | 87.33 0.2 | 70.70 0.2 | |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.