Abstract
Unsupervised graph representation learning has recently gained interest in several application domains such as neuroscience, where modeling the diverse morphology of cell types in the brain is one of the key challenges. It is currently unknown how many excitatory cortical cell types exist and what their defining morphological features are. Here we present GraphDINO, a purely data-driven approach to learn low-dimensional representations of 3D neuronal morphologies from unlabeled large-scale datasets. GraphDINO is a novel transformer-based representation learning method for spatially-embedded graphs. To enable self-supervised learning on transformers, we (1) developed data augmentation strategies for spatially-embedded graphs, (2) adapted the positional encoding and (3) introduced a novel attention mechanism, AC-Attention, which combines attention-based global interaction between nodes and classic graph convolutional processing. We show, in two different species and across multiple brain areas, that this method yields morphological cell type clusterings that are on par with manual feature-based classification by experts, but without using prior knowledge about the structural features of neurons. Moreover, it outperforms previous approaches on quantitative benchmarks predicting expert labels. Our method could potentially enable data-driven discovery of novel morphological features and cell types in large-scale datasets. It is applicable beyond neuroscience in settings where samples in a dataset are graphs and graph-level embeddings are desired.
Introduction
The human brain is composed of a vast diversity of neurons, each characterized by a unique morphology—the intricate, tree-like branching of dendrites and axons. Classifying these structures is fundamental to understanding brain function, yet it has historically relied on manual, subjective processes prone to expert bias. While modern imaging provides massive datasets of 3D neuronal "skeletons," a consistent, automated framework for extracting meaningful features remains elusive.
Existing approaches often utilize hand-engineered metrics or standard deep learning models that struggle with the long-range dependencies inherent in neuronal structures. A minor variation in a distant branch can significantly alter a cell's functional profile. There is a critical need for data-driven representations that capture both local "texture" and global "architecture" without relying on human-annotated labels.
Methodology: The GraphDINO Framework
GraphDINO adapts the DINO (Self-Distillation with No Labels) framework to the domain of spatially-embedded graphs. The model treats neurons as trees where nodes represent 3D coordinates and edges represent physical connections.
Adjacency-Conditioned Attention (AC-Attention)
A key innovation is AC-Attention, which addresses the limitations of standard Transformers and Graph Neural Networks (GNNs). While Transformers offer global interaction, they often ignore local connectivity. Conversely, GNNs focus on local message-passing but may miss global context. AC-Attention introduces a learned bias that encourages the Transformer to prioritize physically connected neighbors while maintaining the ability to process the entire neuron's architecture.
Self-Supervised Training and Augmentation
The model employs a student-teacher architecture. It processes two augmented "views" of the same neuron, training the student network to predict the teacher's output. This self-distillation allows the model to learn robust features without explicit labels.
To facilitate this learning, the researchers developed specific graph augmentations tailored for spatial data, including node subsampling, 3D rotations, coordinate jittering, and random branch deletion. These strategies force the model to identify invariant structural properties.
Results and Discussion
GraphDINO was validated across multiple datasets, including the Blue Brain Project (BBP), Allen Brain Atlas (ACT), and Janelia MouseLight (JML).
Performance Benchmarks
On the BBP dataset, GraphDINO achieved 65.8% accuracy in predicting expert labels, significantly outperforming the unsupervised baseline InfoGraph (48.2%). In clustering tasks within cortical layers, it achieved an Adjusted Rand Index (ARI) of 0.46, compared to 0.27 for traditional manual feature-based methods. On the M1 PatchSeq benchmark, it reached 71% accuracy, surpassing specialized models like MorphVAE.
Biological Insights
The learned embeddings naturally clustered neurons into biologically relevant groups, such as "spiny" versus "aspiny" cells, without prior biological knowledge. Notably, the model correctly identified "inverted" neurons as morphologically similar to specific interneurons, demonstrating its capacity to look beyond simple spatial orientation to capture fundamental structural patterns.
Conclusion
GraphDINO represents a significant step toward automated, bias-free discovery of cell types in large-scale neuroscience datasets. While currently limited by the quadratic complexity of standard attention, future iterations incorporating more efficient attention mechanisms could scale to even denser reconstructions. Beyond neuroscience, this framework is applicable to any domain where data can be represented as spatially-embedded graphs, such as botanical modeling or vascular network analysis.
Summary updated