Markov Random Field

Definition
A Markov Random Field (MRF) models variables with an undirected graph where each variable depends on its neighbors; it's suited for spatial or relational data where directionality is not natural. Imagine a grid where each cell's value is influenced by adjacent cells. MRFs differ from Bayesian networks by being undirected and focusing on local compatibility rather than parent-child causal structure.
Markov Random Field

How does it work?

Markov Random Field algorithms typically represent uncertainty explicitly and use probability calculations to combine data and model assumptions. Implementations focus on numerical stability, how to represent distributions (parametric vs sampled), and efficient updates when new data arrive.

Examples

  • Image denoising — Model pixel neighbourhoods with MRFs for pairwise-smoothness priors in restoration.
  • Spatial label smoothing — Enforce local consistency in segmentation tasks using MRF priors.
  • Markov networks for social ties — Model undirected relationships among entities in network analysis.

Problems

  • Exact inference is generally intractable, requiring approximations
  • Computing the normalizing constant (partition function) is expensive
  • Choosing appropriate potential functions for the domain
  • Training can be slow due to repeated inference in the loop
  1. Wikipedia: Markov random field