S. D. V. Stephens

notes / Basic Neuroscience and Geometry of Neuroscience / chapter 11: Image Segmentation

G13 Image Segmentation: the Mumford–Shah Functional

The reference for this lecture is David Mumford and Jayant Shah, Optimal approximations by piecewise smooth functions and associated variational problems (Commun. Pure Applied Math. 1989).

Images

  • A three-dimensional scene is observed by an eye or a camera: at a point , light of intensity comes from the direction .
  • A lens at focuses the light on a retina (a surface). The intensity of the light signal received by at the point with coordinates is obtained from through some transformation that depends on the functioning of the optical system.
  • The resulting function is “an image”.

The slide’s illustration (from Mumford–Shah) shows two objects, a pyramid with a striped face and a small box , whose light passes through a lens at and forms an inverted image on a screen.

There will be discontinuities in the function along boundaries: an object in front of another, objects with a common boundary, discontinuities in illumination, in the object albedo, and so on. Additional complications:

  • textured objects, fragmented objects (for example a canopy of leaves);
  • shadows, penumbra;
  • surface markings;
  • partially transparent objects;
  • noisy measurements of .

The segmentation problem

The goal is to compute a decomposition of the domain of such that

  1. the function is smooth within each domain ;
  2. the function varies discontinuously (and/or very rapidly) across most of the boundary between different .

Equivalently, this is the problem of computing optimal approximations of a function by piecewise smooth functions.

Mathematical approach

What constitutes an optimal segmentation? We look for a functional measuring the degree of match between a function and a segmentation, to be optimized. Let the be connected open subsets of a given planar domain , each with piecewise smooth boundary , and set We discuss three different action functionals whose minimization gives an optimal image segmentation: a functional that depends on two parameters and , and two limiting cases and , each depending on a parameter.

The Mumford–Shah functional

Definition G13.1 (Mumford–Shah functional). Let be a differentiable function on , possibly discontinuous across , and let consist of piecewise smooth arcs joined at a finite set of singular points, with the total length of the arcs in . The action functional is

  • The first term measures how good is as an approximation of .
  • The second term asks that not vary too much within each .
  • The third term asks that the boundary achieving the decomposition be as short as possible.

Remark (All three terms are needed). All three terms are needed to have a nontrivial minimum:

  1. without the first term, and give ;
  2. without the second term, and give ;
  3. without the third term, taking equal to the average of on each square of a grid of squares (with the grid) gives values of tending to as .

Heuristic interpretation: a solution of the minimization of is a “cartoon” version of the image , in which contours are drawn sharply and the scene is simplified.

Remark (Mumford–Shah conjecture). Is the minimization problem for well posed? Mumford and Shah conjectured that for every continuous a minimum of exists with differentiable on each and made of -arcs joined at a finite number of singular points.

The functional

Restrict to piecewise constant functions, . Then As a function of the , this is minimized by the averages where is the area of .

Definition G13.2 (The functional ).

Relation to the Ising model

The relation is the one between continuous and discrete segmentation:

Left: a square split by a curve Gamma into regions where f = a1 and f = a2. Right: a square lattice of sites split by a staircase path Gamma into sites with f = +1 and f = -1.
  • Suppose is locally constant with only the values .
  • Assume and are “discretized”, that is, defined on a lattice.
  • Let be a path made of segments of horizontal and vertical lines between pairs of adjacent lattice sites where changes sign.
  • Then the functional , seen as a function of , becomes the Ising model energy where the first sum is over lattice sites and the second over pairs of neighboring sites. (A neighboring pair separated by contributes and every other pair contributes , so the second sum is times the length of in lattice units; the factor only rescales .)

The functional

Definition G13.3 (The functional ). A functional of alone: where is a constant, is arc length on , and is the derivative along the unit normal to .

A curve Gamma with arclength direction s, crossed by a family of normal lines, with the normal direction r drawn at one point: curvilinear coordinates near Gamma.

Minimizing means finding so that

  • the length of is as short as possible;
  • the variation of in the direction normal to is as large as possible.

Relation of to

Proposition G13.4 ( as a limit of ). On the smooth parts of use curvilinear coordinates , as in the figure. Take outside a tubular neighbourhood of , set and , and Then

So one can think of as a limit of .

The variational equation for : summary

  • For fixed , is a positive definite quadratic functional in , with a unique minimum, the solution of the elliptic boundary value problem on each
  • With the solution of this elliptic problem, becomes a function of , , to be minimized over .
  • Consider an infinitesimal variation of by a normal vector field , vanishing in a neighbourhood of the singular points of .

Proposition G13.5 (First variation in ). with the boundary values of on the two sides of , and the curvature (a function of the second derivative of the curve ).

