# Investigating Shape Variation Using Generalized Procrustes Analysis and Machine Learning
## 2 Materials and Methods
### Visible Information Extraction
#### 2.2.2 Bayesian Gaussian Process Latent Variable Model  
A Gaussian process latent variable model (GP-LVM) [44; 45] introduces a randomly initialized latent representation for each image sample and a set of approximated Gaussian processes [46] to recreate the images. In an optimization procedure, the parameters of the Gaussian processes as well as the latent image representations are adapted to the data. Using GP-LVM for images [47], each image \(\mathcal{I}_{j}\in\mathbb{R}^{R\times C}\) is interpreted as a vector \(\vec{y}_{j}\in\mathbb{R}^{R\cdot C\times 1}\) and the latent counterpart is a low-dimensional vector \(\vec{x}_{j}\). The GP-LVM defines \(p(\mathbf{Y}|\mathbf{X})\), which maps the features \(p(\mathbf{X})=\prod_{n=1}^{N}\mathcal{N}(\vec{x}_{n}|\vec{0},\mathbf{I})\) to \(\mathbf{Y}=\left[\vec{y}_{1}^{T}\quad\ldots\quad\vec{y}_{n}^{T}\right]^{T}\). This mapping is performed using a set of sparse Gaussian processes [46]. Since this mapping is intractable, the authors of [31] proposed the Bayesian Gaussian process latent variable model. The authors used variational inference [48], where the prior \(Q(\mathbf{X})=\prod_{n=1}^{N}\mathcal{N}(\vec{x}_{n}|\vec{x}_{n},\Sigma_{n})\) was used to optimize  
\[\ln(p(\mathbf{Y}))\geq F(\mathbf{Q})=\int_{\mathbf{X}}Q(\mathbf{X})\ln\Bigl{(} \frac{p(\mathbf{X})p(\mathbf{Y}|\mathbf{X})}{Q(\mathbf{X})}\Bigr{)}d\mathbf{X}. \tag{1}\]  
After optimization of Equation (1), we interpreted \(\mathbb{E}(\vec{x}_{j})\) as features for the image \(\mathcal{I}_{j}\). \(\mathbb{E}(\vec{x}_{j})\) was obtained from the optimized Gaussian distribution in the latent space. The number of features \(D\) as well as the number of auxiliary points used by the sparse Gaussian process are estimated using the log marginal likelihood \(\ln(p(\mathbf{Y}))\) and the step-wise procedure:  
1. Analyze \(\mathbf{Y}\) using the principal component analysis [49]. Estimate the latent dimension \(D^{*}\), which explains 75% of the data. 2. Keep \(D^{*}\) fixed and find the minimum number of auxiliary points reaching 95% of \(\ln(p(\mathbf{Y}))\). \begin{table}
\begin{tabular}{l l} \hline \hline
**Landmark Name** & **Landmark Abbreviation** \\ \hline Upper tip of snout & UTP \\ Center of eye & EYE \\ Anterior insertion of dorsal fin & AOD \\ Posterior insertion of dorsal fin & POD \\ Dorsal insertion of caudal fin & DIC \\ Ventral insertion of caudal fin & VOC \\ Posterior insertion of anal fin & PIA \\ Dorsal base of pectoral fin & BPF \\ Most posterior edge of operculum & PEO \\ Ventral edge of operculum & VEO \\ Anterior insertion of anal fin * & AOA \\ Anterior insertion of pelvic fin * & AOP \\ Halfway between dorsal and ventral insertion of caudal fin * & HCF \\ Posterior end of mouth * & EMO \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Description of the landmarks used in this study. The asterix (*) indicates landmarks not used on Ugandan samples. Figure 4: The used landmarks for GPA coordinate scaling. The green landmarks were not used for the images obtained in Uganda. Keep the number of auxiliary points fixed and find the number of features \(D\) maximizing \(\ln(p(\mathbf{Y}))\). To visualize the visible characters learned by the B-GP-LVM, we applied the method of [24; 47]. For this visualization of the \(D\) features, we generated \(n\) vectors \(\vec{f}_{n,d}\in\mathbb{R}^{D\times 1}\) for each features. In this vector, we fixed all dimensions to the expectation except for the \(d\)-th dimension, which was set to the true specimen value. Following this procedure, \(n\) vectors for each feature could be generated. These vectors were projected to the image space. We calculated the pixel-wise variance and interpreted the resulting image as a visualization of the latent features space. For the interpretation of the images, we applied the pixel-wise hypothesis test for saliency maps (heatmaps) previously introduced in [24].