A systematic comparison of generative models for medical images

Purpose This work aims for a systematic comparison of popular shape and appearance models. Here, two statistical and four deep-learning-based shape and appearance models are compared and evaluated in terms of their expressiveness described by their generalization ability and specificity as well as further properties like input data format, interpretability and latent space distribution and dimension. Methods Classical shape models and their locality-based extension are considered next to autoencoders, variational autoencoders, diffeomorphic autoencoders and generative adversarial networks. The approaches are evaluated in terms of generalization ability, specificity and likeness depending on the amount of training data. Furthermore, various latent space metrics are presented in order to capture further major characteristics of the models. Results The experimental setup showed that locality statistical shape models yield best results in terms of generalization ability for 2D and 3D shape modeling. However, the deep learning approaches show strongly improved specificity. In the case of simultaneous shape and appearance modeling, the neural networks are able to generate more realistic and diverse appearances. A major drawback of the deep-learning models is, however, their impaired interpretability and ambiguity of the latent space. Conclusions It can be concluded that for applications not requiring particularly good specificity, shape modeling can be reliably established with locality-based statistical shape models, especially when it comes to 3D shapes. However, deep learning approaches are more worthwhile in terms of appearance modeling.


Introduction
Building representative, generative models that capture shape and appearance variations of anatomical structures commonly observed in a population of subjects, is a classical problem in computational anatomy. Such models have multiple applications in medical image analysis where they can, for example, provide prior information about plausible shape and appearance configurations in classical image segmentation and registration approaches [13,17]. In an era where medical image analysis is dominated by deep learning-based methods, models of shape and appearance are still valuable B Hristina Uzunova hristina.uzunova@dfki.de 1 as either a way to systematically generate additional training data [15,29] or to directly integrate such information into the network architecture [20,33].
Statistical shape models (SSMs) use the principal component analysis (PCA) on point-wise shape representations to compactly describe the shape variability [4,12].
While those models have had great success in the past [12], they come with significant disadvantages as they are only able to represent linear manifolds, rely on point-bypoint correspondences across all training shapes, and do not generalize well to unseen data when only few training samples were available. Some of those shortcomings have been addressed via targeted extensions of the core method. For example, in [17] a nonlinear extension of SSMs is derived, [5,32] introduce methods to still learn representative SSMs based on few real samples, and [14,18] propose a probabilistic method to build SSMs without fixed point-by-point correspondence. In addition to shape modeling, the PCAbased mechanisms underlying SSMs [4] have also been used to learn statistical appearance models (SAMs) that simultaneously model shape and grayvalue appearance of anatomical structures [3,18]. This not only allows for an improved representation of the structures being modeled, but also enables the generation of realistic images for tasks like data augmentation when training neural networks [29].
In recent years, the focus has shifted away from traditional SSMs or SAMs for generative modeling in medical image analysis as deep learning approaches have become more popular. For example, autoencoders (AEs) and variational autoencoders (VAEs) were successfully applied for feature extraction [2] or unsupervised pathology localization [28]. Furthermore, so-called generative adversarial networks (GANs) known for their excellent ability to generate realistic images have been utilized for data augmentation [7]. Moreover, the recently developed diffeomorphic and deformable autoencoders (DAEs) share foundations with SSMs and are thus particularly suitable for representation learning [1,26]. When compared to traditional SSMs and SAMs, deep learning-based generative models have many advantages in terms of model flexibility and image generation. For example, typically no separate handling of shape and appearance is required, point-by-point correspondences are not needed, and they are flexible enough to directly handle nonlinear relationships. However, deep learning-based models typically require a much larger amount of training data than their traditional counterparts and are often deemed as black boxes that are hard to interpret.
Given the amount of various traditional and deep learningbased shape modeling methods, a systematic investigation of their specific strengths and drawbacks in relevant medical image analysis scenarios has been missing so far. This work aims to consistently and systematically evaluate the performance and characteristics of two traditional approaches (SSMs and their locality-based extension [32] (LSSMs)) and four deep learning-based autoencoding architectures on public datasets. Although the models differ with respect to the representation of input and output data, they were chosen since they agree in terms of purpose and aim: generative modeling of shape and/or appearance information based on a set of training data. Despite the fact that shape information is encoded as contours (or pseudo-landmarks) in statistical shape models, and as label images in CNN-based approaches, all of the discussed approaches can be used interchangeably in downstream tasks, e.g., to synthesize training data, to provide shape priors, or for data augmentation [6,7,29]. The provided comparison aims to contribute to the discussion which generative model is the most appropriate for a given task by evaluating their reconstruction performance as well as the specificity and diversity of generated samples depending on the size of the training dataset.
Furthermore, we study and compare the consistency and characteristics of the respective latent spaces. In a previous study [27], we examined the shape modeling properties of SSMs and different neural networks for 2D shapes. We were able to show that on average neural networks perform on par with SSM in terms of generalization ability while outperforming them in terms of specificity. On the other hand, traditional SSMs and specific extensions especially showed their benefits in scenarios with small training populations. This work substantially extends [27] by (1) also investigating 3D shapes in addition to 2D data, by (2) incorporating appearance information, and by (3) utilizing additional metrics to inspect sample quality and latent space characteristics. We strongly believe that those extensions of our analysis will help to obtain a better understanding of the differences between various deep learning and classical shape and appearance modeling approaches.

