Abstract
The vast amount of health data has been continuously collected for each patient, providing opportunities to support diverse healthcare predictive tasks such as seizure detection and hospitalization prediction. Existing models are mostly trained on other patients data and evaluated on new patients. Many of them might suffer from poor generalizability. One key reason can be overfitting due to the unique information related to patient identities and their data collection environments, referred to as patient covariates in the paper. These patient covariates usually do not contribute to predicting the targets but are often difficult to remove. As a result, they can bias the model training process and impede generalization. In healthcare applications, most existing domain generalization methods assume a small number of domains. In this paper, considering the diversity of patient covariates, we propose a new setting by treating each patient as a separate domain (leading to many domains). We develop a new domain generalization method ManyDG, that can scale to such many-domain problems. Our method identifies the patient domain covariates by mutual reconstruction and removes them via an orthogonal projection step. Extensive experiments show that ManyDG can boost the generalization performance on multiple real-world healthcare tasks (e.g., 3.7% Jaccard improvements on MIMIC drug recommendation) and support realistic but challenging settings such as insufficient data and continuous learning.
Introduction: The Challenge of Patient Covariates
Deep learning models in healthcare often struggle with generalizability. A model trained to detect seizures in one group of patients might fail on a new patient because it has overfit to patient covariates—unique characteristics like a patient’s specific brain wave patterns, the specific hospital bed they were in, or the brand of EEG machine used.
In machine learning terms, this is a Domain Generalization (DG) problem. However, traditional DG methods assume a small number of domains (e.g., data from 5 different hospitals). In reality, every patient is their own "domain." This paper tackles the Many-Domain Generalization challenge, where the number of domains can reach into the thousands, making standard adversarial or meta-learning approaches computationally impractical or ineffective.
The ManyDG Framework
The authors introduce ManyDG, which uses three key steps to disentangle clinical signals from patient-specific noise:
- Feature Extraction: A standard feature extractor $h_\theta(\cdot)$ maps input $x$ to a feature vector $v$.
- Mutual Reconstruction (The Siamese Approach): During training, the model takes two different samples ($x, x'$) from the same patient. It tries to reconstruct the features of the second sample using the "domain factor" ($z$) of the first sample and the "label" ($y'$) of the second. This forces the model to capture what makes that specific patient unique separately from the clinical event.
- Orthogonal Projection: Once the model identifies the patient-specific domain vector ($z$) and the general feature vector ($v$), it uses a non-parametric orthogonal projection. It mathematically "subtracts" the component of the feature vector that is parallel to the domain vector ($v_{||z}$). What remains is a domain-invariant representation ($v_{\perp z}$) used for the final label prediction $g_\xi(\cdot)$.
The model is optimized using a multi-objective loss combining supervised cross-entropy, reconstruction loss, similarity loss (to ensure patient domain consistency), and Maximum Mean Discrepancy (MMD) to align embedding spaces.
Experimental Evaluation
ManyDG was evaluated across four diverse healthcare tasks: IIIC Seizure (2,702 patients), Sleep-EDF (78 subjects), MIMIC-III (drug recommendation), and eICU (readmission risk). ManyDG consistently outperformed strong baselines like SagNet, IRM, and DANN. On the IIIC dataset, which features over 2,700 "domains," ManyDG significantly improved performance metrics, demonstrating its scalability to many-domain problems.
Key Insights
- Scalability: Because the method uses a fixed number of parameters regardless of the number of patients, it scales to massive datasets where previous DG methods would require a linear increase in parameters.
- Robustness to "Small Data": ManyDG is particularly effective when training data is scarce, as it prevents the model from memorizing patient identities instead of learning clinical patterns.
- Continuous Learning: In simulated clinical rollouts, ManyDG adapted more smoothly than other models, which often suffered from domain shifts as new patients arrived.
Conclusion
ManyDG shifts the perspective from "hospital-as-domain" to "patient-as-domain," acknowledging that personalized characteristics are the primary source of spurious correlations in medical AI. By using geometric orthogonality instead of complex adversarial training, it provides a scalable and effective solution for high-stakes healthcare applications.
Summary updated