(On the normal derivative of vanishes, so there; compare the energy density below.) Then is minimized by a that satisfies the variational equation

Complications due to singular points of

The minimizing function is bounded pointwise, but its gradient need not be bounded near the singular points of . If is made of -arcs joined at endpoints, one can use the theory of elliptic boundary value problems in domains with corners to handle this problem.

Proposition G13.6 (Singular points of a minimizer). If , made of -arcs joined at endpoints, is a minimum, then its only singularities are

  1. triple points: three arcs meet at ;
  2. crack tips: a single arc ends;
  3. boundary points: a arc of meets a smooth point of perpendicularly.

A further complication: a minimizer may have worse singularities than meetings of arcs; cusp singularities at the end of arcs may also occur.

A more detailed discussion of the variational problem for

Hölder spaces

Definition G13.7 (Hölder spaces). For and , the Hölder space has the norm where

Start by assuming that is a union of curves joined at endpoints, and that on ; initially assume also that the first derivatives are continuous up to the boundary points (this will be weakened later).

Variation of for fixed

Fix and consider the variational problem for , with variation : The last step uses integration by parts and Green’s theorem, with the whole boundary of , given by and the two sides of each arc of .

Imposing the vanishing of the variation for all test functions gives the variational equation

The operator is positive-definite and self-adjoint. It has a Green function that is outside the diagonal , with singularity

The unique solution on each is constructed by convolution with the Green function:

Remark (The Green function on the whole plane). In the absence of singularities and boundaries, would be the Green function on the whole plane , given by the Fourier transform of evaluated at , namely with the modified Bessel function of the second kind, a solution of with asymptotic behavior

Variation of

Now vary with respect to .

  • Move near a simple point (not a point where several arcs meet). The point lies on one arc .
  • The regularity of ensures that it can be written locally as the graph of a function, either or (implicit function theorem). One can then deform the path by deforming the function, with the variation outside a small neighborhood of the point, so that the new curve does not meet the other arcs outside the endpoints.
The graph y = h(x) of an arc through a point P, a disc U around P, and a deformed arc y = h + t delta h that differs from the original only inside U.

Varying forces to vary too, because is on and discontinuous across . Let and ; extend both to all of by extensions , and set Then compute explicitly the variation , where : This gives the variational equation for the path variation :

Since , its curvature is well defined almost everywhere: Integrating by parts in the last term of the variational equation, so along each

Definition G13.8 (Energy density). The energy density is

In these terms the equation reads which, for fixed , is a second order ODE for .

Special points of

At special points of the analysis of the variational problem is more complicated: the stationarity condition for the functional imposes restrictions at these points. The cases are

  1. points where meets ;
  2. corners, where two arcs meet;
  3. vertices, where three or more arcs meet;
  4. crack-tips, where an arc ends without meeting another arc.

Corners

The problem with corners is that one can have a function with in an open region and on the boundary, with a singularity at a corner point.

Example G13.9 (A harmonic function singular at a corner). In the sector , let where is the conformal map that flattens the corner. Then

The sector -alpha/2 < arg z < alpha/2 in the z-plane mapped by w = z^(pi/alpha) onto the right half-plane Re(w) > 0 in the w-plane.

Theorem G13.10 (Elliptic boundary value problems on domains with corners (Kondratiev)). The previous example is the typical behavior of solutions of elliptic boundary value problems in domains with corners. The solutions satisfy:

  • is bounded everywhere;
  • is at corners with angle ;
  • at corners with (the case is a crack-tip),

Minimizers have no kinks, and other local results

One uses this to show that Mumford–Shah minimizers cannot have kinks (corners between two arcs with angle ). Divide a neighborhood of the corner into the sectors with angle larger and smaller than , and take a smooth cutoff function on a ball near the corner.

Two arcs gamma_i and gamma_j meeting at P at a corner, with angle alpha-plus on the side of the region U-plus and alpha-minus on the side of U-minus, inside two concentric circles around P.

Cut the corner at a small distance, shrinking and enlarging :

A corner of angle alpha-plus at P, cut off by a chord joining the two points at distance epsilon/2 from P along the two arcs, shrinking the region U-plus below and enlarging U-minus above.
  • The new on the smaller is defined by restriction; the new on the larger is extended using the cutoff function, as .
  • Measuring the corresponding change in , one finds that if the functional decreases when the corner is cut as above, so the original kinked path cannot be a minimizer.
  • A similar argument shows that a minimizer meets orthogonally.
  • A similar argument also shows that triple points must have angles : otherwise one can cut a sector and lower the value of .
Three arcs gamma_i, gamma_j, gamma_k meeting at a vertex inside a small disc U, with the angles alpha_ij, alpha_jk, alpha_ik between consecutive arcs marked.
  • If has points where four or more arcs meet, it is not a minimizer: one can separate such a point into triple points and lower the value of .