Compared approaches
In this work, the following two statistical and four deeplearning approaches are considered in a systematic comparison.
Statistical Shape and Appearance Models Statistical shape models (SSMs) are built using a training set of N discrete, vectorized shape representations x 1 . . . x N [4].
Here, each x i ∈ R dm is composed of m landmarks representing the object's shape in a d-dimensional space. PCA of a training set is used to create a mean shape x μ and an orthonormal basis U ∈ R dm× p for projecting shape representations into a low-dimensional latent space z ∈ R p via x new = x μ + Uz or to generate new shapes by varying z.
SSMs can be expanded by appearance modeling (SAMs) [3] by considering appearance images a i and warping their shape representations x i to x μ with the corresponding transformation ϕ i . The resulting "shape-normalized" images can be used in a similar manner for a PCA-based modeling of the intensities sampled on multiple points. After the sampling of the appearance parameters, the resulting image need to be warped back with ϕ −1 .

Locality-based Statistical Shape and Appearance Models
In classical SSMs, the number of training samples influences the flexibility of the model, since the size of the latent space is limited by the size of the training set. Locality-based SSMs (LSSMs) [32] introduce additional flexibility by breaking global relationships and assuming that local shape variations have limited effects in distant areas. This idea can be integrated into the traditional SS(A)M framework by manip-ulating covariances based on the distance between landmarks in a multi-resolution manner.
Autoencoders Autoencoders (AEs) are typically neural networks that aim to learn a low-dimensional representation from high-dimensional input data [16]. They consist of an encoder f : R d → Z that maps the input x ∈ R d to a latent space variable z ∈ Z; and a decoder g : Z → R d that aims to reconstruct the input image as flawlessly as possible by only considering its latent representation. To ensure a good reconstruction of the input image, a reconstruction loss between the real input image and its reconstruction is usually calculated.
AEs can be observed as generative models, where an unseen sample x new can be reconstructed as x new ≈ g( f (x new )) and new samples can be generated by sampling a random latent vector z sample and computing g(z sample ). However, using AEs for the generation of new samples in this manner might be infeasible due to the unknown underlying distribution of the latent space. Thus a random sample can lie far away from the learned distribution and produce unrealistic results.
Variational Autoencoders Variational autoencoders (VAEs) [16] are an extension of conventional AEs that prevent the problem of unknown latent distribution. VAEs constrain the latent space to a known prior distribution p(z), most commonly set to the normal distribution N (0, 1). In practice, this is done by applying a Kullback-Leibler (KL) loss to the latent space. Using VAEs for the reconstruction of unseen samples can be done analogously to conventional AE; however, the main difference lies in the generation of new samples by sampling a z sample ∼ N (0, 1).
Autoencoder Generative Adversarial Nets Autoencoder generative adversarial nets (AE-GANs) [19] are a combination of an autoencoder with an adversarial discriminator inspired by GANs [9]. Thus an AE-GAN consists of an encoder f : R d → Z, a decoder g : Z → R d and enclosed adversarial discriminator d : R d →{real,fake}. Here, the typical GAN-loss is combined with a reconstruction loss to improve convergence. For our purposes, the straightforward use of GANs is infeasible, since they do not directly enable reconstruction of samples and approaches like [24] are time-consuming. Using an AE-GAN architecture enables the reconstruction of samples analogously to AEs.
Diffeomorphic Autoencoders Similarly to statistical models, diffeomorphic autoencoders (DAEs) [1] assume images as a deformed version of a global template. DAEs also feature an encoder-decoder structure; however, the decoder's output is a deformation field ϕ, such that given a template t the input image x can be reconstructed as t • ϕ, where • denotes the warping function. Diffeomorphic autoencoders most commonly constrain the latent space to a normal distribution using a KL loss.
Using the annotations from Sect. 2.1, unseen samples can be reconstructed as x new ≈ t • g( f (x new )) and new samples can be generated as t • g( f (z sample )) with z sample ∼ N (0, 1). DAEs reliably capture shape changes between samples; however, modeling of appearance is not feasible with this approach. For the additional modeling of intensity offsets, an extension to the DAE approach similar to [26] is used in this work. We correspond to this model as appearance DAE (ADAE). The main idea is to represent images as x ≈ (t + a) • ϕ with a being an image-specific pixel-wise intensity offset. To enable this, the encoder f generates a composite latent representation z = [z s , z a ] for shape and appearance respectively and two decoders g s and g a each generate a shape displacement ϕ and an appearance map a.

