Next Article in Journal
Two-Stage Marker Detection–Localization Network for Bridge-Erecting Machine Hoisting Alignment
Previous Article in Journal
An Improved Extended Wavenumber Domain Imaging Algorithm for Ultra-High-Resolution Spotlight SAR
Previous Article in Special Issue
Whole-Body 3D Pose Estimation Based on Body Mass Distribution and Center of Gravity Constraints
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

DG-TTA: Out-of-Domain Medical Image Segmentation Through Augmentation, Descriptor-Driven Domain Generalization, and Test-Time Adaptation

by
Christian Weihsbach
1,2,*,
Christian N. Kruse
3,
Alexander Bigalke
4 and
Mattias P. Heinrich
1,2
1
Institute of Medical Informatics, University of Lübeck, 23562 Lübeck, Germany
2
EchoScout GmbH, 23562 Lübeck, Germany
3
Dampsoft GmbH, 24351 Damp, Germany
4
Drägerwerk AG & Co. KGaA, 23558 Lübeck, Germany
*
Author to whom correspondence should be addressed.
Sensors 2025, 25(17), 5603; https://doi.org/10.3390/s25175603
Submission received: 31 July 2025 / Revised: 29 August 2025 / Accepted: 1 September 2025 / Published: 8 September 2025

Abstract

Highlights

What are the main findings?
  • Combining domain-generalized pre-training with test-time adaptation substantially enhances segmentation accuracy for medical images in out-of-domain scenarios.
  • Generalizing image descriptors and intensity augmentation during training and adaptation outperformed complex existing methods in several scenarios.
What is the implication of the main finding?
  • We provide a powerful tool to achieve high segmentation accuracy out-of-domain, even without access to source data.
  • Our efficient method is applicable to many top public 2D and 3D segmentation models trained on large, private datasets.

Abstract

Applying pre-trained medical deep learning segmentation models to out-of-domain images often yields predictions of insufficient quality. In this study, we propose using a robust generalizing descriptor, along with augmentation, to enable domain-generalized pre-training and test-time adaptation, thereby achieving high-quality segmentation in unseen domains. In this study, five different publicly available datasets, including 3D CT and MRI images, are used to evaluate segmentation performance in out-of-domain scenarios. The settings include abdominal, spine, and cardiac imaging. Domain-generalized pre-training on source data is used to obtain the best initial performance in the target domain. We introduce a combination of the generalizing SSC descriptor and GIN intensity augmentation for optimal generalization. Segmentation results are subsequently optimized at test time, where we propose adapting the pre-trained models for every unseen scan using a consistency scheme with the augmentation–descriptor combination. The proposed generalized pre-training and subsequent test-time adaptation improve model performance significantly in CT to MRI cross-domain prediction for abdominal (+46.2 and +28.2 Dice), spine (+72.9), and cardiac (+14.2 and +55.7 Dice) scenarios (p < 0.001). Our method enables the optimal, independent use of source and target data, successfully bridging domain gaps with a compact and efficient methodology.

1. Introduction

