arXiv:2611.07127cs.LGNov 2026

Manuscript Offprint

arXiv:2611.07127

Scalable Bayesian Gaussian Process Classification for Cancer Histopathology: Calibrated Uncertainty Under Distribution Shift

Yunru Zheng, Wun Ting Chan, Sampras Dsouza, Zhenyu Hong

Abstract

Reliable uncertainty quantification is essential for clinical deployment of cancer diagnosis models, yet neural networks and variational Gaussian process methods can produce overconfident predictions, particularly under the distribution shifts that arise when models trained at one hospital are applied at another. We present a scalable Bayesian Gaussian Process Classification (GPC) framework that operates on frozen pathology foundation model embeddings (Phikon) and combines accelerated Randomly Pivoted Cholesky (RPCholesky) for low-rank kernel factorization, Hamiltonian Monte Carlo (HMC) with non-centered parameterization for posterior sampling, and a pivots-as-inducing-points scheme for prediction. This makes HMC posterior sampling in the low-rank latent representation tractable at N≈300,000N \approx 300,000 training points, enabling HC-based low-rank GPC on substantially larger datasets than prior MCMC-based demonstrations. We evaluate on two histopathology benchmarks for breast cancer metastasis detection: PCam and CAMELYON17-WILDS, where the latter tests calibration under hospital-level distribution shift. Compared to stochastic variational GP and neural network baselines, our method improves calibration and predictive performance — reducing expected calibration error by up to 88% and false negative rate by up to 90% — with the largest gains appearing under distribution shift, suggesting that HMC-based posterior sampling provides more trustworthy uncertainty estimates for cross-site pathology classification.

1 Introduction

Neural networks have been widely used for cancer diagnosis from histopathology images. Despite their high accuracy, neural networks can produce overconfident predictions[Guo et al., 2017], which is a serious limitation in clinical environments where uncertainty quantification is critical. For cancer histopathology, false negatives can be life threatening and delay treatment, whereas false positives can cause patient distress and unnecessary medical expenses. This problem is further compounded when models trained at one hospital are deployed at another, where differences in tissue preparation, staining protocols, and scanner hardware introduce distribution shifts that can silently degrade both accuracy and calibration in neural networks. As pathology foundation models like Phikon are increasingly adopted across institutions [Filiot et al., 2023], the need for uncertainty-aware downstream classifiers that remain calibrated across hospital sites becomes critical for safe deployment.

In contrast, Gaussian Process Classification (GPC) provides principled uncertainty estimates. Unfortunately, the posterior has no closed form since the Bernoulli likelihood is non-conjugate with the Gaussian prior. Historically, approximate inference methods like stochastic variational Gaussian process (SVGP) have dominated GPC instead of direct sampling methods like MCMC [Nickisch and Rasmussen, 2008] due to their much lower cost. In this paper, we show that with a new kernel

Preprint.

factorization method called accelerated randomly pivoted Cholesky (RPCholesky) [Epperly et al., 2025], we could use HMC, a type of Markov Chain Monte Carlo (MCMC) method to sample the posterior of GPC, which outperforms the SVGP and neural-network baselines on calibration and predictive metrics.

Contributions. We make the following contributions: (1) We propose a scalable Bayesian GPC that combines accelerated RPCholesky [Epperly et al., 2025] with HMC under non-centered parameterization, making MCMC-based GPC tractable at N≈300,000N \approx 300,000 training points; (2) We introduce a pivots-as-inducing-points predictive scheme based on previous literature (Quiñonero-Candela and Rasmussen [2005], Williams and Seeger [2001]) that aligns the predictive inducing set with the RPCholesky training approximation; and (3) We demonstrate through cross-hospital evaluation on CAMELYON17-WILDS that HMC-based posterior sampling achieves substantially better calibration than SVGP and neural baselines on the held-out CAMELYON17-WILDS hospital, reducing ECE by up to 88% and false negatives by up to 90%.

References (23)