Scalable Bayesian Inference for the Inverse Temperature of a Hidden\n Potts Model

Matthew T. Moores, Geoff K. Nicholls, A. N. Pettitt, Kerrie Mengersen · DOI

Abstract The inverse temperature parameter of the Potts model governs the strength of spatial cohesion and therefore has a major influence over the resulting model fit. A difficulty arises from the dependence of an intractable normalising constant on the value of this parameter and thus there is no closed-form solution for sampling from the posterior distribution directly. There are a variety of computational approaches for sampling from the posterior without evaluating the normalising constant, including the exchange algorithm and approximate Bayesian computation (ABC). A serious drawback of these algorithms is that they do not scale well for models with a large state space, such as images with a million or more pixels. We introduce a parametric surrogate model, which approximates the score function using an integral curve. Our surrogate model incorporates known properties of the likelihood, such as heteroskedasticity and critical temperature. We demonstrate this method using synthetic data as well as remotely-sensed imagery from the Landsat-8 satellite. We achieve up to a hundredfold improvement in the elapsed runtime, compared to the exchange algorithm or ABC. An open source implementation of our algorithm is available in the R package "bayesImageS."

Introduction

In spatial statistics and image processing, Markov Random Fields (MRFs) like the Potts model are essential for ensuring spatial consistency. By assuming that neighboring pixels are likely to share the same label (e.g., "forest" or "urban"), these models provide a robust framework for image segmentation. The strength of this spatial "stickiness" is controlled by the inverse temperature parameter, $\beta$. However, estimating $\beta$ accurately remains a significant computational challenge.

The Scalability Bottleneck

The primary obstacle in Bayesian inference for the Potts model is the intractable normalizing constant (or partition function). Calculating this constant for an image with $n$ pixels and $k$ labels requires summing over $k^n$ possible configurations—a task that is computationally impossible for even small images.

Existing "likelihood-free" methods, such as the Exchange Algorithm or Approximate Bayesian Computation (ABC), circumvent this by simulating a new image at every step of the estimation process. While theoretically sound, these methods do not scale to the megapixel resolutions common in modern satellite and medical imaging. As shown in the table below, the number of pixels increases dramatically across different applications, making traditional simulation-based methods agonizingly slow.

Comparison of pixel counts and equivalent physical areas for various imaging modalities.

The PFAB Algorithm

To address these limitations, the authors introduce the PFAB (Parametric Functional Approximate Bayesian) algorithm. The core innovation is the use of a "physics-informed" surrogate model to approximate the model's behavior. Instead of simulating data "on the fly," PFAB employs a pre-computation step to build a surrogate for the score function (the derivative of the log-likelihood).

Key features of the PFAB approach include:

  1. Physics-Informed Surrogate: Unlike generic black-box models, the surrogate uses a parametric form (based on skew-Laplace or skew-Gaussian distributions) that respects the known physical properties of the Potts model.
  2. Phase Transition Awareness: The Potts model undergoes a phase transition at a critical temperature ($\beta_{crit}$). PFAB explicitly accounts for this transition, where standard approximation methods often fail.
  3. Integral Curve Approximation: By fitting a curve to the variance of the model's sufficient statistic and integrating it, the algorithm achieves a highly accurate approximation of the expected value.
  4. Parallelization: The pre-computation phase is "embarrassingly parallel," allowing it to be efficiently offloaded to multi-core processors or GPUs.

Application to Landsat-8 Imagery

The authors validated PFAB using both synthetic data and real-world multispectral imagery. A primary test case involved a 1-megapixel image of Brisbane, Australia, captured by the Landsat-8 satellite. The goal was to classify land use based on the Normalized Difference Vegetation Index (NDVI).

Spatial NDVI distribution and frequency histogram for the Brisbane Landsat-8 dataset.

Key Results and Insights

PFAB demonstrates a massive leap in computational efficiency without sacrificing accuracy:

  • 100x Speedup: For the 1-megapixel Brisbane dataset, PFAB completed inference in approximately 1.6 hours. In contrast, the standard Exchange Algorithm would have required roughly 19 hours for a comparable number of iterations.
  • Efficiency Gains: The Effective Sample Size (ESS) per hour—a metric for the amount of useful information generated—was 598 for PFAB, compared to just 1.88 for the Exchange Algorithm.
  • Robustness: Using Simulation-Based Calibration (SBC), the authors proved that PFAB faithfully represents the true posterior distribution. Other recent methods, such as nsBIL, showed significant bias in comparison.

Conclusion

PFAB offers a scalable path forward for Bayesian analysis of large-scale spatial models. By leveraging the known physical properties of the Potts model through a parametric surrogate, it circumvents the traditional bottlenecks of intractable likelihoods. While the current implementation requires a new surrogate for each unique image dimension, the significant speedup enables the analysis of megapixel-scale data that was previously untouchable. The algorithm is available as an open-source R package, bayesImageS.

Summary updated

Abstract

