Global Neuron Shape Reasoning with Point Affinity Transformers

Jakob Troidl, Johannes Knittel, Wanhua Li, Fangneng Zhan, Hanspeter Pfister, Srinivas C. TuragabioRxiv 2024

Abstract

Connectomics is a field of neuroscience that maps the brain's intricate wiring diagram. Accurate neuron segmentation from microscopy volumes is essential for automating connectome reconstruction. However, state-of-the-art algorithms use image-based convolutional neural networks limited to local neuron shape context. Thus, we introduce a new framework that reasons over global neuron shape with a novel point affinity transformer. Our framework embeds a (multi-)neuron point cloud into a fixed-length feature set from which we can decode any point pair affinities, enabling clustering neuron point clouds for automatic proofreading. We also show that the learned feature set can easily be mapped to a contrastive embedding space that enables neuron type classification using a simple classifier. Our approach excels in two demanding connectomics tasks: correcting segmentation errors and classifying neuron types. Evaluated on three benchmark datasets derived from state-of-the-art connectomes, our method outperforms point transformers, graph neural networks, and unsupervised clustering baselines.

Introduction

Mapping the "wiring diagram" of a brain—a field known as connectomics—requires segmenting individual neurons from high-resolution 3D electron microscopy (EM) volumes. While modern AI is proficient at local segmentation, it often fails to capture the "big picture." Because neurons are incredibly thin, spindly, and can span vast distances, local Convolutional Neural Networks (CNNs) often make mistakes, either splitting one neuron into pieces or merging two distinct neurons together.

Correcting these errors currently requires a Herculean manual effort. For example, proofreading the fruit fly brain took 622 researchers roughly 33 human-years. To scale up to a mouse brain, which is 500 times larger, algorithms that understand global neuron morphology are essential to automate this proofreading process.

Methodology

The proposed framework treats neuron shape reasoning as a point cloud problem, leveraging the efficiency of sparse representations over dense voxels.

Point Cloud Encoding

Instead of processing every voxel in a 3D volume, the system samples points from the neuron's structure. These points are passed through a transformer encoder that uses cross-attention to map the variable-sized point cloud into a fixed-length feature set. This is followed by 24 layers of self-attention, allowing information exchange across the entire shape of the neuron.

Affinity Decoding and Clustering

To fix segmentation errors, the model predicts "affinities" — the likelihood that any two points belong to the same neuron. A decoder uses the global feature set to evaluate point pairs, which are then grouped using agglomerative clustering to produce the final, corrected segmentation.

The Point Affinity Transformer architecture, illustrating the encoder-decoder pipeline and the generation of the affinity matrix for clustering.

Contrastive Classification

The same learned features can be projected into a lower-dimensional space using a Deep Set architecture. By training with a contrastive loss—pulling similar neuron types together and pushing different ones apart—the model can identify neuron types using a simple K-Nearest Neighbor (KNN) classifier. This multi-task latent space demonstrates that a model trained for affinity prediction naturally learns features rich enough for high-accuracy classification.

Experimental Setup

The model was evaluated on three benchmark datasets derived from state-of-the-art fruit fly (Drosophila) connectomes:

  • FlyWire OL: The optic lobe, containing well-defined cell type families.
  • MANC: The Male Adult Nerve Cord, responsible for motor output.
  • Hemibrain: A dense reconstruction of the central brain.

Artificial reconstruction errors were constructed by merging randomly selected neurons and background fragments to rigorously test the model's ability to disentangle them.

Results

The Point Affinity Transformer consistently outperformed baselines including DBSCAN, Graph Neural Networks (GNNs), and standard Point Transformers.

Proofreading Accuracy

On the FlyWire dataset, the model achieved a Variation of Information (VOI) score of 0.17, significantly better than the 0.32 achieved by the next best transformer and the 0.82 from GNNs (where lower scores indicate better performance). It was particularly effective at reducing "merge" errors, which are traditionally the most difficult for human proofreaders to fix.

Visual comparison of neuron segmentation results across FlyWire, MANC, and Hemibrain datasets, demonstrating the model's alignment with ground truth.

Type Classification

In neuron type classification, the method achieved a Mean Average Precision (mAP) of 0.77 on FlyWire, outperforming the 0.62 achieved by DGCNN. Furthermore, the model showed robust generalization to "out-of-distribution" data, such as point clouds containing more neurons than were present during training.

Discussion and Conclusion

A primary advantage of this architecture is the use of self-attention over traditional message passing. In long, thin neurons, message passing requires many steps for information to travel between distant segments, whereas self-attention allows the model to reason about the entire structure in a single step. Additionally, the grid-free internal feature space is more efficient for capturing complex, sparse branching patterns than fixed-grid models.

While the current model relies solely on geometric shape, future iterations could incorporate local image context from EM voxels to further enhance performance. The authors envision this general-purpose encoder being used for the unsupervised discovery of new cell types in less-studied brain regions and for generating computationally efficient 3D renderings directly from sparse point samples.

Summary updated

BibTeX
@misc{troidl2024global,
  author = {Jakob Troidl and Johannes Knittel and Wanhua Li and Fangneng Zhan and Hanspeter Pfister and Srinivas C. Turaga},
  title = {{Global Neuron Shape Reasoning with Point Affinity Transformers}},
  year = {2024},
  doi = {10.1101/2024.11.24.625067},
  howpublished = {bioRxiv},
}
Figure