NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Leakage-Free Is Not Confounder-Free: What a Patient-Level Split Cannot Certify About a Medical Imaging Benchmark

Ignazio Gallo, Mattia Gatti, Leonardo Sgroi, Darwin Castillo, Yuliana Jiménez-Gaona, Nicola Landro

TL;DR

Even if you follow the "gold standard" of splitting your medical data by patient to avoid leakage, your AI might still be cheating. This paper demonstrates that in a popular breast cancer imaging benchmark, the date the photo was taken predicts malignancy better than the images themselves, simply because benign and malignant cases were collected in different years.

What Problem Does This Paper Address?

In medical machine learning, we are terrified of "data leakage"—the cardinal sin where images from the same patient end up in both your training and testing sets. To fix this, researchers use "patient-level splits." If Patient A is in the training set, none of their images are allowed in the test set. Problem solved, right?

Not quite. The authors argue that a patient-level split is a necessary safeguard, but it’s not a magic shield against confounders. A confounder is a variable—like the time of day, the specific camera used, or the hospital site—that correlates with the diagnosis across the entire dataset. If all your cancer patients were photographed in 2015 and all your healthy patients in 2012, every single "fold" of your cross-validation will inherit that same bias. Your model might just learn to read the calendar instead of the pathology.

Methods

The authors propose a five-question audit to determine if a model is relying on a shortcut rather than medical reality:

  1. Strength: How well does the candidate confounder (e.g., the date) predict the diagnosis on its own?
  2. Legibility: Can the confounder be "decoded" directly from the pixels? (i.e., does the image "look" like it was taken in 2012?)
  3. Exploitation: Do the model’s diagnostic scores actually fluctuate based on this confounder?
  4. Incremental Value: Does the image provide any extra predictive power once you already know the confounder?
  5. Controlled Discrimination: What happens to the model's accuracy when you only compare patients with the same "confounder value" (e.g., same acquisition date)?

Datasets

  • DMR-IR: The primary public benchmark for breast thermography (infrared imaging). It contains 236 patients.
  • Rodriguez-Guerrero et al. Dataset: A second, independent cohort used as a control. Here, the dominant confounder wasn't the date, but patient age (malignant patients were, on average, 12 years older).

Key Insights and Ideas

  • The Calendar is King: In the DMR-IR dataset, the acquisition date alone achieved an AUROC of 0.980. The best imaging model only managed 0.949. In other words, knowing when a patient walked into the clinic was more informative than looking at their actual scan.
  • Legibility $\neq$ Exploitation: This is a crucial "aha" moment. The authors found that while the acquisition year was easily "legible" in the pixels (likely due to subtle changes in room temperature or camera calibration over the years), not every model actually used that information to make a diagnosis. Only models that pooled many frames from a single visit tended to "exploit" the shortcut.
  • The "Global Offset" Shortcut: In thermography, the shortcut was literally the background temperature. By looking at pixels outside the breast area, a simple decoder could tell which year the image was from with high accuracy.
  • The Support Problem: The reason we can't just "fix" this dataset is a lack of "cross-label support." In DMR-IR, there are only eight pairs of patients (one benign, one malignant) who were scanned on the same day. You can't train a model to ignore the date if the date and the diagnosis are almost perfectly aligned.
Figure 1: Leakage-free is not confounder-free. (a) The 236 DMR-IR patients (140 benign, 96 malignant) by quarter of acquisition, benign above the axis and malignant below. The shaded window, from the first malignant to the last benign acquisition, is the only period both classes occupy (60 patients), and 83 of the 86 acquisition-date groups contain a single class. A patient-level split partitions these patients; no partition of them changes when they were photographed, so every fold inherits the same alignment of calendar and diagnosis. (b) The audit’s five questions (§3) and this benchmark’s answers on one AUROC axis, chance at 0.5. Dark markers are the acquisition date and green markers the thermogram; a filled marker is the answer with its 95% interval, a hollow marker the reference it is read against. Q1: the date alone (the fitted arm of Table 1; scored raw it reads 0.981, the statistic §4.4 uses) against the best imaging arm. Q2: the acquisition year decoded from the pixels among benign patients. Q3: the year carried by a diagnostic score among benign patients, for the one arm of nine that carries it (grey ticks: the other eight). Q4: the date plus the best imaging arm against the date alone, ∆= +0.003 [−0.008, +0.015]. Q5: the frontal probe on the date-overlap cohort against the full cohort. Each number is read from the experiment that produced it.

Key Results

  • Performance Collapse: When the authors restricted the evaluation to the "overlap window" (the brief period where both benign and malignant patients were recruited), the imaging model's performance plummeted from an AUROC of 0.833 to 0.544—barely better than a coin flip.
  • Age as a Confounder: In the second dataset, age was the "shortcut." While age is a legitimate clinical risk factor, the imaging models added zero incremental value over age alone. Once age was controlled for, the models couldn't distinguish between classes.
Figure 5: This visualization shows the "support" problem. In the actual data (a), benign and malignant cases rarely happen on the same day. If they were independent (b), we'd see much more overlap, allowing for a fair test.

Limitations and Future Work

The authors acknowledge that their cohorts are relatively small (96 and 35 malignant events). Because of this, they can't definitively say that thermography has no signal—only that this specific benchmark is too confounded to prove that a signal exists.

The takeaway for the rest of us? "Leakage-free" is the floor, not the ceiling. Future benchmarks need to ensure that recruitment is "interleaved"—meaning both healthy and sick patients are scanned at the same sites, on the same machines, during the same time periods. Without that, no amount of clever data splitting can certify that an AI has actually learned medicine.

Summary updated

BibTeX
@misc{gallo2026leakage,
  author = {Ignazio Gallo and Mattia Gatti and Leonardo Sgroi and Darwin Castillo and Yuliana Jiménez-Gaona and Nicola Landro},
  title = {{Leakage-Free Is Not Confounder-Free: What a Patient-Level Split Cannot Certify About a Medical Imaging Benchmark}},
  year = {2026},
  eprint = {2611.27585},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27585},
}
Figure