The inverse temperature parameter of the Potts model governs the strength of\nspatial cohesion and therefore has a major influence over the resulting model\nfit. A difficulty arises from the dependence of an intractable normalising\nconstant on the value of this parameter and thus there is no closed-form\nsolution for sampling from the posterior distribution directly. There are a\nvariety of computational approaches for sampling from the posterior without\nevaluating the normalising constant, including the exchange algorithm and\napproximate Bayesian computation (ABC). A serious drawback of these algorithms\nis that they do not scale well for models with a large state space, such as\nimages with a million or more pixels. We introduce a parametric surrogate\nmodel, which approximates the score function using an integral curve. Our\nsurrogate model incorporates known properties of the likelihood, such as\nheteroskedasticity and critical temperature. We demonstrate this method using\nsynthetic data as well as remotely-sensed imagery from the Landsat-8 satellite.\nWe achieve up to a hundredfold improvement in the elapsed runtime, compared to\nthe exchange algorithm or ABC. An open source implementation of our algorithm\nis available in the R package "bayesImageS."\n

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Synthetic 2D Images · n=10^6 pixelsApproximate exchange algorithm (MAVM)Average runtime43 hoursk=3 · images=20 · pixels=10^6 · iterations-per-image=10000
Source quote
L341: All four algorithms were run for 10,000 iterations on each image, discarding the first 5,000 as burn-in. The differences in elapsed runtime are illustrated by Figure~\ref{f:elapsed}. All of the algorithms scaled linearly with increasing numbers of pixels, but the approximate exchange algorithm (MAVM) and ABC were roughly two orders of magnitude slower than either pseudolikelihood (PL) or path sampling (TI). For 2D images with n=10^6 pixels the average runtime was 43 hours for MAVM, 42.5 hours for ABC, 36 minutes for PL and 29 minutes for TI. It took 30 minutes for precomputation of 64 values of \mathbb{E}-z | \beta[S(z)] for path sampling, using 16 parallel threads. For 3D images with n=10^6 voxels the averages were 45 hours for MAVM or ABC, 35 minutes for PL and 30 minutes for TI. The precomputation step took 24 minutes for 44 values of \beta. Even allowing for the cost of precomputation, TI was still much faster than MAVM or ABC.
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
Synthetic 2D Images · n=10^6 pixelsABC baselineAverage runtime42.5 hoursk=3 · images=20 · pixels=10^6 · iterations-per-image=10000
Source quote
L341: All four algorithms were run for 10,000 iterations on each image, discarding the first 5,000 as burn-in. The differences in elapsed runtime are illustrated by Figure~\ref{f:elapsed}. All of the algorithms scaled linearly with increasing numbers of pixels, but the approximate exchange algorithm (MAVM) and ABC were roughly two orders of magnitude slower than either pseudolikelihood (PL) or path sampling (TI). For 2D images with n=10^6 pixels the average runtime was 43 hours for MAVM, 42.5 hours for ABC, 36 minutes for PL and 29 minutes for TI. It took 30 minutes for precomputation of 64 values of \mathbb{E}-z | \beta[S(z)] for path sampling, using 16 parallel threads. For 3D images with n=10^6 voxels the averages were 45 hours for MAVM or ABC, 35 minutes for PL and 30 minutes for TI. The precomputation step took 24 minutes for 44 values of \beta. Even allowing for the cost of precomputation, TI was still much faster than MAVM or ABC.
Synthetic 2D Images · n=10^6 pixelsPseudolikelihood (PL) baselineAverage runtime36 minutesk=3 · images=20 · pixels=10^6 · iterations-per-image=10000
Source quote
L341: All four algorithms were run for 10,000 iterations on each image, discarding the first 5,000 as burn-in. The differences in elapsed runtime are illustrated by Figure~\ref{f:elapsed}. All of the algorithms scaled linearly with increasing numbers of pixels, but the approximate exchange algorithm (MAVM) and ABC were roughly two orders of magnitude slower than either pseudolikelihood (PL) or path sampling (TI). For 2D images with n=10^6 pixels the average runtime was 43 hours for MAVM, 42.5 hours for ABC, 36 minutes for PL and 29 minutes for TI. It took 30 minutes for precomputation of 64 values of \mathbb{E}-z | \beta[S(z)] for path sampling, using 16 parallel threads. For 3D images with n=10^6 voxels the averages were 45 hours for MAVM or ABC, 35 minutes for PL and 30 minutes for TI. The precomputation step took 24 minutes for 44 values of \beta. Even allowing for the cost of precomputation, TI was still much faster than MAVM or ABC.
Synthetic 2D Images · n=10^6 pixelsPath sampling (TI) baselineAverage runtime29 minutesk=3 · images=20 · pixels=10^6 · iterations-per-image=10000
Source quote
L341: All four algorithms were run for 10,000 iterations on each image, discarding the first 5,000 as burn-in. The differences in elapsed runtime are illustrated by Figure~\ref{f:elapsed}. All of the algorithms scaled linearly with increasing numbers of pixels, but the approximate exchange algorithm (MAVM) and ABC were roughly two orders of magnitude slower than either pseudolikelihood (PL) or path sampling (TI). For 2D images with n=10^6 pixels the average runtime was 43 hours for MAVM, 42.5 hours for ABC, 36 minutes for PL and 29 minutes for TI. It took 30 minutes for precomputation of 64 values of \mathbb{E}-z | \beta[S(z)] for path sampling, using 16 parallel threads. For 3D images with n=10^6 voxels the averages were 45 hours for MAVM or ABC, 35 minutes for PL and 30 minutes for TI. The precomputation step took 24 minutes for 44 values of \beta. Even allowing for the cost of precomputation, TI was still much faster than MAVM or ABC.
BibTeX
@inproceedings{moores2018scalable,
  author = {Matthew T. Moores and Geoff K. Nicholls and A. N. Pettitt and Kerrie Mengersen},
  title = {{Scalable Bayesian Inference for the Inverse Temperature of a Hidden\textbackslash\{\}n Potts Model}},
  booktitle = {Bayesian},
  year = {2018},
  doi = {10.1214/18-ba1130},
}
Figure