Geodesic Gaussian Processes for Modeling Free-Form Surfaces Embedded in 3D Space Enrique del Castillo∗ Department of Industrial and Manufacturing Engineering The Pennsylvania State University, University Park, PA 16802, USA and Bianca M. Colosimo† Dipartimento di Meccanica - Politecnico di Milano, 20133 Milano, Italy July 21, 2012
Abstract A new method for the statistical modeling of free-form surfaces is presented. The surface is represented in a parametric way, where each cartesian coordinate is a function of surface coordinates (u, v). We apply parameterization algorithms from the manifold learning and computer graphics literature to find these surface coordinates and then use them as locations in a spatial Gaussian Process model that considers correlations a function of geodesic distances over the surface, rather than as a function of euclidean distances over the xy plane. We show how the proposed Geodesic Gaussian Process (GGP) approach performs better than the usual kriging approach to model surfaces where only the heights are modeled as a function of 2-dimensional euclidean space. Our focus is on those situations where the data occurs on a non-euclidean surface and where all 3 cartesian coordinates can only be inferred from noisy measurements. The methodology is applied to simulated surface data and to a real dataset obtained with a Coordinate Measuring Machine (CMM). The parametric surface representation is compatible with CAD models and allows differential-geometry manipulations such as the computation of surface areas.
Keywords: Non-euclidean distances, Non-stationary spatial covariance, Gaussian Random Function Model, Multivariate Spatial Model ∗
Dr. Castillo is Distinguished Professor of Industrial & Manufacturing Engineering and Professor of Statistics. e-mail:
[email protected] † Dr. Colosimo is an Associate Professor in the Production Technology Group. e-mail:
[email protected]
1
1
Introduction
We consider the statistical modeling of noisy measurements taken from a surface S embedded in 3-dimensional (3D) euclidean space. In applications in engineering and geostatistics, Kriging and Gaussian Processes have been used for modeling spatially distributed data under the assumption that observations z(x, y) that occur on nearby locations (x, y) ∈ E2 (euclidean 2D space) will tend to be alike, where “closeness” is defined by the standard euclidean distance on E2 . While this assumption has proven successful in many applications, our focus is instead on those situations where the data occurs on a non-euclidean surface and where all 3 coordinates can only be inferred from noisy measurements. In this paper, we assume the correlation between two different measured points on the surface S ⊂ E3 is a function of the geodesic distance between them . For instance, in industrial metrology, measurements (x, y, z) on the surface of a “freeform” manufactured part are taken by definition on a non-euclidean 2-manifold and correlations will likely occur as a function of distance on the surface. Furthermore, measurement errors on all 3 spatial coordinates may be possible, so selecting one of the coordinates as the main response neglects the measurement error of the other two coordinate locations. Data obtained with scanners from machined surfaces has been reported to be gaussian-like but strongly spatially correlated [40]. Likewise, geostatistical data is frequently obtained from deposits whose directions follow non-euclidean paths [4]. If due to physical considerations, 3D data occur on a non-euclidean surface, correlations between points may exist, but the spatial correlation will depend on the geodesic distance between the points located on the surface, rather than depending on the inter-point euclidean distances on the space the surface is embedded in. If spatial correlation exists as a function of geodesic distances, spatial predictions based on euclidean distances will be biased, as we show below. In the earth sciences, a standard approach to model anisotropic spatial covariance whose contours are elliptical is to use Mahalanobis distances between two points wi and wj , rather than their euclidean distance, i.e., the covariance function is C(Ah) instead of C(h), where h = wi − wj and A is some invertible n × n matrix [34]. This, however, will not be adequate when there is local anisotropy, a term used in geostatistics to describe the changing direction behavior of deposits on a region subdivided in cells. An anisotropic covariance function does not meet the usual stationarity assumption in gaussian processes; local anisotropy cannot be dealt with a Mahalanobis distance. Some authors (e.g. [24]) use stationary kriging with non-euclidean distances. But as discussed by Curriero [8], covariance functions that are known to be valid (positive definite) in euclidean space are not necessarily valid on non-euclidean space, so he suggests applications involving noneuclidean distances to provide proof that the covariance functions utilized remain valid. Using a Mahalanobis distance is perhaps the simplest instance of one of the two main strategies to deal with the problem of modeling local anisotropy in geostatistics, namely, space deformation methods. These suggest transforming the non-euclidean space into an euclidean space, a line of work that originated with the important paper by Sampson and Guttorp [32]. Sampson and Guttorp’s procedure requires multiple measurements at the same 2-dimensional space locations {wi = (x, y)i } (the process is assumed time stationary), and applies multidimensional scaling (MDS) on the variances computed from the replicates 2
to obtain locations {w∗i = (x∗ , y ∗ )i } on a transformed, euclidean space, where a standard variogram or covariance model can then be estimated (and its validity be assured). Finally, using thin plane splines, they fit a function f : E2 → E2 (note this is a function from 2D to 2D) such that an isometry is found, i.e., f (w) = w∗ . This function then allows to extend the mapping from the observed points to any other new point w at which it is desired to predict the response of interest. A recent paper in this line of work, by Boisvert and Deutsch [5] also addresses the local anisotropy problem. They use the Isomap algorithm [41] to find near geodesical distances in a geological application in order to allow Kriging predictions on a scalar spatial response (grades of a mineral of interest at different depths). Their procedure requires considerable prior knowledge of the directions of the deposits in order to specify an anisotropic field (5 additional parameters per cell are needed). Their use of a dimensionality reduction method like Isomap is only for finding geodesic distances, but not to find a parameterization, so they do not use a parametric surface model as we do. Our proposed procedure, which is a space transformation method, only assumes we are dealing with noisy observations on a 2-dimensional surface patch contained in E3 , and models all three coordinates using a parametric surface approach. Other work that follows a space transformation strategy is by Schmidt and O’Hagan [35], who present a bayesian approach to find a transformation f : E2 → E2 . They set the prior of f as a Gaussian process and use MCMC techniques for posterior inference. Kim, Mallick and Holmes [18] focus on modeling sharp transitions in the covariance function, which they argue cannot be modeled with the type of smooth splines used by SampsonGuttorp approaches. They also consider finding a transformation f : E2 → E2 but their approach is based on partitioning the domain D, assuming each subregion is homogeneous and hence adequately modeled by a standard stationary kriging or gaussian process (this resembles methods in computer graphics used to “segment” a 3D object into several surface patches, each with lower curvature and hence easier to parameterize). In contrast with these procedures, our geodesic Gaussian Process model finds a 2D to 3D parameterization since it models all 3 measured coordinates and does not require replicated observations at the same locations or extra surface parameters. Furthermore, it allows inferences in the true underlying surface in the presence of noise, a modeling aspect recently emphasized by Cressie and Wikle ([7], section 4.1.2). A second strategy for modeling anisotropy is to directly fit a non-stationary covariance model to the data, rather than transforming the 2D locations space and use stationary covariance models in the transformed space. Recent efforts along this line are Paciorek and Schervish [30] who modify the Mahalanobis distance |Ah| by including the covariance matrices of a gaussian kernel centered at each point i. Jun and Stein [17] propose nonstationary models for the specific case the process occurs on a 2-sphere. Our proposed method falls in the first category of strategies, that of space transformation methods. A related field whose object of study are cloud points of data is statistical shape analysis. In this field, the shape of an object is defined as the geometrical properties of a configuration of points that remains after similarity transformations are removed via Procrustes alignment. There, the emphasis is to characterize the variability of the shape of objects based on a series of specimens of the same type (see e.g., [11] for a thorough discussion up to 1998). Given that these methods have been studied mostly in the biological 3
sciences, the points are frequently selected manually (landmarks) based on their biological or evolutionary interest. The emphasis in the present paper, instead, is to characterize a single cloud of points representing a surface acquired with a contact or non-contact probe in such a way that reliable predictions in all 3 coordinates can be made in the presence of noise. In this paper, a new methodology is presented to model noisy data that occurs on surfaces. Our Geodesic Gaussian Process (GGP) approach uses a parametric representation of the surface where all three coordinates are modeled via a Gaussian Process on the parametric space defined by surface coordinates (u, v). This is the preferred representation of surfaces in Computer Aided Design (CAD) (e.g see [26]) and file standards (e.g., IGES). Geodesic distances between the observed points, needed for GP modeling, are obtained from a E2 → E3 parameterization that is close to isometric. Our parametric surface setup facilitates solving the parameterization problem, models all 3 coordinates, does not require replicated observations at the same locations, and allows extension of the mapping to future locations on the surface. The rest of this paper is organized as follows. Section 2 introduces the main model assumptions as well as the differential geometry notions that will be used later on. Section 3 discusses the computation of a near isometric parameterization of a 3D surface (and therefore, computation of geodesic distances), a problem intensively studied in recent years in the fields of computer graphics and manifold learning. In section 4 we describe fitting the GP models. Then section 5 discusses how to “extend” the parameterization mapping to new locations on the surface (other than those used to fit the model) such that new predictions can be made. Section 6 presents a classical differential geometry analysis of the fitted surfaces, indicating how this can be useful to estimate the surface area of the underlying true surface. Section 7 discusses application of the proposed methods to a real data set obtained with a coordinate measuring machine (CMM). Throughout the paper, we use several illustrative simulated examples to show the benefits of the Geodesic GP approach over alternative modeling approaches. The paper concludes with some general discussion and suggestions for further research.
2
Model assumptions
The spatial statistical modeling of data obtained on a surface requires appropriate definition of the ‘locations’ at which the data are observed, and for this we can make use of some standard concepts from differential geometry. To this end, let p : D ⊂ E2 → S ⊂ E3 be a parameterization [29] from the space of surface coordinates (or ‘parameters’) to a 3-dimensional point p(u, v) on the surface S (see Figure 1). Since we wish to model the uncertainty on all 3 coordinates, we decompose p(u, v) in its three parametric component surfaces: x(u, v) p(u, v) ≡ p(w) = y(u, v) , w = (u, v) ∈ D ⊂ E2 , p(w) ∈ S ⊂ E3 (1) z(u, v) 4
p(w 1 )= p(u 1, v1 )
p−1 (x , y , z)=(u , v ) (u 1, v 1)=w 1
S p(w 2 )= p(u 2, v 2 )
3D (x,y,z) measurements on original non-euclidean surface
[ ]
x (u , v) y (u , v ) = p(u , v)= p(w ) z(u , v)
Near-isometric parameterization mapping p : D⊂E 2 → S⊂E 3
D
(u 2, v 2 )=w 2
(u,v) parameterization on euclidean space
∣w 1−w 2∣≈d s ( p(w 1), p(w 2))≥∣ p(w 1)− p (w 2)∣ Figure 1: An isometric parameterization from the 2-dimensional surface embedded in E3 to euclidean E2 is a mapping p : D ⊂ E2 → S ⊂ E3 such that distances on the non-euclidean surface ds (p(w1 ), p(w1 )) equal the euclidean distances between the corresponding points w1 = (u1 , v1 ) and w2 = (u2 , v2 ) in the parameterized space. As it is well-known in cartography, an exact parameterization is not possible except for the case of developable surfaces. There exist several ways to find near isometric mappings.
It is assumed points p(w) lie on a 2-dimensional manifold that forms a surface patch ([29]) embedded in E3 . This means that p is a one-to-one differentiable function (so its inverse exists, see Figure 1) and its Jacobian J = (∂p/∂w) has rank 2. The image S of p(w) (w ∈ S) is then a surface patch. While we initially do not make use of this regularity condition for model fitting, later on we will use it, since it guarantees any 2 of the 3 inverse functions can be solved to “extend” the mapping [20] to a new location (u0 , v0 ) on D (e.g., once the models are fit, we can solve, e.g., pˆx (u0 , v0 ) = x0 and pˆy (u0 , v0 ) = y0 for u0 and v0 ). The parametric surface representation (1) is the preferred approach to model a surface in CAD as it is used by Non-Uniform-Rational B-spline Surface models (NURBS) [26]. We assume points p(w) on the true underlying surface are not directly observable, but are observed only in the presence of measurement error [?], thus we observe mx (w) m(w) = my (w) = p(w) + ε(w), w ∈ D (2) mz (w) where ε(w) ∼ N (0, Σε ) denotes a non-smooth i.i.d. measurement error process defined on D and Σε contains the “nuggets” τi2 , i ∈ {x, y, z}. It is further assumed the true underlying surface is a smooth, non-stationary spatial Gaussian Process, which makes up the “state” equation p(w) = µ(w) + δ(w), w ∈ S (3) 5
x(u , v)=x(w)
y(u , v)= y (w)
[ ]
z(u , v)=z (w)
x (u , v) p (u , v)= p (w )= y (u , v ) z (u , v )
Figure 2: Points on a 2D surface embedded in 3D euclidean space are described in parametric form as a set of points p(u, v) where (u, v) are coordinates described on the surface. With this representation, the surface is decomposed into its three euclidean coordinate functions x(u, v), y(u, v) and z(u, v), each described over the same parametric space of coordinates (u, v).
where
β 0x f x (w) µ(w) = β 0y f y (w) β 0z f z (w)
models long-range (systematic) variation and δ(w) is a zero-mean, smooth (no-nugget), 3-dimensional vector stationary Gaussian Process with covariance functions Cx (h), Cy (h), and Cz (h), respectively, where h = wi − wj . Our goal is to make inferences about the state (the underlying surface) p(w), not about m(w) (the observed surface). The functions f • (w) are vector functions of the w = (u, v) surface coordinates and the vectors β • are the corresponding regression parameters. In most cases, a linear or an interaction model in (u, v) suffices for x(u, v) and y(u, v), as can be seen in Figure 2. In applications in manufacturing metrology, the state equation (3) can represent the deviation surface from a nominal geometry T (w), usually specified by a NURBS patch in CAD systems. In such application, our model allows the deviation surface to have systematic (f • (w)0 β • ) and random (δ• (w)) components, which would vary depending on the state of the manufacturing process, a matter that has implications for process monitoring, a topic we do not discuss herein. If no CAD model is available (e.g., in a reverse engineering situation) then equation (3) models directly the manufactured surface S. Hereafter, we refer to model (1-2) as the Geodesic Gaussian Process (or GGP) model. Gaussian Processes have been used recently to model metrology data obtained via a coordinate measurement machine (CMM) by Xia et al. [43, 44]. Rather than using a GP 6
model for each measured coordinate in m = (mx , my , mx )0 as we do here, they consider modeling the projection of m on the direction of approach of the CMM probe, which results in a scalar that is then modeled with a GP. While this device has the merit of considering the uncertainty of the 3 coordinates and is certainly useful for CMM data, it cannot be applied for modeling surface data obtained by other means (e.g., non-contact sensors). Pedone et al. [31] have recently used universal Kriging for devising inspection sampling plans for one dimensional features of surfaces, such as circularity and straightness, for a CMM. We also mention two alternative approaches to model a surface to which we will compare our GGP method. A common practice in spatial statistics is to use what can be called an euclidean Monge patch model [20]: x 0 0 0 + and p(x, y) = + , y 0 0 0 m(x, y) = pz (x, y) εz (x, y) µz (x, y) δz (x, y) (4) where (x, y) ∈ E2 . Equations (4) model only the heights (z) of the surface patch as a function of the other 2 euclidean coordinates. In such a model, spatial correlation is a function of euclidean distances in the xy space, not as a function of distances on the surface space S as model (1) assumes. In this case, p(x, y) is not a parameterization from points on the surface. Depending on the application, selecting one of the three coordinates to be the (univariate) response and to assume the remaining two coordinates to be noise-free may be arbitrary and not justifiable in general. If spatial correlation is a function of geodesic distances on S, this model will result in biased predictions. A third approach we will discuss lies somewhere in between the previous two and consists in using a parameterization of the surface but models (and predicts) only one of the coordinates (e.g., the “heights” z): x 0 0 0 + and p(u, v) = + , 0 0 0 y m(u, v) = pz (u, v) εz (u, v) µz (u, v) δz (u, v) (5) for (u, v) ∈ D, which we will refer to as a parametric Monge patch approach. A spatial prediction model based on (5) would require distances on S (same as in our proposed approach) but it shares with model (4) the obvious problem of having to select one of the three coordinates as the response, and neglecting the uncertainty in the other 2 coordinates. A particular problem of model (5) is that predicting at a new location w0 = (u0 , v0 ) on the surface requires “extending” the mapping, and this can only be done easily if all 3 coordinates are modeled parametrically as we do in model (2-3). An overview of our proposed method is shown diagrammatically in Figure 3.
3
Finding an E2 → E3 surface parameterization
A key step in the proposed method is finding a parameterization p(u, v), for (u, v) ∈ D. Since the parametric coordinate space D is Euclidean, once a parameterization is avail7
( m x , m y , m z )ni =1 i
i
i
Near-isometric parameterization algorithm
(u i , vi )ni =1 Procrustes alignment
aligned (u i , v i )in=1 Systematic variation model forms
GP parametric surface fitting (REML)
m(u , v )
New point ( x 0, y 0, z 0 ) (2 coordinates needed only)
̂ , Ŝ , Ŝ b e d Extension of mapping: solve 2 of the 3 eqs:
̂x (u , v)=x 0, ̂y (u , v)= y 0, ̂z (u , v)= z 0
(u 0, v 0 ) Predictions at new point on S
[
]
̂ (u 0, v0 ) x ̂y ( u 0, v 0 ) = ̂p ( u 0, v 0 )= ̂p (w 0 ) ̂z ( u 0, v 0 )
Figure 3: Main steps of the proposed Geodesic Gaussian Process (GGP) surface modeling method.
able we can use any standard valid spatial covariance models on this space [8]. Given observed coordinates (mxi , myi , mzi )ni=1 , we wish to find the corresponding surface coordinates (ui , vi )ni=1 . There exist several techniques to do this task. These include algorithms from the area of manifold learning, such as the Isomap method [41] and the LLE method [28]. This family of methods, extensively studied in the last decade, attempt to solve the more general problem of dimensionality reduction from En1 to En2 , where n1 n2 . In the field of computer graphics there exist another very large thread of literature on methods to solve the more specific E3 to E2 parameterization problem. The main interest in the computer graphics literature is texture mapping, that is, to set a “texture” value (usually, RGB color values) at a particular location (ui , vi ) on a 3D surface p(u, v) in a scene in order to make it appear in the most realistic way. We point out that our goal is to find a mapping from E2 to E3 , and not from E2 to E2 as in previous space transformation methods in spatial statistics devised to deal with anisotropy. The main difficulty in the parameterization problem is that there are many different ways to define what a good parameterization is. The ideal case is to find an isometry, a mapping that preserves distances between corresponding points. Formally ([29], p. 265), if p : D ⊂ E2 → S ⊂ E3 is an isometry, then dD (w1 , w2 ) = dS (p(w1 ), p(w2 ))
∀ w1 , w2 ∈ D
(6)
where in our case dD (w1 , w2 ) = |w1 −w2 |, the euclidean distance on E2 . An isometric mapping can be thought of a transformation that bends the surface S into a different shape 8
Figure 4: Examples of near isometric parameterizations from noisy data obtained from two sample surfaces, a cylindrical patch (400 points) and a sinusoidal patch (900 points). The distances between pairs of points, dD (wi , wj ) on the uv plane D on the right are approximately equal to the geodesic distances between the corresponding points p(wi ) and p(w2 ) on the patches S on the left. These parameterizations were obtained using the ARAP algorithm [22], see Appendix A.
without changing the intrinsic distances between points on S. Hence, it can be shown that an isometry also preserves areas on S and angles between curves on S (i.e., an isometry is both an equi-area and a conformal mapping) [20]. An isometric mapping is also a geodesic mapping, in which geodesic distances between points in one space (dD ) map into geodesic distances dS on the image space ([20], Theorem 94.2). But as it is well-known in cartography, finding a perfectly isometric mapping is possible only if the surface is developable ([20], p. 181), i.e., if the surface has a gaussian curvature of zero everywhere. Most popular parameterization algorithms in the computer graphics literature have traditionally settled for finding a conformal mapping, i.e., a mapping that preserves only the angles between curves on the surface, which have many nice mathematical properties [15]; however, they result in pronounced area deformations. Intensive work on the surface parameterization problem over the past decade has resulted in algorithms that instead attempt to preserve areas, or that minimize a weighted sum of distortions due to differences in angles and due to differences in areas, achieving in this way an “as isometric as possible” mapping (e.g., [22, 1, 9]). This type of parameterization methods are particularly useful for our approach, since we assume correlations are a function of the geodesic distances on the surface, and these are provided by an isometric mapping. Figure 4 shows two instances of surface patches, observed with noise, and their near-isometric parameterization. The CAD literature is naturally concerned with the surface parameterization problem, given the use of NURBS models in CAD software systems. Some of the earlier parameter9
S
Geodesic distance on S
D
D
Geodesic distance on S
Euclidean distance on D
Euclidean distance on D
Figure 5: Parameterizations of noisy measurements from a cylinder based on 400 points using the Isomap algorithm (top) and ARAP algorithm (bottom). The scatter plots show the exact geodesic distance on the true underlying surface between all 79800 pairs of points plotted against the euclidean distance between the corresponding estimated (u, v) points provided by each method. The estimated correlation coefficient of the scatter measures the degree of isometry and equals 0.9984 (Isomap) and 0.9953 (ARAP), indicating both mappings are near-isometric.
ization methods in CAD were described by Ma and Kruth [25]. These authors propose a “base surface” method, which has been influential in this literature. Their idea is to use a simple (base) surface that approximately resembles the surface one wishes to parameterize. The base surface is created interactively by selecting 4 corner points and fitting a NURBS surface. The parameterization is then obtained by closest-distance projection of the points on the surface of interest onto the base surface. Weiss et al. [42] review other parameterization techniques used by CAD systems, and suggested using algorithms from the computer graphics literature for this task. Figure 5 shows scatter plots of the exact geodesic distances between points p(u, v)i and p(u, v)j on a cylindrical patch plotted against the euclidean distance between the corresponding (ui , vi ) and (uj , vj ) points (for 400 points there are 79800 such pairs) obtained with two parameterization algorithms, Isomap [41] and the “As-Rigid-As-Possible” (ARAP) method [22] that we describe more fully below and in Appendix A. As it can be seen, both methods are near isometries, since the scatters are close to a line (in view of equation (6), one minus the correlation coefficient of the scatters is a measure of nonisometry) with the estimated correlations exceeding 0.995 for each method. Table 1 shows the estimated correlation coefficients of similar scatter plots (not depicted) obtained with other algorithms used for the parameterization step, applied to 400 noisy observations taken from a half cylinder (here we added noise generated with a geodesic gaussian pro10
cess with an exponential correlated function with parameters φ• = 1, σ 2 = τ 2 − 0.0001 to the true points on the cylinder, see next section for a description of the covariance model used). Note that if noise is added, the measured observations no longer form a developable surface, so one should not expect a perfect rectangle on the uv plane. The first 2 algorithms are from the computer graphics literature, while the bottom 4 are from the manifold learning literature. Although the correlations shown are only point estimates, the overall conclusion is clear: among the tested parameterization algorithms, only Isomap and ARAP are able to find a near isometry in the case of a cylinder. If an algorithm is unable to “unfold” this particularly simple, developable surface, it will typically be unable to unfold near isometrically more complicated, non-developable surfaces. In particular, the first algorithm on the table (Least Squares Conformal Map, LSCM [21]) shows how conformal parameterization algorithms from the computer graphics field are not useful for our purposes, since they severely distort distances. A complete survey of parameterization methods from the manifold learning literature up to 2009 is given by der Marteen et al. [10]. These authors also provide a very useful library of Matlab programs some of which were used to prepare Table 1. For our purposes, all that is necessary is to find a reliable near-isometric parameterization method, perhaps one that is fast to compute for large point clouds, and both Isomap and ARAP have these properties. Although we suggest using either method, it is important to point out their weaknesses: as it can be seen in Figure 5, ARAP typically distorts the boundaries of the object (this is also a problem, but of lesser magnitude, for Isomap). Likewise, (see Figure 6) Isomap distorts a surface near a “hole” (ISOMAP proof of asymptotic convergence to a near isometry rests on the assumption observations lie on a geodesically convex manifold, see main theorem in [3], an assumption that is false if the surface has holes).
Algorithm LSCM ARAP LLE HLLE KPCA Isomap
Reference(s) [21] [22],[1] [28] [14] [38] [41]
Estimated correlation (ˆ ρ) No measurement error With measurement error 0.9291 0.8784 0.9976 0.9953 0.9420 0.8998 0.9442 0.9434 0.9557 0.9557 0.9995 0.9984
Table 1: Correlation coefficients between euclidean and geodesic distances obtained with different parameterization algorithms applied to the 79800 pairs of points from a grid of 400 noise-free observations generated on a half cylindrical patch.
Surfaces with holes might be a common situation in a metrology situation: some regions of the object might have no measurements due to the pose of the object relative to a noncontact scanner, and this results in gaps in the measured surface. Therefore, we look at this issue in more detail in example 3 below.
11
ARAP (u,v) parameterization
x̂ (u , v)
ŷ (u , v)
ISOMAP (u,v) parameterization
̂z (u , v)
Figure 6: Parameterization of a bilinear NURBS surface patch with a rectangular hole. Whereas the ARAP parameterization preserves the geometry of the hole, the ISOMAP algorithm does not retain the rectangular features of the surface hole.
4
Model fitting
Given the coordinates on the surface {ui , vi }ni=1 that correspond to the n measurements {m(ui , vi )}ni=1 (collected in the n × 3 design matrix M ), the next step (see Figure 3) is to fit a Gaussian Process model to x(u, v), y(u, v), and z(u, v) surfaces. In principle, one could model the three parametric surface components with a multivariate gaussian process. Such model would require specification of the spatial cross-covariance matrix (where recall w = (u, v)): C(w, w0 ) ≡ Cov(p(w), p(w0 )) ∈ E3×3 cov(x(w), x(w0 )) cov(x(w), y(w0 )) cov(x(w), z(w0 )) = cov(y(w), x(w0 )) cov(y(w), y(w0 )) cov(y(w), z(w0 )) cov(z(w), x(w0 )) cov(z(w), y(w0 )) cov(z(w), z(w0 ))
(7)
for w 6= w0 , which as emphasized by Cressie and Wikle ([7], p. 234) needs not be symmetric (note that the within-location variance-covariance matrix C(w, w) = Cov(p(w), p(w)) = Var(p(w)) ∈ E3×3 is symmetric). Specifying a non-symmetric cross-covariance has proved difficult [12] because whatever form this matrix is parameterized, it must be positive definite. Simplifying assumptions are usually made, such as adopting a “separable” correlation matrix [2]: C(w, w0 ) = ρ(w, w0 ) · T
12
where T models within-location correlations and ρ(w, w0 ) models spatial correlation between locations, assumed the same for all responses (clearly inadequate for our case). Furthermore, this results in a symmetric cross-covariance. As discussed in [7], the symmetry assumption is very strong, and there is no a priori reason for it to hold in practice. This is particularly true for our surface modeling application: there is no reason we can think of for assuming that for instance, a surface will have cov(x(wi ), y(wj )) = cov(x(wj ), y(wi )) for every pair of distinct points (wi , wj ), other than the simple case when all these correlations are zero. But having all cross-correlations equal to zero is equivalent to a model where each parametric surface component can be modeled independently. Recently, Gneiting et al. [12] propose a multivariate extension of the univariate Matern spatial covariance model, but it also produces symmetric cross-correlation matrices. Another popular technique for multivariate data in geostatistics is the Linear Model of Corregionalization [2], but it also assumes symmetry. A recent study by Kleijnen and Mehdad [19] indicates that multivariate LMC Kriging predictions do not outperform Kriging predictions of each response if fitted individually instead. For all these reasons, we proceed to fit each parametric surface model independently, assuming Σε = diag(τx2 , τy2 , τz2 ) in eq. (2) and C(w, w0 ) = diag(Cx (h), Cy (h), Cz (h)) in eq. (3) where h = w − w0 (see conclusions section for more on this). For each component δ• in equation (3), we use a powered exponential spatial covariance model [2] such that the n × n covariance matrix of each surface component x(wi ), y(wi ) and z(wi ) over all measurements can be written as Σ• = σ•2 exp(−φ• D w )p• + τ•2 I n ,
• ∈ {x, y, z}
(8)
where D w is an n × n euclidean distance matrix on the D space. Therefore, the covariance parameters for each surface component model are θ • = {φ• , σ•2 , τ•2 , p• }. These parameters and β • (eq. 2) are estimated using restricted maximum likelihood (REML, [33]). For each parametric surface model, the REML estimator minimizes 2 (n − k• ) log(σm (θ• )) + log(|R(θ• )|) + log(|F 0• R(θ • )−1 F • |) 2 (θ • ) is the variance C• (0) expressed as a function of its covariance parameters, where σm F • is the n × p matrix which expands the set of uv locations M according to the terms in the mean model form f• (w) in eq. (3), R(θ) is the n × n correlation matrix between the n points computed from (8) and k• is the number of parameters estimated in each parametric surface model. The REML objective has several minima, and therefore we use a simulated annealing (SA) global optimization routine [36] started from a set of welldispersed initial points for its minimization. At each point returned by the SA routine, we run the fmincon interior point nonlinear minimization routine in MATLAB [36]. We follow the recommendations in Lophaven et al. [23] for dealing with numerical issues related to the computations of the inverses and determinants in the likelihood function. Given the minimizing parameters θ • , we estimate β • from its generalized least squares estimator [33]. This procedure is then repeated for each parametric surface, giving the parameter ˆ • and β ˆ , for • = {x, y, z}. estimates θ •
13
Examples with simulated surface data In the simulations shown in this paper, we first generated a grid of points over the true underlying surface (usually, a NURBS surface) to which we added geodesically correlated gaussian errors. To do this, we computed the (u, v) parameterization of the noise-free points using either the ARAP or Isomap method and then generated spatially correlated normal noise using a powered exponential correlation function, where euclidian distances (in the D space) were used, as these correspond closely to the geodesic distances on S. The model fitting and prediction methods shown below then applied the GGP approach to these simulated data sets. To evaluate the performance of the GGP and the more common “Monge patch” approaches of section 2, we simply predict the surface at the simulated points with each method and compute the euclidean distance between the predicted 3D points and the corresponding true surface points, since these are given. We then report the mean squared prediction error per point. This is the mean squared prediction error, MSP, defined for the different models in section 2 as follows. For the GGP model: s Pn p(ui , vi ) − p(ui , vi )|2 i=1 |ˆ (9) MSPtot = n ˆ (ui , vi ) = (ˆ where p x(u, v), yˆ(u, v), zˆ(u, v))0 and |·| denotes euclidean distance (the subscript refers to the total of the 3 coordinates being predicted). For the geodesic Monge patch model: v 2 u u m x i u Pn u i=1 myi − p(ui , vi ) u zˆ(ui , vi ) t MSPz(u,v) = (10) n (note the first two coordinates are not modeled, so the predictions simply equal to the observations). Finally, for the euclidean Monge patch model: v 2 u u mxi u Pn u i=1 myi − p(ui , vi ) u zˆ(xi , yi ) t (11) MSPz(x,y) = n where the first two coordinates are also not predicted but the z coordinate is predicted as a function of the euclidean coordinates x, y instead. Since we are simulating data from known surfaces to which we add noise, in all of these expressions above we are comparing the predicted 3D points against the true underlying 3D cartesian coordinates at each point (ui , vi ) on the surface (p(ui , vi )). Later on, in section 7, we will analyze a real dataset for which no “known underlying surface” exists. There we report the mean square error statistics above by substituting the true surface points (p(ui , vi )) with the observed measurements (m(ui , vi )), and n will represent the number of points at which we are predicting, not the points used to fit the model as in this section.
14
In simulated cases (where the true surface points are available), the mean square prediction error statistics above can be compared to the simulated mean square error: s r Pn Pn 2 2 i=1 |m(ui , vi ) − p(ui , vi )| i=1 |ε(ui , vi )| = MSEtot = n n which is a measure of the mean “noise” added to the totality of the surface. If in a simulation it turns out that MSPtot < MSEtot this means the GGP model is able to filter the measurement error enough to get predictions that on average are closer to the true surface than what the observed measurements are. Example 1.- a cylindrical surface patch. Table 2 shows the performance metrics of a series of simulations taking the cylindrical patch of figure 5 as the true underlying surface. Geodesically correlated normal noise was added to a grid of points on the surface, as described before, with correlation function parameters φ• = 1, σ•2 = τ•2 = 0.00001. An interaction model (in u, v) was fit to the mean of x(u, v), while a quadratic model was fit to the mean of y(u, v), z(u, v), and z(x, y). We studied the performance of the GGP methodology compared to the alternative “Monge patch”predictions (see section 2) for different number of points. The statistics are averages and standard deviations from 30 independent simulation (same data used across methods). As it can be seen from the table, in some cases, the parametric 3D predictions get closer to the true unknown surface than the simulated data, since the mean square error of the simulated points is higher than that of the parametric 3D predictions (thus, the proposed approach is effectively filtering the observational noise in the state-space model 2-3). The parametric Monge patch predictions zˆ(u, v) are also effective, with the benefits of predicting all 3 coordinates in a parametric way more evident as the number of points increases. Note how since we are comparing against the true surface points in expressions (9-10), MSPz(u,v) can certainly be greater than MSPtot . The euclidean GP approach (z(x, y)) incurs in considerable higher prediction errors (around 50% compared to the parametric 3D predictions). n 400
MSEtot 0.00756 (0.00006) 900 0.00798 (0.00109) 1600 0.00771 (0.00098)
MSPtot MSPz(x,y) 0.00773 0.01178 (0.00108) (0.00091) 0.00796 0.01188 (0.00108) (0.00099) 0.00764 0.01192 (0.00099) (0.00094)
MSPz(u,v) 0.00772 (0.00107) 0.00813 (0.00106) 0.00787 (0.00096)
Table 2: Prediction results for cylindrical patch example, 30 simulations, mean and standard deviations of performance statistics (standard deviations inside parenthesis).
Example 2.- a sinusoidal surface patch. In this case the true surface is z(u, v) = 0.1 sin(u), depicted in figure 4. This is a type of surface patch reported to be useful as a model in high precision micro machining [45]. 15
[ ]
x̂ (u , v) ̂p (u , v)= ŷ (u , v) ẑ (u , v)
̂z (x , y)
ˆ (u, v) and Figure 7: Left: Sinusoidal function observed points, GGP parametric surface predictions p predictions based on the Monge patch zˆ(x, y) (n = 400 points). On the right: a side view.
The same noise parameters as in the cylindrical patch case were added to a grid of points generated on this surface. An interaction model (in u, v) was fit to the mean of x(u, v), and to the mean of y(u, v), while in this case an constant (intercept only) model mean was used for z(u, v), and z(x, y). Similarly to the cylindrical case, the parametric Monge patch predictions zˆ(u, v) are also effective, with the benefits of predicting all 3 coordinates in a parametric way more evident as the number of points increases (Table 3). The euclidean GP approach (z(x, y)) incurs in an even worse prediction errors compared to the parametric 3D predictions. While the underlying surface is developable (gaussian curvature is zero) the measured points are not, so the uv surface will not be a perfect rectangle even if a perfect isometry were to be found. This surface has strong curvature, so modeling the heights as a function of 2D euclidean spaces badly estimates the distances, and hence the correlations, between points on the surface, resulting in an underestimation of the peaks and troughs of the function (see Figure 9). By strong curvature we are referring to large values of the principal curvatures at some points, not to the gaussian curvature values, which for a near-developable surface will be near zero. n 400
MSEtot 0.00761 (0.00089) 900 0.00785 (0.00132) 1600 0.00752 (0.00099)
MSPtot MSPz(x,y) 0.02435 0.04552 (0.00693) (0.00187) 0.01284 0.02946 (0.00284) (0.00148) 0.00954 0.01957 (0.00123) (0.00112)
MSPz(u,v) 0.02434 (0.00693) 0.01287 (0.00284) 0.009629 (0.00122)
Table 3: Results for sinusoidal patch example, 30 simulations, mean and standard deviations of performance statistics (standard deviations inside parenthesis).
Example 3.- a surface with a hole. To study the effect of a hole on the GGP approach, consider the simulated NURBS depicted in figure 1. This is a NURBS bilinear 16
surface with corner control points (0.0, 0.0, 0.5), (1.0, 0.0, -0.5), (0.0, 1.0, -0.5), and (1.0, 1.0, 0.5) (the Matlab NURBS toolbox [39] was used to generate this surface). Geodesically correlated, vector Gaussian noise was simulated as described above with parameters φ• = 1, τ•2 = σ•2 = 0.0001 and p• = 1 (powered exponential correlation function) and added to the 400 3D points representing the surface. An interaction mean model was specified for x(u, v) and y(u, v) and a quadratic mean model was set for z(u, v). We created a rectangular hole on this surface (by simply deleting points from the generated simulated surface data) and applied the proposed GGP methodology to it. Figure 6 shows the 2D surface parameterization obtained with the ARAP algorithm and the 3 fitted parametric surfaces using GGP. In this particular case, the performance of predicting the three coordinates using GGP result in a mean square error of the predictions of 0.0073 that compares favorably with the error from fitting a standard Kriging model to the euclidean Monge patch z(x, y) (the mean squared prediction error is 0.0162; predicting using a model for z(u, v) also works well, with a mean squared prediction error of 0.0074). The simulated error MSE was 0.0072, so the GGP-fitted surface is quite precise, showing the procedure is unaffected by holes or gaps. As a comparison, the figure also shows the parameterization obtained with the ISOMAP algorithm (reducing the dimensionality from E3 to E2 ). As it can be seen, the rectangular feature of the hole is lost with this parameterization. Appendix A describes briefly the Isomap and the ARAP algorithms.
5
Predicting at new locations on the surface: extending the mapping
A distinctive feature of the procedure for predicting a new point p(u0 , v0 ) on the surface using our GGP approach is that first, the mapping needs to be extended to the (u0 , v0 ) location, that is, the coordinates on the surface where we want to predict the cartesian coordinates of the location of interest need to be specified first, since they are unknown. Once these are specified, the prediction vector p(u ˆ 0 , v0 ) is given by the predictions of each component (x(u0 , v0 ), y(u0 , v0 ) and z(u0 , v0 )), obtained from the three GP models fitted as in the previous section. Extending the map to any surface coordinates (u0 , v0 ) can always be done using the GGP approach if our assumption of p(w) being a surface patch (i.e., a one to one function from D to S with a Jacobian of rank 2, see section 2) is true. All that is needed are the predictive GP models xˆ(u, v), yˆ(u, v), and zˆ(u, v) (equation 15 below details these expressions, which are the standard universal Kriging predictors given the surface coordinates). The surface coordinates (u0 , v0 ) that correspond to the cartesian coordinates in E3 , (x0 , y0 , z0 ) are obtained by solving any two of the three non-linear equations: xˆ(u0 , v0 ) = x0 yˆ(u0 , v0 ) = y0 zˆ(u0 , v0 ) = z0
(12) (13) (14)
Thus, the user needs to select only any two of the three coordinates x0 , y0 , z0 per each point where surface predictions are desired (these could be those coordinates where the 17
corresponding models fits best, for instance). To solve the system of 2 equations for (u0 , v0 ), an initial guess can be given to the nonlinear solver based on triangulation information. Specifically, suppose we specify x0 and y0 (say) and a triangulation mesh has been computed on all n points. The extension method then first finds the triangle that contains this point. We then find the baricentric coordinates of x0 , y0 within its enclosing triangle, i.e., solve the following system for the barycentric coordinates bi : x0 = b0 px,0 + b1 px,1 + b2 px,2 y0 = b0 py,0 + b1 py,1 + b2 py,2 1 = b0 + b1 + b2 where px,i and py,i are the x and y coordinates of the triangle vertices enclosing (x0 , y0 ) in 3D space. Finally, we transform the baricentric coordinates to cartesian coordinates (on the (u, v) plane), that is, we compute uini = b0 wu,0 + b1 wu,1 + b2 wu,2 vini = b0 wv,0 + b1 wv,1 + b2 wv,2 where wu,i and wv,i are the u and v coordinates of the triangle vertices enclosing (x0 , y0 ) in the 2D uv space. These two operations are simply done with Matlab functions cartToBary and barytoCart. The coordinates (uini , vini ) are then an initial guess given to the nonlinear solver, which then produces the final (u0 , v0 ) coordinates from solving two of the equations (12-14) (we use the fsolve routine in Matlab, see Appendix B for software implementation details). Given the surface coordinates where a new prediction is desired, minimum mean square (MSE) prediction follows the usual approach in Gaussian Processes [33]. The prediction equation for each true underlying surface component in p(u0 , v0 ) is given by: ˆ • + c0 Σ−1 (M• − F • β ˆ ), pˆ• (u0 , v0 ) = f (u0 , v0 )0 β • p• •
• = {x, y, z}
(15)
where M• are all the measurements of each coordinate • = {x, y, z} across the n observations in (2). Evidently, expression (15) is precisely that used to solve for (u0 , v0 ) in (12–14). ˆ (u0 , v0 ) we now only need to evaluate all three of To predict all three surface components p them at (u0 , v0 ). An important detail in expression (15) is that the vector cp• is equal to cp• ≡ Cov(p• (u0 , v0 ), M• ) cp• (w0 − w1 ) cp (w0 − w2 ) • = .. . cp• (w0 − wn ) which are the covariances between the true underlying surface component p• in (3), where • = {x, y, z}, and the observed coordinate M• in equation (2). Cressie and Winkle [7] emphasize how these covariances should not contain the nuggets (τ•2 ), since we are predicting the true underlying surface (p(u0 , v0 )), not the observed one (m(u0 , v0 )). 18
Example 4: extending the mapping. Figure 8 shows an example of extending the mapping and predicting at new locations for data simulated from the NURBS surface shown earlier in figure 1. The mapping was found using the ARAP parameterization from 400 observations, and the GP models for all three coordinates fit using REML. The mapping was then extended using the fitted equations (15) and solving for u0 and v0 the first two equations (12-13) for 36 additional points, specified by locations in Euclidean space at x0 and y0 values that ranged from 0.5 to 0.7, in steps of 0.04. The figure shows the original 400 observations parametrized in the uv plane with the additional 36 (u0 , v0 ) ˆ (u0 , v0 ) were computed, using all three predicted solutions. From these values, predictions p surface components. The predictions on the surface are also shown in Figure 8.
D
(u 0, v 0 )
( x 0, y 0 )
Figure 8: Extending the parameterization to new locations on the surface. Top left: the resulting (u0 , v0 ) parameterization (light circles) from the NURBS surface observations. The new (u0 , v0 ) locations that correspond to the specified new (x0 , y0 ) locations are shown in dark. Top Right: 3D plot of the {(x0 , y0 )} points at which the extended mapping was desired with the corresponding new (u0 , v0 ) points on the surface. Right bottom: a close up of the mapping going from a specific (x0 , y0 ) point in E2 up to the corresponding (u0 , v0 ) point on the surface S.
Finding prediction error estimates σ ˆp2 can be done in the usual way by using the “plug in” standard error estimate, or a bootstrapping estimate as suggested by Kleijnen et al. [13]. This will provide a 3D prediction ellipsoid around a point prediction. A bootstrapping estimate would have to incorporate the imprecision in the near-isometric parameterization algorithm, which is not perfect. Some ideas on how to do this via cross-validation are given in the last section of the present paper.
19
6
Differential-Geometrical analysis of the fitted surface
A benefit of the parametric surface model approach is that it allows estimation of lengths, angles and areas on the true underlying surface in the presence of measurement error (on all 3 coordinates), in contrast to finding the same surface characteristics using a triangulation of the observed data (which simply either neglects measurement noise or filters the data disregarding any statistical modeling). In this section we illustrate how to estimate the surface area. Assume we have fitted p(u, ˆ v) = (ˆ x(u, v), yˆ(u, v), zˆ(u, v))0 , the Gaussian Processes of each of the parametric components coordinates (1). Define the vectors of partial derivatives (where in the rest of this section we omit the “hat” used to denote estimates): d1 (u, v) ≡
∂p(u, v) , ∂u
d2 (u, v) ≡
and
∂p(u, v) ∂v
Then the coefficients of the first fundamental form of S, used to determine its surface area, are equal to [20]: g11 = |d1 |2 , g12 = d1 d2 , g22 = |d2 |2 and the area of S defined parametrically on the domain D of the uv plane is given by ZZ ZZ √ g du dv (16) |d1 × d2 | du dv = A(S) = D
D
2 is the discriminant of the first fundamental form. It can be shown, where g = g11 g22 − g12 after some algebra, that for the Gaussian Processes assumed in this paper (for p• = 1), all the partial derivatives in d1 and d2 evaluated at an specific pair (u0 , v0 ) have the form: n
X ∂Si ∂p• ∂ • = (f • (u0 , v0 )0 β • ) + σ 2 , ∂u0 ∂u0 ∂u 0 i=1 and
n
X ∂Si,• ∂p• ∂ = (f • (u0 , v0 )0 β • ) + σ 2 , ∂v0 ∂v0 ∂v 0 i=1 where
and
• ∈ {x, y, z}
• ∈ {x, y, z}
∂Si,• exp(−φ• |(u0 , v0 ) − (ui , vi )|) = φ• (ui − u0 )γi,• , ∂u0 |(u0 , v0 ) − (ui , vi )| ∂Si,• exp(−φ• |(u0 , v0 ) − (ui , vi )|) = φ• (vi − v0 )γi,• ∂v0 |(u0 , v0 ) − (ui , vi )|
i = 1, 2, ..., n,
i = 1, 2, ..., n
where γi,• is the ith entry of the vector γ • ≡ Σ−1 y (M• − F • β • ). Integral (16) can be evaluated numerically for the values (u0 , v0 ) in the domain D of the parameterization mapping. To illustrate, consider the half cylinder of figure 5. The surface area in this case is π/2 = 1.5708. We simulated 400 and 900 points with low noise (σ•2 = τ•2 = 20
Figure 9: CMM data. On the left, the original dataset (n = 9535), in the middle a decimated data set (n = 954), and on the right the (u, v) parameterization of the decimated 3-dimensional data using the ARAP algorithm.
0.00001) on this surface and use the Isomap parameterization. The estimated areas, using a triangulation of the points and using equation (16) are shown in Table 4. As n increases, the quality of the area estimates improves, with the surface integral being better for this case. Depending on the domain of the surface, doing a coordinate transformation may be better if the integral (16) is used, as usually done in numerically integration. Integrating over a irregular boundary will provide much more imprecise results (for both methods), as typically happens in numerical multiple integration. In general, the triangulation method is less robust to noise, since the GGP models are “filtering” the measurement error. No. of points 400 900
Triangulation 1.7398 1.6879
Surface integral (eq. 16) 1.6040 1.5934
Table 4: Surface area estimates for half cylinder based on different number of points. True area of noise-free surface is π/2 = 1.5708.
7
Real (non-simulated) surface application: CMM data
In this section we model a set of data measurements acquired with a coordinate measuring machine (CMM) and studied by Colosimo and Pacella [6] in the context of multiresolution data analysis. We contrast the performance of the proposed approach in modeling this surface via cross-validation, fitting the different models in a subset of data and predicting a different subset of points. The original dataset consists of 9535 points from a free form surface (see Figure 9) of base size 100 mm. × 100 mm., acquired with a CMM system. We decimated the data set by selecting points every 24 observations (giving n = 398) and every 10 points (giving n = 954 points). Table 5 shows the mean square prediction errors obtained by cross-validation. The crossvalidation was done at n different points than the original ones, for which the (ui , vi ) 21
parameters were computed first (i.e., the parameterization mapping was extended) and then the predictions for these points were computed using the GGP models fitted with the original data. This was done for each parametric surface in our model. Finally, we compute the mean square error of the predictions generated by GGP (MSPtot ) and also by the euclidean (MSPz(x,y ) and geodesic (MSPz(u,v) ) Monge patch methods (see section 2 for a description of the three modeling methods contrasted). As mentioned in section 4, since the underlying surface is unknown, the mean square error statistics 9-11 were computed by substituting the true surface points (p(ui , vi )) with the observed measurements (m(ui , vi )). We tried different mean models for x(u, v), y(u, v), z(u, v) and z(x, y). From the mean square errors of the cross-validated predictions, the best mean models are an interaction model for x(u, v) and y(u, v) and a constant (intercept) model for z(u, v) and z(x, y). In this application it is relevant to compare the GGP predictions to the euclidean Monge patch method (i.e., only predicting the heights z as function of euclidean coordinates x, y) as this is the most common surface prediction method in practice. The mean square errors of doing this in the best fitting models are considerable higher than assuming correlations along geodesic distances. Note how MSPz(x,y) is computing squared errors only on the heights z, whereas MSPtot computes square errors on all 3 coordinates. Thus, it is notable how MSPtot = 0.01647 < MSPz(x,y) = 0.01891 (for the case of non-simulated data, where we use m(ui , vi ) instead of p(ui , vi ) in expressions (9-11), note how MSPz(u,v) < MSPtot necessarily, since the former is included in the later error statistics). Hence, these statistics are evidence that the data set exhibits correlations along the geodesics, and that the GGP model is predicting this surface substantially better than a standard universal kriging model fitted in euclidean space to z(x, y). Table 6 shows the parameter estimates for the best MSPtot MSPz(x,y) n Mean models for (x, y, z) 398 interaction, interaction, intercept 0.02699 0.03089 954 interaction, interaction, intercept 0.01647 0.01891 398 interaction, interaction, quadratic 0.03209 0.02599 0.02201 954 interaction, interaction, quadratic 0.01982
MSPz(u,v) 0.01942 0.01046 0.02605 0.01520
Table 5: Cross-validation results for CMM data, mean square errors performance statistics. Different mean models were used; the use of an interaction mean model for x(u, v) and y(u, v) and an intercept (constant) model for z(u, v) gave the best overall predictions, obtained by modeling the spatial covariance over the geodesics.
fitting mean models for both n = 398 and n = 954. For zˆ(u, v) and zˆ(x, y) the estimated spatial correlation is very strong (φˆ = 0.01 in both cases), which is not surprising given that a constant mean was specified (in contrast, if a quadratic mean model is used for zˆ(u, v) then φˆ = 0.49 for n = 954). Of particular interest are the “nugget” estimates τˆ•2 . As it can be seen, for n = 954 the nugget estimate is significantly smaller for zˆ(u, v) than for zˆ(x, y), indicating a better fit for the former model. It is not possible to say that these nuggets represent measurement error, since we do not know the true nature of the surface S and hence τˆ2 + σ ˆ 2 represent a mix of model error and measurement error (or random noise due to other causes). If the true model for p(w) were known, then we could clearly identify these two variances with measurement (small scale) and spatial (larger scale) variability, 22
but this type of knowledge is not practically available in the majority of applications. n 398 954
ˆ σ (φ, ˆ 2 , τˆ2 )x(u,v) 0.35, 2.86e-06, 4.83e-08 0.34, 1.23e-05, 2.92e-07
ˆ σ (φ, ˆ 2 , τˆ2 )y(u,v) 0.36, 0.0010, 4.83e-08 0.35, 2.87e-05, 1.31e-07
ˆ σ (φ, ˆ 2 , τˆ2 )z(u,v) 0.01, 3.16e-05, 4.40e-08 0.01, 5.92e-06, 6.79e-09
ˆ σ (φ, ˆ 2 , τˆ2 )z(x,y) 0.01, 3.41e-05, 3.94e-08 0.01, 4.26e-05, 2.67e-08
Table 6: Cross-validation parameter estimates for the GGP model, CMM data, for the best fitting mean models, namely, an interaction model for x(u, v) and y(u, v) and an intercept (constant) mean model for z(u, v) and z(x, y).
8
Discussion and conclusions
A new approach for the statistical modeling of surfaces embedded in 3-dimensional space was presented. The Geodesic Gaussian Process (GGP) method first finds a parameterization on the surface under study and then fits spatial Gaussian Process models on each cartesian coordinate as a function of the surface coordinates. It was shown in this paper that the GGP approach performs well with respect to the usual Kriging modeling approaches of surfaces found in the literature which assume correlations occur over an euclidean space. If the correlation occurs on the surface over their geodesic distance between points, euclidean spatial models result in biased predictions. In this paper, independent GP models were fitted for each coordinate since the most common multivariate GP models assume a symmetric cross-covariance matrix which is an untenable assumption in our application. It is possible that the hierarchical approach of Berlinger (see [7]) may be a way of fitting a multivariate GP process to all 3 coordinates. From the point of view of application in industrial metrology, it is of interest to determine if for a variety of real-life machined surfaces the correlation can be better modeled geodesically or over euclidean distances. A study similar to the CMM data of section 7 could be conducted with this aim (there it was found that our GGP model which assumes correlations over geodesic distances fits better). From the computational point of view, it is necessary to modify the algorithms to allow the study of much larger datasets. Considerable work has been carried out in the Spatial Statistics literature in the last 10 years to deal with the “big n” problem. It is feasible to incorporate these techniques in the GP-fitting and prediction steps of the GGP methodology, and this remains a matter of further work for the present paper. We did not look into the estimation of prediction errors in the present paper other than using the common plug-in estimators from a Gaussian Process (Kriging). We can follow the suggestion in [13] and use bootstrapping to get a better estimate of these standard errors. In our case, however, the uncertainty in the parameterization procedure would have to be accounted in a cross-validation or bootstrapping approach. This is also a matter of further work. The parameterization approaches used (ARAP and ISOMAP) may find difficulties if the surface has sharp edges, which may be of particular interest in metrology. A way to 23
handle this is to segment a complicated 3D object that perhaps closes into itself (so it is not a surface patch) and partition it in such a way that we get a series of patches. There is a great number of algorithms to do this in the computer graphics literature, and we will study this problem in the near future. Another matter that deserves further research is the use of an ARAP-like algorithm that does not depends on a triangulation, so it is “meshless”. The idea is to build neighborhoods (similar than those created by Isomap and many manifold learning algorithms) and try to flatten each of these using the ARAP algorithm, as opposed to working with triangles. This should represent a more robust algorithm. Finally, we point out that there might be applications of the GGP methodology in computer experiments when the interest is to model an unknown function that needs to be maximized/minimized. It may be possible that spatial correlations over the surface manifold provides better predictions, an hence, faster convergence to a good local optima, than if using classical euclidean kriging as existing methods like EGO [16] do.
Appendix A. The Isomap and the ARAP algorithms A.1 The Isomap algorithm Assume we wish to find a function p(w) from En1 to En2 where n1 < n2 . The Isomap algorithm [41] first approximates the geodesic distances dg (p(wi ), p(wj )) by connecting the points p(wi ) with its closest neighbors. These neighbors are represented by a weighted graph over the points, with edges equal to the euclidean distances |p(wi ) − p(wj )|. The basic idea exploited in this and many similar “manifold learning” algorithms is precisely the definition of a manifold: an abstract space (perhaps of high dimension) which in small neighborhoods can be approximated well with an euclidean space. To compute the geodesic distance matrix D S over all points, Isomap finds shortest paths between all points in the graph made up of all neighborhoods, a problem usually solved with Dijkstra’s algorithm. These shortest distances are the approximated geodesic distances. Isomap then minimizes the Frobenius norm of D − D S with respect to the vectors wi , where D is the matrix of euclidean distances. Provided the domain D of p(w) is convex, the authors prove the asymptotic convergence of Isomap to a perfect isometry [3]. The algorithm is very useful for dimensionality reduction, since the objective can be minimized for different dimensions n1 and the “optimal” reduced dimension can be obtained by choosing n1 such that |D − D S |F is smallest (where | · |F denotes Frobenius norm). In our parameterization application, n1 = 2 and n2 = 3 are fixed.
A.2 The “As-Rigid-As-Possible” (ARAP) algorithm Suppose we have a triangulation mesh of 3D points where triangles are numbered 1 to T and the areas of each 3D triangle denoted by At . The goal is to find a parameterization from the 2D plane to the 3D mesh. For each triangle, denote by wt = {w0t , w1t , w2t } its 24
Figure 10: Illustration of the ARAP algorithm for the CMM data of section 7. Left: the triangulation of the original 3D data projected over the 2D x-y plane. Center: the 2D triangulation after rigid transformations are applied. Note how the triangles on the “tail” are most distorted. Right: a final procrustes alignment step is required to keep the orientation of the resulting (u, v) mapping with respect to the original 3D data.
2D vertices and by pt = {p0t , p1t , p2t } its 3D vertices. The mapping between pt and wt has a 2 × 2 Jacobian Jt (w) for each triangle which models the distortion it goes through. The ARAP algorithm [22] tries to minimize the area distortions: T X
At |Jt (w) − Lt |2F
(17)
t=1
where L = {L1 , ..., LT } is a set of rotation matrices to be applied to each triangle. The algorithm is then trying to find a rigid transformation and the locations of the 2D vertices wt such that areas are distorted as least as possible when the mesh is flattened. The optimization is performed in 2 stages following an approach by Sorkine and Alexa [1]. First, the rotation matrices Lt are found for fixed w0 s (this involves a SVD factorization per triangle); then the w0 s are found for given L’s (this involves solving a linear system). The process is repeated until a convergence criterion is reached. Liu et al. [22] show how (17) can be modified to add a term that considers also angle distortions, but from their numerical experiments, and ours, this is not necessary: the angles are preserved quite well so the resulting parameterization is close to an isometry. An inital parameterization is required to start the ARAP algorithm; following Liu et al. [22] we used the Least Squares Conformal Map (LSCM) which provides a quick (but conformal) mapping. Figure 10 shows the different steps of the ARAP algorithm applied to the CMM dataset of section 7. Note how a procrustes alignment step is required after the algorithm ends in order to align the parameterization (ui , vi ) with the original data (xi , yi , zi ).
Appendix B. Software implementation We have used Matlab throughout this research since it provides a fast development environment and excellent support for graphics and optimization techniques. We made use of 25
its built-in triangulation routines and found the MATLABMesh toolbox [37] particularly useful. Some of the NURBS surfaces used in this work were created with the NURBS toolbox [39]. All the manifold learning algorithms listed in Table 1, including Isomap, where run using the routines written by der Mateen et al. [10]. Our ARAP routine was adapted from that by Liu et al. [22]. The Matlab code that implements the GGP modeling of all the examples in this paper is available upon request from the first author. Matlab’s Optimization, Global Optimization, and Statistics toolboxes are necessary. Acknowledgements. This research was supported by the MUPROD project of the European Union, grant no XXXX
References [1] Sorkine, O., and Alexa, M, “As-rigid-as-possible surface modeling”, Proceedings of the Eurographics/ACM Symposium on Geometry Processing, Belyaev, A., and Garland, M, eds., pp. 109-116, (2007). [2] Banerjee, S., Carlin, B.P., and Gelfand, A.E., Hierarchical modeling and analysis for spatial data, Boca Raton, FL: Chapman & Hall/CRC Press, (2004). [3] Bernstein M., de Silva, V., Langford, J.C., and Tenenbaum, J.B., “Graph approximations to geodesics on embedded manifolds”, unpublished manuscript, http://isomap.stanford.edu, (retrieved 4/1/2012), (2000). [4] Boisvert, J.B., Manchuck, J.G., and Deutsch, C.V., “Kriging in the presence of locally varying anisotropy using non-euclidean distances”, Mathematical Geology, 41, pp. 585601, (2009). [5] Boisvert, J.B. and Deutsch, C.V., “Programs for kriging and sequential Gaussian simulation with locally varying anisotropy using non-Euclidean distances”, Computers and Geosciences, 37, pp. 495-510, (2011). [6] Colosimo, B.M., and Pacella, M., “On Integrating Multisensor Data for Quality Inspection and Mon- itoring, Technical Paper, Politecnico di Milano, Italy (2011). [7] Cressie, N., and Wikle, C.K., Statistics for Spatio-Temporal Data, Wiley, (2011). [8] Curriero, F.C., “On the use of non-euclidean distance measures in Geostatistics”, Mathematical Geology, 38(8), pp. 907-926, (2007). [9] Degener, P., Meseth, J., and Klein, R., “An Adaptable Surface Parameterization Method” Proceedings of the 12th International Meshing Roundtable, pp. 201-213, (2003).
26
[10] der Maaten, L., Postma, M.E., and van der Herik, J., “Dimensionality Reduction: A Comparative Review”, Tilburg Centre for Creative Computing, Tilburg University, http://www.uvt.nl/ticc (Retrieved April 2, 2012), (2012). [11] Dryden, I.L., and Mardia, K.V., Statistical Shape Analysis, Chichester, John Wiley & Sons, (1998). [12] Gneiting, T., Klieber, W., Schlather, M., “Matern Cross-Covariance Functions for Multivariate Random Fields”, J. of the American Statistical Association, 105 (491), pp. 1167-1177, (2010). [13] Den Hertog D, Kleijnen JPC, Siem AWD. “The correct kriging variance estimated by bootstrapping”. Journal of the Operational Research Society 57, pp. 400409, (2006). [14] Donoho, D.L., and Grimes. , C.“Hessian eigenmaps: New locally linear embedding techniques for high-dimensional data”. Proceedings of the National Academy of Sciences, 102(21) pp. 7426-7431, (2005). [15] Floater, M.S., and Hormann, K., “Surface parameterization: a tutorial and survey”, in Advances in Multiresolution for Geometric Modelling, Springer, pp. 157–186, (2005). [16] Jones, D.R., Schonlau,M., Welch, W.J., “Efficient global optimization of expensive black-box functions”, Journal of Global Optimization, 13, pp. 455-492 (1998). [17] Jun, M., and Stein, M. L., “Nonstationary Covariance Models for Global Data”, The Annals of Applied Statistics 2(4), pp. 12711289, (2008). [18] Kim, H-M., Mallick, B.K., and Holmes, C.C., “Analyzing Nonstationary Spatial Data Using Piecewise Gaussian Processes”, Journal of the American Statistical Association, 100:470, pp. 653-668, (2005). [19] Kliejnen, J., and Mehdad, E., “Kriging in multi-response simulation including a Monte Carlo Laboratory”, CentER Discussion Paper, Tilburg University, Netherlands, http://ssrn.com/abstract=2060891, (retrieved 5/1/2012), (2012). [20] Kreyszig, E., Differential Geometry. Dover Publications, NY, (1991). [21] Levy, B., Petitjean, S., Ray, N., and Maillot, J., “Least Squares Conformal Maps for Automatic Texture Atlas Generation”, Journal ACM Transactions on Graphics Proceedings of ACM SIGGRAPH 2002, 21(3), pp. 362 - 371, (2002). [22] Liu, L., Zhang, L., Gotsman, C., and Gortler, S.J., “A Local/Global Approach to Mesh Parameterization”, in Alliez and Rusinkiewics, S., (eds.), Eurographics Symposium on Geometry Processing, 27(5), pp. (2008). [23] Lophaven, S.N., Nielsen, H.B., and Sondergaard, J., “Aspects of the Matlab toolbox DACE”. IMM Technical University of Denmark, Lyngby, Denmark, (2002).
27
[24] Lyon, S.W., Sorensen, R., Stendahl, J., and Seibert, J., “Using landscape characteristics to define an adjusted distance metric for improving kriging interpolations”, International Journal of Geographical Information Science, 24(5), pp. 723740, (2010). [25] Ma, W., and Kruth, J.P., “Parameterization of randomly measured points for least squares fitting of B-spline curves and surfaces”, Computer Aided Design, 27(9), pp. 663-675, (1995). [26] Patrilakis, N.M. and Maekawa, T., Shape Interrogation for Computer Aided Design and Manufacturing, Springer, (2002). [27] Pedone, P., Vicario, G. and Romano, D., “Kriging-based sequential inspection plans for coordinate measuring machines”, Appl. Stochastic Models Bus. Ind., 25, pp. 133149, (2009). [28] Roweis, S.T., andSaul, L.K., “Nonlinear dimensionality reduction by Locally Linear Embedding”. Science, 290(5500), pp. 2323-2326, (2000). [29] O’Neill, B., Elementary Differential Geometry. New York: Academic Press, (1966). [30] Paciorek, C.J., and Mark J. Schervish, M.J., “Spatial modelling using a new class of nonstationary covariance functions”, Environmetrics, 17, pp. 483506, (2006). [31] Pedone, P., Vicario, G., and Romano, D., “Kriging-based sequential inspection plans for coordinate measuring machines”, Appl. Stochastic Models Bus. Ind., pp. 133-149, (2009). [32] Sampson, P.D., and Guttorp, P., “Nonparametric Estimation of Nonstationary Spatial Covariance Structure”, Journal of the American Statistical Association, 87(417), pp. 108-119, (1992). [33] Santner, T. J. and Williams B. and Notz W., (2003). The Design and Analysis of Computer Experiments, NY, Springer-Verlag. [34] Schabenberg, O., and Gotway, C.A., Statistical Mehods for Spatial Data Analysis, Chapman & hall CRC Press, (2005). [35] Schmidt, A.M. and O’Hagan, A., “Bayesian inference for non-stationary spatial covariance structure via spatial deformations”, J. R. Statist. Soc. B, 65, Part 3, pp. 743758, (2003). [36] Matlab, The MathWorks Inc., Natick, MA, (2011). [37] Schmidt, R., MatlabMesh Toolkit, http://www.dgp.toronto.edu/ rms/ software/matlabmesh/. (Retrieved 4-1-2012). [38] Sch¨olkopf, B., Smola, A.J., and Muller, K.-R. “Nonlinear component analysis as a kernel eigenvalue problem”. Neural Computation, 10(5):1299-1319, (1998).
28
[39] Spink, D.M., NURBS, a Matlab Toolbox. http://www.mathworks.com/matlabcentral /fileexchange/26390-nurbs-toolbox-by-d-m-spink. (Retrieved 3-1-2012). [40] Sun, X., Rosin, P.L., MArtin, R.R., and Langbein, F.C., “Noise Analysis and Synthesis for 3D laser Depth Scanners”, Graphical Models, 71(2), pp. 34-48, ( 2009). [41] Tenenbaum, J.B. , de Silva, V., and Langford, J.C. , “A global geometric framework for nonlinear dimensionality reduction”. Science, 290(5500), pp. 2319-2323, (2000). [42] Weiss, V., Andor, L, Renner, G., and Varady, T., “Advanced surface fitting techniques”, Computer Aided Geometric Design, 19, pp. 19-42, (2002). [43] Xia, H., Ding, Y., and Wang, J., “Gaussian process method for form error assessment using coordinate measurements, IIE Transactions, 40, pp. 931-946, (2008). [44] Xia, H., Ding, Y., and Mallick, B.K., “Bayesian hierarchical model for combining misaligned two- resolution metrology data, IIE Transactions, 43, pp. 242-258, (2011). [45] Zhang, X.D., Fanf, F.Z., Wang, H.B., Wei, G.S., and Hu, X.T., “Ultra-precision machining of sinusoidal surfaces using the cylindrical coordinate”, J. of Micromechanics and Microengineering, 19, pp. 1-7,(2009).
29