G12 Differential Topology of Image Segmentation and Invariance
This part of the course is based on the paper of Thomas J. Tsao and Doris Y. Tsao, A topological solution to object segmentation and tracking (Proc. Natl. Acad. Sci. U.S.A. 2022).
Segmentation and invariance
Vision has to solve two basic problems:
- the segmentation problem: how the visual pixels of a single image are grouped into distinct objects;
- the invariance problem: how objects can be identified across images despite their changing appearance.
The slides illustrate both with photographs (from Tsao–Tsao): (A) a close-up of overlapping variegated leaves with three circled points, where one has to decide which of the points lie on the same leaf; (B) three photographs of the same horse, seen from the side, from behind and from the front. The main problem of invariance is that the appearance of the same object can change drastically with a change in perspective.
One could hand-pick multiple views of the same object and train classifiers to perform view-invariant detection. This delegates the problem to the hand-picker responsible for the training, which is the same biological visual system one wants to understand. The main idea of the mathematical approach is instead:
- segmentation of an image into separate surfaces through the detection of occluding contours (the spatial separation of visible surfaces);
- tracking of invariant surfaces through the detection of stereo diffeomorphisms (the overlap relations between surfaces visible from different views).
There are two aspects of the problem:
- how surfaces in space are projected into ray spaces, and how diffeomorphisms in ray spaces encode surfaces;
- how to compute these diffeomorphisms from images.
The first is an “encoding” problem, mathematically well posed; the second is a “detection” problem, subject to noise and ambiguity. The basic object is the perspective projection, a map from a 2D surface to a 2D ray space. Differential topology lets one view perspective projections as 2D-to-2D diffeomorphisms on regular domains separated by critical points.
A figure from Tsao–Tsao summarizes the framework in four panels, each pairing a photograph of a variegated leaf with a schematic drawing: (A) points project to ray space (a point
The main properties of the approach:
- 3D space is mapped homeomorphically, through biprojection, onto a 3D submanifold of the product of a pair of 2D ray spaces;
- a scene in 3D space is a collection of 2D surfaces, and these are also mapped continuously into the product of two ray spaces;
- the topology of the surfaces is coded by perspective transformations between pairs of ray spaces;
- a mapping from a domain in one ray space to another ray space fully specifies a surface in the 3D environment;
- there are conditions under which partial samples can be associated with a single surface;
- transition vectors model movements of the eye and perspective transitions: perspective mappings and occluding contours are derived from changes of images.
Ray spaces and perspective projection
Definition G12.1 (Scenes, rays and visual space).
- Setting: a scene in Euclidean 3D space, consisting of compact objects (and planes) whose boundary is a collection of smooth, compact, orientable 2D surfaces (rough surfaces are approximated by smooth ones).
- A ray is a half-line in Euclidean 3D space.
- The ray space
is the set of all rays starting at a point . It is identified with the sphere, . (Rays are half-lines, not lines, so the parameterizing space is and not .) On ray space we use spherical coordinates with and . - An observation domain is an open connected region
. - The visual space is the sphere bundle
with fiber over each and projection map .
Definition G12.2 (Ray projection). Given an observation point
Definition G12.3 (Visibility and perspective projection).
- A point
is visible from if the interior of the ray segment from to does not intersect any surface in the given scene. - The visible scene for an observation point
is the set of points on the surfaces in the scene that are visible from . - The perspective projection from a 2D surface
in to a ray space , with , is the ray projection of each visible point . - The ambient perspective projection is the perspective projection to
of all points of the visible 3D environment. - The ambient perspective projection to a visual space
is the collection of the ambient perspective projections to each with .
The groupoid of movement in observation space
Not all rigid motions of the ambient
Definition G12.4 (Groupoid). A groupoid
- a set of objects
; - a set of morphisms (arrows)
; - source and target maps
; - an associative composition
The perspective transition groupoid has as arrows the triples
Stereo projection
Definition G12.5 (Stereo projection and stereo set). Let
The stereo set of the perspective transition
The product
The figure shows the geometry of a perspective transition and the stereo projection (biprojection) of a point
Proposition G12.6 (3D embedding). Let
Proof. This can be checked directly in local coordinates. Put
Now take a domain
The slides illustrate this with a picture from Tsao–Tsao: a curved surface carrying a letter “A”, seen from two observation points. The patch projects to domains
Occluding contours
Almost all points of a ray space are regular with respect to a perspective projection: they are regular values, since by Sard’s theorem the critical values of a differentiable map form a set of measure zero.
Definition G12.7 (Fold cone and occluding contours). The fold cone of an object, seen from an observation point, is the cone of rays grazing the object. The surface of the fold cone is transverse to the surfaces
The slide’s cartoon shows the ray-space sphere of an observer and a cone of rays grazing a small round object; the cone continues past it and meets a background object (a cloud) along a ring.
In the figure, the point
Singularities: folds and cusps
The relevant theory of singularities is in H. Whitney, On singularities of mappings of Euclidean spaces. I. Mappings of the plane into the plane (Annals of Mathematics 1955), and in V. I. Arnold, Catastrophe Theory (Springer 1984).
Theorem G12.8 (Whitney). Generically there are only two kinds of singularities: all other singularities reduce to these, or cancel under small changes in the direction of projection, while these two types are stable and persist after small deformations of the map. The stable singularities of smooth mappings between 2D surfaces are
- folds,
- cusps.
The slides use Arnold’s pictures. First, the fold of the projection of a sphere onto the plane:
Second, the cusp of the projection of a surface onto the plane. Arnold’s picture shows a pleated surface over the plane, its fold curve, and the image of the fold curve in the plane, which has a cusp. Here it is drawn for the normal form
Both singularities appear as occlusion contours. For a torus, the apparent contour consists of an outer fold curve and inner fold curves that end in cusps:
- Every point in a border of accretion is a critical value of the perspective projection.
- The singularities of a projection from a surface to the ray space are either fold points or cusp points (at the end of a fold contour).
Ownership of occluding contours
Figure–background perception problems show that a contour in a 2D image may be ambiguous as to which side it belongs to. The slide shows the classical black vase on a white background, whose outline can also be seen as two faces in profile. This ownership problem arises with 2D images, but it is usually resolved when one is allowed to change perspective (mapping 3D space with biprojections to
Accretion
The observation point moves from
Illusory contours versus occluding contours
In a segmentation of a 2D image some contours are “illusory”: they do not separate different objects in 3D space. The slides show an example from Tsao–Tsao: two frames of a cluttered scene, their edge maps, and two kinds of contour segments compared between the frames. For a texture segment, the image regions on both sides of the contour map diffeomorphically from one frame to the other. For an occluding segment, the region on one side (the owner side) maps diffeomorphically, and the region on the other side does not.
Definition G12.9 (Surface with boundary). A surface with boundary has local charts
The regions of a 2D image on the two sides of a contour can be seen as surfaces with boundary. A change of perspective maps them to two other regions, each the image under a diffeomorphism of surfaces with boundary. These two diffeomorphisms may or may not be restrictions of a single diffeomorphism of a 2D surface without boundary:
- if they glue, the contour is an illusory contour;
- if they do not glue to a single diffeomorphism, the contour is an obstruction (occluding) contour, with an intervening accretion region.
The slides illustrate the gluing with a standard picture: two manifolds with boundary
- In a perspective transition, accretion and deletion happen only on the background side. This disambiguates the image–background ownership problem.
- Given a set of frame images of the same scene from varying observation points, there is a set of associated perspective transitions
. Surfaces in the 3D scene have projection images and , related by the maps , where is the map induced by the transition as above. - The contours on
and the accretion zones on determine the occlusion contours and border ownership.
Computational aspect: receptive fields
The question is how receptive fields solve the correspondence problem between images taken from different perspectives. The slide shows vertically oriented Gabor filters (Gaussian envelopes times sinusoidal gratings), even and odd, as grayscale images: a pair
Definition G12.10 (Receptive fields as Gabor frames).
- The components of an image function
on the Gabor filters are . - Under a transformation
of the image, where and is its adjoint. - A diffeomorphism
is locally linearized by an affine transformation , and are the components on the affine-transformed Gabor filters .
In a perspective transition, the measured response (to first-order approximation of the deformation) is a shift of the Gabor frame of a simple cell’s receptive field, apparently following an energy minimization process. The slides show measured changes of the receptive field of one Gabor simple cell: a stereo pair of aerial photographs of terrain, with a bar marking the receptive field, and below them a row of five receptive-field profiles
Further mathematical considerations on the Tsao–Tsao model
Recall the two main geometric aspects of the problem:
- how surfaces in space are projected into ray spaces, and how diffeomorphisms in ray spaces encode surfaces;
- how to compute these diffeomorphisms from images.
The first is an “encoding” problem, mathematically well posed; the second is a “detection” problem, subject to noise and ambiguity.
- Perspective projection: a mapping from a 2D surface to a 2D ray space; differential topology gives 2D-to-2D diffeomorphisms on regular domains separated by critical points.
- Stereovision: two independent 2D ray spaces, and a mapping of 3D space to a submanifold of the 4-dimensional product of two ray spaces; the topology of surfaces is encoded through “perspective transformations” between ray spaces.
Geometries
- A ray is a half-line in Euclidean 3D space; the ray space is the 2D sphere
(half-lines, so not ). - The visual space is the sphere bundle with projection
and fiber over : the points of (open and connected) together with the set of all possible observation directions (rays). - The rigid motions form the special Euclidean group
, with - A change of perspective: observation points
are related by a rigid motion of the ambient that moves to . It also acts on the visual space sphere bundle , mapping rays to rays .
The perspective transition groupoid
From here on
Definition G12.11 (Perspective transition groupoid). For a visual scene
- objects:
is the total space of the visual space sphere bundle ; - morphisms (arrows):
is the set of triples with and , that is , and , with and ; - source and target maps
, - morphisms are invertible,
- composition of morphisms,
Ray projections
- For an observation point
and any point in , the ray projection is the ray in pointing in the direction of . - For a region
and different observation points , the stereo-projection (biprojection) map is - Let
be the straight line in that contains and . The map fails to be injective along , and gives an embedding - A 2D surface
has image , embedded in the 4D space . - The restrictions to
of the projections of to the two factors give smooth projections between 2D spaces. - We generally assume that the visual scene is limited in 3D, so that it does not simultaneously meet all ray directions from the observer:
for some direction .
Correspondences
Definition G12.12 (Correspondence). A correspondence between
A function
Functions
Definition G12.13 (Composition of correspondences). For correspondences
When working with smooth manifolds this requires the intersection
Transversality
Definition G12.14 (Transversality). Smooth
If
Theorem G12.15 (Sard’s theorem: transversality is generic). Let
Transversality of
Whitney’s theorems
By transversality,
Theorem G12.16 (Whitney’s immersion theorem). A smooth map
Theorem G12.17 (Whitney’s embedding theorem). A manifold
First deform
The slide illustrates the trick with plane curves: a figure-eight curve has one double point; a small deformation adds a kink, creating a second double point; the region between the two double points (shaded) is then pushed across and shrunk until both double points disappear, leaving an embedded closed curve.
So, possibly after a smooth deformation,
- Equivalence classes of correspondences
: correspondences are taken up to the equivalence that allows such deformations to achieve transversality and embeddings. - Semigroupoid: in general correspondences are not invertible, so composition gives a semigroupoid (arrows with an associative composition, as in a groupoid, without inverses); the invertible correspondences are (equivalent to) graphs of diffeomorphisms.
Correspondences and visibility
- Correspondences are given by surfaces
inside the product . - The sub-correspondence
accounts for the visibility condition for with respect to the observation points . - Let
be a non-transparent part of a visual scene. A visible point is one such that the ray from to contains no other point of ; these form the visible scene. - For
there are two visible surfaces, and .
Definition G12.18 (Stereo set correspondence).
Assume the surfaces
Critical sets and stable types
Definition G12.19 (Critical points and critical values). Let
Theorem G12.20 (Sard’s theorem). The set of critical values
Theorem G12.21 (Whitney). Singularities of smooth maps from a 2D surface to the plane reduce (up to small deformations) to the stable types, folds and cusps, with normal forms
These are the fold and the cusp pictured earlier. The local quadratic or cubic equation near folds and cusps means that the fiber of the projection consists in general of two points near a fold curve, or three points near a cusp: only one of these points is in the visible surface
The presence of folds and cusps for the two projections
Surfaces with boundary and accretion
- One uses the visible-surfaces correspondence
instead of the whole . - The surfaces
and have boundary, and the boundary partly overlaps with the occluding contours of the projections and of . - These are surfaces with boundary in the sense defined above: local charts
, homeomorphisms of with open sets of (topology induced from ), with smooth coordinate changes , where smooth near a point of means extending to a smooth map on a neighborhood in .
The regions of a 2D image on the two sides of a contour are surfaces with boundary, mapped by the change of perspective to two other regions (each the image under a diffeomorphism of surfaces with boundary). As in the gluing picture above:
- if the two maps are restrictions of a single diffeomorphism of a 2D surface without boundary, the contour is an illusory contour;
- if they are not restrictions of a single diffeomorphism (they do not glue to a surface without boundary), the contour is an actual obstruction contour.
So the accretion region disambiguates image/background ownership and illusory/real contours.
The thin semigroupoid of ray projections
Definition G12.22 (Thin category). A thin category is a category with at most one morphism between any pair of objects. (Example: partially ordered sets.)
Consider the correspondences from the ray projections of a surface
Definition G12.23 (Thin semigroupoid of ray projections). The thin semigroupoid
It just keeps track of the changes of stereo-perspective on a fixed surface
The semigroupoid of visibility under ray projections
Now consider the correspondences with the visibility condition,
References
- Thomas J. Tsao, Doris Y. Tsao, A topological solution to object segmentation and tracking, Proc. Natl. Acad. Sci. U.S.A. 119 (41) (2022) e2204248119.
- H. Whitney, On singularities of mappings of Euclidean spaces. I. Mappings of the plane into the plane, Annals of Mathematics 62 (1955) no. 3, 374–410.
- V. I. Arnold, Catastrophe Theory, Springer, 1984.