# Thin plate spline

Thin plate splines (TPS) are a spline-based technique for data interpolation and smoothing. They were introduced to geometric design by Duchon.[1] They are an important special case of a polyharmonic spline. Robust Point Matching (RPM) is a common extension and shortly known as the TPS-RPM algorithm.[2]

## 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 ${\displaystyle z}$  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 ${\displaystyle x}$  or ${\displaystyle y}$  coordinates within the plane. In 2D cases, given a set of ${\displaystyle K}$  corresponding points, the TPS warp is described by ${\displaystyle 2(K+3)}$  parameters which include 6 global affine motion parameters and ${\displaystyle 2K}$  coefficients for correspondences of the control points. These parameters are computed by solving a linear system, in other words, TPS has a 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 ${\displaystyle x}$  is two dimensional, for interpolation, the TPS fits a mapping function ${\displaystyle f(x)}$  between corresponding point-sets ${\displaystyle \{y_{i}\}}$  and ${\displaystyle \{x_{i}\}}$  that minimizes the following energy function:

${\displaystyle E_{\mathrm {tps} }(f)=\sum _{i=1}^{K}\|y_{i}-f(x_{i})\|^{2}}$

The smoothing variant, correspondingly, uses a tuning parameter ${\displaystyle \lambda }$  to control the rigidity of the deformation, balancing the aforementioned criterion with the measure of goodness of fit, thus minimizing:

${\displaystyle E_{\mathrm {tps} ,\mathrm {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}}$

For this variational problem, it can be shown that there exists a unique minimizer ${\displaystyle f}$  .[3] 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

The thin plate spline has a natural representation in terms of radial basis functions. Given a set of control points ${\displaystyle \{c_{i},i=1,2,\ldots ,K\}}$ , a radial basis function defines a spatial mapping which maps any location ${\displaystyle x}$  in space to a new location ${\displaystyle f(x)}$ , represented by

${\displaystyle f(x)=\sum _{i=1}^{K}w_{i}\varphi (\left\|x-c_{i}\right\|)}$

where ${\displaystyle \left\|\cdot \right\|}$  denotes the usual Euclidean norm and ${\displaystyle \{w_{i}\}}$  is a set of mapping coefficients. The TPS corresponds to the radial basis kernel ${\displaystyle \varphi (r)=r^{2}\log r}$ .

### Spline

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

${\displaystyle f_{tps}(z,\alpha )=f_{tps}(z,d,c)=z\cdot d+\phi (z)\cdot c=z\cdot d+\sum _{i=1}^{K}\phi _{i}(z)c_{i}}$

where d is a ${\displaystyle (D+1)\times (D+1)}$  matrix representing the affine transformation (hence ${\displaystyle z}$  is a ${\displaystyle 1\times (D+1)}$  vector) and c is a ${\displaystyle K\times (D+1)}$  warping coefficient matrix representing the non-affine deformation. The kernel function ${\displaystyle \phi (z)}$  is a ${\displaystyle 1\times K}$  vector for each point ${\displaystyle z}$ , where each entry ${\displaystyle \phi _{i}(z)=\|z-x_{i}\|^{2}\log \|z-x_{i}\|}$ . Note that for TPS, the control points ${\displaystyle \{c_{i}\}}$  are chosen to be the same as the set of points to be warped ${\displaystyle \{x_{i}\}}$ , so we already use ${\displaystyle \{x_{i}\}}$  in the place of the control points.

If one substitutes the solution for ${\displaystyle f}$ , ${\displaystyle E_{tps}}$  becomes:

${\displaystyle E_{tps}(d,c)=\|Y-Xd-\Phi c\|^{2}+\lambda c^{T}\Phi c}$

where ${\displaystyle Y}$  and ${\displaystyle X}$  are just concatenated versions of the point coordinates ${\displaystyle y_{i}}$  and ${\displaystyle x_{i}}$ , and ${\displaystyle \Phi }$  is a ${\displaystyle (K\times K)}$  matrix formed from the ${\displaystyle \phi (\|x_{i}-x_{j}\|)}$ . Each row of each newly formed matrix comes from one of the original vectors. The matrix ${\displaystyle \Phi }$  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 ${\displaystyle c}$ , 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.

## Applications

TPS has been widely used as the non-rigid transformation model in image alignment and shape matching.[4] An additional application is the analysis and comparisons of archaeological findings in 3D[5] and was implemented for triangular meshes in the GigaMesh Software Framework.[6]

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

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

However, note that splines already in one dimension can cause severe "overshoots". In 2D such effects can be much more critical, because TPS are not objective.[citation needed]

## References

1. ^ 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. doi:10.1007/BFb0086566
2. ^ Chui, Haili (2001), Non-Rigid Point Matching: Algorithms, Extensions and Applications, Yale University, New Haven, CT, USA, CiteSeerX 10.1.1.109.6855
3. ^ Wahba, Grace (1990), Spline models for observational data, Philadelphia, PA, USA: Society for Industrial and Applied Mathematics (SIAM), CiteSeerX 10.1.1.470.5213, doi:10.1137/1.9781611970128, ISBN 978-0-89871-244-5
4. ^ Bookstein, F. L. (June 1989). "Principal warps: thin plate splines and the decomposition of deformations". IEEE Transactions on Pattern Analysis and Machine Intelligence. 11 (6): 567–585. doi:10.1109/34.24792.
5. ^ Bogacz, Bartosz; Papadimitriou, Nikolas; Panagiotopoulos, Diamantis; Mara, Hubert (2019), "Recovering and Visualizing Deformation in 3D Aegean Sealings", Proc. Of the 14th International Conference on Computer Vision Theory and Application (VISAPP), Prague, Czech Republic, retrieved 28 March 2019
6. ^ "Tutorial No. 13: Apply TPS-RPM Tranformation". GigaMesh Software Framework. Retrieved 3 March 2019.