Architectures and Implementation Details
In order to decouple architectural search from network performance and enable comparability between the deep learning approaches in terms of the number of trainable parameters, the same architectures (except for particular model-specific components) were applied for all models. In this way, the expressiveness of the networks for a fixed architecture can be evaluated and separated from the performance gain due to architectural optimization. Each encoder (or discriminator) contains three convolutional layers (2D or 3D depending on the input data) with stride two and a growing number of channels [in ch ,20,40,80] and a fully connected layer at the end to obtain the latent vector. The decoders contain three subsequent bilinear upsampling and convolutional layers with a decreasing number of channels [80,40,20,out ch ]. The input and output number of channels in ch and out ch depends on the input and output types (onehot encoded label images, displacement fields or one-channel intensity images). When modeling shapes (represented as labels) a weighted generalized Dice loss is used [25], when modeling appearances an SSIM-loss is chosen. For the diffeomorphic autoencoders, the displacement field is regularized using diffusion and L1-regularization as in [26]. All parameters for the weighting of the loss function were taken from [26], where both regularization terms are weighted by a factor of ten.

Evaluation techniques
Assessing the quality of generative models Generalization Ability Generalization ability (GA) is the ability of a generative model to reconstruct samples unseen during training. Formally, given a set of real left out images r i ∈ R, GA is measured as 1 is a suitable image-wise distance metric andr is the reconstructed input r. The reconstruction of unseen samples is established depending on the used approach as explained in 2.1.
Specificity The specificity is the ability of a generative model to generate new samples that are similar to the real samples of the training dataset, i.e., realistic samples can be generated. Specificity is measured by generating a dataset s j ∈ S of N S sampled images and calculating: where R is a set of real images. Specificity measures the distance of a generated image to its best fitting real image; however, the diversity of the generated samples is not considered. This means that a good specificity may indicate that the model only generates one image that suits a particular real image very well. Thus the diversity of the generated images is also considered by the following evaluation method.
Likeness The likeness score proposed by [10] evaluates the realism of generated images by considering the aspects creativity, inheritance and diversity. The authors propose to compute a distance-based separability index (DSI) by comparing the distributions of distances between images of the same class (real or synthetic) and different classes. For two sets R, S of real and synthetic images, the intra-class distance set (ICD) is defined as: , and the betweenclass distance set (BCD) can be determined as: The Kolmogorov-Smirnov statistic is used to quantify the similarity of the distribu- , and the average of the two KS similarities defines the DSI: DS I (R, S) = (s R + s S )/2. We refer to this metric as likeness since it describes the similarity between the distribution of the real data and the generated data. The likeness ranges from 0 to 1 where smaller values indicate better synthetic images.

Quantifying the latent space
Compactness The most important property of the latent space is its dimension, with a smaller number of latent dimensions contributing to the interpretability of the model. While in SSMs the dimension of the latent space is determined by the number of modes describing the desired percentage of variability (95%), for deep learning models this must be empirically determined a priori (see appendix for choice of latent dimensions).
Normality An important assumption of all approaches is that new samples can be generated by sampling a vector z from a normal distribution. This requires a roughly normal distribution of the learned latent spaces. To assess this property, we encode a set of real samples and examine the distribu-tions along each dimension using a Shapiro-Wilk test [23]. In this manner, the percentage of not-normally distributed components of the latent space can be determined. A further visual evaluation of the smooth distribution of the latent space can be established by interpolating between the projections of two random images and visualizing the decodings of the intermediate latent vectors.
Latent ambiguity score A desired property of generative models is that if an image x is mapped to its latent variable z and reconstructed tox, the reconstructionx should also get mapped to the same latent vector. This is given for SSMbased models, however not mandatorily fulfilled by deep learning approaches. To asses the extent of the problem, we propose the latent ambiguity score (r i )))|| 2 is the mean latent space distance of images r i ∈ R and their reconstructions, 2 is the mean encoded distance between different images. LAS close to zero corresponds to an unambiguous latent space, whereas a score close to one indicates that the latent mappings of the real and the reconstructed images are nearly randomly located. Thus models with high LAS are able to sample the entire latent space by simply subsequently inputting the reconstructions of the previous input.

