Rethinking external validation for the target population: Capturing patient-level similarity with a generative model

Mohammad Azizmalayeri, Ameen Abu-Hanna, Saskia Houterman, Marije M. Vis, Giovanni CinàarXiv 2026

TL;DR

When clinical prediction models fail during external validation, it is often unclear whether the model itself is flawed or if the new patient population is simply too different. This paper introduces a framework that uses generative autoencoders to score patient-level similarity to the training data, allowing researchers to isolate true model deficiencies from population shifts. Crucially, this approach enables robust external validation without requiring institutions to share sensitive raw development data.

What Problem Does This Paper Address?

Before a machine learning model can be safely deployed in a hospital, it undergoes external validation—testing it on a completely new dataset from a different hospital or region. However, interpreting the results is notoriously difficult. If the model performs poorly, is it due to intrinsic flaws (like overfitting), or "case-mix effects" (the new hospital has a vastly different patient demographic)?

Traditional validation relies on a single aggregate metric (like an overall AUC or Brier score), which lumps all external patients together and masks crucial nuances. Existing methods to fix this, like linear propensity score weighting, fail to capture complex, non-linear patient interactions and require researchers to have access to both the development and external datasets simultaneously. This creates massive data-privacy roadblocks in medical research.

Methods

The authors propose a targeted validation framework that stratifies an external dataset into subgroups based on how closely individual patients resemble the original training data.

Instead of traditional linear models, they leverage an unsupervised generative model—specifically, an autoencoder (AE)—trained exclusively on the development data. The autoencoder learns to compress and reconstruct "in-distribution" patient data. When it encounters an unfamiliar patient profile, its reconstruction error spikes. This error serves as a non-linear proxy for patient-level dissimilarity.

The framework guides researchers through two deployment scenarios using a structured decision tree:

  1. Deployment at the development site: Assessing model robustness under potential data drift.
  2. Deployment at an external site: Evaluating transportability to a new target population by splitting patients into "In-Distribution-like" (ID-like) and "Out-of-Distribution" (OOD) subgroups.
Figure 1. Flowchart illustrating the proposed external validation framework. Blue boxes indicate operations, gray boxes highlight key points, diamonds represent decision points, and circles denote final conclusions.

The framework uses the Brier score as its primary performance metric because it is mathematically additive, meaning the overall score can be perfectly broken down into a weighted average of the ID-like and OOD subgroup scores.

Datasets

The authors validated their approach using two distinct datasets:

  • Synthetic Data: A 2D dataset drawn from a multivariate normal distribution, used to visually demonstrate how autoencoders map complex data boundaries better than linear logistic regression.
  • The Netherlands Heart Registration (NHR) TAVI Dataset: A real-world clinical registry containing data from 23,418 patients across 16 centers (2013–2023) undergoing transcatheter aortic valve implantation (TAVI). The study focused on the 5 largest hospitals (10,693 patients) to predict 30-day post-procedural mortality using a leave-one-center-out cross-validation strategy.

Key Insights and Ideas

  • Aggregate Metrics Lie: Conventional external validation can completely mask a model's true utility. A model might show poor overall performance simply because the external dataset contains a large portion of OOD patients, even though it performs flawlessly on patients similar to its training set.
  • Privacy-Preserving Validation: Because the autoencoder only needs to see the development data once, a research team can package and share the trained autoencoder weights alongside their prediction model. External hospitals can then run validation locally without ever needing access to the original, highly sensitive training data.
  • Linear Boundaries Fall Short: Through their simulation study, the authors showed that linear discriminative models (like logistic regression membership models) often draw arbitrary straight lines that erroneously label highly distant points as "similar." Autoencoders capture the true, curved geometry of the data manifold.

Key Results

When applying the framework to the real-world NHR TAVI dataset, the results drastically altered the conclusions you would draw from standard validation:

  • For Hospitals 1, 3, and 4, standard external validation showed a concerning performance gap compared to internal testing. However, when the authors evaluated the model on the matched/ID-like subgroups, the gap disappeared. This proved the model's intrinsic predictive logic was sound; the apparent failure was entirely due to a different patient mix.
  • Conversely, for Hospital 5, the performance gap remained wide even for patients highly similar to the training data. Further analysis revealed that Hospital 5 had a significantly lower baseline mortality rate (2.7% vs 3.4%), indicating a fundamental shift in the underlying outcome mechanism ($p(y|x)$) that warns clinicians the model is truly unsafe to use there without recalibration.

Limitations and Future Work

While promising, the authors note several limitations:

  • Relevance of Matching: If an external dataset has zero overlap with the development distribution, or is an exact mirror image of it, this stratification framework provides little added value.
  • Arbitrary Thresholds: Defining exactly where "ID-like" ends and "OOD" begins relies on choosing a percentile cutoff (e.g., the 90th percentile), which can vary by clinical context.
  • Simple Generative Architecture: This study relied on a basic autoencoder. The authors suggest that future work should explore more advanced generative architectures, such as Variational Autoencoders (VAEs) or Diffusion models, to capture even highly heterogeneous patient populations.

Summary updated

BibTeX
@misc{azizmalayeri2026rethinking,
  author = {Mohammad Azizmalayeri and Ameen Abu-Hanna and Saskia Houterman and Marije M. Vis and Giovanni Cinà},
  title = {{Rethinking external validation for the target population: Capturing patient-level similarity with a generative model}},
  year = {2026},
  eprint = {2605.11284},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.11284},
}
Figure