Thin plate spline

From HandWiki

Thin plate splines (TPS) are a spline-based technique for data interpolation and smoothing. "A spline is a function defined by polynomials in a piecewise manner."[1][2] They were introduced to geometric design by Duchon.[3] 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.[4]

Physical analogy

The name thin plate spline refers to a physical analogy involving the bending of a plate or 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 [math]\displaystyle{ z }[/math] 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 [math]\displaystyle{ x }[/math] or [math]\displaystyle{ y }[/math] coordinates within the plane. In 2D cases, given a set of [math]\displaystyle{ K }[/math] corresponding control points (knots), the TPS warp is described by [math]\displaystyle{ 2(K+3) }[/math] parameters which include 6 global affine motion parameters and [math]\displaystyle{ 2K }[/math] 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 [math]\displaystyle{ x }[/math] is two dimensional, for interpolation, the TPS fits a mapping function [math]\displaystyle{ f(x) }[/math] between corresponding point-sets [math]\displaystyle{ \{y_i\} }[/math] and [math]\displaystyle{ \{x_i\} }[/math] that minimizes the following energy function:

[math]\displaystyle{ E_{\mathrm{tps}}(f) = \sum_{i=1}^K \|y_i - f(x_i) \|^2 }[/math]

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

[math]\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 }[/math]

For this variational problem, it can be shown that there exists a unique minimizer [math]\displaystyle{ f }[/math] .[5] The finite element discretization of this variational problem, the method of elastic maps, is used for data mining and nonlinear dimensionality reduction. In simple words, "the first term is defined as the error measurement term and the second regularisation term is a penalty on the smoothness of [math]\displaystyle{ f }[/math]."[1][2] It is in a general case needed to make the mapping unique.

Radial basis function

Main page: Radial basis function

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

[math]\displaystyle{ f(x) = \sum_{i = 1}^K w_{i}\varphi(\left\| x - c_{i}\right\|) }[/math]

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

Spline

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

[math]\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 }[/math]

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

If one substitutes the solution for [math]\displaystyle{ f }[/math], [math]\displaystyle{ E_{tps} }[/math] becomes:

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

where [math]\displaystyle{ Y }[/math] and [math]\displaystyle{ X }[/math] are just concatenated versions of the point coordinates [math]\displaystyle{ y_i }[/math] and [math]\displaystyle{ x_i }[/math], and [math]\displaystyle{ \Phi }[/math] is a [math]\displaystyle{ (K\times K) }[/math] matrix formed from the [math]\displaystyle{ \phi (\|x_i - x_j\|) }[/math]. Each row of each newly formed matrix comes from one of the original vectors. The matrix [math]\displaystyle{ \Phi }[/math] 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 [math]\displaystyle{ c }[/math], 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.[6] An additional application is the analysis and comparisons of archaeological findings in 3D[7] and was implemented for triangular meshes in the GigaMesh Software Framework.[8]

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]

See also

References

  1. 1.0 1.1 1.2 Tahir, Anam (2023). Formation Control of Swarms of Unmanned Aerial Vehicles. Finland: University of Turku. ISBN 978-951-29-9411-3. https://www.utupub.fi/bitstream/handle/10024/175822/Annales%20F%2027%20Tahir.pdf?sequence=1&isAllowed=y. 
  2. 2.0 2.1 2.2 Tahir, Anam; Haghbayan, Hashem; Böling, Jari M.; Plosila, Juha (2023). "Energy-Efficient Post-Failure Reconfiguration of Swarms of Unmanned Aerial Vehicles". IEEE Access 11: 24768 – 24779. doi:10.1109/ACCESS.2022.3181244. https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9791400. 
  3. 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
  4. Chui, Haili (2001), Non-Rigid Point Matching: Algorithms, Extensions and Applications, Yale University, New Haven, CT, USA 
  5. Wahba, Grace (1990), Spline models for observational data, Philadelphia, PA, USA: Society for Industrial and Applied Mathematics (SIAM), doi:10.1137/1.9781611970128, ISBN 978-0-89871-244-5 
  6. 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. 
  7. 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), http://insticc.org/node/TechnicalProgram/visigrapp/presentationDetails/73858, retrieved 28 March 2019 
  8. "Tutorial No. 13: Apply TPS-RPM Tranformation". https://gigamesh.eu/?page=tutorials&topic=13._Apply_TPS_RPM_Transformation. Retrieved 3 March 2019. 

External links