Data and experimental setup
Thorax X-Rays We use an openly available thorax Xray dataset containing 247 chest radiographs and ground truth segmentations of five structures: the heart, both lungs and both clavicles (see Fig. 1 for examples) [30]. This dataset is only used for shape modeling, thus for the SSM methods, point-based representations are used, and for the deep-learning approaches the segmentation labels are applied directly. The images are split in 123/114/10 test/train/validation.

Brain MRIs
This dataset contains 600 3D T1-weighted brain MRIs from the publicly available IXI dataset 1 [11]. Anatomical labels were generated using atlas-based segmentation, while simultaneously obtaining the one-to-one correspondences needed for SSM-based methods from the registration. A dataset split of 300/290/10 test/train/validation is used. For this dataset, we explore both shape and appearance modeling of the given segmentations and intensity volumes. Since deep-learning methods are very resource demanding, the images and labels are cut to a central area around the ventri-  Fig. 1.
Three experiments are carried out: 1) shape modeling for 2D thorax x-rays; 2) shape modeling for 3D brain MRIs; 3) appearance modeling for 3D brain MRIs. For the shape modeling scenarios, point-based representations of the segmentation labels are used as input, whereas the deep-learning methods take in the one-hot-encoded labels directly. For the appearance modeling scenario, the intensity image volumes can be directly used by the neural networks; however, the SAMs consider shape distortions (given by registration displacement fields) and appearances separately. Each model is trained on various training set sizes and the generalization ability, specificity and likeness are assessed in accordance to that. This allows an observation of the quality of the generative models depending on the training set size and thus an assessment of their robustness. To avoid choosing unsuitable training data for smaller training set sizes, a multi-fold training is performed (four folds for N < 100, two folds for N ≥ 100), averaging the results over the folds. To establish fairness against all methods when generating new samples, the latent vectors are drawn from the normal distribution described by the mean and standard deviation of the latent vectors of the training dataset. The metrics used for assessing the generative models vary depending on the data. When shapes are considered, average symmetric surface distance (ASSD) is calculated for all models. Here, a geometric distance is deliberately chosen since a landmark distance is infeasible for the deep learning approaches using labels as inputs, and a label-based metric such as Dice is not precise enough and might favor the methods trained on labels since they optimize towards a generalized Dice coefficient during training. Hence, the chosen ASSD is the middle ground between the slight loss of accuracy by computing the contours from the landmarks for the evaluation of statistical methods and the conversion from contours to labels and backward for the deep learning approaches. For the appearances, the L1 distance is used here. Since our experience showed that metrics like MSE and SSIM behave similarly, those results are only shown in Appendix. The latent space evaluation is carried out for the largest possible training sets for each experiment.

