Accelerating Markov Random Field Inference with Uncertainty Quantification

Ramin Bashizade, Xiangyu Zhang, Sayan Mukherjee, Alvin R. Lebeck · DOI

Abstract

Statistical machine learning has widespread application in various domains. These methods include probabilistic algorithms, such as Markov Chain Monte-Carlo (MCMC), which rely on generating random numbers from probability distributions. These algorithms are computationally expensive on conventional processors, yet their statistical properties, namely interpretability and uncertainty quantification (UQ) compared to deep learning, make them an attractive alternative approach. We propose a high-throughput accelerator for Markov Random Field (MRF) inference using MCMC with Gibbs sampling. We propose a tiled architecture with near-memory computing and a novel hybrid on-chip/off-chip memory system to efficiently support UQ. Our FPGA prototype achieves a 26× speedup over prior work, while ASIC analysis suggests a 120×–210× speedup over high-end GPUs.

Introduction: The Challenge of Probabilistic Inference

While Deep Neural Networks (DNNs) dominate modern AI, probabilistic models like Markov Random Fields (MRFs) remain essential for computer vision and statistical learning. Unlike "black-box" DNNs, MRFs offer high interpretability and Uncertainty Quantification (UQ)—the ability to report confidence levels alongside predictions.

However, MRF inference typically relies on Markov Chain Monte Carlo (MCMC) algorithms, which are notoriously slow on standard CPUs and GPUs. MCMC requires iterative sampling from probability distributions, creating significant sequential bottlenecks and massive memory overhead when tracking variable histories for UQ.

Architectural Innovations

The proposed Stochastic Processing Accelerator addresses these bottlenecks through several key architectural innovations:

Tiled Architecture and Chromatic Scheduling

The design exploits the "conditional independence" inherent in MRFs. In a first-order MRF, a pixel's state only depends on its immediate neighbors. By employing a "checkerboard" schedule—updating all "black" pixels, then all "white" pixels—the accelerator can update thousands of variables in parallel without conflicts.

Stochastic Processing Units (SPUs)

Specialized SPUs handle the core math of Gibbs sampling. As shown in the algorithm loop, each iteration requires computing label probabilities and sampling a new label based on those probabilities. The SPUs implement a stall-free pipeline for energy calculation, scaling, and random number generation.

The Gibbs sampling algorithm loop requires repeated sampling from probability distributions based on calculated energy functions.

Efficient Uncertainty Quantification

A major contribution of this work is the Hybrid Memory Logging system. To perform UQ, the system must track a histogram of all labels a variable takes over thousands of iterations. Storing these histograms for every pixel in a high-definition image would overwhelm off-chip bandwidth.

The researchers observed that as the algorithm converges, most variables stop changing labels frequently. Data from motion estimation benchmarks shows that nearly 100% of pixels in an image take on fewer than 9 unique labels throughout the process, even when the total label space is much larger.

Analysis of unique labels per pixel across different datasets shows that most pixels converge to a very small set of labels, enabling efficient memory logging.

By storing the most frequent labels on-chip and only logging changes to off-chip DRAM, the hybrid system provides the data needed for perfect UQ histograms while reducing off-chip bandwidth requirements by 71%.

Performance Results

The accelerator was evaluated using motion estimation (Middlebury database) and stereo vision benchmarks.

  • FPGA Prototype: Implemented on an Intel Arria 10 FPGA, the design achieved a throughput of 4.67 billion labels per second, representing a 26× speedup over previous state-of-the-art FPGA implementations.
  • ASIC Scaling: Analysis in 15nm technology indicates that a design with 2048 function units running at 3GHz would outperform an Nvidia RTX 2080 Ti by 120× to 210× for the tested applications, while occupying only 7.7% of the GPU's area.
  • Real-Time Capability: The ASIC design is capable of processing Full-HD images at 30fps with 64 labels per pixel for 1500 iterations per frame.

Limitations and Future Work

While impressive, the current architecture has constraints: it is optimized for first-order MRFs (4-neighbor connectivity), supports discrete random variables (up to 64 labels), and uses fixed bit-widths. Future work aims to generalize the interconnect for higher-order models and support continuous variables, bringing interpretable, uncertainty-aware AI to edge devices and real-time systems.

Summary updated

BibTeX
@misc{bashizade2021accelerating,
  author = {Ramin Bashizade and Xiangyu Zhang and Sayan Mukherjee and Alvin R. Lebeck},
  title = {{Accelerating Markov Random Field Inference with Uncertainty Quantification}},
  year = {2021},
  eprint = {2108.00570},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.00570},
}
Figure