Markov Random Fields

Graduate Depth 72 in the knowledge graph I know this Set as goal
Unlocks 3 downstream topics
graphical-models undirected-graphs inference cliques

Core Idea

Markov random fields (undirected graphical models) represent joint distributions using potential functions on cliques, where a variable's conditional distribution depends only on its neighbors. They are symmetric in dependencies (unlike directed Bayesian networks) and are natural for image processing, spatial modeling, and problems without clear causality.

How It's Best Learned

Implement inference in a simple MRF for image denoising or texture synthesis using belief propagation.

Explainer

From your work with probabilistic graphical models, you know that a graphical model encodes a joint probability distribution by making independence assumptions explicit through graph structure. Bayesian networks use directed edges to represent conditional dependencies, which naturally express causal or generative stories: "A causes B, B causes C." But many real-world problems involve dependencies that are symmetric — neighboring pixels in an image influence each other without a clear causal direction, atoms in a crystal lattice interact mutually, and words in a sentence constrain each other bidirectionally. Markov random fields (MRFs) handle these situations by using undirected graphs, where an edge between two variables simply means "these two are directly related."

The key structural concept in an MRF is the clique — a subset of nodes that are all connected to each other. Instead of specifying conditional probability tables as in Bayesian networks, MRFs define potential functions (also called compatibility functions or factors) on cliques. A potential function assigns a non-negative score to each configuration of the variables in a clique, expressing how "compatible" those values are with each other. For example, in an image denoising MRF, a pairwise potential between neighboring pixels might assign a high score when both pixels have similar values and a low score when they differ sharply — encoding the prior belief that natural images are locally smooth. The joint distribution is proportional to the product of all clique potentials, but since potentials are not probabilities, you need a partition function Z to normalize everything into a proper distribution.

The Markov property in an MRF takes a spatial rather than temporal form: a variable is conditionally independent of all other variables given its neighbors in the graph. This is called the local Markov property, and it is what makes inference tractable — you only need to look at a variable's immediate neighborhood to reason about it. This connects to the Hammersley-Clifford theorem, which states that any distribution satisfying this Markov property with respect to an undirected graph can be factored as a product of potentials on the graph's cliques. The theorem provides the theoretical foundation linking graph structure to factorization.

Computing exact marginal probabilities or finding the most probable configuration in an MRF is generally intractable because the partition function Z requires summing over all possible configurations — exponential in the number of variables. Practical inference relies on approximate methods. Belief propagation passes messages between neighboring nodes, iteratively refining local beliefs about each variable's distribution. On tree-structured graphs, belief propagation is exact; on graphs with loops (which most real MRFs have), it becomes loopy belief propagation, an approximation that often works well in practice despite lacking formal guarantees. Other approaches include variational methods, which find a tractable distribution close to the true one, and sampling methods like Gibbs sampling, which draw samples from the joint distribution by iterating through variables one at a time, conditioning on neighbors — directly exploiting the local Markov property.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIterated Integrals and Fubini's TheoremJoint Distributions and Marginals (Rigorous)Independence of Sigma-AlgebrasConditional ExpectationMarkov ChainsHidden Markov ModelsMarkov Random Fields

Longest path: 73 steps · 407 total prerequisite topics

Prerequisites (2)

Leads To (1)