2D and 3D Shape Modeling
The specificity and generalization ability for the shape models are presented in Fig. 2. For the 2D scenario, all deeplearning approaches perform similarly to the LSSM in terms of generalization ability, whereas the classical SSM performs significantly worse, regardless the training set size. For small training set sizes (N ≤ 40), LSSM even outperforms the deep-learning methods. Furthermore, for small training set size the neural networks tend to not generate small structures like the clavicles (bars in Fig. 2). This problem does not appear when using (L)SSMs or DAEs, since they represent shapes as a deformed global template that contains all structures. When it comes to specificity, the deep-learning methods outperform the (L)SSMs for all training set sizes.
A different behavior can be observed for the 3D shapes. Here, the (L)SSMs both yield slightly improved generalization ability compared to the deep-learning methods. Please note that all methods perform with voxel-level accuracy for N > 5. Again, the deep-learning methods yield better specificity values; however, the difference between the models is not as vast and the distances for all models lie under one voxel. A significant drawback of the neural networks in this scenario, is however their enormous GPU memory demand, which is why the input shape size needed to be drastically decreased in order to enable training on a 12GB GPU for all models. Figure 3 shows surface distances for a reconstructed structure (putamen) by some of the methods, where the LSSM and AE-GAN approaches deliver the smallest distances, which is consistent with the presented quantitative results.
The assessment of the latent spaces gives further insight. The normality test of latent vectors shows that SSMs have a large amount of non-normally distributed dimensions (LSSM: 40%, SSM: 33%) which might be the reason for their bad specificity. On the contrary, the deep-learning methods yield less non-normally distributed dimensions (VAE: 10%, AE: 18%, DAE: 13%, AE-GAN: 19%), whereas expected methods with explicit KL-normalization have the smallest percentage of non-normally distributed dimensions. In terms of compactness, the SSM methods are much more compact, whereas the latent space dimension of the neural networks is much larger, implicitly making them harder to interpret ( Table 2). Table 1 shows the LAS for the different models. SSMs, by definition, have an L AS = 0; however, all deep learning methods show scores > 0. Again, neural networks that apply a KL-loss tend to map reconstructions closer to their initial input shapes. Thus, VAEs and DAEs seem to build a less ambiguous latent space than AEs and (AE-)GANs. A less ambiguous latent space is generally desirable in generative modeling; however, in deep learning methods some ambiguity comes with a trade-off concerning the representation of degrees of freedom. Since statistical models are linear mappings and have an a-priori one-to-one correspondence from the input to its latent representation and back, their representation abilities are limited. Following from this, some ambiguity should be taken into account for the higher expressiveness of deep learning models.
To further visualize the latent spaces, Fig. 4 shows interpolations between two random 2D shapes. Due to the missing regularization of the latent space, AEs produce holes in the segmentations and they show abrupt, irregular changes between interpolated shapes (middle shape and shape left to it), which are also present to a lesser extent in DAEs and  3D Appearance Modeling Figure 5 shows the results of the 3D appearance modeling. Here, the deep-learning methods perform better in terms of generalization and specificity for all training set sizes, whereas the ADAE yields the best results. In terms of likeness, the VAE yields the worst results, possibly due to the blurriness of the generated samples. The best likeness is delivered by the AE-GAN approach, followed by ADAE that is constrained through a template and thus most likely generates less diverse samples.
In terms of latent space ambiguity and normality, the same tendency as in the previous experiments can be observed. The percentage of non-normality distributed components can be broken down as follows: AE: 12%; VAE: 7%; GAN:  Fig. 4 Visualization of the linear interpolation between latent vectors of two shapes (first and last in a row). The bars underneath indicate the ASSD between a reconstruction (20 steps) and the first shape (top bar); and a reconstruction and the last shape (bottom bar). First and last values are the ASSD between real shape to itself or to the second shape and vice versa: yellow(max)→blue(0). Some models skipped due to space constrains AE DAE AE-GAN LSSM 14%; DAE: 7%; PCA: 52%; LPCA: 56%. However, in terms of compactness, the SAM and LSAM show a significant increase of modes, shrinking the gap between the neural networks and the statistical approaches. The interpolation experiment from Fig. 6 also shows that a smooth interpolation is possible for all methods. However, the images generated by the VAE are very blurry. The images generated by the (L)SAMs look more realistic, yet, they are not able to attain the high quality of the images generated by the ADAE and AE-GAN models.

