Abstract
Domain shift in Magnetic Resonance Imaging (MRI) poses a significant challenge for the generalizability of deep learning models across different clinical sites and scanner manufacturers. Variations in acquisition protocols and hardware often lead to performance degradation in downstream tasks like segmentation. We present "Harmonizing Flows," an unsupervised framework that utilizes Normalizing Flows (NFs) to standardize MRI images. By learning the probability distribution of a source site, our model can adapt images from unseen target sites without requiring labels, source data, or prior knowledge of the target domain. Our results on the ABIDE dataset demonstrate that this source-free, task-agnostic approach outperforms existing harmonization and test-time adaptation methods in both segmentation accuracy and anatomical preservation.
Introduction
In medical imaging, particularly MRI, the "domain shift" problem is a major hurdle for clinical deployment of deep learning. Images of the same anatomy can vary significantly depending on the scanner manufacturer, acquisition parameters, or patient population. Consequently, a segmentation model trained on data from one site often fails when applied to data from another.
Existing harmonization solutions typically require "traveling subjects" (the same person scanned at multiple sites), access to original source data (raising privacy concerns), or task-specific labels. "Harmonizing Flows" addresses these limitations by providing a source-free, task-agnostic framework that works even when the target domain is completely unknown during the training phase.
Methodology
The proposed framework consists of three distinct stages designed to bridge the gap between source and target distributions without compromising anatomical integrity.
1. Pre-training the Harmonizer
Initially, a shallow U-Net, acting as the "harmonizer," is trained to reconstruct source images from versions that have been artificially degraded. These degradations include synthetic shifts in brightness and contrast. This stage establishes a baseline capability for the network to restore and standardize image appearance.
2. Learning the Source Distribution
The core of the method involves Normalizing Flows (NFs). NFs are a class of generative models that learn to map complex data distributions to a simple Gaussian distribution using a series of invertible transformations. By training an NF on the source site data, the model learns an exact probabilistic representation of what a "valid" source domain image looks like.
3. Test-Time Adaptation
When an image from a new, unknown site is encountered, the harmonizer processes it. The parameters of the harmonizer are then updated on-the-fly to maximize the likelihood of its output according to the frozen NF model. In this setup, the NF acts as a "distributional compass," guiding the harmonizer to tweak the image until its characteristics align with the source distribution. To ensure the underlying anatomy is not distorted, the harmonizer is constrained to a simple linear transformation:
$$h_\theta(x) = \alpha * x + \beta$$
This constraint ensures that only contrast and brightness are modified, preserving the structural boundaries essential for medical diagnosis.
Experimental Setup
The study utilized the Autism Brain Imaging Data Exchange (ABIDE) dataset, focusing on four sites with distinct image characteristics: CALTECH ($D_1$), KKI ($D_2$), PITT ($D_3$), and NYU ($D_4$). The researchers used 20 T1-weighted MRIs from each site. To evaluate the effectiveness of the harmonization, they performed brain segmentation into 15 structural labels, measuring how well the standardized images supported accurate anatomical quantification.
Results and Discussion
"Harmonizing Flows" was benchmarked against several established methods, including Cycle-GAN, Style-Transfer, and TENT (a popular test-time adaptation strategy).
- Superior Segmentation Accuracy: The proposed method achieved an average Dice Similarity Coefficient (DSC) of 82.9%, significantly outperforming Cycle-GAN (79.1%) and TENT (65.1%). This suggests that explicit image-level harmonization is more effective than simply adapting the weights of a downstream segmentation network.
- Anatomical Preservation: The method achieved the lowest Hausdorff Distance (2.63 mm) among all tested baselines. This metric is critical in medical imaging as it indicates how well the shapes and boundaries of brain structures are maintained during the transformation process.
- Privacy and Efficiency: By requiring only the frozen NF model at test time, the approach respects data privacy and storage constraints. There is no need to store or transmit sensitive source images once the NF is trained.
Conclusion and Future Work
"Harmonizing Flows" represents a significant step toward robust, site-agnostic medical imaging AI. By combining the exact likelihood estimation of Normalizing Flows with a constrained harmonizer, the framework achieves high-quality standardization without the need for target-domain labels or source-data access.
Future research will focus on extending the framework from 2D slices to 3D volumes, which remains a computational challenge for NFs. Additionally, exploring more complex (yet still constrained) mappings beyond global linear transformations may help address more severe non-linear domain shifts encountered in diverse clinical settings.
Summary updated