Deep networks trained on digitized tissue slides can tell which scanner produced an image with 100% balanced accuracy and which hospital sent it with 97.9%, even though a pathologist cannot see either (Hidden Variables in Deep Learning Digital Pathology and Their Potential to Cause Batch Effects: Prediction Model Study). Dataset documentation such as datasheets cannot catch this. A datasheet only records what its authors knew to write down, and most slide archives never recorded scanner or preparation metadata in the first place. We propose to measure these hidden acquisition signatures directly from the data. The tool is robust principal component analysis: a method that splits a data matrix into a low-rank part, which captures patterns shared across many rows, and a sparse part, which captures a few rows or entries that deviate sharply from them.
The idea rests on an asymmetry in slide data. Acquisition effects such as scanner optics, staining protocol, and section thickness touch every patch on a slide and repeat across every slide from a site, so they should be low-rank. Metastases usually occupy a small fraction of the patches in a cohort, so they should be sparse. A decomposition that pulls tumor patches into the sparse part leaves behind a low-rank background, and that background can be examined for directions that vary between slides but not within them. Those directions are candidates for undocumented acquisition factors. The output is a quantitative audit card: how many hidden acquisition factors exist, which slides share them, and how much diagnostic signal is lost or gained when they are removed. We validate it by hiding the known site and scanner labels and checking whether the audit recovers them.
Core Claim
Using only slide identity, which every archive has, a noisy low-rank plus group-sparse decomposition of frozen patch embeddings recovers a subspace of acquisition factors. We make three testable claims about it. First, it predicts withheld site and scanner labels better than the same analysis run on plain principal components or on slide-mean embeddings. Second, the separation holds up as tumor burden varies across slides. Third, projecting the subspace out lowers site leakage without lowering tumor detection.
The closest prior work is CARE: Confounder-Aware Aggregation for Reliable LLM Evaluation. CARE applies sparse-plus-low-rank decomposition to matrices of scores from language-model judges and reads hidden confounders such as verbosity off the factors that fall away from the quality axis. CARE relies on the assumption that true quality is the dominant shared factor, and its authors warn that the method fails when a bias is stronger than the signal. Pathology is the regime where that assumption fails: scanner and site are more learnable than biology. We reverse CARE's logic. Here the dominant shared factor is taken to be the artifact, and the diagnostic signal is modeled as the sparse deviation. This also moves the method from judge-score matrices to continuous image embeddings, a domain CARE does not address. Rank Aggregation via Low-Rank and Structured-Sparse Decomposition uses the same mathematics to aggregate noisy rankers and does not audit datasets at all.
Method
Let $X \in \mathbb{R}^{d \times N}$ stack the $d$-dimensional embeddings of $N$ tissue patches, pooled across all slides, as columns. The embeddings come from a frozen pretrained encoder. We solve
$$\min_{L,S}\; \|L\|_* + \lambda \|S\|_{2,1} + \frac{\mu}{2}\|X - L - S\|_F^2 .$$
Here $\|L\|_*$ is the nuclear norm, the sum of singular values, which encourages $L$ to be low-rank. $\|S\|_{2,1}$ sums the Euclidean norms of the columns of $S$, which drives most patches to have exactly zero sparse part while letting a few deviate as whole vectors. The Frobenius term with weight $\mu$ absorbs small dense noise.
Each of these choices adds to basic principal component pursuit as defined in Robust principal component analysis?. That paper gives the convex relaxation, the ALM solver, and the default weight $\lambda = 1/\sqrt{n}$; it also notes that the exact model $X = L + S$ ignores dense noise, which is why we add the $\mu$ term. The whole-patch sparsity follows the group-sparsity idea from Background Subtraction Using Low Rank and Group Sparsity Constraints, where moving objects form contiguous groups rather than scattered pixels. Per-iteration SVDs become expensive at this scale, a cost that paper also flags. We therefore subsample a fixed number of patches per slide and use randomized truncated SVD.
To read off acquisition factors, we express $L$ in its top singular directions. For each direction we compute the ratio of between-slide variance to total variance of its coefficients. Directions with a high ratio are constant within a slide and vary across slides, which is how an acquisition signature behaves. Tissue morphology varies within a slide and should score low. Clustering slides on their high-ratio coefficients gives the hidden groupings reported on the audit card. We choose the number of factors with a stability criterion across bootstrap resamples of slides. Because practical performance is known to be sensitive to $\lambda$ (Low Rank Plus Sparse Decomposition of Synthetic Aperture Radar Data for Target Imaging), we report every result across a sweep of $\lambda$ around the default rather than tuning $\lambda$ on labels.
Physical stain normalization such as RestainNet: a self-supervised digital re-stainer for stain normalization models only dye absorption. Our decomposition makes no optical assumption, so it can in principle capture non-color signatures. Whether it does is an empirical question the experiments address.
Research Program
The work has three stages. The first is a controlled simulation. We take patches from a single site and inject synthetic slide-level signatures with known rank, including additive color shifts, blur, and changes in feature variance. We also vary the fraction of tumor patches per slide from under 1% up to macro-metastatic slides with large tumor fractions. This maps where the separation breaks down. We expect it to fail when tumor patches in a slide are numerous enough to look low-rank themselves, which violates the incoherence condition that PCP requires.
The second stage is the audit on real multi-center cohorts. We use Camelyon16 and Camelyon17, because Camelyon17 spans multiple clinical centers. We also want the five-institution, two-scanner melanoma cohort from the hidden-variables study if access can be arranged, since it carries scanner, origin, age, and preparation-date labels. All labels are withheld from the audit and used only for scoring.
The third stage is remediation. We project the discovered acquisition subspace out of the embeddings and retrain a standard attention-based multiple-instance classifier, which predicts a slide label from a bag of unlabeled patches.
Baselines
The naive reference point is the raw frozen embedding with no correction. We measure how well site and scanner can be predicted from it with a balanced-accuracy linear probe. The melanoma study's reported figures of 100% for scanner and 97.9% for origin, from a trained ResNet50, set the expected scale of leakage. The slide-level baseline for tumor detection is CLAM on Camelyon16. Attention-based Multiple Instance Learning with Mixed Supervision on the Camelyon16 Dataset reports AUC 0.895 and mean Dice 0.215 for CLAM, rising to AUC 0.924 with 10% tile annotations. That annotated result is the strongest reported number in the file and serves as a supervised ceiling, not a competitor we must beat.
The comparison that decides the audit claim is against the simpler unsupervised alternatives, all run on the same patches, encoder, subsample, and number of retained directions. These are plain PCA with the same between-slide ratio analysis, and clustering of per-slide mean and per-slide median embeddings. We also run RestainNet-style stain normalization before embedding. For RestainNet the file gives F1 and Dice gains on other datasets; no reported result found on Lacuna for RestainNet on Camelyon17 site leakage.
A supervised upper bound projects out the directions of a linear probe trained on the true site labels. It shows how much of the achievable leakage reduction the unsupervised audit captures. The key ablation removes the sparse term, setting $\lambda \to \infty$, which reduces the method to noisy low-rank approximation. This isolates whether pulling tumor patches out of the background is what makes the acquisition subspace clean.
We count the audit as beating the baselines under three conditions. First, the recovered slide groupings have higher adjusted Rand index against true site and scanner labels than PCA and slide-median clustering. Second, the advantage grows with tumor burden. Third, after remediation, site-probe accuracy drops toward chance while slide AUC stays within noise of the uncorrected model or improves.
Why not just…?
Why not just run plain PCA and drop the top components? If scanner effects dominate the spectrum, plain PCA will find them too. The problem is that tumor-rich slides also pull principal directions toward tumor morphology, so dropping those directions can remove diagnostic signal along with the artifact. This is the failure that Robust principal component analysis? attributes to squared-error fitting under gross deviations. The ablation without the sparse term, together with the analysis stratified by tumor burden, tests this directly. If PCA matches our method on slides with little tumor, that is expected. The claim fails if PCA also matches it on tumor-heavy slides.
Why not just center each slide, or cluster robust per-slide medians? This is the most serious alternative. Per-slide centering removes any shift in the mean embedding, and a median resists a minority of tumor patches, so slide-median clustering may recover sites nearly as well as our method. We include both as baselines. Our method has two potential advantages. It can capture signatures that change feature variance rather than the mean, which centering leaves intact, and the simulation injects exactly such signatures. It also estimates a factor count and subspace jointly across slides instead of treating each slide separately. If median clustering matches our method on real data, we will report that the audit reduces to robust pooling, and the remaining contribution would be the interpretable factor count and the tumor-burden stress test.
Why not just fill out a datasheet or follow the reproducibility checklist? Datasheets for datasets describes itself as a tool for identification that depends on metadata the creators have. The checklist from the Camelyon replication study makes sure the known preprocessing steps are written down. The failed reimplementations in that study, where the Lee algorithm's slide accuracy fell from 92% to 54.7%, show the cost of omissions. A checklist cannot report a scanner fingerprint that nobody recorded. We see our audit as producing numbers to fill in a datasheet's composition section, not as a replacement for it.
Why not just apply stain normalization? Stain normalization such as RestainNet corrects dye color. Whether any site signal survives it is measurable: we train the site probe on normalized embeddings. If leakage drops to chance after normalization alone, our method adds little beyond color correction, and we will say so.
Decisive Checks
Two outcomes would falsify the proposal. The first is if the between-slide directions of $L$ recover withheld Camelyon17 centers no better than slide-median clustering at any tumor burden. The second is if removing them reduces slide AUC. In that case the low-rank background carries diagnostic information and the dominance-inversion premise is wrong for this data. A secondary check asks whether the support of $S$, the set of patches it pulls out, overlaps the Camelyon16 tumor masks above the unsupervised baselines. We will compare that overlap against CLAM's reported Dice of 0.215 to judge whether the sparse part is biology or noise.
References
- Hidden Variables in Deep Learning Digital Pathology and Their Potential to Cause Batch Effects: Prediction Model Study
- CARE: Confounder-Aware Aggregation for Reliable LLM Evaluation
- Rank Aggregation via Low-Rank and Structured-Sparse Decomposition
- Robust principal component analysis?
- Background Subtraction Using Low Rank and Group Sparsity Constraints
- Low Rank Plus Sparse Decomposition of Synthetic Aperture Radar Data for Target Imaging
- RestainNet: A self-supervised digital re-stainer for stain normalization
- Reproducibility of deep learning in digital pathology whole slide image analysis
- Attention-based Multiple Instance Learning with Mixed Supervision on the Camelyon16 Dataset
- Datasheets for datasets