Discussion and conclusion
In this work, a systematic comparison of the shape and appearance modeling abilities of four deep learning and two statistical generative models was performed. To facilitate comparability, all methods were consistently evaluated using the same image data, processing pipeline and metrics, and the network architectures of the deep-learning methods were kept constant except for model-specific components.
In general, our experiments show that for shape modeling, present extensions of classical SSMs have a number of advantages over deep learning-based approaches. Among the tested methods, the locality-based SSM approach achieves the best generalization ability and requires less training samples and less computational resources, especially in the case of 3D shapes. The latent space of SSM-based models shows advantages like better interpretability and compactness and is producing continuous and smooth interpolation results. Another advantage of SSM-based models in this scenario is that anatomical shapes are represented point-based with sub-voxel accuracy, while CNN-based architectures use voxelized label maps. The main disadvantage of SSM-based models is, however, the lower specificity of generated samples, which is likely caused by the non-normality of the latent space distribution.
Since they use a linear mapping of the input data to the latent vectors, the distribution of the training data defines the distribution of the latent space. Interestingly, even the deep learning methods that use no KL-constrain on their latent space, map the the input data to a latent distribution that has far more normally distributed components than the ones resulting from statistical models. This results into fairly good specificity (e.g. AE-GAN) even though no latent space constrain is used. A possible reason for that is the usage of weight decay regularization during the optimization process which gives the network's weights a Gaussian prior and thus  the latent space is also pushed in the direction of a normal distribution. Here, the regularization term is low weighted; however, other works feature approaches like regularized autoencoders [8] that only use regularization techniques and omit the KL-loss. Yet, the explicit constraining of the latent space to a normal distribution using a KL-term here yields slightly increased specificity; however, this might interfere with the model's generalization ability and presents an additional loss component, making the optimization process more complex and increasing the number of hyperparameters. Thus, whether a KL-constrain is used greatly depends on the chosen application and desired results.
For the simultaneous shape and appearance modeling, however, the deep-learning methods show considerable advantages: the ADAE and AE-GAN generate diverse, sharp and realistic images and show best results in terms of all metrics. Here, ADAEs have the further advantage that their latent space is more normally distributed and less ambiguous due to the use of the KL divergence. Surprisingly, they also prevent blurriness of the generated samples typical for the standard VAE approach. SAM-based approaches require pre-registration of all training images to establish point-bypoint correspondences, and unavoidable registration errors may reduce generalization ability. Also, the compactness and computational resources needed approach those of deep learning methods due to the size of the underlying covariance matrices. So that SAM-based methods are clearly inferior to deep-learning models for appearance modeling.
Given the wide variety of generative models, we only considered a selection of commonly used approaches in this paper. We provided a comparison between LSSMs and other classical shape modeling approaches, like waveletbased SSMs or Gaussian process morphable models, in our previous work [31,32]. Other approaches, like autoregressive generative models [21] or normalizing flows [22], show promising generative properties, but are costly to train and have few applications in the medical field so far. Besides the integration of such models in a systematic comparison as focused in this paper, a further interesting line of research is to combine the strengths of different models. One example is included in this paper by combining autoencoders with a GAN-inspired discriminative loss function. Another possible example is to use normalizing flows to ensure normality distributions in the latent space of VAE or SSM models. This will be one of our future directions of research.
In conclusion, this study enables insights into the advantages and disadvantages of generative models for medical images in different settings, providing a decision support for the choice of a suitable model and motivating further research for the improvement of the presented drawbacks. Considering the various possible applications and purposes of generative models, their different characteristics need to be weighed with regard to the specifically planned application, since, e.g., interpretability and a small number of parameters might be an important feature for applications like segmentation but high specificity and diverse and naturalistic samples might be required for data augmentation for the training of neural networks.
Funding Open Access funding enabled and organized by Projekt DEAL.

Declarations
Conflict of interest Hristina Uzunova, Matthias Wilms, Nils D. Forkert, Heinz Handels and Jan Ehrhardt declare that they have no conflict of interest. This article does not contain any studies with human partici-pants or animals performed by any of the authors. For this type of study, formal consent is not required.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.

A Optimizing the latent space dimension toward evaluation metrics for the different models
In our work, the latent dimensions are fixed between the different models in order to preserve comparability (different latent spaces correspond to a different number of trainable parameters). For the 2D shape models, a latent dimension of 512 was chosen, since it is the smallest model corresponding to specific thresholds: specificity ≤ 2.6mm and generalization ability ≤ 1.5mm for all models when the largest possible training set is used. For the 3D models, 1024 was chosen similarly setting both cutoff values at 0.5mm. However, choosing the latent dimensionality for each model separately is not trivial, since a trade-off between specificity and generalization, as well as computational feasibility needs to be obtained. A good value might result in a good result for specificity for one model, but lead to bad generalization ability in that same model or be less suitable for other models. Here, we investigated that property exemplary for the use-case of the 2D shapes. The tested dimensions are 128, 256, 512, 1024, 1500. The experimental setup is corresponding to the previous experiments using the same training set sizes and a multi-fold validation. The results for the three highest dimensions are presented in Fig. 7 since 512 is the first size delivering optimal results for at least one of the models. Interestingly, larger dimensions are not always contributing to better generalization ability: the GAN and AE models yield best results using latent vectors of size 512, contrary to the VAE and DAE approaches, that achieve slightly better results with a latent dimension of size 1500. Another important observation is that specificity is not best, when generalization is best. However, overall those different dimensions deliver fairly similar results, such that 512 remains a good choice for the means of comparability and computational efficacy.

Dim=512
Optimal for GAN &AE Dim=1024 Optimal for GAN, DAE &AE Dim=1500 Fig. 7 The results for the 2D shapes plotted for different latent dimensions. The dimensions optimal for a certain model and metric are noted underneath the plots, respectively B Additional metrics for the evaluation of appearance models