Cross-Population Transfer Learning for Antidepressant Treatment Response Prediction: A SHAP-Based Explainability Approach Using Synthetic Multi-Ethnic Data ()
1. Introduction
The effectiveness of antidepressant treatment is highly variable, with substantial inter-individual differences in therapeutic response and side-effect profiles [1]-[7]. These differences are driven by a complex interplay of genetic predispositions, demographic characteristics, environmental influences, and clinical histories. Pharmacogenomic studies have shown that population-specific genetic variants particularly in genes related to drug metabolism, such as CYP2D6 can significantly alter pharmacokinetics and pharmacodynamics, influencing both efficacy and tolerability [8]-[11]. Similarly, cultural, dietary, and healthcare access differences further modulate treatment outcomes across global populations. Despite these complexities, most of the machine learning (ML) models for antidepressant response prediction have been developed using single-population, often homogeneous, datasets. Such models tend to capture patterns specific to the source population, resulting in limited external validity when applied to cohorts with different genetic backgrounds, environmental exposures, or clinical practices. This gap is especially problematic in psychiatry, where treatment personalization is essential for reducing the trial-and-error process that prolongs patient suffering [12]-[14].
Transfer learning (TL) has emerged as a powerful paradigm for addressing domain shift in ML [15]-[18]. By leveraging learned representations from a well-resourced source domain and adapting them to a target domain with limited labeled data, TL offers a practical solution for extending predictive performance across diverse populations [19]-[21]. However, improving predictive accuracy alone is insufficient for clinical adoption; transparency and interpretability remain equally critical. Recent advances in explainable AI (XAI) notably SHapley Additive exPlanations (SHAP) enable model-agnostic, consistent quantification of feature contributions [22] [23]. SHAP can uncover both globally important predictors and case-specific factors driving individual predictions, facilitating clinician trust and aiding in hypothesis generation for biological and clinical research [24] [25].
In this study, we:
1) Develop a baseline neural network model trained exclusively on a European cohort.
2) Evaluate its zero-shot generalization to East Asian, African, and Latin American populations.
3) Apply transfer learning to improve target-domain performance.
4) Use SHAP to identify and compare key predictive features across populations, highlighting population-specific and shared determinants of treatment response.
2. Methods
2.1. Data Generation and Cohort Design
We constructed a synthetic, multi-ethnic antidepressant trial with four cohorts-European, East Asian, African, and Latin American-to isolate methodological questions from data-availability constraints while preserving clinically plausible relationships. Population-specific allele frequencies for SNP1, SNP2, and CYP2D6 poor-metabolizer status were chosen to approximate published pharmacogenomic distributions reported in global cohorts. European and African populations were simulated with higher CYP2D6 variability, while East Asian cohorts exhibited lower poor-metabolizer prevalence, consistent with prior large-scale studies. Coefficient magnitudes were selected to reflect moderate pharmacogenetic effects rather than deterministic outcomes, ensuring overlap between responder and non-responder distributions. For each population we generated 200 individuals (total N = 800) with the following variables:
Demographics: age (18 - 80 y, normally distributed; mean ≈ 45, SD ≈ 15), gender (binary; 1 = female, 0 = male; p (female) ≈ 0.60), body-mass index (BMI; mean ≈ 26, SD ≈ 5).
Clinical: baseline Hamilton Depression Rating Scale (HAMD) score (range 17 - 30; mean ≈ 24, SD ≈ 3).
Genetics/PK: two biallelic markers (SNP1, SNP2; coded 0 - 2), and CYP2D6 poor-metabolizer status (binary), with population-specific frequencies reflecting reported literature patterns.
Response probabilities were generated via population-specific logistic models:
with coefficients (European: −1.50, 0.03, −0.50, 0.02, −0.10, 0.50, −0.30, 0.80; East Asian: −2.00, 0.02, −0.30, 0.01, −0.08, 0.30, −0.20, 0.60; African: −1.20, 0.04, −0.60, 0.03, −0.12, 0.60, −0.40, 0.70; Latin American: −1.80, 0.025, −0.40, 0.015, −0.09, 0.40, −0.25, 0.65). We multiplied p by mild uniform noise (0.9 - 1.1) and clipped to [0, 1] to introduce unmodeled variation. To avoid degenerate single class splits we used Bernoulli sampling and, if needed, a small smoothing toward 0.5. Figure 1 (see placeholder below) summarizes simulated age, BMI, HAMD, allele/metabolizer frequencies, and observed response rates by population.
Figure 1. Population characteristics and response rates across European, East Asian, African, and Latin American cohorts.
2.2. Preprocessing
For the European source domain, continuous features were standardized using StandardScaler fit on the European training split only, then applied to its validation and test splits. For target domains, we evaluated 1) zero-shot transfer by transforming target features with the European scaler, and 2) domain-aware fine-tuning by fitting a new scaler on the target training subset only and applying it to that target’s validation/test. Categorical/binary variables (gender, CYP2D6) were left as 0/1; SNP dosages were kept as 0 - 2 counts.
2.3. Model Architecture
We implemented a feedforward neural network in TensorFlow/Keras:
Input: 7 features (age, gender, BMI, HAMD, SNP1, SNP2, CYP2D6).
Hidden block 1: Dense (64, ReLU) + Batch Normalization + Dropout (0.30).
Hidden block 2: Dense (32, ReLU) + Batch Normalization + Dropout (0.20).
Output: Dense (1, sigmoid).
Regularization: L2 (0.01) on dense layers.
Optimization: Adam (learning rate 1e−3), binary cross-entropy loss, metrics = accuracy and AUC.
Training control: Early Stopping on validation AUC (patience = 10, restore best weights).
A shallow two-layer neural network was selected to balance expressiveness and overfitting risk given the limited cohort size (n = 200 per population). This architecture allows the model to capture non-linear interactions between clinical and pharmacogenomic features (e.g., age × CYP2D6 status) that cannot be represented by linear models alone. In preliminary experiments (not shown), logistic regression achieved comparable AUROC in the European cohort but exhibited reduced robustness under cross-population transfer, motivating the use of a lightweight neural architecture.
2.4. Training Protocol
Base model (source): trained on the European cohort using an 80/20 train/test split; within the training set, 20% served as validation for early stopping [26] [27].
Transfer learning (targets): for each non-European population we cloned the base network, froze lower layers (all but the final block), replaced the head with Dense (16, ReLU) → Dense (1, sigmoid), and fine-tuned with Adam(1e−4) on a small, labelled subset (n = 200; 20% of that population) with 20% internal validation. Fine-tuning was performed using 20% of each target cohort (n = 40 per population), with an internal 20% validation split, while the remaining 80% formed a held-out target test set. This emulates realistic low-data adaptation. The remaining 80% formed a held-out target test set. To mitigate overfitting during fine-tuning on small target datasets, lower layers were frozen, learning rates reduced (1e−4), and early stopping applied. Despite these measures, AUROC occasionally decreased after adaptation, indicating residual overfitting risk. We report both zero-shot (no adaptation) and fine-tuned performance.
2.5. Evaluation
Primary discrimination was assessed by Area Under the Receiver Operating Characteristic (AUROC). We also report accuracy at a 0.5 threshold for descriptive context. To quantify uncertainty and robustness, we performed nonparametric bootstrapping (100 resamples with replacement) of each population’s evaluation set; AUROC was recomputed per resample, skipping resamples with single-class labels, and 95% percentile CIs were derived from the bootstrap distribution. Confusion matrices are shown for the European test set to illustrate operating characteristics at the default threshold.
2.6. Explainability
We used SHAP Kernel Explainer (model-agnostic) to characterize feature contributions:
Background set: a random subset of 100 standardized European training samples.
Sampling: 200 SHAP samples per explanation for computational stability.
Global importance: summary plots of mean |SHAP| values across 100 held-out instances, ranking features by overall impact.
Local explanations: force plots for representative predictions, illustrating direction and magnitude of each feature’s contribution relative to the expected model output.
3. Results
3.1. Baseline model Performance on the European Cohort
The baseline neural network, trained exclusively on the European cohort (80% train/20% test split), achieved AUROC = 0.651 and accuracy = 0.865 on the held-out European test set. The training curves (Figure 2) show rapid convergence of accuracy and steady decline in loss within the first 15 epochs, after which both metrics stabilized, indicating no signs of overfitting under early stopping.
The confusion matrix for the European test set (Figure 3) demonstrates balanced classification performance, with relatively low misclassification rates in both responder and non-responder classes. Notably, the true positive rate exceeded the true negative rate, suggesting a slight bias toward predicting treatment response.
Figure 2. Model training history for the European cohort: accuracy and loss over epochs.
3.2. Cross-Population Generalization
When the base model was applied zero-shot to other populations without retraining, performance varied substantially. The model generalized well to the African cohort (AUROC = 0.714), moderately to the Latin American cohort (AUROC = 0.658), but poorly to the East Asian cohort (AUROC = 0.501), which was near random chance. Bootstrap-based pairwise comparisons of AUROCs revealed statistically significant performance gaps between the European cohort and the East Asian cohort (ΔAUROC ≈ 0.15, p < 0.05), while differences between European and African cohorts were not statistically significant. Fine-tuning did not yield consistent statistically significant improvements across populations, supporting the conclusion that naïve adaptation alone is insufficient under strong domain shift.
Figure 3. Confusion matrix showing classification outcomes for the European test set.
Applying transfer learning with limited target-domain data improved performance in some cases, but gains were inconsistent. The African cohort saw a slight decrease in AUROC after fine-tuning, suggesting potential overfitting to the small fine-tuning subset. Performance for East Asian and Latin American cohorts improved marginally but remained below European levels. Figure 4 visually compares base model versus transfer model AUROC across all four populations, with annotated sample sizes per target domain.
3.3. Explainability Insights from SHAP
Global interpretability via SHAP Kernel Explainer revealed that gender and age were the two most influential predictors across the European training set (Figure 5). Genetic variables, particularly SNP1 allele count and CYP2D6 poor metabolizer status, also had strong directional associations with predicted treatment response probabilities [28] [29]. Local interpretability (Figure 6) provided a force plot for a representative patient, illustrating how individual features contributed positively or negatively toward predicting treatment response. For example, in this instance, female gender and the presence of a CYP2D6 poor-metabolizer genotype increased the predicted probability of response, while higher baseline HAMD score reduced it.
Figure 4. Comparison of AUROC for base and transfer models across European, East Asian, African, and Latin American cohorts.
Figure 5. Global SHAP feature importance for the base model trained on European data.
Figure 6. Local SHAP force plot showing feature contributions for an individual prediction.
3.4. Model Robustness Analysis
To evaluate stability of performance estimates, bootstrap resampling (n = 100 iterations) was performed for each population. In the European cohort, the mean AUROC was 0.656 with a 95% confidence interval [0.552, 0.746], indicating stable performance. The African cohort showed similar stability, whereas East Asian and Latin American cohorts exhibited wider confidence intervals, reflecting higher variability and reduced reliability of predictions in these populations. Figure 7 depicts AUROC means with 95% CI error bars for each population, highlighting the gap in model robustness between European/African versus East Asian/Latin American cohorts.
Figure 7. Bootstrap-derived AUROC means and 95% confidence intervals for each population.
4. Discussion
4.1. Principal Findings and Interpretation
This study shows that a neural network trained on a European cohort does not generalize uniformly across populations. Zero-shot performance was moderate–good in African (AUROC 0.714) and Latin American (0.658) cohorts but near-chance in East Asian (0.501), while internal European test performance was AUROC 0.651 (Section 3.1). The apparent discrepancy between European AUROC values (0.651 vs 0.746) reflects evaluation on different data subsets. Specifically, AUROC = 0.651 corresponds to the held-out European test split used for internal validation of the base model, whereas AUROC = 0.746 represents performance aggregated over the full European cohort in the cross-population evaluation setting. These values are therefore not contradictory but reflect distinct evaluation protocols. Together, these results highlight domain shift: the conditional distribution of features and outcomes differs by population enough to degrade out-of-domain accuracy.
Fine-tuning with limited target data did not reliably improve AUROC (e.g., African: 0.714 → 0.612; Latin American: 0.658 → 0.459). Two mechanisms likely contributed: 1) small adaptation sets (n ≈ 200 per population, with only a fraction used for training/validation), which increases overfitting risk; and 2) mismatch in calibration after re-scaling features per target domain, altering the learned decision boundary. These findings underscore that naïve transfer learning may underperform when the target sample is small and covariate shift is large.
4.2. What the Model Learned (and didn’t)
SHAP analyses consistently ranked gender, age, and baseline HAMD among the most influential predictors (Figure 5, Figure 6), with CYP2D6 and SNP1 contributing to population-dependent ways. This aligns with the simulation priors and suggests the network captured clinically plausible structure. However, SHAP explanations are associational, not causal; correlated features can share or exchange attribution, and Kernel Explainer introduces Monte-Carlo variance. Thus, SHAP should be used to audit model behaviour and generate hypotheses, not to infer mechanistic biology.
4.3. Clinical and Translational Implications
1) Population-specific adaptation is necessary [30]-[32]. Before deployment beyond the source cohort, models should undergo site/population-level fine-tuning and recalibration (e.g., Platt scaling or isotonic regression) using local data.
2) Explainability aids safe adoption. SHAP can surface feature relevance shifts across populations, helping clinicians and governance bodies detect potential bias and decide when to retrain or restrict use [33]-[35].
3) Guardrails at the point of care. Given AUROC dispersion (Figure 7), thresholds should be population-specific, with calibration curves and decision-curve analysis to quantify net benefit before clinical use.
4.4. Methodological Lessons
When small target data harms: Our fine-tuning likely overfit. Remedies include early stopping on AUC with nested validation, stronger regularization, and freezing more layers. Even better, use parameter-efficient adaptation (e.g., adapters/LoRA) to reduce trainable degrees of freedom.
Beyond naïve TL: Consider domain adaptation approaches that match representations across groups (e.g., DANN adversarial training, CORAL/MMD alignment, Group DRO), or mixture-of-experts with a gating network conditioned on population features.
Shift-aware training objectives: Invariant Risk Minimization (IRM) or risk-extrapolation techniques can encourage predictors that generalize across environments.
Calibration and fairness: Evaluate calibration error and subgroup fairness (e.g., TPR/FPR gaps) by population and by clinically meaningful subgroups (age, sex). Where needed, apply post-hoc calibration and constraint-based training.
4.5. Limitations
Synthetic data: While it enables controlled experiments, it cannot capture the full complexity of real-world pharmacotherapy (polypharmacy, comorbidity, adherence, measurement bias). Associations reflect simulation priors, not causal pharmacogenomics.
Limited targets and features: Only seven features were modeled; real EHR/biobank settings include comorbidity burden, socioeconomic factors, clinician behavior, dosing, and longitudinal trajectories.
Evaluation scope: We focused on AUROC. Clinical translation also needs PPV/NPV at operational thresholds, calibration, decision-curve net benefit, and utility-weighted outcomes.
4.6. Future Work
1) Real-world validation across multi-ethnic datasets, with prospective evaluation and pre-registered analysis plans.
2) Richer modalities (medication dose/timing, side effects, longitudinal HAMD/PHQ-9, polygenic risk), and time-aware models (RNN/Transformer, survival).
3) Robust domain generalization (DANN/Group-DRO/IRM) and meta-learning to learn how to adapt with very few target samples.
4) Federated and privacy-preserving learning to leverage multi-site diversity without centralizing data.
5) Clinical impact studies: threshold selection, calibration drift monitoring, and human-AI teaming workflows using SHAP to support shared decision-making.
4.7. Bottom Line
Cross-population antidepressant response prediction is feasible but fragile. Performance depends on how far the target domain departs from the source, how much target data is available for adaptation, and how well the model is calibrated locally [36]-[41]. Explainability provides crucial visibility into what the model is using and how that changes by population, supporting safer, more equitable deployment provided models are adapted, calibrated, and continuously audited in their intended settings [42]-[45].
5. Conclusion
This study demonstrates that transfer learning, coupled with model-agnostic explainability tools such as SHAP, can serve as a promising framework for adapting antidepressant treatment response prediction models across diverse populations. By leveraging a European-trained neural network and evaluating both zero-shot and fine-tuned performance on synthetic East Asian, African, and Latin American cohorts, we observed that cross-population generalization is achievable but inherently uneven. While performance remained relatively strong in the African cohort, significant degradation occurred in East Asian and Latin American populations, underscoring the necessity of population-specific adaptation before clinical deployment. The integration of SHAP provided valuable transparency, enabling the identification of both shared and population-specific predictive features, including demographic variables such as gender and age, as well as pharmaco-genetically relevant markers like CYP2D6 metabolizer status and SNP1 allele frequency. Such insights are essential not only for auditing model fairness but also for guiding targeted model refinements that reflect population-specific biology and treatment contexts [46]-[51]. From a translational perspective, these findings emphasize that predictive performance alone is insufficient for trustworthy clinical AI; models must also be interpretable, robust, and context aware [52]-[56]. The use of synthetic data in this work allowed for controlled hypothesis testing, but real-world validation will be required to confirm the observed trends. Future research should extend this framework to multi-drug treatment scenarios, longitudinal outcome prediction, and real-world EHR or biobank data, ideally within federated or privacy-preserving infrastructures. Such approaches will be essential to ensure that antidepressant response models are both clinically reliable and equitably performant across the populations they aim to serve.