In the domain of physics and probability, a Markov random field (MRF), Markov network or undirected graphical model is a set of random variables having a Markov property described by an undirected graph. In other words, a random field is said to be a Markov random field if it satisfies Markov properties. The concept originates from the Sherrington–Kirkpatrick model.
A Markov network or MRF is similar to a Bayesian network in its representation of dependencies; the differences being that Bayesian networks are directed and acyclic, whereas Markov networks are undirected and may be cyclic. Thus, a Markov network can represent certain dependencies that a Bayesian network cannot (such as cyclic dependencies); on the other hand, it can't represent certain dependencies that a Bayesian network can (such as induced dependencies). The underlying graph of a Markov random field may be finite or infinite.
When the joint probability density of the random variables is strictly positive, it is also referred to as a Gibbs random field, because, according to the Hammersley–Clifford theorem, it can then be represented by a Gibbs measure for an appropriate (locally defined) energy function. The prototypical Markov random field is the Ising model; indeed, the Markov random field was introduced as the general setting for the Ising model.[1] In the domain of artificial intelligence, a Markov random field is used to model various low- to mid-level tasks in image processing and computer vision.[2]
Given an undirected graph
G=(V,E)
X=(Xv)v\in
V
G
Pairwise Markov property: Any two non-adjacent variables are conditionally independent given all other variables:
Xu\perp\perpXv\midXV
Local Markov property: A variable is conditionally independent of all other variables given its neighbors:
Xv\perp\perpXV\smallsetminus[v]}\midX\operatorname{N(v)}
where is the set of neighbors of
v
\operatorname{N}[v]=v\cup\operatorname{N}(v)
v
Global Markov property: Any two subsets of variables are conditionally independent given a separating subset:
XA\perp\perpXB\midXS
where every path from a node in
A
B
S
The Global Markov property is stronger than the Local Markov property, which in turn is stronger than the Pairwise one.[3] However, the above three Markov properties are equivalent for positive distributions[4] (those that assign only nonzero probabilities to the associated variables).
The relation between the three Markov properties is particularly clear in the following formulation:
i,j\inV
Xi\perp\perpXj|XV
i\inV
J\subsetV
i
Xi\perp\perpXJ|XV\cupJ)}
I,J\subsetV
XI\perp\perpXJ|XV
As the Markov property of an arbitrary probability distribution can be difficult to establish, a commonly used class of Markov random fields are those that can be factorized according to the cliques of the graph.
Given a set of random variables
X=(Xv)v\in
P(X=x)
x
X
P(X=x)
X
x
X
x
Xv
If this joint density can be factorized over the cliques of
G
P(X=x)=\prodC(G)}\varphiC(xC)
then
X
G
\operatorname{cl}(G)
G
\varphiC
\varphiC
log(\varphiC)
xC
Some MRF's do not factorize: a simple example can be constructed on a cycle of 4 nodes with some infinite energies, i.e. configurations of zero probabilities,[5] even if one, more appropriately, allows the infinite energies to act on the complete graph on
V
MRF's factorize if at least one of the following conditions is fulfilled:
When such a factorization does exist, it is possible to construct a factor graph for the network.
Any positive Markov random field can be written as exponential family in canonical form with feature functions
fk
P(X=x)=
1 | |
Z |
\exp\left(\sumk
\top | |
w | |
k |
fk(x
\top | |
w | |
k |
fk(x
Z=\sumx
Here,
l{X}
fk,i
fk,i(x\{k\
x\{k\
Nk=|\operatorname{dom}(Ck)|
fk,i
wk,i=log\varphi(ck,i)
ck,i
Ck
The probability P is often called the Gibbs measure. This expression of a Markov field as a logistic model is only possible if all clique factors are non-zero, i.e. if none of the elements of
l{X}
The importance of the partition function Z is that many concepts from statistical mechanics, such as entropy, directly generalize to the case of Markov networks, and an intuitive understanding can thereby be gained. In addition, the partition function allows variational methods to be applied to the solution of the problem: one can attach a driving force to one or more of the random variables, and explore the reaction of the network in response to this perturbation. Thus, for example, one may add a driving term Jv, for each vertex v of the graph, to the partition function to get:
Z[J]=\sumx
Formally differentiating with respect to Jv gives the expectation value of the random variable Xv associated with the vertex v:
E[Xv]=
1 | \left. | |
Z |
\partialZ[J] | |
\partialJv |
\right| | |
Jv=0 |
.
Correlation functions are computed likewise; the two-point correlation is:
C[Xu,Xv]=
1 | \left. | |
Z |
\partial2Z[J] | |
\partialJu\partialJv |
\right| | |
Ju=0,Jv=0 |
.
Unfortunately, though the likelihood of a logistic Markov network is convex, evaluating the likelihood or gradient of the likelihood of a model requires inference in the model, which is generally computationally infeasible (see 'Inference' below).
A multivariate normal distribution forms a Markov random field with respect to a graph
G=(V,E)
X=(Xv)v\in\simlN(\boldsymbol\mu,\Sigma)
(\Sigma-1)uv=0 iff \{u,v\}\notinE.
As in a Bayesian network, one may calculate the conditional distribution of a set of nodes
V'=\{v1,\ldots,vi\}
W'=\{w1,\ldots,wj\}
u\notinV',W'
See main article: Conditional random field. One notable variant of a Markov random field is a conditional random field, in which each random variable may also be conditioned upon a set of global observations
o
\varphik
o
Markov random fields find application in a variety of fields, ranging from computer graphics to computer vision, machine learning or computational biology,[12] [13] and information retrieval.[14] MRFs are used in image processing to generate textures as they can be used to generate flexible and stochastic image models. In image modelling, the task is to find a suitable intensity distribution of a given image, where suitability depends on the kind of task and MRFs are flexible enough to be used for image and texture synthesis, image compression and restoration, image segmentation, 3D image inference from 2D images, image registration, texture synthesis, super-resolution, stereo matching and information retrieval. They can be used to solve various computer vision problems which can be posed as energy minimization problems or problems where different regions have to be distinguished using a set of discriminating features, within a Markov random field framework, to predict the category of the region.[15] Markov random fields were a generalization over the Ising model and have, since then, been used widely in combinatorial optimizations and networks.