# Difference between revisions of "Thin plate spline"

en>Schomerus (Reinstating the commented out section. This is a bad way to make edits because then they don't show up in the diffs! If there are any doubts about these sections, I suggest bringing them up in the talk page first. ~~~~) |
|||

Line 1: | Line 1: | ||

{{expert-subject}} | {{expert-subject}} | ||

− | '''Thin plate splines (TPS)''' are | + | '''Thin plate splines (TPS)''' are a [[spline]]-based technique for data [[interpolation]] and [[smoothing]]. They were introduced to [[geometric design]] by Duchon. <ref>J. Duchon, 1976, Splines minimizing rotation invariant semi-norms in Sobolev spaces. pp 85–100, In: Constructive Theory of Functions of Several Variables, Oberwolfach 1976, W. Schempp and K. Zeller, eds., Lecture Notes in Math., Vol. 571, Springer, Berlin, 1977</ref> |

==Physical analogy== | ==Physical analogy== | ||

Line 10: | Line 10: | ||

The TPS arises from consideration of the integral of the square of the second derivative -- this forms its smoothness measure. In the case where <math>x</math> is two dimensional, for interpolation, the TPS fits a mapping function <math>f(x)</math> between corresponding point-sets <math>\{y_i\}</math> and <math>\{x_i\}</math> that minimises the following energy function: | The TPS arises from consideration of the integral of the square of the second derivative -- this forms its smoothness measure. In the case where <math>x</math> is two dimensional, for interpolation, the TPS fits a mapping function <math>f(x)</math> between corresponding point-sets <math>\{y_i\}</math> and <math>\{x_i\}</math> that minimises the following energy function: | ||

:<math> | :<math> | ||

− | + | E_{tps}(f) = \sum_{i=1}^K \|y_i - f(x_i) \|^2 | |

</math> | </math> | ||

Line 16: | Line 16: | ||

:<math> | :<math> | ||

− | E_{tps}(f) = \sum_{i=1}^K \|y_i - f(x_i) \|^2 + \lambda \iint\left[\left(\frac{\partial^2 f}{\partial x_1^2}\right)^2 + 2\left(\frac{\partial^2 f}{\partial x_1 \partial x_2}\right)^2 + \left(\frac{\partial^2 f}{\partial x_2^2}\right)^2 \right] \textrm{d} x_1 \, \textrm{d}x_2 | + | E_{tps,smooth}(f) = \sum_{i=1}^K \|y_i - f(x_i) \|^2 + \lambda \iint\left[\left(\frac{\partial^2 f}{\partial x_1^2}\right)^2 + 2\left(\frac{\partial^2 f}{\partial x_1 \partial x_2}\right)^2 + \left(\frac{\partial^2 f}{\partial x_2^2}\right)^2 \right] \textrm{d} x_1 \, \textrm{d}x_2 |

</math> | </math> | ||

Line 31: | Line 31: | ||

where <math>\left\|\cdot\right\|</math> denotes the usual [[Norm (mathematics)|Euclidean norm]] and <math>\{c_{i}\}</math> is a set of mapping coefficients. The TPS corresponds to the radial basis kernel <math>\varphi(r) = r^2 \log r</math>. | where <math>\left\|\cdot\right\|</math> denotes the usual [[Norm (mathematics)|Euclidean norm]] and <math>\{c_{i}\}</math> is a set of mapping coefficients. The TPS corresponds to the radial basis kernel <math>\varphi(r) = r^2 \log r</math>. | ||

− | |||

===Spline=== | ===Spline=== | ||

Suppose the points are in 2 dimensions (<math>D = 2</math>). One can use ''homogeneous coordinates'' for the point-set where a point <math>y_{i}</math> is represented as a vector <math>(1, y_{ix}, y_{iy})</math>. The unique minimizer <math>f</math> is parameterized by <math>\alpha</math> which comprises two matrices <math>d</math> and <math>c</math> (<math>\alpha = \{d,c\}</math>). | Suppose the points are in 2 dimensions (<math>D = 2</math>). One can use ''homogeneous coordinates'' for the point-set where a point <math>y_{i}</math> is represented as a vector <math>(1, y_{ix}, y_{iy})</math>. The unique minimizer <math>f</math> is parameterized by <math>\alpha</math> which comprises two matrices <math>d</math> and <math>c</math> (<math>\alpha = \{d,c\}</math>). | ||

Line 75: | Line 74: | ||

E_{bending} = \lambda\,\textrm{trace}[Q_2(Q_2^T\Phi Q_2 + \lambda I_{(k-D-1)})^{-1}Q_2^T Y Y^T] | E_{bending} = \lambda\,\textrm{trace}[Q_2(Q_2^T\Phi Q_2 + \lambda I_{(k-D-1)})^{-1}Q_2^T Y Y^T] | ||

</math> | </math> | ||

− | + | ||

==Application== | ==Application== | ||

Line 81: | Line 80: | ||

alignment and shape matching. | alignment and shape matching. | ||

− | The | + | The Thin-plate-spline has a number of properties which have contributed to its popularity: |

− | # | + | #It produces smooth surfaces, which are infinitely differentiable. |

− | # | + | #There are no free parameters that need manual tuning. |

#It has closed-form solutions for both warping and parameter estimation. | #It has closed-form solutions for both warping and parameter estimation. | ||

#There is a physical explanation for its energy function. | #There is a physical explanation for its energy function. | ||

Line 96: | Line 95: | ||

==References== | ==References== | ||

− | *Haili Chui: Non-Rigid Point Matching: Algorithms, Extensions and Applications. PhD Thesis, Yale University, May 2001. | + | {{Reflist}} |

+ | * Haili Chui: Non-Rigid Point Matching: Algorithms, Extensions and Applications. PhD Thesis, Yale University, May 2001. | ||

*G. Wahba, 1990, Spline models for observational data. Philadelphia: Society for Industrial and Applied Mathematics. | *G. Wahba, 1990, Spline models for observational data. Philadelphia: Society for Industrial and Applied Mathematics. | ||

− | |||

==External links== | ==External links== | ||

Line 105: | Line 104: | ||

*[http://elonen.iki.fi/code/tpsdemo/index.html TPS in C++] | *[http://elonen.iki.fi/code/tpsdemo/index.html TPS in C++] | ||

*[http://launchpad.net/templatedtps TPS in templated C++] | *[http://launchpad.net/templatedtps TPS in templated C++] | ||

+ | *[http://code.google.com/p/pheonixrt/wiki/WarpTPS TPS interactive morphing demo] | ||

[[Category:Splines]] | [[Category:Splines]] | ||

[[Category:Multivariate interpolation]] | [[Category:Multivariate interpolation]] |

## Latest revision as of 19:53, 6 January 2015

**Thin plate splines (TPS)** are a spline-based technique for data interpolation and smoothing. They were introduced to geometric design by Duchon. ^{[1]}

## Physical analogy

The name *thin plate spline* refers to a physical analogy involving the bending of a thin sheet of metal. Just as the metal has rigidity, the TPS fit resists bending also, implying a penalty involving the smoothness of the fitted surface. In the physical setting, the deflection is in the direction, orthogonal to the plane. In order to apply this idea to the problem of coordinate transformation, one interprets the lifting of the plate as a displacement of the or coordinates within the plane. In 2D cases, given a set of corresponding points, the TPS warp is described by parameters which include 6 global affine motion parameters and coefficients for correspondences of the control points. These parameters are computed by solving a linear system, in other words, TPS has closed-form solution.

## Smoothness measure

The TPS arises from consideration of the integral of the square of the second derivative -- this forms its smoothness measure. In the case where is two dimensional, for interpolation, the TPS fits a mapping function between corresponding point-sets and that minimises the following energy function:

The smoothing variant, correspondingly, uses a tuning parameter to control how non-rigid is allowed for the deformation, balancing the aforementioned criterion with the measure of goodness of fit, thus minimising:

For this variational problem, it can be shown that there exists a unique minimizer (Wahba,1990).The finite element discretization of this variational problem, the method of elastic maps, is used for data mining and nonlinear dimensionality reduction.

## Radial basis function

{{#invoke:main|main}}

The Thin Plate Spline has a natural representation in terms of radial basis functions. Given a set of control points , a radial basis function basically defines a spatial mapping which maps any location in space to a new location , represented by,

where denotes the usual Euclidean norm and is a set of mapping coefficients. The TPS corresponds to the radial basis kernel .

### Spline

Suppose the points are in 2 dimensions (). One can use *homogeneous coordinates* for the point-set where a point is represented as a vector . The unique minimizer is parameterized by which comprises two matrices and ().

where d is a matrix representing the affine transformation (hence is a vector) and c is a warping coefficient matrix representing the non-affine deformation. The kernel function is a vector for each point , where each entry for each () dimensions. Note that for TPS, the control points are chosen to be the same as the set of points to be warped , so we already use in the place of the control points.

If one substitutes the solution for , becomes:

where and are just concatenated versions of the point coordinates and , and is a matrix formed from the . Each row of each newly formed matrix comes from one of the original vectors. The matrix represents the TPS kernel. Loosely speaking, the TPS kernel contains the information about the point-set's internal structural relationships. When it is combined with the warping coefficients , a non-rigid warping is generated.

A nice property of the TPS is that it can always be decomposed into a global affine and a local non-affine component. Consequently, the TPS smoothness term is solely dependent on the non-affine components. This is a desirable property, especially when compared to other splines, since the global pose parameters included in the affine transformation are not penalized.

### Solution

The separation of the affine and non-affine warping space is done through a QR decomposition (Wahba,1990).

where Q1 and Q2 are and orthonormal matrices, respectively. The matrix is upper triangular. With the QR decomposition in place, we have

where is a matrix. Setting (which in turn implies that ) enables us to cleanly separate the first term in last third equation into a non-affine term and an affine term (first and second terms last equation respectively).

The least-squares energy function in the last equation can be first minimized w.r.t and then w.r.t. . By applying Tikhonov regularization we have

The minimum value of the TPS energy function obtained at the optimum is

## Application

TPS has been widely used as the non-rigid transformation model in image alignment and shape matching.

The Thin-plate-spline has a number of properties which have contributed to its popularity:

- It produces smooth surfaces, which are infinitely differentiable.
- There are no free parameters that need manual tuning.
- It has closed-form solutions for both warping and parameter estimation.
- There is a physical explanation for its energy function.

## See also

- Inverse distance weighting
- Radial basis function
- Subdivision surface (emerging alternative to spline-based surfaces)
- Elastic map (a discrete version of the thin plate approximation for manifold learning)
- Spline
- Polyharmonic spline (the thin-plate-spline is a special case of a polyharmonic spline)

## References

- ↑ J. Duchon, 1976, Splines minimizing rotation invariant semi-norms in Sobolev spaces. pp 85–100, In: Constructive Theory of Functions of Several Variables, Oberwolfach 1976, W. Schempp and K. Zeller, eds., Lecture Notes in Math., Vol. 571, Springer, Berlin, 1977

- Haili Chui: Non-Rigid Point Matching: Algorithms, Extensions and Applications. PhD Thesis, Yale University, May 2001.
- G. Wahba, 1990, Spline models for observational data. Philadelphia: Society for Industrial and Applied Mathematics.