{'fraction_non_alphanumeric': 0.027204744713769984, 'fraction_numerical': 0.010636926250644663, 'mean_word_length': 5.4422757475083055, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Topology-preserving augmentation for CNN-based segmentation of congenital heart defects from 3D paediatric CMR

Patient-specific 3D printing of congenital heart anatomy demands an accurate segmentation of the thin tissue interfaces which characterise these diagnoses. Even when a label set has a high spatial overlap with the ground truth, inaccurate delineation of these interfaces can result in topological errors. These compromise the clinical utility of such models due to the anomalous appearance of defects. CNNs have achieved state-of-the-art performance in segmentation tasks. Whilst data augmentation has often played an important role, we show that conventional image resampling schemes used therein can introduce topological changes in the ground truth labelling of augmented samples. We present a novel pipeline to correct for these changes, using a fast-marching algorithm to enforce the topology of the ground truth labels within their augmented representations. In so doing, we invoke the idea of cardiac contiguous topology to describe an arbitrary combination of congenital heart defects and develop an associated, clinically meaningful metric to measure the topological correctness of segmentations. In a series of five-fold cross-validations, we demonstrate the performance gain produced by this pipeline and the relevance of topological considerations to the segmentation of congenital heart defects. We speculate as to the applicability of this approach to any segmentation task involving morphologically complex targets.


Introduction
Medical image segmentation is an integral part of many pipelines for the analysis of clinical data. For many applications, such as the calculation of ventricular volumes, algorithmic approaches need only achieve a segmentation that shares a sufficient overlap with an expert defined reference standard. This can be assessed using the Dice Similarity Coefficient (DSC). However, in other cases the topology of the segmentation is also important. For example, topologically correct segmentation is a prerequisite for the detailed visualisation of paediatric congenital heart disease (CHD) anatomy using patient-specific 3D printed models.
Segmentation of the congenitally malformed heart from CMR images is a challenging task due to inhomogeneity in signal intensity, limited contrast-tonoise ratio and the presence of image artefacts [5]. Furthermore, significant variation in the structural presentation of disease limits the success of conventional methods such as atlas-based strategies [9]. Finally, patient-specific 3D printing demands a high fidelity representation of disease, demonstrating anatomy at the limit of spatial resolution. Segmentation results should accurately represent clinically meaningful thin tissue interfaces such as the atrial septum (see figure  1). Inaccurate interface segmentation introduces anomalous topological features that may falsely indicate the presence of congenital heart defects. Consequently, exponents of patient-specific 3D printed heart models have hitherto relied on manual and semi-automated segmentation methods, typically requiring at least an hour of manual interaction per patient [5].
Convolutional neural networks (CNNs) have been successfully applied to a multitude of image segmentation tasks, including the delineation of congenital heart defects from CMR data. Wolterink et al. [6] trained a slice-wise, 2D CNN using dilated convolutions. Meanwhile, Yu et al. [7] explored deep supervision [8] and dense connectivity within 3D CNNs. Considering a limited training set of just ten cases, these approaches achieved impressive results in terms of spatial overlap. However, automated approaches cannot yet match the overlap performance of the leading semi-automated procedures [3,5], and have largely paid little attention to topological correctness.
Especially in the paediatric setting, developers of medical image segmentation algorithms cannot generally assume a database of thousands or millions of training cases. Instead, state-of-the-art CNNs have relied on data augmentation schemes. Augmentation acts as a source of regularisation and generalisation, capturing modes of variation likely to exist in the underlying population but which are absent from the training data. Spatial scaling, small angle rotation and non-rigid deformation are attractive transformations for augmentation, accounting for variation in patient size, orientation and posture. However, under such schemes, and when subsequently resampled by nearest neighbour interpolation, each of these can cause violations of ground truth topology near thin tissue interfaces (see figure 2(b)).
Knowingly or otherwise, the best-performing previous work [6,7,8] has limited spatial augmentation to a subset of transformations that are topologypreserving: orthogonal rotation and lateral inversion only. However, given that orthogonal rotation has no clinical rationale, this is unlikely to aid the generalisation of CNNs, providing a source of regularisation alone.
We hypothesise that topology-preserving label map augmentation is a prerequisite to any advanced provision for topologically-informed deep learning. To investigate this hypothesis we make the following contributions in the context of CHD segmentation from 3D CMR: -We present a novel pipeline for the augmentation of label map data in a topology-preserving manner. -We present a novel metric for assessing the topological correctness of segmentation results, using it to demonstrate improved performance compared with previous work and with conventional image resampling schemes.

Topology-preserving augmentation pipeline
The notion of simple points 1 is central to the fast-marching topology correction tool developed by Bazin et al. [1]. Starting from a scalar representation of the naively transformed object, this algorithm removes non-simple points from all isosurfaces, correcting the topology to match a known template. Whilst correcting object topology to match that of a ball is straightforward, defining the template for morphologically complex congenital anatomy presents a greater algorithmic challenge. Our solution (see figure 2) is predicated on the idea that the whole heart blood pool has an uncomplicated topological representation. In reality, the topology of the blood pool label can be highly complex, demonstrating numerous fine-scale features associated with the trabeculated, endocardial surfaces. To avoid this complexity, we invoke a property that we refer to as cardiac contiguous topology (CCT). This describes the structural relationships between sub-classes of the cardiac blood pool and their communication. Importantly, the CCT captures the appearance of thin tissue interfaces and defects by defining how and where the heart's chambers and vessels are contiguous.
To remove topological features associated with trabeculation, each sub-class is corrected (via the approach in [1]) to have topology equivalent to a ball at the outset. Once recombined, the topology of the blood pool is defined only by the connections of each cardiac sub-class. Furthermore, we require that the blood pool class constitutes a well-composed set 2 . Such label maps have the advantageous property that repeated topological erosion is guaranteed to result in a one voxel wide CCT template. This captures the topology of the ground truth blood pool in a morphologically simple object free from thin interfaces (see figure 2(f)).
Having established a CCT template for each ground truth label map, the two can be spatially transformed in tandem. Whilst nearest neighbour resampling is likely to cause topological errors in the label map, the morphologically simpler CCT template can be resampled without incurring such changes.
We resample the transformed blood pool label using trilinear interpolation, realising an image bounded in the range [0, 1]. Akin to a probability map, this is corrected to share the topology of the transformed CCT template, ensuring that the arbitrary CCT of the ground truth labels is maintained (see figure 2(c)). Most often, the sub-valvular apparatus and its association with the papillary muscles are only partially visualised in CMR: the true-to-life topological properties of the myocardium are rarely apparent. Hence, we resample the spatially transformed myocardium label by naive nearest neighbour interpolation.

Study design
Data -We employ the ten cases provided during the training phase of the HVSMR Challenge 2016 (see [5] for acquisition and clinical details). Each case includes an isotropic, high-resolution, axially-reformatted, 3D CMR volume acquired at Boston Children's Hospital and demonstrating CHD anatomy. This is tightly cropped around a provided set of manually segmented labels, delineating the whole heart blood pool and myocardium as two separate classes.
Prior to experimentation, an expert in paediatric, CHD segmentation corrected small topological errors that were present in the provided blood pool label maps. The vast majority of corrections removed false positive voxels from within thin interfaces. Totally, 0.098% and 0.0059% of the blood pool and myocardium classes were changed respectively. In a series of five-fold cross-validations (train on eight, test on two), we address a three-class segmentation problem, separating the blood pool, myocardium and background classes. In the context of a deep CNN, the performance of the topology-preserving augmentation pipeline is compared with a naive, nearest neighbour resampling of label data and with augmentation by orthogonal rotation and lateral flipping only (as in [6,7,8]).
Architecture -We adopt the V-net architecture (see figure 3) in all experiments [4], using 3D convolution to learn residual features across spatial scales.
Metrics -Overlap performance was assessed using the DSC. However, such global metrics are largely insensitive to errors in thin interface regions. To characterise the topology of the inferred blood pool, we introduce a novel, interpretable metric. This extends the notion of simple points to connected components, algorithmically counting the number of topologically relevant clusters of voxels where inferred and ground truth segmentations disagree (see figure  1(c)). This approach is clinically meaningful as clusters of topologically relevant errors indicate the anomalous appearance of congenital defects.
Implementation -Prior to augmentation, all CMR data were normalised to have zero mean and unit variance. The topology-preserving augmentation pipeline used the SimpleITK package for spatial transformation and resampling; fast-marching topology correction [1] and associated topological operations used relevant plugins for the Medical Image Processing And Visualisation (MIPAV) platform. From the ten cases provided by the HVSMR Challenge, a total of 10,000 training examples were pre-computed by data augmentation according to figure 2. For comparison we pre-computed a further 10,000 training examples by augmentation using orthogonal rotation and lateral inversion alone. In both cases we also made small perturbations to the voxel intensity of the image data.
All models were trained for 8,000 iterations using the Adam optimiser (Pytorch default settings for learning rate and beta parameters) and the categorical cross entropy loss. Each batch contained eight image patches of 96 × 96 × 96 voxels, randomly cropped from the augmented data. With respect to the submission of batches and weight initialisation, models were trained identically.

Results and discussion
Our results assess the impact of two characteristics of data augmentation: (i) whether spatial transformation is clinically informed; and (ii) whether label map topology is preserved after transformation and resampling.
Perhaps for their ease of implementation, previous work has employed orthogonal rotations [6,7,8] and lateral inversion [7,8] only. Whilst these transformations are guaranteed to preserve label map topology, they are not representative of the distribution of CMR data seen in the clinic. For example, since patient position is invariably head first-supine, orthogonal rotations are unrealistic. Though small variations in patient orientation are observed, these are best captured by small angle rotations. We seek to describe this distribution through the use of the clinically justified transformations shown in figure 2.
With respect to spatial overlap, figure 4 suggests a benefit to this approach. The DSC improves from 0.918 (0.891, 0.934) 3 to 0.925 (0.918, 0.938) and from 0.839 (0.808, 0.854) to 0.868 (0.828, 0.888), for the blood pool and myocardium classes respectively. These results suggest that unlike orthogonal rotation, clinically justified transformations act not only as a source of regularisation but are also beneficial to the generalisability of the network. Overall, these results are consistent with, or in the case of the myocardium class, exceed those achieved by previous work [2,6,7,8].
As well as spatial overlap, we are also concerned with the topology of the inferred blood pool label map. Of particular interest are the false positive clusters which characterise defective interface segmentations and the anomalous presence of defects. Figure 4 demonstrates that compared to previous work, the naive introduction of clinically justified transformations has a detrimental effect on inferred blood pool topology. The median number of topologically relevant false positive clusters increases from 9.0 (6.0, 12.0) to 12.0 (6.3, 22.5). However, when coupled with our topology-preserving augmentation pipeline and its consideration of CCT, this number falls dramatically to 6.5 (6.0, 10.5): a statistically significant improvement according to Wilcoxon Signed Rank test (p = 0.022). This also represents improved performance compared with the clinically unrealistic though topology-preserving augmentation schemes used in previous work.
These observations suggest that the topological features of inferred cardiac segmentations are strongly dependent on the training data. Though perhaps predictable, it must be remembered that in the context of complex morphology, topological features can be encapsulated by relatively few voxels. In fact, across the ten thousand augmented representations of the ten ground truth label sets we produced, less than 0.5% of blood pool voxels were changed by our topologypreserving pipeline. Figure 4 shows that best performance can be attributed to augmentation pipelines which are both clinically justified and which preserve ground truth label topology. Our topology-preserving augmentation pipeline provides a means of simultaneously achieving both qualities.

Conclusion
Our work demonstrates for the first time the importance of label map topology to the task of CNN-based CHD segmentation from 3D CMR images of paediatric patients. We have presented a novel pipeline for the augmentation of training data for CNN optimisation. Invoking the concept of CCT and developing an associated, clinically meaningful metric, we show that the properties of this pipeline -allowing for clinically justified data augmentation whilst preserving arbitrary label map topology -are beneficial to the topological properties of inferred segmentations. We speculate that these findings may be applicable to any medical image segmentation task for which morphologically complex foreground objects can be represented as a number of contiguous sub-classes.