Pipeline for 2D voltage imaging videos that flags ‘events’ (fast, localized changes) using statistical detectors inspired by radar signal processing, producing maps and summaries for downstream analysis.
Voltage imaging produces high-frame-rate videos where brightness changes correspond (imperfectly) to changes in neural electrical activity. The practical challenge is separating true events from noise, motion, and background drift. I built and tested detectors that highlight candidate events and produce interpretable outputs for scientists to review.
Voltage imaging gives you video of neural activity — and the hard part is telling a real event apart from noise.
The problem: brief events in noisy video
Voltage imaging records fast changes in brightness that correspond, imperfectly, to electrical activity in neurons. The events you care about are short, localized, and low-contrast, sitting on top of photobleaching, motion, and sensor noise. A naive brightness threshold either drowns in false positives or misses the real thing entirely.
So the real task is not 'find bright spots' — it is 'decide, per pixel and per frame, whether a change is more surprising than the background should produce.'
Borrowing from radar
The detectors here come from radar signal processing, where the same problem — spot a faint target against a fluctuating background — has decades of theory behind it. I use CFAR-style adaptive thresholding to hold the false-alarm rate stable as the background changes, and a Quadratic Gamma Discriminator to flag deviations from a learned noise model.
Treating a microscopy problem as a detection problem is the whole idea: it means the thresholds adapt instead of being hand-tuned per recording.
Figure 1 — Per-pixel detection: the CFAR threshold adapts to the local noise band, so only a change that is genuinely unlikely — not merely bright — is flagged as an event.
The detection pipeline
Detection is built as a set of interchangeable stages so the pre-processing filter and the detector can be swapped and tuned independently. A parallel grid search runs across filter and detector parameters, and the best operating points are chosen by real detection-theory metrics rather than by eye.
Pre-process (swap)
A Gamma spatio-temporal filter for enhancement, or Kalman–MCC for robust background estimation via maximum correntropy — chosen per recording.
Detect
A CFAR detector scores each pixel/region over time and surfaces candidate events.
Evaluate + select
FROC (true-positive rate vs. false positives per image) and truncated AUC to compare detectors across the search, then top-K model summaries.
Figure 2 — The grid-search detection pipeline. Filters and detectors are interchangeable, model selection uses detection-theory metrics, and a human review workbench closes the loop.
Keeping a human in the loop
Detectors are only half the system. A separate review workbench (a Fiji/Groovy plus browser workflow) lets a scientist inspect regions of interest and events with zoom, contrast, and overlay controls, accept/reject/mark-unsure at both the ROI and event level, and see a robust Kalman baseline under each trace. Decisions autosave, and ROI and event tables export for downstream analysis — so human judgment feeds back into which parameters win.
Modeling activity on a template grid
Beyond detection, a template-aligned 32×32 grid workflow models zebrafish left / right / neutral activity end to end: a grid autoencoder compresses each frame, a GRU predicts the latent code forward in time, and a classifier reads those latent codes — all with video-level splits so evaluation never leaks across a recording.
FAQ
What is CFAR?
Constant False Alarm Rate: a family of adaptive thresholding methods that keep false detections stable across changing noise. It is a workhorse of radar detection.
What is Kalman–MCC?
A background estimator that uses the maximum correntropy criterion instead of plain least squares, which makes it robust to the heavy-tailed noise and outliers common in imaging video.
How are detectors compared fairly?
By detection-theory metrics rather than a single accuracy number: FROC curves and truncated AUC compared across a parallel grid search, instead of a single threshold picked by eye.
Does this run in real time?
It is offline analysis today, built for careful review and reproducible reports, with GPU acceleration where it helps.
What I built
Preprocessing routines for voltage imaging videos (normalization, background handling, and region-wise aggregation).
Event detectors that score pixels/regions over time and surface candidate events for review.
Evaluation utilities to compare detector behavior across recordings and parameter settings.
Exportable visual summaries (event maps and time-series traces) to support interpretation.
How it works
Treat each pixel/region as a time-series.
Estimate a baseline/noise profile from nearby frames.
Apply statistical tests to flag frames/regions whose changes are unlikely under the noise model.
Aggregate detections into event maps and interpretable summaries.