# treemoco_contrastive_neuron_morphology_representation_learning__e9a9772a.pdf Tree Mo Co: Contrastive Neuron Morphology Representation Learning Hanbo Chen , Tencent AI Lab hanbochen@tencent.com Jiawei Yang , University of California, Los Angeles jiawei118@ucla.edu Daniel Maxim Iascone University of Pennsylvania, Philadelphia daniel.iascone@pennmedicine.upenn.edu Lijuan Liu Southeast University, Nanjing juan-liu@seu.edu.cn Lei He University of California, Los Angeles lhe@ee.ucla.edu Hanchuan Peng Southeast University, Nanjing h@braintell.org Jianhua Yao Tencent AI Lab jianhuayao@tencent.com Morphology of neuron trees is a key indicator to delineate neuronal cell-types, analyze brain development process, and evaluate pathological changes in neurological diseases. Traditional analysis mostly relies on heuristic features and visual inspections. A quantitative, informative, and comprehensive representation of neuron morphology is largely absent but desired. To fill this gap, in this work, we adopt a Tree-LSTM network to encode neuron morphology and introduce a self-supervised learning framework named Tree Mo Co to learn features without the need for labels. We test Tree Mo Co on 2403 high-quality 3D neuron reconstructions of mouse brains from three different public resources. Our results show that Tree Mo Co is effective in both classifying major brain cell-types and identifying sub-types. To our best knowledge, Tree Mo Co is the very first to explore learning the representation of neuron tree morphology with contrastive learning. It has a great potential to shed new light on quantitative neuron morphology analysis. Code is available at https: //github.com/Tencent AILab Healthcare/Neuron Representation. 1 Introduction The central nervous system is composed of hundreds to thousands of neuronal subtypes. Subtype is the critical determinant of neuronal function within local and long-range circuits and is identified by a combination of gene expression patterns, dendrite/axon morphology, synaptic connectivity, and electrophysiological properties. In particular, dendritic morphology is a central node of neuronal subtype identity, as dendritic branches receive the vast majority of the presynaptic input onto each neuron and directly shape the electrophysiological properties of the neuron that governs its firing output. Delineating neuron cell-types based on their dendritic morphology is one of the core problems of neuroscience for the past century [51]. : Equal contribution. : Work done when authors were at Tencent AI Lab. : Corresponding author. 36th Conference on Neural Information Processing Systems (Neur IPS 2022). Figure 1: Distribution of neurons in the embedding space of Tree Mo Co visualized by t-SNE [39]. Thumbnails of dendrites are randomly colored. (b-e) Zoom-in view of regions in (a) showing clustering of isocortex layer 5 cells (b), layer 2/3 cells (c), basket cells (d), and Martinotti cells (e). Neuron dendritic morphology can be digitally represented by a 3D neuron reconstruction (Fig. 2(a)), a tree graph with 3D coordinates of each node; the root is placed at soma. With recent advances in imaging [9, 11, 47] and computational methods [20, 27, 42], 3D reconstruction of whole neuron trees with high-throughput is now accessible for mouse brain [28, 44]. However, due to the lack of effective measurement, most analyses of these 3D reconstructions are still largely based on biologists visual inspection. Considering the enormous number of neurons in the brain and the 3D formation of neuron morphology, such visual inspection is subjective, biased, and has low throughput. The past decade has witnessed the success of deep learning in learning representations of almost all kinds of data such as image, language, sound, and graph [2]. However, as a special type of graph or graphic data, most of the quantitative analysis of neuron trees is still based on simple heuristic features [33]. Only a few attempts have been made in learning deep representations of neuron morphology. In [52], the authors proposed to encode neuron morphology with tree recurrent neural network (TRNN). However, this method relies on manual annotations, limiting its application to supervised training only. In [22], the authors proposed a generative self-supervised learning (SSL) method for neuron morphology representation learning, named Morph VAE, to reconstruct original neuron trees via a variational autoencoder and random walk sampling. Since this method cannot encode tree topology structure, its classification performance is limited and the method still relies on label information to generate reasonable predictions. In [32], the authors adopt multi-view based SSL to learn representations of neuron morphology. Though the work mainly focuses on the local components of neuron branch which is not available in whole neuron reconstruction data, its promising results advocate the possibility of learning morphology representation without labels. Inspired by the contrastive learning successes in visual representation, we experiment with adapting Mo Co for neuron morphology representation learning, namely Tree Mo Co. It can learn embedding of 3D neuron reconstructions without needing prior knowledge such as cell type annotation. It first maps neuron trees input to a deep embedding space by our proposed neuron encoder, and then incorporates an SSL pipeline composed of neuron tree augmentations and a contrastive loss to learn representations. By testing the framework on 2403 neuron reconstructions from 3 different data resources, we are excited to find that Tree Mo Co can clearly delineate neuron morphology in the embedding space (Fig. 1). Comparison with prior arts shows that Tree Mo Co can achieve premium results than supervised methods even without annotations. 2 Background and Related Works Heuristic features of neuron morphology. To quantitatively describe the neuron morphology, a set of heuristic features and related tools namely L-measure [33] has been proposed and widely used. These features can be summarized as 4 categories including (1) distance-based measurements (e.g., branch length, distance to soma); (2) angle-based measurements (e.g., bifurcation angle); (3) topology-based measurements (e.g., number of bifurcations, branch order); and (4) size-based measurements (e.g., branch radius, surface area). Statistics of these features such as mean or standard deviation are usually adopted to describe neuron morphology. Such representation is easy to compute and explain. However, they cannot differentiate complex morphologies (examples in Appx. A.1). Cell-type and neuron morphology classification. As the primary function of dendritic branches is to compartmentalize functionally related synaptic inputs, dendritic morphology can be used to categorize neuronal subtypes based on total dendritic length, amount of branching across the dendritic trees, and localization of dendritic branch fields to different brain regions (such as layers of neocortex). Most existing cell-type classification algorithms rely on hand-crafted features [33] to predict or cluster cell types [40, 24]. In some recent works, researchers started to adopt tree-based model [52, 23] and sequence-based model [22] to classify neuron morphology. Despite competing performance than classic methods, training of these models requires manual annotations of cell types. Contrastive learning. Contrastive learning (CL) is a SSL method that aims at bringing positive sample pairs closer and spreading away the negative sample pairs in the feature embedding space. This method dates back to [13] or earlier, and has recently drawn significant interest across different communities [45, 25, 17, 48, 16, 6, 5]. Some research efforts have been made in graph contrastive learning (GCL) [37, 30, 15, 49, 46]. Particularly, Graph CL [49] studies the graph data augmentations systematically for GCL, and Info GCL [46] provides a theoretical analysis for it. However, to our best knowledge, no work has studied the tree graph, a special instance of graph, within the context of CL. 3.1 Tree graph representation of neuron We define a neuron reconstruction as T (V, E), where V = {vk}; vk = (xk, yk, zk) are nodes with 3D coordinates and E = {ek}; ek = (vk, vparent k ) are edges connecting each node with its parent. As shown in Figure 2-(e), the number of 1-degree nodes could vary by reconstruction and image resolutions, while the bifurcation/tip nodes preserve major topology information. For computational efficiency, we remove 1-degree nodes and directly connect the root node, the bifurcation nodes, and the tip nodes in T (Fig. 2(b)). To preserve the shape information of 1-degree node sequences (branch in Fig. 2(e)), we calculate the related features and concatenate them with the coordinate property of its downstream node, as illustrated in Figure 2-(e,f). The processed tree graph is defined as Υ Process(T) (X, G), where G represents the tree topology and X = {xk}N k=1 is an N (3 + Q) matrix that is from N nodes with 3D coordinates and Q-dim branch features. : Euclidean distance 𝐷 : edge vector sequence 𝐹𝐸 shift and rotate Branch features Processed neuron tree graph Example neuron reconstruction Topology augmentation (i) Original (ii) Dropped (iii) Skipped (iv) Swapped [𝑥, 𝑦, 𝑧, 𝐿, 𝐶, 𝐹𝐸] bifurcation/tip node 1-degree node low resolution high resolution Figure 2: Illustration of (a) neuron reconstruction, (b) processed tree graph, (c) branch feature computation, (d) topology augmentations. (ii) to (iv) correspond to (9) to (11) in Table 1. (e) and (f) illustrate neuron tree processing for computation efficiency and resolution normalization purposes. Input Tree Υ = (X, 풢) Neuron Encoder Contrasting X = ϕ(X) z = η( X, 풢) h(z) ||h(z)||2 Projection Augmentation LSTM-based Tree Path Processor Child Nodes i, j Parent Node k Figure 3: The overview of Tree Mo Co: (a) Tree Mo Co pipeline. (b) The zoom-in view of how the LSTM-based tree path processor η propagates information from child nodes i and j to a parent node k. Blue and green colors denote the corresponding information flows for two LSTM cells, respectively. The symbol Σ denotes summation. The dashed rectangles mark our double-cell LSTM processor. Branch feature is a Q-dim vector, of which two dimensions denote length and contraction. Length L is the accumulated distance between adjacent nodes along a branch: L = Pstart i