A Deep Learning based Fast Signed Distance Map Generation
Zihao Wang, Clair Vandersteen, Thomas Demarcy, Dan Gnansia, Charles Raffaelli, Nicolas Guevara, Hervé Delingette
MMedical Imaging with Deep Learning 2020 1–6 MIDL 2020 – Short Paper
A Deep Learning based Fast Signed Distance Map Generation
Zihao WANG , [email protected] Inria Sophia Antipolis, France Université Côte d’Azur, Nice, France
Clair Vandersteen , Head and Neck University Institute, Nice, France
Thomas Demarcy Dan Gnansia Oticon Medical, Nice, France
Charles Raffaelli , Department of Radiology, Nice University Hospital, Nice, France
Nicolas Guevara , Hervé Delingette , Abstract
Signed distance map (SDM) is a common representation of surfaces in medical imageanalysis and machine learning. The computational complexity of SDM for 3D parametricshapes is often a bottleneck in many applications, thus limiting their interest. In this paper,we propose a learning based SDM generation neural network which is demonstrated on atridimensional cochlea shape model parameterized by 4 shape parameters. The proposedSDM Neural Network generates a cochlea signed distance map depending on four inputparameters and we show that the deep learning approach leads to a fold improvement inthe time of computation compared to more classical SDM generation methods. Therefore,the proposed approach achieves a good trade-off between accuracy and efficiency. Keywords:
Signed Distance Map, Deep Learning
1. Introduction
A Signed Distance Map (SDM) (Tsai and Osher, 2003) is a scalar field f ( x ) giving the signeddistance of each point x to a given (closed) surface, which mathematically translates intothe relation (cid:107)∇ f (cid:107) = 1 . In practise, SDMs are 2D or 3D images storing the distance of eachvoxel center and are widely used to tackle various problems in computer vision or computergraphics fields. In machine learning, SDMs are useful to encode the probability to belong toa shape through log-odds maps (Pohl et al., 2006). For instance, given a surface S ( θ S ) and ascalar l ref , the probability for a voxel n having position x n to belong to the surface can beprovided through the SDM SDM( S ( θ S ) , x n ) at that voxel as p ( Z n = 1) = σ (cid:16) SDM( S ( θ S ) , x n ) l ref (cid:17) where σ ( x ) is the sigmoid function.While there exist fast (linear complexity) sweeping methods (Maurer et al., 2003) forcomputing SDM from binary shapes, the naive computation of an SDM from triangularmeshes has complexity O ( N n T ) where N is the number of image voxels and n T is the c (cid:13) Z.W. , C. , T. , D. , C. , N. & H. . a r X i v : . [ c s . G R ] M a y umber of triangles describing the shape. An example of a generic computation of SDMfrom meshes is available in VTK (Quammen et al., 2011; Baerentzen and Aanaes, 2005)through the vtkImplicitPolyDataDistance class. Since many algorithms are relying on theSDM generation, it is critical to optimize its computation time in various ways (Jia et al.,2018). In medical image analysis, the naive approach leads to poor performances due to thefact that volumetric images and complex shapes are considered. To improve the performanceof the SDM calculation, several authors (Wu et al., 2014; Roosing et al., 2019) proposed2D and 3D SDM computation methods that take advantage of graphics processing units(GPU) in order to accelerate the computation. Yet, there does not exist any generic libraryfor fast computation of SDM on GPU, and the availability of specific GPU at test time is asignificant limitation for machine learning applications.Algorithmic optimizations were proposed by various authors (Jones et al., 2006) byadopting hierarchical data structures to reach an O ( N log n T ) complexity. For instance,Complete Distance Field Representation (CDFR) (Jian Huang et al., 2001) were introducedwith triangles structured into 3D grids cells.Fast approximations of SDM was proposed in (Wu and Kobbelt, 2003) based on structuredpiece-wise linear distance approximation. Those approaches often require a significant pre-computation stage that can override their computational benefits at later stage.Recent works of (Chen and Zhang, 2019) and (Park et al., 2019) developed neural networksfor the generation of SDM for various of shapes. They rely on an decoder network that takesas input shape parameters and position, and outputs the SDM at that point. The training ofthose deep SDFs is based on a continuous regression from random samples involving a clamploss (Park et al., 2019). Those networks are used for shape inference and are point-basedsigned distance evaluators (without any convolution operation) rather than being generatorsof SDM. As discussed later in this paper, this is a major issue for fast generation of largeimages of signed distance maps.Despite those prior works, there does not exist any generic and efficient way to computeSDM from a triangular mesh on a grid on CPU resources. In this paper, we propose analternative method for fast computation of SDM based on Convolutional Neural Network(CNN) which does not rely on the rasterization of mesh triangles and does not require anyhardware acceleration at test time. Results showed that our approach reduces the SDMcomputational time complexity significantly without any significant impact on the accuracyof shape recovery.
2. Methods and Evaluation
The cochlea is an organ that transforms sound signals into electrical nerve stimuli to thecortex. Cochlea lesions can lead to hearing loss that can be improved by inserting CochlearImplant(CI) on patients at a middle stage of the disease. Cochlea shape recovery from imagesis a pivotal step for CI, and the work of (Demarcy, 2017) is a state-of-art method for cochleashape analysis which makes a computationally intensive use of SDM computations insideExpectation-Maximization loops. ast Signed Distance Map Generation We rely on a parametric cochlea shape model that represents the shape variability of thehuman cochlea. It is represented as a generalized cylinder around a centerline having fourshape parameters a, α, b, φ , two of them for the longitudinal (resp. radial) extent of thecenterline. To compute the SDM of the shape model, the parametric surface was discretizedas triangular meshes whose edge lengths are approximately 0.30 ± vtkImplicitPolyDataDistance classwhich implements a naive SDM algorithm based on point-to-triangle distance computations.For training the neural network, we generated a static dataset consisting of 625 ( × × × )cochlea SDM datasets of size × × by uniformly sampling the 4 deformation parameterswithin user specified ranges. In addition, we performed random data augmentation, bygenerating online SDMs during the training stage through a random sampling of the 4 shapeparameters. Our SDM Neural Network (SDMNN) is an encoder-decoder network with merged layers, itsstructure being inspired by the well known U-net (Ronneberger et al., 2015). The SDMNNhas the four shape parameters as input and generates as output a × × signed distancemap (see Fig. 1).Figure 1: Proposed Signed Distance Map Neural Network (SDMNN)
3. Experiments and Evaluation
The SDMNN was trained on one NVIDIA 1080Ti GPU with both static 625 datasets andonline random SDMs with a Mean Square Error (MSE) loss for 168 hours. After training,we generated 100 test SDMs with the naive mesh-based VTK code that are associated withrandom shape parameters. Those were compared to the SDMs generated by the SDMNNfor the same shape parameters and the average MSE on the whole images were MSE = . mm which is small given that the range of a SDM is ( − . mm, . mm ) . ualitative results are shown in Fig. 2 (I) where the comparison of the SDMNN andnaive mesh-based generated maps is performed by extracting the isocontours associated withthe zero (red) and 1mm (yellow) level sets. We see that the isocontours from the SDMNNmatch closely the ones generated from the mesh. Some small and smooth distorsions appearfor the yellow contours. Since in surface reconstruction problems, the main focus of SDM ison the zero level set, the errors of the yellow isocontours are likely not to entail any majorreconstruction errors. To verify the accuracy of the zero level isocontour, we have extractedthe zero isosurface by the marching cubes algorithm associated with the standard shapevalues and compared that reconstructed surface with the original triangulated mesh model(the one used to generate the mesh SDM). In Fig. 2 (II) the 2 surfaces are overlaid showingthat the SDMNN isosurface is as smooth as the original mesh and that the 2 surfaces arevery close indeed. The proposed approach is evaluated quantitatively in three ways. First,Figure 2: (Left-I) comparison between isocontours extracted from an SDM generated by theSDM neural network (left) and classical method (right);(Right-II) comparison ofreconstructed 0-isosurface between the two methods.we compare the computation times between VTK mesh-based SDM generation and theSDMNN-based generation. All evaluations were performed on a Dell Mobile Workstationwith Intel(R) Core(TM) i7-7820HQ @ 2.90GHz CPU. We show in Table 1 that the SDMneural network is about 66 times more efficient to generate a SDM than the classical method.Second, the performance was also compared for fitting a cochlea shape model on a clinicalCT image as in (Demarcy, 2017) which requires several hundreds of evaluations of signeddistance maps. In such case, the speedup was shown to be about 11 times faster than themesh-based alternative. We also implemented the DeepSDF and IM-NET (Park et al., 2019;Chen and Zhang, 2019) for the generation of SDM of the cochlea with 4 shape parameters.For a fair comparison, we run DeepSDF (which is very similar to the IM-NET) to test itscomputational efficiency to fill a (60, 50, 50) SDM grid in one batch. The resulting computingtime is 28s as shown in Table 1 which is even worse than the default VTK algorithm. Thisshows that there is high price to pay to have a point-based network rather than a image-basednetwork. Furthermore, we found the accuracy in terms of signed distances of both networksto be significantly worse than our proposed SDMNN.Thirdly, we evaluated the difference in terms of estimated shape parameters after fitting9 clinical CT cochlea volumes using both mesh-based and SDMNN methods. This lead torecover the 4 shape parameters a, α, b, φ on each of the 9 cochleas that are stored in vector P mesh when using mesh-based SDM generation method and vector P SDMNN with SDMNN. ast Signed Distance Map Generation Table 1: Different Methods Computational time for SDM generation (h:m:s)Generation Time SDMNN Mesh based SDM DeepSDFSingle SDM 0:00:00.2 0:00:10.7 0:00:28.1Shape Fit 1:05:02.1 12:15:45.4 FailedThe errors in shape parameters P err = (cid:107) P mesh − P SDMNN (cid:107) are reported in Table 2 showingnegligible discrepancies given that the parameters magnitude (see head of Table 2).Table 2: Shape parameters estimation error for SDMNN compared to mesh based SDMParameters Name a α b ϕ Parameters Range (2.0, 5.0) (0.0, 1.2) (0.05, 0.25) ( − π/ , π/ )Mean shape parameters errors 2.06e-08 2.53e-08 5.4e-08 1.00e-09 P err on 9 cases.
4. Conclusion
In this paper, we have proposed a deep learning-based fast signed distance map generationmethod. We showed quantitatively and qualitatively that it can generate 3D SDM in lessthan 300 ms, while having an accuracy suitable for shape-recovery, with no noticeable changesin recovered shape parameters. This CNN based SDM generation model can be used for anyparametric shape model for SDM generation and does not require any GPGPU resourcesafter training, which is compatible with a clinical environment. While other point-basedapproaches such as DeepSDF and IM-NET have been also proposed recently, the timeoverhead to fill a regular grid appears to be fairly large. The current approach is probablysuitable only when the number of shape parameters is small since the number of SDMs inthe training set should grow quadratically with the number of shape parameters. Futurework will look at additional strategies to speed-up the training stage and improve the outputaccuracy.
5. Acknowledgement
This work was partially funded by the regional council of Provence Alpes Côte d’Azur, bythe French government through the UCA
JEDI "Investments in the Future" project managedby the National Research Agency (ANR) with the reference number ANR-15-IDEX-01, andwas supported by the grant AAP Santé 06 2017-260 DGA-DSH.
References
J. A. Baerentzen and H. Aanaes. Signed distance computation using the angle weightedpseudonormal.
IEEE Transactions on Visualization and Computer Graphics , 11(3):243–253,May 2005. ISSN 2160-9306. doi: 10.1109/TVCG.2005.49. hiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. In TheIEEE Conference on Computer Vision and Pattern Recognition (CVPR) , June 2019.Thomas Demarcy.
Segmentation and study of anatomical variability of the cochlea frommedical images . Theses, Université Côte d’Azur, July 2017.Shuman Jia, Antoine Despinasse, Zihao Wang, Hervé Delingette, Xavier Pennec, Pierre Jaïs,Hubert Cochet, and Maxime Sermesant. Automatically Segmenting the Left Atrium fromCardiac Images Using Successive 3D U-Nets and a Contour Loss. In
Statistical Atlases andComputational Modeling of the Heart (STACOM) workshop , Granada, Spain, September2018.Jian Huang, Yan Li, R. Crawfis, Shao-Chiung Lu, and Shuh-Yuan Liou. A complete distancefield representation. In
Proceedings Visualization, 2001. , pages 247–561, Oct 2001.M. W. Jones, J. A. Baerentzen, and M. Sramek. 3d distance fields: a survey of techniquesand applications.
IEEE Transactions on Visualization and Computer Graphics , 12(4):581–599, July 2006. ISSN 2160-9306. doi: 10.1109/TVCG.2006.56.C. R. Maurer, Rensheng Qi, and V. Raghavan. A linear time algorithm for computing exacteuclidean distance transforms of binary images in arbitrary dimensions.
IEEE Transactionson Pattern Analysis and Machine Intelligence , 25(2):265–270, Feb 2003. ISSN 1939-3539.doi: 10.1109/TPAMI.2003.1177156.Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove.Deepsdf: Learning continuous signed distance functions for shape representation. In
TheIEEE Conference on Computer Vision and Pattern Recognition (CVPR) , June 2019.Kilian M Pohl, John Fisher, Martha E Shenton, Robert W Mccarley, W Eric L Grimson, RonKikinis, William M Wells, and W L Eric. Logarithm Odds Maps for Shape Representation.
MICCAI , 9(Pt 2):955–963, 2006.C. Quammen, C. Weigle, and R. Taylor. Boolean operations on surfaces in vtk withoutexternal libraries.
VTK journal , 05 2011.Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks forbiomedical image segmentation. volume 9351, pages 234–241, 10 2015. ISBN 978-3-319-24573-7. doi: 10.1007/978-3-319-24574-4_28.A. Roosing, O. Strickson, and Nikolaos Nikiforakis. Fast distance fields for fluid dynamicsmesh generation on graphics hardware. 03 2019.Richard Tsai and Stanley Osher. Level set methods and their applications in image science.
Communications in mathematical sciences , 1, 12 2003. doi: 10.4310/CMS.2003.v1.n4.a1.Jianhua Wu and Leif Kobbelt. Piecewise linear approximation of signed distance fields. In
Vision, Modeling and Visualization , pages 513–520, 09 2003.Yizi Wu, Jiaju Man, and Ziqing Xie. A double layer method for constructing signed distancefields from triangle meshes.
Graphical Models , 76(4):214 – 223, 2014. ISSN 1524-0703., 76(4):214 – 223, 2014. ISSN 1524-0703.