Medical image analysis, particularly image segmentation, has made a significant leap forward in recent years with the advent of deep learning. However, changes in data distribution introduced by different input modalities or devices can lead to errors in the performance of deep learning models [1]. Since multiple imaging techniques are often required for disease identification, and treatment planning, and MRI devices especially offer broad flexibility in adjusting acquisition parameters, access to all of these different domains is usually infeasible. Consequently, trained models may produce inaccurate results when encountering unseen, out-of-domain data at test time [2].
Supervised fine-tuning and transfer learning can be used as a workaround to adjust networks to the unseen domain, as seen in [3,4]. Still, this would in turn require curating and labeling data again, which is often costly and time-consuming. Frequently studied approaches to overcome this effort utilize domain translation and unsupervised domain adaptation methods, but they require simultaneous access to both source and target data [5,6]. Accessing the source and target data jointly introduces a challenge, as the source data may be unavailable during model adaptation to the target domain. Source-free domain adaptation circumvents those restrictions and requires only target data during source-model adaptation. Here, some methods perform retraining on a larger set of target images to adapt models [7,8]. In practice, a single out-of-domain data sample is often given for which we want to obtain optimal results immediately. We target this setting in our study, facing the most challenging data constraints. In this setting, domain generalization techniques can be used to optimize the source model performance for `any’ unseen out-of-distribution sample. In computer vision, techniques such as domain randomization, multi-task training, random convolutions, masking autoencoders, and image mask obfuscation have been proven to enhance model generalization successfully [9,10,11,12,13]. Specific approaches have also been designed in the medical domain to build foundation models for CT and MRI processing, optimally augmenting training input for CT and MRI cross-domain segmentation, discriminating input domains for adaptive CT lesion segmentation, synthesizing CT and MRI inputs for robust training of segmentation models, and combining text report and image data for multi-organ CT segmentation [14,15,16,17,18]. Domain generalization is an ultimate goal to achieve, but to date, no universal solution that works robustly has been found. Test-time adaptation (TTA), as a complementary approach, optimizes the source model performance only for one or a limited number of samples [19,20,21,22,23,24,25,26].
Linking both approaches enables optimal separate use of source and target data, where domain generalization maximizes the base performance, and TTA can further optimize the result. Numerous methods to bridge domain gaps have already been developed, but they often require complex strategies and assumptions such as intertwined adaptation layers [24,25], indirect supervision tasks [22,27], prior knowledge about label distributions [21], assumptions on the distinctiveness of domains [6], or many consecutive steps [28].

Contributions

We propose employing DG-TTA, a minimally invasive and compact approach that utilizes a robust augmentation–descriptor scheme during domain-generalized pre-training and TTA for high-performance medical image segmentation in unseen domains with significant domain gaps.
  • We propose combining DG pre-training and TTA to achieve optimal performance with minimum data requirements (DG-TTA).
  • We introduce the use of the SSC feature descriptor, previously applied in image registration tasks for DG pre-training and TTA, and we demonstrate its superiority on small-scale datasets.
  • We perform TTA with a lean self-supervision scheme to avoid auxiliary optimization tasks or the need for prior assumptions, as opposed to related TTA methods.
  • The proposed methodological contributions are evaluated in several out-of-domain CT-to-MR segmentation scenarios.
The proposed methodological contributions were integrated into the state-of-the-art nnUNet segmentation framework [29] to obtain high-quality predictions of medical 3D images within a unified framework.

2. Materials and Methods

2.1. Study Design and Patients

We included data from five publicly available datasets in this retrospective study (see Figure 1 and Table A1). The contents of all datasets have been previously reported [30,31,32,33,34]. Those prior studies focused on data collection and the development of individual segmentation methods, whereas we aim to develop a universal method for segmentation in this study. Throughout the following paragraphs, we use abbreviated names for the BTCV, AMOS, TotalSegmentator (TS), MyoSegmenTUM spine (SPINE), and MMWHS datasets. Example images of the datasets are presented in Figure 2. From the mentioned datasets, cross-domain prediction settings are compiled, all targeting the challenging domain gap between CT source and MR target prediction (CT > MR). Data partitioning was performed randomly and kept throughout all evaluated methods for fair comparison.

2.2. Datasets

2.2.1. BTCV: Multi-Atlas Labeling Beyond the Cranial Vault

The dataset [30] contains 30 labeled abdominal CT scans of a colorectal cancer chemotherapy trial with 14 organs: spleen (SPL), right kidney (RKN), left kidney (LKN), gallbladder (GAL), esophagus (ESO), liver (LIV), stomach (STO), aorta (AOR), inferior vena cava (IVC), portal vein and splenic vein (PSV), pancreas (PAN), right adrenal gland (RAG), and left adrenal gland (LAG). Data dimensions reach from 512 × 512 × 85 vox to 512 × 512 × 198 vox and fields of view from 280 × 280 × 280 mm 3 to 500 × 500 × 650 mm 3 . We split the dataset into a 20/10 training/test set for our experiments, using a subset of ten classes that are uniformly labeled across all scans (Classes AOR, PSV, RAG, and LAG were omitted).

2.2.2. AMOS: A Large-Scale Abdominal Multi-Organ Benchmark for Versatile Medical Image Segmentation

The AMOS dataset [31] comprises CT and MRI scans from eight scanners with a similar field of view to the BTCV dataset, which includes patients with structural abnormalities in the abdominal region (e.g., tumors). Unlike the BTCV dataset’s organs, AMOS has additional segmentation labels for the duodenum, bladder, and prostate/uterus, but not for the PSV class.

2.2.3. MMWHS: Multi-Modality Whole Heart Segmentation

This dataset [32] contains CT and MR images of seven cardiac structures: the left ventricle, right ventricle, left atrium, right atrium, the myocardium of the left ventricle, the ascending aorta, and the pulmonary artery. The CT data resolution is 0.78 × 0.78 × 0.78   mm 3 / vox . The cardiac MRI data were obtained from two sites using a 1.5 T scanner and reconstructed to achieve resolutions ranging from 0.80 × 0.80 × 1.00   mm 3 / vox to 1.00 × 1.00 × 1.60   mm 3 / vox .

2.2.4. SPINE: MyoSegmenTUM Spine

This MRI dataset [33] contains water, fat, and proton density-weighted lumbar spine scans with manually labeled vertebral bodies (L1–L5). The field of view is 220 × 220 × 80 mm 3 , with a resolution of 1.8 × 1.8 × 4.0   mm 3 / vox .

2.2.5. TS: TotalSegmentator, 104 Labels

The large-scale TS dataset contains CT images of 1204 subjects with 104 annotated classes. The annotations were created semi-automatically, with a clinician reviewing each one. The data was acquired across 8 sites on 16 scanners with varying slice thickness and resolution [34]. Unlike the SPINE dataset, this dataset includes the vertebral bodies and spinous processes in its class labels. Model predictions were corrected accordingly in a postprocessing step to obtain reasonable results for evaluation (see the following paragraph).

2.2.6. Pre-/Postprocessing

We resampled all datasets to a uniform voxel size of 1.50 × 1.50 × 1.50   mm 3 / vox . For the SPINE task, we cropped the TS ground truth to exclude the spinous processes, using a mask dilated by five voxels around the proposed prediction in the TS > SPINE out-of-domain prediction setting to provide comparable annotations. Visualizations of the resulting ground truth labels can be seen in Section 3.

2.3. Related Work

2.3.1. Domain Generalization

One way to improve model generalization is to increase the data manifold via augmentation [35]. Augmentations can comprise simple intensity-based modifications such as the application of random noise, partial corruption of image areas [12,13], randomly initialized weights [11,15], or differentiable augmentation schemes [16]. Generalization by domain randomization [9] leverages a complete virtual simulation of input data to provide broadly varying data [17]. Using specialized self-supervised training routines has also proven to be effective in improving model generalization [10,14].

2.3.2. Test-Time Adaptation

Test-time adaptation (TTA) is performed in the target data domain and can be limited to a single target sample without access to the source data. The tent is an often-cited approach that adapts batch normalization layers of the network by minimizing prediction entropy [19]. Other works have successfully introduced auxiliary tasks [23] or priors to steer the adaptation, such as AdaMI [21]. RSA utilizes edge-guided diffusion models to translate images from the source to the target domain and selects the best-synthesized edge-image candidate based on the consistency of predictions [28]. Autoencoders capturing feature statistics can reduce implausible target segmentation outputs, such as TTA-RMI [23] or [24,25]. Approaches nearest to our proposed method utilize consistency-self-supervision schemes in combination with sample augmentation, but they introduce further model complexity through the addition of Mean Teacher or domain adversarial methods [6,36]. Many of the mentioned methods employ 2D models for image segmentation due to the memory requirements of the pipeline elements.

2.4. Proposed Method

We aim to leverage compact and effective domain-generalizing augmentation, as well as self-supervision during test-time adaptation, to enhance the performance of 3D segmentation models across domains. As shown in Figure 3, our method consists of two steps. The domain-generalized pre-training of the segmentation network involves using domain-generalizing techniques on the source image input (see the following paragraph). Later, our TTA strategy is employed on individual target domain samples and does not require access to the source data. Both steps are integrated into the state-of-the-art nnUNet segmentation framework [29].

2.5. Domain-Generalized Pre-Training on Source Data

Pre-training is performed on the labeled source training dataset D t r a i n = { x s , y s } s = 1 l , l N , where x s and y s can also be patches. Recently, global intensity non-linear augmentation GIN [15] was introduced to improve model generalization. In GIN, a shallow convolutional network g ρ is re-initialized at each iteration by random parameters ρ and used to augment the input x . The augmented image is then blended with the original image, weighted by α :
GIN ( x ) = α g ρ ( x ) + ( 1 α ) x
We propose combining GIN augmentation with self-similarity context (SSC) descriptors [37]. The approaches can be considered orthogonal, where GIN augmentation increases the input data manifold, and SSC features were designed to yield a robust generalized description. Our intuition is that GIN-augmented features effectively enrich the SSC descriptor space, thereby providing the network with meaningful input to generalize more effectively. Further explanations regarding this intuition can be found in the Appendix B in Figure A1. The SSC descriptor is defined as follows, with x (The CT and MR images used in our experiments do not necessarily follow a Gaussian distribution. The descriptor can generalize to images without prior assumptions about normality, as presented in Section 3) denoting the input image, p denoting the position of a central image patch, d denoting the position of neighboring patches within the neighborhood N , SSD denoting the sum of squared distances, and σ N 2 denoting a noise estimate defined as the mean of all patch distances.
SSC ( x , p , d ) = exp S S D ( x , p , d ) σ N 2 , p , d N ,
The generalizing SSC descriptor aggregates distance measures of the neighborhood around an image patch, neglecting the image patch itself. The 6-neighborhood pattern N diagonally connects adjacent patches around the center patch, resulting in a mapping of R 1 × | Ω | R 12 × | Ω | for voxel space Ω [37]. For our experiments, we use a patch size and patch distance of 1 vox .

2.6. Target Domain TTA

Our test-time adaptation method can now be applied to pre-trained models. For any given pre-trained model f θ on the training dataset D t r a i n , we aim to optimally adjust the weights to a single unseen sample from the target test set D t e s t = { x t } during TTA. Instead of adding complex architectures, we propose to use two augmentation functions, A and B, to obtain differently augmented images. In our case, A and B are solely comprised of a spatial augmentation function S; therefore, A = S A and B = S B . The core idea of the method is to optimize the network to produce consistent predictions given two differently augmented inputs, where x A , t and x B , t are the spatially augmented images from function A and B (branch A and B), respectively:
x A , t = A ( x t ) = S A ( x t ) S A : R | Ω | R | Ω |
x B , t = B ( x t ) = S B ( x t ) S B : R | Ω | R | Ω |
Both augmented images are passed through the pre-trained network f θ :
y ^ A , t = f θ ( x A , t )
y ^ B , t = f θ ( x B , t )
Before calculating the consistency loss, both network predictions, y ^ A , t and y ^ B , t , need to be mapped back to the initial spatial orientation for voxel-wise compatibility by applying the inverse transformation operation S A 1 and S B 1 . In addition, a consistency masking m c ( · ) is applied to filter inversion artifacts, with ζ indicating voxels that were introduced at the image borders during the inverse spatial transformation but are unrelated to the original image content. Inversion and masking yield the branch inversion functions A 1 and B 1 :
m c ( y ^ A , t , y ^ B , t ) = y ^ A , t ζ y ^ B , t ζ
A 1 = m c S A 1
B 1 = m c S B 1
We steer the network to produce consistent outputs by comparing them with the test-time loss L T T A , defined as follows:
L T T A = ( y ^ A , t , y ^ B , t ) = A 1 f θ x A , t , B 1 f θ x B , t
As the loss function , we choose a Dice loss with predictions y ^ A , t and y ^ B , t given as class probabilities for all voxels in Ω , where e is a small constant ensuring numerical stability. | B | and | C | indicate the batch and channel sizes, respectively. y ^ A , t , ω and y ^ B , t , ω represent individual voxel values:
( y ^ A , t , y ^ B , t ) = 1 1 | B | | C | B , C ω Ω 2 · y ^ A , t , ω · y ^ B , t , ω + e ω Ω y ^ A , t , ω d + y ^ B , t , ω d + e , ω Ω
Selecting exponent d = 2 ensures consistency in the Dice loss landscape, rather than d = 1 , which forces the network to additionally maximize the confidence of the prediction (see Figure 4). For spatial augmentation, we use affine image distortions on image/patch coordinates, which we found to be sufficient during our experiments.

Optimization Strategy

During TTA, only the classes C of interest are optimized for consistency (The classes of interest are an arbitrary choice, depending on the use case of the adaptation). To increase the robustness of predicted labels, we use an ensemble of three TTA models in the final inference routine of the nnUNet framework [29]. The AdamW optimizer was used with a learning rate of η = 1 × 10 5 , weight decay β = 0.01 , and no scheduling. We empirically selected a count of N s = 12 optimization steps throughout all of our experiments. Special caution has to be taken when applying test-time adaptation to models that require patch-based input. Since patch-based inference limits the field of view, the optimizer will adapt the model weights and overfit for consistency of the specific image region. Therefore, we accumulate gradients of N p = 16 randomly drawn patches during one optimization step.

2.7. Statistical Methods

In the following sections, segmentation quality is evaluated using the Dice score overlap metric (Dice) and the 95th percentile of the Hausdorff distance (HD95). The significance of TTA improvements is determined with the one-sided Wilcoxon Signed Rank test [38], with significance levels denoted as * p < 0.05, ** p < 0.01, and *** p < 0.001 (software used: Python 3.11, scipy 1.14.1).

3. Results

3.1. Experiment I: Abdominal CT/MR Cross-Domain Segmentation

In this experiment, we evaluate the performance of multiple base models and adapted models in an abdominal segmentation scenario. All base models were trained on source CT data (denoted by BS in the figures and tables). NNUNET denotes the standard model of the nnUNet pipeline [29] without specialized domain generalization capabilities. NNUNET BN denotes a nnUNet model with batch normalization layers. GIN, SSC, and GIN + SSC base models were pre-trained with the domain generalizing techniques described in Section 2.5. For comparison, we report the results of four related cross-domain methods mentioned in Section 2.3: Tent, TTA-RMI, RSA, and AdaMI [19,21,23,28]. Tent and AdaMI only required minor changes to the pipeline (loss and layers), and we have integrated them into the nnUNet pipeline. For the evaluation of TTA-RMI and RSA, we integrated the scenario data into the methods’ pipelines. For AdaMI, a class ratio prior needs to be provided, which we estimated by averaging the class voxel counts of the training dataset while we considered the same image field of view for the patch-based input. In addition to the base models’ performances, we report the adapted models’ performance after TTA (denoted by +A) and the significance of improvements compared to the NNUNET BS base model (reference). In the case of the batch normalization model NNUNET BN, we additionally evaluated adapting only the normalization layer parameters (+A-nor) or only the encoder (+A-enc). In all other experiments, all model parameters were adapted.
The results can be compared by referring to the boxplots in Figure 5 or Table 1, where the Dice similarity is presented. Table 2 presents Hausdorff distance results. For reference, we report the in-domain target data performance when training the NNUNET model on the target domain (no test data was included in target training).
The NNUNET base model achieves a mean Dice value of 32.0% when predicting across domains. This represents a drop of −52.6% compared to the NNUNET model when trained on the target data domain (reference model). Tent can outperform the reference model by +17.6% Dice, with significant improvements. TTA-RMI outperforms the reference model by +7.8% Dice. With RSA, we experience a decrease to 10.7% Dice. AdaMI performs best among the comparison methods, with a mean Dice value of 62.8% after adaptation.
Pre-trained models with generalization techniques achieve Dice scores of 76.3%, 76.1%, and 78.6% when predicting across domains (GIN, SSC, and GIN + SSC). Subsequent adaptation gains +1.1%, +1.6%, and −0.4% Dice. The highest mean performance is reached by the GIN + SSC pre-trained model (78.6%), whereas its adaptation results in a slight performance decrease (−0.4%). The HD95 distance can be reduced to a minimum of 17.2   m m after adapting the GIN + SSC model. Using our TTA scheme, the performance of non-generalizing pre-trained models improves significantly. The highest model internal improvement is reached for the NNUNET BN model when all model parameters are adapted during TTA (+64.0% Dice and 42.9   m m HD95). Adapting partial layers of the model results in lower gains. The Hausdorff distance measurements (HD95) in Table 2 reflect the changes in the Dice score in most cases. For Tent, an increase in the mean HD95 distance was measured, whereas Dice performance increased. This discrepancy can be explained by falsely predicted pixels that appeared in the outside regions of the image, far away from the organs’ centers.
Although substantial gains can be achieved with our method, there remains a gap of −5.9% Dice to the model that has been trained on the target domain data directly (target training, in-domain Dice score of 84.5% vs. our best-performing cross-domain model GIN + SSC 78.6%).

Runtime

Pre-training of the GIN-SSC model took 15.3 h and was comparable to the other model variants. Test-time adaptation of a single scan took approximately 1.7 min per fold on an Nvidia Tesla V100-SXM3-32GB GPU. For a three-fold ensemble, this accumulates to 5.2 min per scan.

3.2. Experiment II: Multi-Scenario CT/MR Cross-Domain Segmentation with DG-TTA

Building upon Experiment I, we demonstrate the efficacy of our method, leveraging the TS dataset’s 600 training samples as a strong basis in three segmentation tasks (all CT > MR): abdominal organ, lumbar spine, and whole-heart segmentation (TS > SPINE, TS > AMOS, TS > MMWHS MR). Unlike to the large TS dataset, we present results for the whole-heart segmentation task using only as few as 12 CT samples in model pre-training (MMWHS CT > MR).
Abdominal prediction across domains using the TS > AMOS datasets resulted in 64.1%, 68.4%, 81.4%, 79.0%, and 79.6% Dice similarity after adapting the models (see Figure 6). All adapted and generalized pre-trained models significantly increased the base model’s performance. Compared to the more limited BTCV training dataset tested in Experiment I (GIN + SSC + A, 78.6% Dice), training on the TS dataset yielded better top results (GIN + A, 81.4% Dice). The best mean Dice score for lumbar spine segmentation was reached by the GIN + SSC-adapted model (73.7% Dice). In the cardiac segmentation scenario, rich and low-sample training datasets were compared. For cross-domain prediction with the rich-sample pre-trained TS model, a best mean Dice score of 82.6% was reached with GIN augmentation. For the low-sample training MMWHS dataset, GIN+SSC+A reached the highest mean Dice of 71.5%. Visual results of the mentioned scenarios are depicted in Figure 7.
Table 3 summarizes the mean Dice and HD95 scores of all scenarios for the GIN, SSC, and GIN + SSC methods, along with their ranked scores. We found GIN + SSC + A to perform best across all scenarios, reaching a score rank of 1.9, outperforming SSC + A and GIN + A (ranks 3.3 and 3.5).

3.3. Experiment III: TTA Ablation Experiments

In this ablation experiment, the best configuration of our TTA scheme is evaluated using combinations of the individual TTA pipeline blocks: intensity augmentation, spatial augmentation, and gradient backpropagation of the self-supervised consistency Dice loss in the two branches, A and B (see Figure 8). Disabling or enabling the blocks of our pipeline resulted in 56 combinations. We selected one conventionally pre-trained base model (NNUNET BS) and one generalized pre-trained base model (GIN BS) to find an optimal configuration of our method in the abdominal segmentation task BTCV > AMOS.
Varying blocks for the NNUNET model results in up to +30.1% gains in the Dice score. For the GIN model, the maximum gain in Dice score is +1.6%, as this model is already generalizing well. TTA benefits from both intensity and spatial augmentation; however, no clear trend can be observed to reject specific configurations entirely (except for applying no augmentation at all, which consistently yields outputs for branches). Combining the ranks of the Dice gains of both models Figure 8a,b), we found that using gradients and backpropagation only in branch A, without intensity augmentation, and affine spatial augmentation in branches A and B, is an optimal trade-off between conventionally pre-trained and domain-generalized pre-trained models (see Figure 8c).

4. Discussion

Our experiments demonstrated that the GIN+SSC augmentation–descriptor combination is highly effective, particularly when using limited data samples in the pre-training stage of our two-step approach. If the domain-generalized pre-training does not result in sufficient target domain performance, our test-time adaptation scheme recovers weakly performing networks. This adaptation is crucial, as it is impossible to know the target domain properties a priori. Significant gains were achieved in all scenarios with the GIN+SSC combination, especially in the cardiac MMWHS CT > MR scenario, where we report improvements from +21.8% Dice for GIN+SSC over using GIN-only augmentation. The presented results are consistent across five challenging CT > MR out-of-domain prediction scenarios spanning abdominal, cardiac, and spine segmentation with small- and large-scale datasets from 12 to 600 training samples. Our approach can address many performant public segmentation models that have been trained on large, private, and unshareable datasets without the need to control their training regime for domain generalization directly. This flexibility is, moreover, beneficial because model providers would usually opt for a less generalizable model if this led to higher in-domain performance. Here, our method reaches improvements of up to +64.0% Dice for non-domain-generalized pre-trained models (see Section 3.1, model NNUNET BN).

4.1. Pertinent Findings in This Study

The proposed GIN+SSC augmentation–descriptor scheme outperforms augmentation-only and descriptor-only configurations in our pre-training and TTA pipeline with a best score rank of 1.9. Similar to earlier works, we updated the batch normalization layers of the models with our TTA scheme; however, the mean performance is higher when using consistency loss compared to the entropy-based formulation of Tent. Additionally, adapting all parameters is preferred over adjusting only single layers or parts of the model using our consistency scheme. Many cross-domain methods require 2D models, as the surrounding pipelines are complex and impose limits on the base model’s memory size. Our compact scheme can be used with 3D models and does not require prior assumptions.

4.2. Differences with Regard to Existing Literature

The TTA-RMI, AdaMI, and RSA methods evaluated in this study are tailored to specific setups, datasets, and their properties. Adaptation with AdaMI was successful but requires a class-ratio prior. This assumption is tough to fulfill in patch-based frameworks, where it is unclear what organ is visible and how large it will appear in the image region. We could not achieve high scores with RSA, which generates convincing source-style CT images from MR inputs; however, the predicted 2D masks are scattered in 3D space since the method does not include 3D convolutional layers.
In our experience, there is a tendency towards designing complex methods. This complexity is reflected in longer training and adaptation runtimes, such as 126.6 h for the domain translation and segmentation training pipeline and 82.0   min of adaptation for the method presented in [28]. Our proposed method required 15.3 h of training and 5.2   min for adaptation. It is compact and readily integrated into the well-established nnUNet pipeline [29], as it solely involves input-feature modifications and self-supervised test-time adaptation.

4.3. Limitations of the Technical Method

GIN augmentation alone can achieve sufficiently high performance out-of-domain when considering anatomies for which large pre-training datasets are available. Here, our TTA scheme yields only moderate additional gains (abdominal: +1.1% and +0.2%, lumbar spine: −0.4%, and cardiac: +1.2% Dice score). We empirically selected the number of adaptation epochs and observed further score gains or, occasionally, score drops for samples when the test-time adaptation continued beyond the specified epoch. A precise measure of convergence to stop the adaptation would be needed, but it is currently out of reach (since TTA has no ground-truth target to evaluate). We maintained the chosen number of epochs throughout all performed experiments and scenarios and are thus confident that this choice is reasonable for new scenarios as well. Apart from intensity-level domain gaps, domain gaps in image orientation and resolution of the target domain scans impose further difficulties for cross-domain predictions. To mitigate these issues, the pre-training of our source models could be further optimized by using multi-resolution augmentation in this regard, or images of the unseen target data could be reoriented to a standardized orientation.

5. Conclusions

In this study, we investigated the application of domain-generalized pre-training and augmentation-based test-time adaptation for robust cross-domain medical image segmentation. We found that models pretrained with a combination of generalizing augmentation and a generalizing feature descriptor can successfully predict across CT and MRI domains (GIN augmentation + SSC descriptor). An augmentation-based test-time adaptation scheme subsequently enhances segmentation performance in cases where the domain-generalized pre-training does not suffice. Substantial gains could be achieved with our GIN + SSC method for abdominal (+46.2 and +28.2 Dice), spine (+72.9), and cardiac (+14.2 and +55.7 Dice) scenarios (p < 0.001). These gains demonstrate that pre-trained models for volumetric medical segmentation can be effectively reused on target scans using a compact methodology that can be easily integrated into existing pipelines.
Our method enables the reuse of models pretrained on small-scale and large-scale CT datasets on MR images, which can differ vastly in intensity distribution. While cross-domain segmentation performance can be significantly improved, a gap remains compared to models trained directly on the target domain data (e.g., for the abdominal cross-domain prediction setting, our best-performing model, GIN + SSC, achieves 78.6% Dice, which is lower than the in-domain model’s performance of 84.5% Dice).
Our method effectively combines generalizing augmentation, a generalizing descriptor, and augmentation-based test-time adaptation to enable cross-domain medical image segmentation. The method proved effective in several scenarios, including abdominal, cardiac, and spine segmentation.

Author Contributions

Conceptualization, C.W., C.N.K., A.B. and M.P.H.; methodology, C.W., A.B. and M.P.H.; software, C.W., C.N.K. and M.P.H.; validation, C.W.; formal analysis, C.W.; investigation, C.W.; resources, C.W. and M.P.H.; data curation, C.W. and M.P.H.; writing—original draft preparation, C.W.; writing—review and editing, C.W., A.B. and M.P.H.; visualization, C.W.; supervision, M.P.H.; project administration, M.P.H.; funding acquisition, M.P.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the German Federal Ministry of Education and Research (BMBF) grand title “MEDICARE”, grant number 01IS21094, and grant title “Medic V-Tach”, grant number 01KL2008, the latter within the European Research Area Network on Cardiovascular Diseases (ERA-CVD).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The open-source code of the presented method is available at: https://github.com/multimodallearning/DG-TTA (accessed on 31 August 2025). The original data presented in the study are openly available: BTCV [dataset] [30] AMOS [dataset] [31] MMWHS [dataset] [32] MyoSegmenTUM spine [dataset] [33] TotalSegmentator [dataset] [39].

Acknowledgments

During the preparation of this manuscript/study, the author(s) used Grammarly, version 1.128.1.0 for the purposes of spelling and grammar checks. The authors have reviewed and edited the output and take full responsibility for the content of this publication.

Conflicts of Interest

Authors Christian Weihsbach, Mattias P. Heinrich were employed by the company EchoScout GmbH. Author Christian N. Kruse was employed by the company Dampsoft GmbH. Author Alexander Bigalke was employed by the company Drägerwerk AG & Co. KGaA. The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
+Aadapted
AORaorta
BSbase
CTcomputed tomography
DGdomain generalization
ESOesophagus
GALgallbladder
GTground truth
HDHausdorff distance
IVCinferior vena cava
LIVliver
LKNleft kidney
MRImagnetic resonance imaging
PANpancreas
RKNright kidney
SPLspleen
STOstomach
TTAtest-time adaptation

Appendix A

Table A1. Characteristics of the publicly available datasets used in this study [30,31,32,33,34].
Table A1. Characteristics of the publicly available datasets used in this study [30,31,32,33,34].
DatasetBTCVAMOSTotal Segmentator Training DatasetMyoSegmenTUM SpineMMWHS
Variable:
Date range≤201520222012–2020≤2018≤2017
ModalitiesCTCT/MRCTMRCT/MR
CT scans505001204060
MRI scans010005460
Patients5060012045460
SitesN/A1813
ScannersN/A81614
Sex:
MaleN/A314∼70015N/A
FemaleN/A186∼50039N/A
Not reported500N/A0N/A
Age (y)
MinN/A221821N/A
MaxN/A8510078N/A
MedianN/A50∼7040N/A
MeanN/A48.7∼70.051.6N/A
Labeled structures Spleen, right kidney, left kidney, gallbladder, esophagus, liver, stomach, aorta, inferior vena cava, portal vein and splenic vein, pancreas, right adrenal gland, left adrenal glandSpleen, right kidney, left kidney gallbladder, esophagus, liver, stomach, aorta, inferior vena cava, pancreas, right adrenal gland, left adrenal gland, duodenum, bladder, prostate/uterusCardiac, abdominal organ and lumbar spine labels (a subset of the 27 organs, 59 bones, 10 muscles, and 8 vessels labeled)Vertebral bodies L1 to L5Myocardium of left ventricle, left ventricle, right ventricle, left atrium, right atrium, aortic trunk, pulmonary artery trunk
Key clinical characteristicsPatients were randomly selected from a combination of an ongoing colorectal cancer chemotherapy trial and a retrospective ventral hernia studyPatients were be diagnosed with abdominal tumors and abnormalitiesPatients with no signs of abnormality (404), patients with different types of abnormality (645), including tumor, vascular, trauma, inflammation, bleeding, and otherHealthy volunteersPatients with pathologies involving cardiac diseases, myocardium infarction, atrial fibrillation, tricuspid regurgitation, aortic valve stenosis, Alagille syndrome, Williams syndrome, dilated cardiomyopathy, aortic coarctation and Tetralogy of Fallot.

Appendix B

Figure A1. Column-wise comparison of a CT image intensity histogram from the MMWHS dataset and an MR image intensity histogram from the AMOS dataset. Top: Distributions for normalized images with zero mean and unit variance. Middle: Opaque histogram overlay of N = 20 GIN augmented images. GIN augmentation results in a range of intensities with a discernible difference between the CT and MR samples. Bottom: Opaque histogram overlay of N = 20 GIN augmented images to which the SSC descriptor has been applied afterwards. Minor intensity variations can be seen at the histogram edges due to the GIN augmentation. To our understanding, GIN + SSC is a powerful combination since GIN augmentation enriches the output features of the SSC descriptor. The SSC descriptor cannot achieve perfect domain invariance, thus GIN effectively augments non-domain-invariant subfeatures.
Figure A1. Column-wise comparison of a CT image intensity histogram from the MMWHS dataset and an MR image intensity histogram from the AMOS dataset. Top: Distributions for normalized images with zero mean and unit variance. Middle: Opaque histogram overlay of N = 20 GIN augmented images. GIN augmentation results in a range of intensities with a discernible difference between the CT and MR samples. Bottom: Opaque histogram overlay of N = 20 GIN augmented images to which the SSC descriptor has been applied afterwards. Minor intensity variations can be seen at the histogram edges due to the GIN augmentation. To our understanding, GIN + SSC is a powerful combination since GIN augmentation enriches the output features of the SSC descriptor. The SSC descriptor cannot achieve perfect domain invariance, thus GIN effectively augments non-domain-invariant subfeatures.
Sensors 25 05603 g0a1

References

  1. Karani, N.; Chaitanya, K.; Baumgartner, C.; Konukoglu, E. A lifelong learning approach to brain MR segmentation across scanners and protocols. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2018: 21st International Conference, Granada, Spain, 16–20 September 2018; Proceedings, Part I. Springer: Cham, Switzerland, 2018; pp. 476–484. [Google Scholar]
  2. Pooch, E.H.; Ballester, P.; Barros, R.C. Can we trust deep learning based diagnosis? the impact of domain shift in chest radiograph classification. In Proceedings of the Thoracic Image Analysis: Second International Workshop, TIA 2020, Held in Conjunction with MICCAI 2020, Lima, Peru, 8 October 2020; Proceedings 2. Springer: Cham, Switzerland, 2020; pp. 74–83. [Google Scholar]
  3. Usman, M.; Zia, T.; Tariq, A. Analyzing transfer learning of vision transformers for interpreting chest radiography. J. Digit. Imaging 2022, 35, 1445–1462. [Google Scholar] [CrossRef] [PubMed]
  4. Luna Lozoya, R.S.; Ochoa Domínguez, H.d.J.; Sossa Azuela, J.H.; Cruz Sánchez, V.G.; Vergara Villegas, O.O.; Núñez Barragán, K. Cross-Domain Transfer Learning Architecture for Microcalcification Cluster Detection Using the MEXBreast Multiresolution Mammography Dataset. Mathematics 2025, 13, 2422. [Google Scholar] [CrossRef]
  5. Zhu, J.Y.; Park, T.; Isola, P.; Efros, A.A. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2223–2232. [Google Scholar]
  6. Varsavsky, T.; Orbes-Arteaga, M.; Sudre, C.H.; Graham, M.S.; Nachev, P.; Cardoso, M.J. Test-time unsupervised domain adaptation. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2020: 23rd International Conference, Lima, Peru, 4–8 October 2020; Proceedings, Part I 23. Springer: Cham, Switzerland, 2020; pp. 428–436. [Google Scholar]
  7. Chen, C.; Liu, Q.; Jin, Y.; Dou, Q.; Heng, P.A. Source-free domain adaptive fundus image segmentation with denoised pseudo-labeling. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2021: 24th International Conference, Strasbourg, France, 27 September–1 October 2021; Proceedings, Part V 24. Springer: Cham, Switzerland, 2021; pp. 225–235. [Google Scholar]
  8. Wen, Z.; Zhang, X.; Ye, C. Source-Free Domain Adaptation for Medical Image Segmentation via Selectively Updated Mean Teacher. In Proceedings of the International Conference on Information Processing in Medical Imaging, San Carlos de Bariloche, Argentina, 18–23 June 2023; Springer: Cham, Switzerland, 2023; pp. 225–236. [Google Scholar]
  9. Tobin, J.; Fong, R.; Ray, A.; Schneider, J.; Zaremba, W.; Abbeel, P. Domain randomization for transferring deep neural networks from simulation to the real world. In Proceedings of the 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Vancouver, BC, Canada, 24–28 September 2017; IEEE: Vancouver, BC, Canada, 2017; pp. 23–30. [Google Scholar]
  10. Bucci, S.; D’Innocente, A.; Liao, Y.; Carlucci, F.M.; Caputo, B.; Tommasi, T. Self-supervised learning across domains. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 5516–5528. [Google Scholar] [CrossRef] [PubMed]
  11. Xu, Z.; Liu, D.; Yang, J.; Raffel, C.; Niethammer, M. Robust and generalizable visual representation learning via random convolutions. arXiv 2020, arXiv:2007.13003. [Google Scholar]
  12. He, K.; Chen, X.; Xie, S.; Li, Y.; Dollár, P.; Girshick, R. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Orleans, LA, USA, 18–24 June 2022; pp. 16000–16009. [Google Scholar]
  13. Hoyer, L.; Dai, D.; Wang, H.; Van Gool, L. MIC: Masked image consistency for context-enhanced domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 11721–11732. [Google Scholar]
  14. Zhou, Z.; Sodha, V.; Pang, J.; Gotway, M.B.; Liang, J. Models genesis. Med. Image Anal. 2021, 67, 101840. [Google Scholar] [CrossRef] [PubMed]
  15. Ouyang, C.; Chen, C.; Li, S.; Li, Z.; Qin, C.; Bai, W.; Rueckert, D. Causality-inspired single-source domain generalization for medical image segmentation. IEEE Trans. Med. Imaging 2022, 42, 1095–1106. [Google Scholar] [CrossRef] [PubMed]
  16. Hu, S.; Liao, Z.; Zhang, J.; Xia, Y. Domain and Content Adaptive Convolution Based Multi-Source Domain Generalization for Medical Image Segmentation. IEEE Trans. Med. Imaging 2022, 42, 233–244. [Google Scholar] [CrossRef] [PubMed]
  17. Billot, B.; Greve, D.N.; Puonti, O.; Thielscher, A.; Van Leemput, K.; Fischl, B.; Dalca, A.V.; Iglesias, J.E. SynthSeg: Segmentation of brain MRI scans of any contrast and resolution without retraining. Med. Image Anal. 2023, 86, 102789. [Google Scholar] [CrossRef] [PubMed]
  18. Liu, J.; Zhang, Y.; Chen, J.N.; Xiao, J.; Lu, Y.; Landman, B.A.; Yuan, Y.; Yuille, A.; Tang, Y.; Zhou, Z. CLIP-Driven Universal Model for Organ Segmentation and Tumor Detection. arXiv 2023, arXiv:2301.00785. [Google Scholar] [CrossRef]
  19. Wang, D.; Shelhamer, E.; Liu, S.; Olshausen, B.; Darrell, T. Tent: Fully test-time adaptation by entropy minimization. arXiv 2020, arXiv:2006.10726. [Google Scholar]
  20. Sun, Y.; Wang, X.; Liu, Z.; Miller, J.; Efros, A.; Hardt, M. Test-time training with self-supervision for generalization under distribution shifts. In Proceedings of the International Conference on Machine Learning, PMLR, Online, 13–18 July 2020; pp. 9229–9248. [Google Scholar]
  21. Bateson, M.; Kervadec, H.; Dolz, J.; Lombaert, H.; Ben Ayed, I. Source-relaxed domain adaptation for image segmentation. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2020: 23rd International Conference, Lima, Peru, 4–8 October2020; Proceedings, Part I 23. Springer: Cham, Switzerland, 2020; pp. 490–499. [Google Scholar]
  22. Huang, Y.; Yang, X.; Huang, X.; Liang, J.; Zhou, X.; Chen, C.; Dou, H.; Hu, X.; Cao, Y.; Ni, D. Online Reflective Learning for Robust Medical Image Segmentation. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2022: 25th International Conference, Singapore, 18–22 September 2022; Proceedings, Part VIII. Springer: Cham, Switzerland, 2022; pp. 652–662. [Google Scholar]
  23. Karani, N.; Erdil, E.; Chaitanya, K.; Konukoglu, E. Test-time adaptable neural networks for robust medical image segmentation. Med. Image Anal. 2021, 68, 101907. [Google Scholar] [CrossRef] [PubMed]
  24. He, Y.; Carass, A.; Zuo, L.; Dewey, B.E.; Prince, J.L. Self domain adapted network. In Proceedings of the Medical Image Computing and Computer Assisted Intervention–MICCAI 2020: 23rd International Conference, Lima, Peru, 4–8 October 2020; Proceedings, Part I 23. Springer: Cham, Switzerland, 2020; pp. 437–446. [Google Scholar]
  25. He, Y.; Carass, A.; Zuo, L.; Dewey, B.E.; Prince, J.L. Autoencoder based self-supervised test-time adaptation for medical image analysis. Med. Image Anal. 2021, 72, 102136. [Google Scholar] [CrossRef] [PubMed]
  26. Liu, Q.; Chen, C.; Dou, Q.; Heng, P.A. Single-domain generalization in medical image segmentation via test-time adaptation from shape dictionary. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtually, 22 February–1 March 2022; Volume 36, pp. 1756–1764. [Google Scholar]
  27. Li, H.; Liu, H.; Hu, D.; Wang, J.; Johnson, H.; Sherbini, O.; Gavazzi, F.; D’Aiello, R.; Vanderver, A.; Long, J.; et al. Self-supervised Test-Time Adaptation for Medical Image Segmentation. In Machine Learning in Clinical Neuroimaging; Abdulkadir, A., Bathula, D.R., Dvornek, N.C., Habes, M., Kia, S.M., Kumar, V., Wolfers, T., Eds.; Springer: Cham, Switzerland, 2022; pp. 32–41. [Google Scholar]
  28. Zeng, H.; Zou, K.; Chen, Z.; Zheng, R.; Fu, H. Reliable source approximation: Source-free unsupervised domain adaptation for vestibular schwannoma MRI segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention, Marrakesh, Morocco, 6–10 October 2024; Springer: Cham, Switzerland, 2024; pp. 622–632. [Google Scholar]
  29. Isensee, F.; Jaeger, P.F.; Kohl, S.A.; Petersen, J.; Maier-Hein, K.H. nnU-Net: A self-configuring method for deep learning-based biomedical image segmentation. Nat. Methods 2021, 18, 203–211. [Google Scholar] [CrossRef] [PubMed]
  30. Landman, B.; Xu, Z.; Igelsias, J.; Styner, M.; Langerak, T.; Klein, A. Miccai multi-atlas labeling beyond the cranial vault–workshop and challenge. In Proceedings of the MICCAI Multi-Atlas Labeling Beyond Cranial Vault—Workshop Challenge, Munich, Germany, 5–9 October 2015; Volume 5, p. 12. [Google Scholar]
  31. Ji, Y.; Bai, H.; Ge, C.; Yang, J.; Zhu, Y.; Zhang, R.; Li, Z.; Zhang, L.; Ma, W.; Wan, X.; et al. AMOS: A large-scale abdominal multi-organ benchmark for versatile medical image segmentation. In Proceedings of the 36th International Conference on Neural Information Processing Systems, NIPS ’22, Red Hook, NY, USA, 28 November–9 December 2022. [Google Scholar]
  32. Zhuang, X.; Li, L.; Payer, C.; Štern, D.; Urschler, M.; Heinrich, M.P.; Oster, J.; Wang, C.; Smedby, Ö.; Bian, C.; et al. Evaluation of algorithms for Multi-Modality Whole Heart Segmentation: An open-access grand challenge. Med. Image Anal. 2019, 58, 101537. [Google Scholar] [CrossRef] [PubMed]
  33. Burian, E.; Rohrmeier, A.; Schlaeger, S.; Dieckmeyer, M.; Diefenbach, M.N.; Syväri, J.; Klupp, E.; Weidlich, D.; Zimmer, C.; Rummeny, E.J.; et al. Lumbar muscle and vertebral bodies segmentation of chemical shift encoding-based water-fat MRI: The reference database MyoSegmenTUM spine. BMC Musculoskelet. Disord. 2019, 20, 152. [Google Scholar] [CrossRef] [PubMed]
  34. Wasserthal, J.; Breit, H.C.; Meyer, M.T.; Pradella, M.; Hinck, D.; Sauter, A.W.; Heye, T.; Boll, D.T.; Cyriac, J.; Yang, S.; et al. TotalSegmentator: Robust Segmentation of 104 Anatomic Structures in CT Images. Artif. Intell. 2023, 5, e230024. [Google Scholar] [CrossRef] [PubMed]
  35. Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention, Munich, Germany, 5–9 October 2015; Springer: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
  36. Perone, C.S.; Ballester, P.; Barros, R.C.; Cohen-Adad, J. Unsupervised domain adaptation for medical imaging segmentation with self-ensembling. NeuroImage 2019, 194, 1–11. [Google Scholar] [CrossRef] [PubMed]
  37. Heinrich, M.P.; Jenkinson, M.; Papież, B.W.; Brady, S.M.; Schnabel, J.A. Towards realtime multimodal fusion for image-guided interventions using self-similarities. In Proceedings of the Medical Image Computing and Computer-Assisted Intervention–MICCAI 2013: 16th International Conference, Nagoya, Japan, 22–26 September 2013; Proceedings, Part I 16. Springer: Cham, Switzerland, 2013; pp. 187–194. [Google Scholar]
  38. Wilcoxon, F. Individual comparisons by ranking methods. In Breakthroughs in Statistics: Methodology and Distribution; Springer: New York, NY, USA, 1992; pp. 196–202. [Google Scholar]
  39. Wasserthal, J. Dataset with Segmentations of 117 Important Anatomical Structures in 1228 CT Images. 2023. Available online: https://zenodo.org/records/10047292 (accessed on 31 August 2025).
Figure 1. Study flowchart. Data from five publicly available datasets was included and combined to define several out-of-domain CT > MR prediction scenarios (the red arrows indicate their combinations) [30,31,32,33,34]. We randomly extracted subsamples for a source and target data ratio of at least 2:1. For the MMWHS dataset, we split the training and test data to include individual patients only (no paired data across training and testing).
Figure 1. Study flowchart. Data from five publicly available datasets was included and combined to define several out-of-domain CT > MR prediction scenarios (the red arrows indicate their combinations) [30,31,32,33,34]. We randomly extracted subsamples for a source and target data ratio of at least 2:1. For the MMWHS dataset, we split the training and test data to include individual patients only (no paired data across training and testing).
Sensors 25 05603 g001
Figure 2. Sample images from the datasets used in this study, shown as maximum intensity projections.
Figure 2. Sample images from the datasets used in this study, shown as maximum intensity projections.
Sensors 25 05603 g002
Figure 3. Our proposed method consists of two steps that, when combined, achieve optimal performance; however, they can also be used independently. Both steps rely on modifying input features to improve model generalization during training and enable unsupervised model adaptation at test time. (Left): Model pre-training with source domain data. We propose to use GIN augmentation [15] and the SSC descriptor [37] in this step. (Right): TTA is applied in the target data domain. Two different augmented versions of the same input are passed through the pre-trained segmentation network. The network weights are then optimized, supervised by the Dice loss, which guides the network to produce consistent predictions. After applying inverse spatial transformations, consistency masking is used to filter out non-matching regions.
Figure 3. Our proposed method consists of two steps that, when combined, achieve optimal performance; however, they can also be used independently. Both steps rely on modifying input features to improve model generalization during training and enable unsupervised model adaptation at test time. (Left): Model pre-training with source domain data. We propose to use GIN augmentation [15] and the SSC descriptor [37] in this step. (Right): TTA is applied in the target data domain. Two different augmented versions of the same input are passed through the pre-trained segmentation network. The network weights are then optimized, supervised by the Dice loss, which guides the network to produce consistent predictions. After applying inverse spatial transformations, consistency masking is used to filter out non-matching regions.
Sensors 25 05603 g003
Figure 4. Dice loss landscapes given scalar probability values y ^ A and y ^ B for different exponents d = [ 1 , 2 ] in Equation (11). d = 2 yields zero loss along the diagonal, which is favorable for consistency.
Figure 4. Dice loss landscapes given scalar probability values y ^ A and y ^ B for different exponents d = [ 1 , 2 ] in Equation (11). d = 2 yields zero loss along the diagonal, which is favorable for consistency.
Sensors 25 05603 g004
Figure 5. Base (BS) and adapted model (+A) performance of several methods bridging a CT > MR domain gap in abdominal organ segmentation. Ordinate shows Dice scores in percentage. Median (—) and mean (+) are indicated for boxes. The significance of improvement over the source NNUNET BS base model is shown above boxes (* p < 0.05; *** p < 0.001). The right part of the figure shows a zoomed-in view of the three rightmost proposed methods.
Figure 5. Base (BS) and adapted model (+A) performance of several methods bridging a CT > MR domain gap in abdominal organ segmentation. Ordinate shows Dice scores in percentage. Median (—) and mean (+) are indicated for boxes. The significance of improvement over the source NNUNET BS base model is shown above boxes (* p < 0.05; *** p < 0.001). The right part of the figure shows a zoomed-in view of the three rightmost proposed methods.
Sensors 25 05603 g005
Figure 6. Base (BS) and adapted (+A) model performance given in Dice similarity percentage for several cross-domain prediction scenarios. Top row and bottom left: TS pre-trained models. Bottom right: MMWHS CT pre-trained models with only 12 training samples. Ordinate shows Dice scores in percentage. Median (—) and mean (+) are indicated for boxes. The significance of improvement over the source NNUNET BS base model is shown above boxes (** p < 0.01; *** p < 0.001).
Figure 6. Base (BS) and adapted (+A) model performance given in Dice similarity percentage for several cross-domain prediction scenarios. Top row and bottom left: TS pre-trained models. Bottom right: MMWHS CT pre-trained models with only 12 training samples. Ordinate shows Dice scores in percentage. Median (—) and mean (+) are indicated for boxes. The significance of improvement over the source NNUNET BS base model is shown above boxes (** p < 0.01; *** p < 0.001).
Sensors 25 05603 g006
Figure 7. Visual results corresponding to the statistics in Figure 5 and Figure 6. The rows indicate the source and target datasets used, while the columns show the base (BS) or adapted (+A) models’ predictions. Ground truth is given in the leftmost column. Positively predicted voxels are shown in colors. Erroneous areas of predictions are marked with contours. The class colors for the abdominal task labels comprise spleen Sensors 25 05603 i001, right kidney Sensors 25 05603 i002, left kidney Sensors 25 05603 i003, gallbladder Sensors 25 05603 i004, esophagus Sensors 25 05603 i005, liver Sensors 25 05603 i006, stomach Sensors 25 05603 i007, aorta Sensors 25 05603 i008, inferior vena cava Sensors 25 05603 i009, and panreas Sensors 25 05603 i010. Whole-heart class labels comprise the right ventricle Sensors 25 05603 i011, right atrium Sensors 25 05603 i012, left ventricle Sensors 25 05603 i013, left atrium Sensors 25 05603 i014, and myocardium Sensors 25 05603 i015. Best viewed digitally.
Figure 7. Visual results corresponding to the statistics in Figure 5 and Figure 6. The rows indicate the source and target datasets used, while the columns show the base (BS) or adapted (+A) models’ predictions. Ground truth is given in the leftmost column. Positively predicted voxels are shown in colors. Erroneous areas of predictions are marked with contours. The class colors for the abdominal task labels comprise spleen Sensors 25 05603 i001, right kidney Sensors 25 05603 i002, left kidney Sensors 25 05603 i003, gallbladder Sensors 25 05603 i004, esophagus Sensors 25 05603 i005, liver Sensors 25 05603 i006, stomach Sensors 25 05603 i007, aorta Sensors 25 05603 i008, inferior vena cava Sensors 25 05603 i009, and panreas Sensors 25 05603 i010. Whole-heart class labels comprise the right ventricle Sensors 25 05603 i011, right atrium Sensors 25 05603 i012, left ventricle Sensors 25 05603 i013, left atrium Sensors 25 05603 i014, and myocardium Sensors 25 05603 i015. Best viewed digitally.
Sensors 25 05603 g007
Figure 8. (a) Gains in Dice score on a non-domain-generalized pre-trained NNUNET model. (b) Gains in Dice score on a domain-generalized pre-trained GIN model. (c) Combined rank for configurations of (a,b). A, B and AB indicate whether augmentation or gradient backpropagation were enabled in branch A, branch B, or both branches (AB). The best rank is highlighted.
Figure 8. (a) Gains in Dice score on a non-domain-generalized pre-trained NNUNET model. (b) Gains in Dice score on a domain-generalized pre-trained GIN model. (c) Combined rank for configurations of (a,b). A, B and AB indicate whether augmentation or gradient backpropagation were enabled in branch A, branch B, or both branches (AB). The best rank is highlighted.
Sensors 25 05603 g008
Table 1. Base (BS) and adapted model (+A) performance given in Dice similarity percentage of several methods bridging a CT > MR domain gap in abdominal organ segmentation. In the case of the batch normalization model NNUNET BN, we evaluated adapting only the normalization layer parameters (+A-nor) or the encoder (+A-enc), in addition to evaluating the adaptation of all parameters. Higher Dice values indicate better performance. Mean column corresponds to values in Figure 5. Class names abbreviated: spleen (SPL), right/left kidney (RKN/LKN), gallbladder (GAL), esophagus (ESO), liver (LIV), stomach (STO), aorta (AOR), inferior vena cava (IVC), and pancreas (PAN). Performance gains refer to the NNUNET BS model. Bold formatting indicates the best score per column.
Table 1. Base (BS) and adapted model (+A) performance given in Dice similarity percentage of several methods bridging a CT > MR domain gap in abdominal organ segmentation. In the case of the batch normalization model NNUNET BN, we evaluated adapting only the normalization layer parameters (+A-nor) or the encoder (+A-enc), in addition to evaluating the adaptation of all parameters. Higher Dice values indicate better performance. Mean column corresponds to values in Figure 5. Class names abbreviated: spleen (SPL), right/left kidney (RKN/LKN), gallbladder (GAL), esophagus (ESO), liver (LIV), stomach (STO), aorta (AOR), inferior vena cava (IVC), and pancreas (PAN). Performance gains refer to the NNUNET BS model. Bold formatting indicates the best score per column.
MethodStage SPLRKNLKNGALESOLIVSTOAORIVCPANDice μ ± σ Gain
NNUNETBSReference40.221.915.924.922.976.034.326.421.835.332.0 ± 16.3
+Aours76.070.074.442.542.079.852.065.246.760.860.9 ± 13.6+28.9
TentBS 0.00.00.00.00.343.70.02.30.51.54.8 ± 13.0−27.2
+A 68.768.480.330.225.350.352.447.030.343.049.6 ± 17.5+17.6
TTA-RMIBS 3.210.823.33.311.638.915.23.18.711.212.9 ± 10.5−19.1
+A 65.848.055.79.325.166.737.036.025.628.539.8 ± 17.9+7.8
RSABS 5.54.54.30.00.04.47.31.20.00.32.7 ± 2.6−29.2
+A 12.514.118.60.92.424.55.310.015.82.910.7 ± 7.4−21.3
AdaMIBS 40.221.915.924.922.976.034.326.421.835.332.0 ± 16.3
+A 75.077.783.137.137.983.856.568.148.261.162.8 ± 16.7+30.9
NNUNET BNBS 0.00.00.00.00.343.70.02.30.51.54.8 ± 13.0−27.2
+A-norours62.879.280.132.826.574.067.652.534.556.356.6 ± 18.7+24.6
+A-encours80.187.188.434.630.983.173.968.843.864.865.5 ± 20.5+33.6
+Aours81.687.289.240.135.984.773.475.154.166.868.8 ± 18.3+36.8
GINBS 81.990.491.963.747.892.773.280.972.168.176.3 ± 13.5+44.3
+Aours81.690.592.172.348.993.374.779.270.970.677.4 ± 12.6+45.4
SSCBSours83.692.993.060.539.193.174.681.169.573.276.1 ± 16.1+44.1
+Aours83.491.292.968.148.691.474.483.371.372.277.7 ± 13.0+45.7
GIN+SSCBSours83.093.393.365.950.394.176.583.973.771.978.6 ± 13.3+46.6
+Aours82.292.792.768.447.193.474.584.873.572.578.2 ± 13.6+46.2
(NNUNET)(Target training)86.594.695.070.959.997.381.491.285.483.284.5 ± 11.1+52.6
Table 2. Base (BS) and adapted model (+A) performance is given in the 95th percentile of the Hausdorff distance in mm (HD95) for several methods bridging the CT > MR domain gap in abdominal organ segmentation. Smaller distances indicate better performance. Class names abbreviated: spleen (SPL), right/left kidney (RKN/LKN), gallbladder (GAL), esophagus (ESO), liver (LIV), stomach (STO), aorta (AOR), inferior vena cava (IVC), and pancreas (PAN). Distance reduction refers to the NNUNET BS model (the more negative, the better). Bold formatting indicates the best score per column.
Table 2. Base (BS) and adapted model (+A) performance is given in the 95th percentile of the Hausdorff distance in mm (HD95) for several methods bridging the CT > MR domain gap in abdominal organ segmentation. Smaller distances indicate better performance. Class names abbreviated: spleen (SPL), right/left kidney (RKN/LKN), gallbladder (GAL), esophagus (ESO), liver (LIV), stomach (STO), aorta (AOR), inferior vena cava (IVC), and pancreas (PAN). Distance reduction refers to the NNUNET BS model (the more negative, the better). Bold formatting indicates the best score per column.
MethodStage SPLRKNLKNGALESOLIVSTOAORIVCPANHD95 μ ± σ Reduction
NNUNETBSReference96.260.2105.066.068.8151.3181.1127.7115.272.6104.4 ± 38.1
+Aours70.936.558.293.851.5158.1191.4126.3116.572.897.6 ± 47.3−6.8
TentBS 90.1102.732.7141.546.093.5182.5123.076.398.7 ± 43.7−5.7
+A 186.7215.1181.7130.9180.3239.3228.3171.4162.8182.9187.9 ± 30.5+83.5
TTA-RMIBS 105.9101.092.669.4149.9114.3163.3101.9109.696.8110.5 ± 26.0+6.1
+A 67.947.684.865.9122.093.5103.499.7112.976.987.4 ± 22.0−17.0
RSABS 116.888.960.277.7129.7206.9115.7146.1154.1101.3119.7 ± 40.2+15.3
+A 80.2119.9102.897.7116.183.9100.243.436.686.686.7 ± 26.4−17.7
AdaMIBS 96.260.2105.066.068.8151.3181.1127.7115.272.6104.4 ± 38.1
+A 39.346.144.785.540.9174.4196.1106.297.156.288.7 ± 53.7−15.8
NNUNET BNBS 90.1102.732.7141.546.093.5182.5123.076.398.7 ± 43.7−5.7
+A-norours50.926.537.752.471.2180.787.9110.550.335.270.3 ± 44.1−34.1
+A-encours27.411.89.643.568.5157.556.457.737.317.448.7 ± 41.1−55.7
+Aours38.154.042.650.433.0134.670.282.931.620.255.8 ± 31.7−48.6
GINBS 9.54.84.510.543.259.830.152.935.828.027.9 ± 19.1−76.5
+Aours18.19.84.78.550.657.947.477.733.063.137.1 ± 24.6−67.3
SSCBSours19.53.74.39.519.020.526.555.338.337.523.4 ± 15.6−81.0
+Aours33.954.84.17.941.843.741.448.541.422.334.0 ± 16.2−70.4
GIN+SSCBSours24.53.53.98.510.721.420.055.719.611.517.9 ± 14.4−86.5
+Aours42.33.84.17.511.223.823.727.517.410.917.2 ± 11.6−87.2
(NNUNET)(Target training)2.96.27.76.27.018.819.26.35.38.48.8 ± 5.3−95.6
Table 3. Mean base (BS) and adapted (+A) model performance for GIN, SSC, and GIN + SSC methods summarized for all evaluated scenarios. Performance given in Dice in percentage and the 95th percentile of the Hausdorff distance (HD95) in mm. Rank of the scores per group is given in brackets. The combined score rank is given in the last column of the lower table group (mean of ranks across all scores per method). Bold formatting indicates the best score per column.
Table 3. Mean base (BS) and adapted (+A) model performance for GIN, SSC, and GIN + SSC methods summarized for all evaluated scenarios. Performance given in Dice in percentage and the 95th percentile of the Hausdorff distance (HD95) in mm. Rank of the scores per group is given in brackets. The combined score rank is given in the last column of the lower table group (mean of ranks across all scores per method). Bold formatting indicates the best score per column.
MethodStage TS > AMOS
Dice
TS > AMOS
HD95
TS > SPINE
Dice
TS >SPINE
HD95
TS > MMWHS MR
Dice
TS > MMWHS MR
HD95
NNUNETBSReference51.468.20.859.267.634.8
GINBS 81.2 (2)11.8 (1)73.2 (2)11.7 (3)81.4 (5)11.1 (6)
+Aours81.4 (1)14.2 (3)72.8 (3)9.7 (2)82.6 (1)10.2 (5)
SSCBSours77.7 (5)16.7 (5)35.6 (6)22.8 (6)81.3 (6)8.9 (2)
+Aours79.0 (4)22.6 (6)69.1 (4)13.3 (4)82.0 (2)8.5 (1)
GIN+SSCBSours75.7 (6)14.8 (4)57.9 (5)15.3 (5)81.8 (4)10.1 (4)
+Aours79.6 (3)12.1 (2)73.7 (1)9.4 (1)81.8 (4)9.4 (3)
MethodStage BTCV > AMOS
Dice
BTCV > AMOS
HD95
MMWHS CT > MR
Dice
MMWHS CT > MR
HD95
COMBINED
SCORE RANK
NNUNETBSReference32.0104.415.8147.8
GINBS 76.3 (5)27.9 (4)36.8 (6)85.6 (6) 4.0
+Aours77.4 (4)37.1 (6)49.7 (5)77.5 (5) 3.5
SSCBSours76.1 (6)23.4 (3)58.8 (4)53.0 (4) 4.7
+Aours77.7 (3)34.0 (5)70.5 (2)25.4 (2) 3.3
GIN+SSCBSours78.6 (1)17.9 (2)59.9 (3)47.9 (3) 3.7
+Aours78.2 (2)17.2 (1)71.5 (1)17.8 (1) 1.9
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Weihsbach, C.; Kruse, C.N.; Bigalke, A.; Heinrich, M.P. DG-TTA: Out-of-Domain Medical Image Segmentation Through Augmentation, Descriptor-Driven Domain Generalization, and Test-Time Adaptation. Sensors 2025, 25, 5603. https://doi.org/10.3390/s25175603

AMA Style

Weihsbach C, Kruse CN, Bigalke A, Heinrich MP. DG-TTA: Out-of-Domain Medical Image Segmentation Through Augmentation, Descriptor-Driven Domain Generalization, and Test-Time Adaptation. Sensors. 2025; 25(17):5603. https://doi.org/10.3390/s25175603

Chicago/Turabian Style

Weihsbach, Christian, Christian N. Kruse, Alexander Bigalke, and Mattias P. Heinrich. 2025. "DG-TTA: Out-of-Domain Medical Image Segmentation Through Augmentation, Descriptor-Driven Domain Generalization, and Test-Time Adaptation" Sensors 25, no. 17: 5603. https://doi.org/10.3390/s25175603

APA Style

Weihsbach, C., Kruse, C. N., Bigalke, A., & Heinrich, M. P. (2025). DG-TTA: Out-of-Domain Medical Image Segmentation Through Augmentation, Descriptor-Driven Domain Generalization, and Test-Time Adaptation. Sensors, 25(17), 5603. https://doi.org/10.3390/s25175603

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop