# Computing the Gromov-Wasserstein Distance between Two Surface Meshes Using Optimal Transport
## 5 Computational Experiments
### Shape Similarity: Synthetic Data from TOSCA  
We use the Gromov-Wasserstein formalism to detect non-rigid shape similarity. The experiments were performed on meshes taken from the TOSCA non-rigid dataset ([PERSON] et al., 2016; [PERSON] et al., 2017). Eleven classes of objects were considered (see Figure 1): 8 classes of animals, cats (9 poses), dogs (11 poses), gorilla (21 poses), horses (17 poses), seahorses (6 poses), shark (1 pose), wolves (3 poses), two male shapes, [PERSON] (20 poses) and [PERSON] (15 poses), one female shape, [PERSON] (24 poses), and one mythical shape, centaurs (6 poses), for a total of 133 shapes. Note that compared to the full TOSCA non rigid dataset, we removed all lions as their meshes had severe topological issues at the level of the mane. Each class consists of the same shape under different poses. These poses are the results of transformations that were designed to mimic non-rigid motions within objects (see [PERSON] et al., 2017; [PERSON] et al., 2017), for details). Note that the different representatives within a class may be represented with different meshes (i.e., in addition to having different geometry those meshes may have different topologies), and may have different genera. Each shape is represented with a triangulated mesh with approximately 3400 vertices and 6600 faces, with the exception of the gorilla and seahorse meshes that include approximately 2100 vertices and 4200 faces. The Euclidean farthest point sampling procedure was used to select 1000 points from each shape's set of vertices. In brief, one begins by selecting a point at random from the set of vertices. The second point is chosen among the remaining vertices as the one that is at the greatest distance from this first point. Subsequent points are always chosen to maximize the shortest distance to the previous points. In each experiment, a pair of shapes \(i\) and \(j\) is represented with their sets of sampled vertices, \(S_{i}\) and \(S_{j}\), and the geodesic distance matrices between those vertices, \(d_{i}\) and \(d_{j}\). The geodesic distances are computed using the method proposed by [PERSON] et al. [38] and implemented in the code \"geodesic\" by [PERSON], available at [[https://code.google.com/archive/p/geodesic/](https://code.google.com/archive/p/geodesic/)]([https://code.google.com/archive/p/geodesic/](https://code.google.com/archive/p/geodesic/)), and accessed on 1 June 2020. The masses associated to the vertices are set uniform, equal to \(1/Nv\), where Nv is the number of vertices. The GW problem is solved using FreeGW up to convergence. At each value of \(\beta\), \(\sqrt{U_{\beta}^{\text{MF}}}\) (see above), defines \(DM_{\beta}(i,j)\), i.e., the \((i,j)\)-th element of the distance matrix \(DM_{\beta}\) over all shapes in our TOSCA dataset. Note that \(\sqrt{U_{\beta}^{\text{MF}}}\) satisfies the properties of a metric distance only when \(\beta\) is large (at convergence with respect to \(\beta\)). We generated a set of distance matrices \(DM_{\beta}\) for \(\beta\) ranging from \(10^{5}\) to \(10^{12}\). Figure 1 provides graphical representations of \(DM_{\beta}\) for two different temperatures, \(\beta=3\times 10^{7}\) and \(\beta=10^{12}\). Note that the discrimination between the different shapes of TOSCA improves as \(\beta\) increases. In order to assess quantitatively how well the different distance matrices \(DM_{\beta}\) classify correctly the shapes in TOSCA, we designed the following set of classification experiments. We first built a reference set: we selected randomly half the shapes from each of the 11 classes within TOSCA to form this reference set. Each remaining shape was then classified by considering its distances (derived from \(DM_{\beta}\)) to all shapes in the reference set, and assigning it to the class of the shape with the shortest such distance (this is a 1-nearest neighbor classification experiment).