Abstract
Clinical machine learning models often fail when deployed in new environments due to domain shift—variations in hardware, site practices, or temporal factors. We present the Disentangled Autoencoder (Dis-AE), a novel architecture designed for domain generalization. By employing adversarial training with a gradient reversal layer, Dis-AE strips away clinically irrelevant domain noise while preserving task-specific information. Evaluated on synthetic and large-scale real-world blood count datasets, Dis-AE demonstrates superior robustness to unseen domains compared to standard models.
Introduction: The Challenge of Domain Shift in Clinical AI
Machine learning models frequently exhibit high performance in controlled laboratory settings but degrade significantly in clinical practice. This phenomenon, known as domain shift, occurs when a model inadvertently learns "shortcuts"—associating specific hardware quirks or local site practices with clinical outcomes rather than true biological signals. For instance, a model trained on a high-end analyzer might fail when deployed at a site using different equipment.
While domain adaptation (fine-tuning on target site data) is a common approach, it is often impractical due to data scarcity or privacy concerns. This research focuses on domain generalization: building models that are inherently robust to unseen settings by learning domain-invariant representations.
Methodology: The Disentangled Autoencoder (Dis-AE)
The proposed Dis-AE architecture utilizes a multi-pronged approach to achieve disentanglement:
- Autoencoder Core: An encoder maps input data to a latent space, while a decoder reconstructs the input, ensuring the learned features are meaningful.
- Task Heads: These branches perform the primary clinical tasks, such as predicting patient demographics from blood counts.
- Domain Heads (Adversaries): These branches attempt to identify the source domain (e.g., specific machine or site) of the data.
- Gradient Reversal Layer (GRL): Positioned between the encoder and domain heads, the GRL flips the gradient sign during backpropagation. This penalizes the encoder if domain information is detectable, forcing it to "forget" machine-specific noise.
Experimental Setup and Datasets
The study evaluates Dis-AE across three levels of complexity:
- Synthetic Datasets: Controlled environments featuring affine, periodic, and exponential transformations to test the model's limits.
- INTERVAL & COMPARE Trials: Real-world Full Blood Count (FBC) data from blood donors, involving natural shifts between different Sysmex XN-2000 analyzers.
- Cambridge University Hospitals (CUH) Dataset: A massive clinical dataset of over 1 million samples, spanning multiple years, care settings, and analyzer upgrades.
Key Insights and Results
A core contribution of this work is the conceptualization of domain-instance grouping. Rather than treating a "site" as a monolithic domain, the authors recognize that a single sample is influenced by multiple overlapping factors, such as the specific machine used, processing delays, and seasonal variations.
Performance and Generalization
- Variation Reduction: In synthetic tests, Dis-AE reduced the "Variation Term" (measuring domain information in the latent space) from 1.011 to 0.003 compared to a vanilla autoencoder, without sacrificing classification accuracy (~98%).
- Latent Space Mixing: Visualizations using PHATE showed that while raw data clustered by machine, Dis-AE's latent space clustered by clinical task, indicating successful domain-agnostic representation.
- Diversity and Robustness: Experiments with "Many Affines" demonstrated that training on a more diverse set of source domains significantly improves performance on extreme, unseen domains.
Limitations and Future Directions
Despite its success, Dis-AE faces challenges common to adversarial models, including training instability (approximately 20% of runs required restarts). Additionally, there is a fundamental trade-off between reconstruction quality and disentanglement; as the encoder ignores domain noise, the decoder's ability to recreate the original "noisy" input diminishes. Future work may involve providing domain labels directly to the decoder to alleviate this tension. Finally, "correlation traps"—where clinical tasks are highly correlated with domain factors (e.g., age and care setting)—remain a significant hurdle for disentanglement methods.
Summary updated