CNEL

Zebrafish neural imaging: event detection & source separation

Signal-processing research for detecting brief neural events and separating activity from background, artifacts, and measurement noise in zebrafish imaging video.

Frame from a zebrafish neural imaging video.

Overview

Research platform for zebrafish neural-imaging video: statistical event detection for voltage recordings and a calcium-imaging experiment program that separates activity from background, artifacts, and noise.

The project began with high-frame-rate voltage-imaging videos and now includes a calcium-imaging source-separation track. Across both modalities, the practical challenge is the same: preserve biologically meaningful activity while distinguishing it from motion, background structure, measurement noise, and other bright but misleading signals.

Neural imaging gives you video of activity — and the hard part is deciding what belongs to the biology, what belongs to the measurement, and what evidence is safe to trust.

The problem: brief events in noisy video

Voltage and calcium imaging record brightness changes that correspond, imperfectly and on different time scales, to neural activity. The events you care about are localized and low-contrast, sitting on top of photobleaching, motion, persistent anatomy, and sensor noise. A naive brightness threshold either drowns in candidates or misses real activity.

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.'

Current research: source separation without erasing the signal

The newest experiment track asks whether source-separation and denoising methods can improve event discovery in spontaneous calcium-burst recordings without changing the amplitude, footprint, or timing of the activity we ultimately want to interpret.

The clearest result so far is architectural rather than a single winning model: quiet-field standardization and spatial context have mattered more than model depth. At a budget of 58 candidates per burst, nested single-feature selection recovered 58 of 79 known events, compared with 51 of 79 for the archived carrier. At tighter budgets of 20 and 40, however, the native standardized carrier still performed best.

That trade-off matters. Several PCA, ICA, factorization, spectral, and state-space methods reduced noise or improved ranking, but none simultaneously passed the full preservation audit. The working design therefore keeps the activity carrier intact, uses separation outputs as bounded auxiliary evidence, and ranks candidates with a separate score.

Read the experiment note →

Preserve
Keep an immutable activity carrier for scientific traces, timing, and downstream interpretation.
Separate
Use spatial, spectral, ICA, factorization, and dynamical channels as bounded auxiliary features.
Rank
Compare candidate ordering at fixed budgets instead of treating a larger candidate list as better precision.
Gate
Advance only when detection improves without unacceptable amplitude, area, timing, morphology, or stability loss.

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.
Report
Per-model diagnostics: event-duration histograms, FROC curves, sensitivity heatmaps, PSD comparisons, and qualitative montages.
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.

Has source separation solved the detection problem?

Not yet. Some methods reduce noise or improve fixed-budget ranking, but no source-separation lane has passed every preservation and detection gate. The current evidence supports using separation outputs as auxiliary evidence while keeping the original activity carrier intact.

What I built

  • Preprocessing and normalization routines for voltage- and calcium-imaging video.
  • Statistical event detectors and proposal generators that score pixels and regions over time.
  • Source-separation experiments spanning PCA, ICA, nonnegative factorization, spectral denoising, latent dynamics, and morphology-aware spatial features.
  • Nested evaluation and human-review tools that separate proposal coverage, candidate ranking, signal preservation, and scientific interpretation.

How it works

  • Preserve an immutable activity carrier instead of allowing a denoiser to silently redefine the scientific signal.
  • Compute bounded source-separation, spatial, spectral, and dynamical features as auxiliary evidence.
  • Generate candidate events, then rank them independently under fixed candidate budgets.
  • Audit detection recall together with amplitude, area, timing, morphology, candidate burden, and visual remainders.

Snapshot

Track
Research · neural imaging · signal separation
Status
Active research; source-separation methods are under gated evaluation.
Focus
Voltage & calcium imagingEvent detectionSource separationStatistical detection

Stack

  • Python
  • Scientific computing
  • GPU acceleration where helpful

Glossary

Voltage imaging
A microscopy method that records fast changes related to electrical activity as video.
CFAR
Constant False Alarm Rate: a family of adaptive thresholding methods that aim to keep false detections stable across changing noise.
QGD
Quadratic Gamma Discriminator: a statistical detector designed to highlight deviations from a learned background/noise model.
Source separation
A family of methods that decomposes an observed recording into candidate sources such as neural activity, background structure, artifacts, and measurement noise.
Fixed-budget recall
The fraction of known events recovered when every method is allowed the same number of ranked candidates.