G15 Pattern Theory
This lecture introduces Grenander’s pattern theory. The main references are Grenander’s Elements of Pattern Theory, Grenander and Miller’s Pattern Theory: From Representation to Inference, and Mumford and Desolneux’s Pattern Theory: The Stochastic Analysis of Real-World Signals (full references at the end).
Motivation
The broad motivation is a question: is it possible to use something like the theory of formal languages for vision?
The principle is to determine what the building blocks of images are, and to find the rules by which they are coupled together. Things to account for include
- texture;
- (types of) randomness;
- symmetries;
- clustering of elements;
- shapes (and variations of shapes);
- discretization and approximation;
- pattern interference;
- etc.
Generators, bonds and configurations
Generator space and symmetries
Definition G15.1 (Generators, similarities and bonds).
- The generator space
is a space of “building blocks”, or patterns, . It comes with a decomposition into various parts, or sectors, of the generator space. - The similarity group
is a group of transformations (bijections preserving the decomposition into the ). - Arity: each
has a certain “valence” (arity) , like a node in a graph, which is the number of other elements it can connect to (“bond”). The bond structure of is , . - The bond value space: each bond
carries a label .
Both
The figure shows a configuration of seven generators
Configurations
Configurations are built by gluing generators together according to their bond structure.
Definition G15.2 (Configurations and regularity).
- The configuration architecture of a configuration is a graph, the connector graph.
- A bond is internal if it is connected to another bond, and external if it is left open.
- A truth-valued function
on the bond values decides which bonds match: or . - A configuration
is locally regular if for all elements and any internal bond between them Over all internal bonds, for all pairs of generators, this says - A configuration is regular if it is locally regular and its connector graph is in some assigned class
(lattice, tree, linear, etc.). - The regularity is the data
.
Definition G15.3 (Configuration space). The configuration space
- a coupling connector
; - the action of the similarities: each
maps to itself.
Definition G15.4 (Homomorphisms). Let
Images, patterns and templates
Put an equivalence relation
- the equivalence relation must be compatible with the
-action; - equivalent configurations must have the same external structure (external bonds);
- the equivalence preserves coupling connectors.
Definition G15.5 (Images, patterns, templates).
- The images are the equivalence classes,
. - A pattern is any
-invariant subset of . - A pattern family is a partition of
into pieces that are unions of -orbits. - A template is a choice of a representative in each
-orbit of a pattern.
Dressing everything with probabilities
- Grenander had earlier argued the viewpoint that any (algebraic) structure in mathematics can be dressed with probabilities: Ulf Grenander, Probabilities on Algebraic Structures, Dover, 2008 (originally 1963).
- In the theory of formal languages and generative grammars it is common to consider probabilistic grammars: Rens Bod, Jennifer Hay, Stefanie Jannedy, Probabilistic Linguistics, MIT Press, 2003.
- So consider some kind of statistical physics model for probabilistic patterns and images.
Assigning probabilities
Definition G15.6 (Acceptor function and probability of a configuration). An acceptor function is a function
Another, similar version also puts a probability
One thing probabilities do is replace rigid regularity by a more general relaxed regularity, by replacing the truth-valued bond value function discussed before by the acceptor function: one uses
Probabilities of images and conditioning
A subset
Observe that the probability of a subconfiguration
Deformations
Definition G15.7 (Deformations).
are the abstract images (not directly observable).- Deformation mappings
are maps to the deformed images. - The deformation mechanism is automorphic if
. - More realistically, the
are effects like noise, etc., and destroy part of the structure of : heteromorphic deformations.
Deformations can act on
Definition G15.8 (Image restoration problem). Find a mapping
Definition G15.9 (Pattern recognition problem). Algorithmically find the pattern class (a subset of
The rest of the lecture takes a closer look at the mathematics involved:
- probabilistic directed acyclic graphs;
- hidden Markov models;
- Markov random fields;
- canonical representations of pattern theory;
- shape analysis.
Probabilistic directed acyclic graphs
For a directed edge
Definition G15.10 (Probabilistic directed acyclic graph). Let
- Each vertex
carries a random variable . - All these random variables
have the same (finite) state space . - A configuration is a point in
, with . - The model is given by the conditional probabilities
of a site , conditional on its parents the parent vertices of in the directed structure.
Definition G15.11 (Realization by a directed graph). A random variable
Proposition G15.12 (Factorization). Random variables with a realization by a PDAG satisfy
Proof. By recursively “peeling off leaf nodes”. A leaf
In the figure, the graph
Example G15.13 (Finite state Markov chains). The simplest case of a PDAG is when the graph is the one-dimensional lattice,
Example G15.14 (Branching processes on trees).
- The probability law for the next generation depends only on the immediately previous one (Markov).
- The number of branchings at a site is independent of the number of sites in the same generation.
- Nodes are conditionally independent of their non-descendants given their parents.
The tree in the figure is generated by the rules
Information on a PDAG
From
Hidden Markov models
Definition G15.15 (Hidden Markov model).
- There are
observed states , each taking possible values. - There are
hidden states , each taking possible values. - They satisfy the conditional independence
In the special case where all the transitions
Example G15.16. Take
Definition G15.17 (Invariants). The invariants of the HMM are the polynomial functions on
The invariants generate an ideal
Questions.
- Viterbi sequence: find the most likely hidden data given the observed data.
- Find all parameter values for a model that result in the same observed distribution.
- Find what parameter-independent relations hold between the observed probabilities
.
Recent algebro-geometric methods (tropical geometry, etc.) have been developed to approach these problems about HMMs; see Pachter–Sturmfels, Tropical geometry of statistical models, and Drton–Sturmfels–Sullivant, Lectures on Algebraic Statistics.
Formal languages and generative grammars within pattern theory
The case of formal languages and generative grammars can be recovered within pattern theory.
Probabilistic context-free grammars
Definition G15.18 (Probabilistic context-free grammar). A probabilistic context-free grammar is
and are disjoint finite sets: the non-terminal and terminal symbols; is the start symbol; is a finite rewriting system on , the production rules with and ; assigns probabilities to the production rules, with the ways to expand the same non-terminal add up to probability one.
Probabilities of parse trees
Let
These probabilities account for the syntactic ambiguities of parse trees in context-free languages.
Subtree independence assumption
Definition G15.19 (Span). A vertex
Denote by
; .
Example G15.20. Take the parse tree with root
Then
Sentence probabilities in PCFGs
Theorem G15.21 (Chomsky normal form). Context-free grammars can always be put in Chomsky normal form, where all the production rules are of the form
So a parse tree for a CFG in Chomsky normal form has two kinds of nodes: an internal node marked with a non-terminal
Assume the CFG is in Chomsky normal form. Write
Definition G15.22 (Inside and outside probabilities). The inside probabilities are
In the figure, the inside probability concerns the inner triangle, the subtree with root
Proposition G15.23 (Recursive formula for inside probabilities).
Proof. Split the tree at the first branching,
Training probabilistic context-free grammars
Consider first the simpler case of a Markov chain, with a transition
In the case of probabilistic context-free grammars, use the training corpus to estimate the probabilities of the production rules,
Markov random fields
Markov random fields are one of the main probabilistic tools for the configuration spaces of pattern theory. They live on arbitrary non-directed graphs (a special case being lattices).
Definition G15.24 (Markov random field). To each vertex
Example: the Ising model
is the collection of pixels of an image (a real-valued function of two variables). is a binary image, a black/white approximation of by areas.
Definition G15.25 (Ising model of an image). The energy functional is
The probability
- In the physical Ising model,
is the external magnetic field and are the spin variables. - For image segmentation problems, consider
as fixed, and the conditional probability
The temperature controls the behavior:
- in the high temperature regime
, the probability approaches the uniform probability distribution on the finite set of all possible ; - in the low temperature regime
, the probability approaches the delta distribution concentrated on the minimizer of (for fixed ).
Monte Carlo and Metropolis–Hastings type algorithms converge to the minimizer of
The slides show an example of the segmentation of an image
Potts models
Potts models are a more general example of Markov random fields. The Ising model is used to approximate a
The example on the slides is a satellite image (CNES, the French space agency) of farmland, a patchwork of fields in shades of gray, next to its segmentation using a Potts model (Xavier Descombes), in which each field becomes a region of one flat color from a small palette.
Canonical representations of pattern theory
A canonical representation is a construction of the generator set
Example G15.26 (Probabilistic directed acyclic graphs). Let
Shape analysis
The historical origin of shape analysis is D’Arcy Thompson’s On Growth and Form (1917). The slide reproduces some of his drawings. A fish (Polyprion) is drawn on a square grid, and three related species (Pseudopriacanthus altus, Scorpaena, Antigonia capros) are drawn on deformed versions of the same grid. In another pair, a porcupinefish drawn on a rectangular grid (A) becomes a sunfish (B) when the grid is bent into a fan of curved coordinate lines. Each species is obtained from another by a smooth deformation of the plane.
Shape space
Definition G15.27 (Templates and shapes).
is a template.- The shapes are
, with a diffeomorphism of the ambient space. is the space of diffeomorphisms and the shape space, with the transformations .
The map
To achieve an optimal
The optimal
The slides show an example from Trouvé–Younes (Mise en correspondance d’objets déformables): two images to be matched, a blurred white square and a blurred white disk on black, and the deformation obtained between them, drawn as a square grid bent by the diffeomorphism, with the grid lines pulled in toward the center.
More details on shape spaces
These follow Bauer–Bruveris–Michor, Overview of the geometries of shape spaces and diffeomorphism groups.
Definition G15.28 (Spaces of shapes).
- A shape is a submanifold of an ambient
diffeomorphic to a fixed manifold . is the space of immersed submanifolds, and the space of embedded submanifolds. is the space of parameterized immersions, with the action of by changes of parameterization, and an orbifold with singular points.
A Riemannian metric on
Metrics of this kind come from the ambient space.
- Consider the left action of
on the parameterized embeddings . is a Lie group, with Lie algebra , the compactly supported vector fields.- Construct a right invariant metric on
. - Then the left action of
on induces a metric on such that is a Riemannian submersion. - This measures the cost of deforming a shape in terms of the minimal cost of deforming the ambient space, through the quadratic form
for an infinitesimal deformation of , with the infimum over the that agree with on . - This induces a metric on
through the metric on induces a metric on invariant under reparameterizations of by , so it descends to a metric on .
Remark. All these spaces are infinite dimensional, so there are many analytic subtleties in dealing with their Riemannian geometry.
Metrics on
To specify a metric it suffices to specify the paths of minimal distance, the geodesics. A geodesic in
Proposition G15.29 (Geodesic equation). If the metric is specified by the quadratic form
This gives a relation between metrics on
Example G15.30 (Geodesic equations on
- With
(just the metric) the geodesic equation is a model of turbulence in fluid dynamics (Burgers). - With
the geodesic equation is the Camassa–Holm equation (shallow water waves). - With
the geodesic equation is the periodic Hunter–Saxton equation (propagation of waves in nematic liquid crystals).
Definition G15.31 (Sobolev metrics). The Sobolev metric on
Theorem G15.32 (Completeness). Let
The last slide shows an example of a geodesic between shapes for the Sobolev metric
References
- Ulf Grenander, Elements of Pattern Theory, Johns Hopkins University Press, 1996.
- Ulf Grenander, Michael I. Miller, Pattern Theory: From Representation to Inference, Oxford University Press, 2007.
- David Mumford, Agnès Desolneux, Pattern Theory: The Stochastic Analysis of Real-World Signals, CRC Press, 2010.
- Ulf Grenander, Probabilities on Algebraic Structures, Dover, 2008 (originally 1963).
- Rens Bod, Jennifer Hay, Stefanie Jannedy, Probabilistic Linguistics, MIT Press, 2003.
- Lior Pachter, Bernd Sturmfels, Tropical geometry of statistical models, Proc. Natl. Acad. Sci. USA 101 (2004), no. 46, 16132–16137.
- Mathias Drton, Bernd Sturmfels, Seth Sullivant, Lectures on Algebraic Statistics, Birkhäuser, 2009.
- Alain Trouvé, Laurent Younes, Mise en correspondance d’objets déformables, Traitement du Signal 20 (2003), no. 3, 295–302.
- Martin Bauer, Martins Bruveris, Peter W. Michor, Overview of the geometries of shape spaces and diffeomorphism groups, J. Math. Imaging Vision 50 (2014), no. 1-2, 60–97.
- D’Arcy Wentworth Thompson, On Growth and Form, Cambridge University Press, 1917.