Spectral Algorithms for Segmenting Neurons in their Three-dimensional Space Ioannis a Koutis , Richard a a Garcia-Lebron , Jose a Farrington-Zapata , Jose L. b Serrano-Velez , Eduardo b Rosa-Molinar Computer Science Department, Biology Department – Biological Imaging Group, University of Puerto Rico-Rio Piedras b Abstract The adapted Random Walker method Results Automating segmentation of individual neurons in electron microscopic (EM) images is a crucial step in the acquisition and analysis of connectomes. It is commonly thought that approaches which use contextual information from distant parts of the image to make local decisions, should be computationally infeasible. Combined with the topological complexity of three-dimensional (3D) space, this belief has been deterring the development of algorithms that work genuinely in 3D. The Random Walker method introduced by Leo Grady [7] solves the following problem. First a simple affinity graph is constructed. For the affinity construction we use a rather simple function. A number of pixels/nodes are taken as seeds. Each seed is assigned label. We can have an arbitrary number of labels, but for our purpose let’s assume that there are two kinds: inside seeds lying in the interior of the neuron in focus, and outside seeds that are pixels in the exterior of the neuron. The rest of the pixels are unlabeled. One can imagine a particle starting at an undecided pixel and performing a random walk on the affinity graph. If the particle at time t is in a vertex i, the particle selects one of the neighboring vertices j, with probability proportional to wij. One can ask the question: The method handles easily very noisy frames as the ones shown in Figure 1 However, recent breakthrough results in spectral graph theory show that this intuition is wrong. It is in fact possible to solve linear systems of matrices associated with the affinity graphs derived from the images in time that essentially scales with their size. This renders feasible a multitude of previously proposed algorithms for image segmentation, and in particular algorithms based on the computation of fundamental spectral properties of the graphs, which encode information valuable for segmentation. In this work we adapt the Random Walker method to expand a rough shape of the neuron into a significantly more precise segmentation. We apply the methods to customized registered 3D EM images of retrograde-filled spinal motor neurons with in bloc heavy atom staining. Supplemented with the recently discovered linear system solvers our algorithms make efficient use of 3D contextual information to generate noise-insensitive neuron segmentation that delivers the surface of the neuron as whole, rather than as a stack of 2D boundaries. The synergy of advanced customized EM imaging techniques and recent breakthroughs in spectral graph theory enables the development of powerful and efficient segmentation algorithms that operate genuinely on 3D images to deliver accurate segmentations. Three-Dimensional (3D) Algorithms Assuming cross-sectional images are registered into a volume, the direct segmentation of the 3D volume has several advantages over linking individual 2D segmentations, or `propagating’ an initial 2D segmentation through the volume. Dendrites of the same neuron that appear disconnected or ambiguously connected in individual 2D frames, are ultimately connected through the soma. In addition, the expected noise artefacts and the natural fluctuations in pixel brightness have strong adversary effect on connectivity properties in 2D but they are insignificant in a 3D context. What is the probability that the random walker will reach first an inside seed? This probability clearly depends in a very involved and global way on all paths from the pixel to all the inside and outside seeds. It is however possible to compute these probabilities very fast using our algorithmic primitive: The probabilities can be calculated by solving two SDD linear systems that inherit the connections from the graph and are of dimension equal to the number of undecided pixels. 1. While there are unlabeled pixels 2. Compute the above probabilities for all such pixels 3. Assign the inside (outside) label to all pixels with probability >0.75 (<0.25) Computing Seeds We find seeds by performing a simple threshold cut of edges in the affinity graph, accompanied with the computation of a connected component inside the neuron. Outside seeds are produced by using a combination of the L1 distance of pixels from the connected component and their intensity values. Final inside seeds are calculated by sparsifying the connected component and keeping a percentage of the nodes in it based on brightness. Care is taken so that dendrite pixels are not entirely cut out but still maintain a 50% representation Figure 4. Cross-sectional view of 3D segmentation. Future Work The method involves a small number of parameters and a possible way of computing the best values for any given instance can be achieved by training a neural network. We also plan to explore further the use of spectral primitives for the construction of the affinity graphs, using the effective resistance between two neighboring pixels as a more robust measure for affinity. Fast Solvers: An Algorithmic Primitive Despite these advantages several works insist in taking the 2D/linking approach. Typically the reason is a combination of two factors. (i) The segmentation algorithm at hand does not scale with the input size, and so computation is prohibitively expensive on larger inputs. (ii) The algorithms and their implementation rely on concepts that depend on planar geometry and don’t generalize readily to the much more complex 3D space. This is especially true for algorithms that rely on topology [1]. The method delivers in less than 10 minutes accurate segmentations that deliver the surface directly in 3D. . We adapt the random walker method to perform the following loop: Fig2.The labeled and unlabeled areas. Red marks the computed boundary. Fig1. Charging artefacts and chatter noise. Typically, 2D segmentation algorithms can’t `break’ through the walls of noise. Such scans are However, neighbouring lessnoisy frames, or frames with non-aligning noise provide `routes of escape’. Figure 3. The algorithm is insensitive to charging artifacts and chatter noise. Recent breakthroughs allow now the solution of systems of linear equations Ax=b, where A is a Symmtric Diagonally Dominant matrix (SDD), in time O(m logm), where m is the number of the edges in the graph, or equivalently the number of edges in the corresponding graph [3]. The condition defining an SDD matrix A is: Fast implementations are already available [4]. The implications in algorithm design are very wide [6]. In image processing in particular, algorithms such as ncuts, considered widely to be “at least quadratic” [2], can now be implemented to run in near-linear time. Also, the intuition that graph diameter is a bottleneck in the propagation of distant information --implicitly expressed in [1] ” Iteration of the dynamics propagates information over long distances.” -- is not correct. The solution of a linear system depends fundamentally on the whole matrix, yet it can be found in time that essentially scales with the input size. References [1] Machines that learn to segment images: a crucial technology for connectomics. Jain, Seung, Turaga [2] Convolutional Networks Can Learn to Generate Affinity Graphs for Image Segmentation. Turaga, Murray, Jain, Roth, Helmstaedter, Briggman, Denk, Seung [3] A near-mlogn solver for SDD linear systems, Koutis, Miller, Peng. [4] Combinatorial preconditioners and multilevel solvers for problems in computer vision and image processing, Koutis, Miller, Tolliver [5] Spectral Graph Theory, Chung [6] A breakthrough in algorithm design, Kroeker [7] Random Walks for Image Segmentation, Grady [8] Rayburst sampling, an algorithm for automated three-dimensional shape analysis from laser scanning microscopy images, Rodriguez, Ehlenberger, Hof, Wearne [9] Automatic 3D neuron tracing using all-path pruning, Peng, Long, Myers Acknowledgments I. Koutis is partially supported by NSF CCF-1018463. and UPRRP seed funds. II. R. Garcia is supported by an NSF Bridge to the Doctorate Fellowships. III. The biological imaging group is supported by MH-086994, NSF-1039620, and NSF0964114..