Left: four arcs meeting at a point P inside a disc. Right: the same configuration replaced by two triple points joined by a short segment, the original arcs shown dotted.
  • One can also eliminate cusp corners and lower the value of .
Left: two arcs gamma_i and gamma_j leaving P tangentially, forming a cusp with a thin region U-plus between them. Right: a single arc from P that branches into gamma_i and gamma_j at the boundary of the disc.

Summary of further results

  • For minimizing with fixed, one estimates its proximity to the locally constant average of on each .
  • The relevant quantity is the isoperimetric constant, which measures the smallest necks in each component .

Definition G13.11 (Isoperimetric constant). For a domain , with the length and the area. Set .

A dumbbell-shaped domain W made of two lobes of areas A1 and A2 joined by a neck of width delta, with a dashed curve gamma cutting across the neck.

For the dumbbell in the figure, the curve across the neck has length about , so is at most about . The slides also show a domain with isoperimetric constant : a chain of bulges joined by necks, shrinking towards one end.

Proposition G13.12 (Small limit). where is the norm of on .

Existence of -minimizers

Theorem G13.13 (Existence of -minimizers). If is a rectangle and is continuous on , then, among paths of arcs meeting at endpoints and locally constant functions on , there is a minimum of

Method of proof: geometric measure theory. The main idea is first to show the existence of a “weak solution” with a “very singular” , and then to show that the weak solution must in fact be sufficiently regular, as required by the original problem. Weak solutions are given by Caccioppoli sets (measurable sets whose characteristic function has bounded variation). The topological boundary of such a set may have infinite 1-dimensional Hausdorff measure, but a “reduced boundary” is 1-rectifiable.

What is geometric measure theory?

  • It is the use of measure theory methods to study geometric objects (curves, surfaces) that are highly non-smooth.
  • It was historically developed to study the Plateau problem: the geometry of soap bubble films, that is, area-minimizing surfaces with given boundary curves. (The slides show photographs of clusters of soap bubbles.)
  • Introductions to geometric measure theory: Frank Morgan, Geometric measure theory: A beginner’s guide; Frederick J. Almgren, Jr., Plateau’s Problem: An Invitation to Varifold Geometry; Herbert Federer, Colloquium lectures on geometric measure theory (see the references).

The large case

When , the effect of on the energy is localized in a narrow strip around . First one uses Green’s theorem to reduce to an integral along only, in terms of the solutions and of

Proposition G13.14 ( as an integral along ). The functional satisfies with the boundary values of along the two sides of , and the normal vector pointing to the side of .

Proposition G13.15 (Large asymptotics). When is large, and uniformly in one has . In terms of the functional (with ) this gives

  • The first variation of converges, for large , to the first variation of .
  • One computes explicitly the vanishing of the first variation of , which gives a second order differential equation for .

Let be the matrix of second derivatives of , and , the unit tangent and normal vectors to . The variational equation for is This equation can be interpreted as the geodesic equation in a Lorentzian metric (an indefinite metric, of signature ): space-like solutions locally minimize and time-like solutions locally maximize it; general solutions flip between these two types through cusp singularities at the transitions.

Further reading

There are many more recent results on Mumford–Shah minimizers and segmentation: this is a rich current area of research, with a large number of papers on the topic. Suggested references are the papers of Younes–Michor–Shah–Mumford, Mumford–Kosslyn–Hillger–Herrnstein, and the survey of Leah Bar et al. listed below.

References

  • David Mumford, Jayant Shah, Optimal approximations by piecewise smooth functions and associated variational problems, Commun. Pure Applied Math. Vol. XLII (1989) 577–685.
  • Frank Morgan, Geometric measure theory: A beginner’s guide (Fourth ed.), Academic Press, 2009.
  • Frederick J. Almgren, Jr., Plateau’s Problem: An Invitation to Varifold Geometry, Revised Edition, American Mathematical Society, 2001.
  • Herbert Federer, Colloquium lectures on geometric measure theory, Bull. Amer. Math. Soc. 84 (1978), 291–338.
  • Laurent Younes, Peter W. Michor, Jayant Shah, David Mumford, A metric on shape space with explicit geodesics, Rend. Lincei Mat. Appl. 19 (2008) 25–57.
  • D. Mumford, S. M. Kosslyn, L. A. Hillger, R. J. Herrnstein, Discriminating figure from ground: the role of edge detection and region growing, Proc. Nat. Acad. Sci. U.S.A. 84 (1987), no. 20, 7354–7358.
  • Leah Bar et al., Mumford and Shah model and its applications to image segmentation and image restoration, in “Handbook of Mathematical Methods in Imaging”, Springer 2011, 1095–1157.