Diagnosing source-nested label confounding in pooled biological data
Organizations: Information Sciences Institute, University of Southern California, Marina del Rey, California, USA · Creatuor.com, Redondo Beach, California, USA
Abstract
Scientific collections increasingly pool data from independent studies, giving machine learning far more samples than any single study provides. Pooling, however, introduces a hazard. Contributing studies differ in many experimental or observational factors, including genetic background and acquisition protocol, and each typically examines only one or a few conditions, such as a gene mutation, a disease, or a treatment. A model that learns to recognize where a sample came from can then predict what it is without learning the biology. Accuracy and other metrics may suggest strong performance, and the model's errors can masquerade as biological insight. We demonstrate this with deep-learning classifiers trained on thousands of pooled micro-CT scans of mouse skulls. Landmark-based shape analysis shows the same pattern, indicating that the problem is inherent to how the data were collected and combined rather than to any particular method. We call this hazard source-nested label confounding. Changing the model alone cannot resolve it, because where labels are nested within sources, the data cannot show whether a prediction reflects the biology or the source. Instead, we recommend six diagnostic checks as an audit that requires only provenance metadata and model predictions. Together, these checks show when apparent performance reflects a sample's source and how much remains once the source is held fixed. The same nesting of labels within sites, cohorts, or batches can arise in other pooled data, such as radiographs, multi-site neuroimaging, and genomics. Beyond diagnosis, we encourage curators of pooled collections to publish provenance summary tables alongside their data, making source-label overlap visible before further analysis.
Figures & tables
| Diagnostic | Question; permits | Cannot establish | Result here (test set) | |
|---|---|---|---|---|
| 1 | Label–source nesting. Cross-tabulation of label by source and other recorded provenance (e.g., strain or ancestry, sex, age, scanner), showing how far each label is confined to one source and how well source predicts it. | Can the label be predicted from the sample’s source alone? Permits identifying the finest level (source, or finer strata of recorded provenance) at which claims must be evaluated. | Whether the model uses the nesting; which type of provenance (acquisition, study design, or biological background) underlies it. | Gene label: H(Study Label) = 0; H(Label Study) = 1.21 of 3.86 bits; 6 of 16 labels alone in their study; zygosity and sex confounded with the label in one Enhancer stratum. Control versus mutant: H(Group Study) = 0.41 of 1.00 bits. |
| 2 | Provenance-only baseline. Performance of a classifier given only recorded provenance, and of a majority-class baseline within each provenance group. | How much of the classifier’s score can recorded provenance alone reach? Permits setting the reference against which pooled accuracy is read. | How much of the model’s accuracy provenance causes; in a pooled split, provenance and phenotype predict the same labels, so their contributions cannot be separated. | Study-only classifier 0.874 for control versus mutant (CNN 0.872); six-field metadata-only classifier 0.720 for gene label (CNN 0.848); majority-class baseline 0.712 within study and strain. |
| 3 | Within-source evaluation. Performance within each source (and finer strata of recorded provenance) and on sources holding more than one label, against majority-class, provenance-only, and conventional baselines. | Does discrimination survive when samples are compared only with recorded provenance held fixed? Permits an estimate of the discrimination that recorded provenance does not explain. | Whether surviving discrimination reflects the target phenotype, remaining background or design differences, or acquisition differences. | Control versus mutant: specificity on within-study controls 0.32; AUC on the within-study subset (nine studies pooled) 0.73 vs 0.61 for cranial landmarks, and 0.59–0.85 within the three studies with more than five test controls. Gene label: accuracy within study and strain 0.50–0.85 vs majority-class baseline 0.48–0.54. |
| 4 | Own-source concentration. Probability assigned to labels from the sample’s own source, and the share of errors that cross sources, before and after calibration. | Do mistakes stay within the sample’s own source? Permits identifying cross-source errors, where provenance and target-phenotype explanations differ. | That the model recognizes the source; a classifier that identifies the target phenotype would also stay within its source. | Own-study probability 0.988 (0.891 calibrated); 2 of 20 errors cross studies; accuracy is unchanged when predictions are restricted to the true study’s labels. |
| 5 | Error-pattern check. Comparison of where the errors fall with the labels available in each sample’s own source, a grouping that study design fixes independently of the predictions. | Does the pattern of mistakes (e.g., within gene families or disease subtypes) add evidence beyond recorded provenance? Permits retaining or dropping the pattern as incremental evidence. | Whether errors within a source reflect morphology or provenance. | 18 of 20 errors fall on the 8 label pairs (of 120) that share a study and strain, against 2.2 expected at random; the contributing studies document biological relationships for two of the four groups. |
| 6 | Cross-partition consistency. Per-class asymmetries compared between test and validation, interpreted only where they agree. | Does a per-class pattern hold in both test and validation? Permits declining to interpret asymmetries that fail. | That the pattern would replicate in independent data, because test and validation come from the same sources. | The Spry4 absorption and the Hdac9 Twist1 bias reverse between test and validation; Isl1 and Msx1 are exchanged at chance in both. |
| Reagent or resource | Source | Identifier |
|---|---|---|
| Deposited data | ||
| MusMorph adult mouse skull micro-CT volumes, sparse and dense landmarks, and specimen metadata (MusMorph project) | Devine et al.; 4 Hallgrímsson et al. 34 | FACEBASE:3-HXMC |
| MusMorph project-wide specimen and study metadata ( MusMorph_Metadata.csv , Study_Metadata.csv ) | Hallgrímsson et al. 28 | FACEBASE:6-2EPY |
| MusMorph B9d dataset | Hallgrímsson et al. 10 | FACEBASE:3-JQMM |
| MusMorph Bmp dataset | Hallgrímsson et al. 11 | FACEBASE:3-KB46 |
| MusMorph Brachymorph dataset | Hallgrímsson et al. 12 | FACEBASE:3-KB1W |