Electrode tracer

Finding Neuropixels tracks in whole-brain light-sheet volumes with deep learning

With Yoni Browning.

Before insertion, each probe is coated with a fluorescent dye (DiI or DiD) that leaves a track through the brain. After the experiment, the brain is cleared and imaged on a SmartSPIM light-sheet microscope, and annotators click along each track in Neuroglancer. With up to dozens of shanks per brain, that annotation is slow, and it holds up every analysis that needs to know where the probes were.

Given a whole-brain volume, its dye channel and the number of probes, the electrode tracer returns one ordered trajectory per probe, each as an editable Neuroglancer layer with a confidence score. The annotator then checks and corrects a draft instead of starting from a blank screen.

Approach

Yoni Browning built the first version: GPU vesselness and ridge features feed a small 3-D U-Net that proposes candidate track voxels, and RANSAC fits lines to them under anatomical priors (entry near the pial surface, plausible length and tilt). On three held-out brains (35 DiI tracks) it reaches precision = recall = 0.71, with 50–130 µm lateral error, and every track it scored ≥ 0.45 was correct.

I built its learned successor and am developing a transformer decoder for the hardest cases:

  • Learned tracer (in development). Trained with five-fold cross-validation on 188 annotated brains, with a separate test set held back, it chains a multi-channel 3-D detector, tracklet linking and decoding, and a learned scorer. The detector reaches held-out whole-brain recall of 0.81–0.84 in every fold; end to end, the pipeline finds 1,676 of 2,379 annotated tracks (0.70) on held-out folds.
  • Transformer decoder (current work). A decoder with curve queries, adapted from lane-detection models, targets the cases the graph decoder misses: neighbouring shanks 200 µm apart, and tips where the dye fades.

A Code Ocean app wraps the tracer so experimenters can run it without writing code.

I developed the learned tracer with Claude Code as a collaborator, and its lab notebook holds over 200 pre-registered experiments.