Calcium imaging lets neuroscientists watch thousands of neurons at once, but only through a thick veil. When a neuron fires, a fluorescent indicator glows, yet the glow rises and falls over hundreds of milliseconds while the electrical spike itself lasts about a millisecond, so the sensor physically smooths fast events into slow bumps — a one-way low-pass filter imposed by chemistry, not by software Imaging Action Potentials with Calcium Indicators. This creates a specific failure for the most popular family of anomaly detectors: reconstruction-based methods train a generative model only on normal data and flag inputs it cannot reconstruct well, isolating the defect by subtracting the reconstruction from the input DRÆM - A discriminatively trained reconstruction embedding for surface anomaly detection. In calcium imaging this subtraction is blind by construction. A false transient caused by optical signal bleeding from a neighboring cell has a temporal waveform identical to a real spike, because the indicator smooths every signal the same way Detecting and Correcting False Transients in Calcium Imaging; a pathological burst of precisely synchronized firing is smeared into an unremarkable slow wave. The anomaly lives in the millisecond structure that the sensor destroyed, so a model trained on the observed fluorescence reconstructs the anomaly perfectly and the residual — the very signal the detector depends on — is zero.
The proposal is to move the reconstruction detector behind the filter. We deconvolve the observed fluorescence into an estimate of the underlying spike train using the standard biophysical generative model, and we train the normal-data reconstruction model on those inferred spike trains, not on the raw traces. The detection margin is then whatever fine temporal structure the deconvolution can recover, and the open scientific question is whether that margin survives the known ceiling on recovery fidelity. The second half of the proposal addresses who runs this detector. Clinical calcium imaging for, say, locating seizure-generating tissue is naturally distributed across hospitals with few recordings each, and federated learning — where sites share model updates, never raw data — is the obvious way to pool training signal; benchmarks show federated training of reconstruction detectors can beat each site training alone FedTADBench: Federated Time-Series Anomaly Detection Benchmark. But the training loop's side channel of operational metadata (loss values, participation counts, scheduling telemetry) has been shown to break even cryptographic protection and to expose per-user properties with high accuracy Gradient Disaggregation: Breaking Privacy in Federated Learning by Reconstructing the User Participant Matrix. For a detector of pathological events, the leakage is pointed: reconstruction loss spikes exactly when a patient's anomalous event passes through the model, so per-round loss reporting hands the server the patient's event timing. We design the pipeline so that only event-insensitive components are shared, and we measure the leakage directly with a reconstruction-attack evaluation.
Core Claim
Two claims, one methodological and one about privacy, joined by a single design.
First, the physics-induced shortcut. The known "identical shortcut" in reconstruction-based detection is usually a capacity problem — an over-expressive autoencoder with skip connections learns the identity map and reconstructs everything, which is why architectures like DRÆM bottleneck their reconstructive network DRÆM and why DeScarGAN removes the uppermost skip connections so diseased anatomy can be "healed" DeScarGAN: Disease-Specific Anomaly Detection with Weak Supervision. The calcium shortcut is worse: no amount of capacity control fixes it, because the anomaly is in-distribution in observation space. The observation map is many-to-one — distinct spike sequences produce indistinguishable fluorescence — so the discriminative information exists only before the filter. Our fix is to compose the detector with a regularized inverse of the filter, the nonnegative autoregressive model of Fast Nonnegative Deconvolution for Spike Train Inference From Population Calcium Imaging:
$$c_t = \gamma\, c_{t-1} + s_t, \qquad y_t = a\, c_t + b + \varepsilon_t, \qquad s_t \ge 0$$
where $c_t$ is intracellular calcium concentration, $\gamma \in (0,1)$ is the decay factor set by the indicator's clearance kinetics, $s_t$ is the nonnegative spike count at frame $t$, $y_t$ is observed fluorescence, and $\varepsilon_t$ is noise. Enforcing $s_t \ge 0$ is what shrinks the equivalence class of spike trains consistent with a given trace — linear filters that allow negatives produce ringing "anti-spikes" Fast Nonnegative Deconvolution. The detector $g_\theta$ is then trained on normal deconvolved population activity $\hat{s}_{1:T}$, and the anomaly score is the reconstruction residual $\lVert g_\theta(\hat{s}_{1:T}) - \hat{s}_{1:T} \rVert$, computed per site and never transmitted in the clear. Because deconvolution is only partially faithful — the Spikefinder challenge found all top architectures, biophysical and deep alike, plateau at an average correlation of 0.44 with ground-truth electrophysiology Community-based benchmarking improves spike rate inference from two-photon calcium imaging data — the claim is explicitly quantitative: detection margin should degrade gracefully with deconvolution fidelity, and we will characterize the curve.
Second, the privacy claim. What must be shared across sites is the event-insensitive part: the indicator kinetics parameters and the normal-activity manifold, which reflect shared biology across hospitals. What must stay local is anything event-bearing: residuals, per-window losses, anomalous-window diagnostics. We replace free-form client feedback with fixed-schedule participation and aggregate-only scalar reporting, then evaluate whether a Gradient-Disaggregation-style honest-but-curious server can still infer patient event timing from whatever channel remains.
Research Program
The build has three components. The first is a deconvolution front-end implementing the model above, in two variants: the original interior-point solver, which runs at roughly ten times real time for one hundred neurons Fast Nonnegative Deconvolution, and a differentiable unrolled variant so the front-end and detector can be trained jointly. The second is the normal-manifold reconstruction model on deconvolved population traces, with deliberately restricted capacity (bottlenecks, no skip connections) so that the capacity-induced shortcut and the physics-induced shortcut are separately diagnosable; spatial footprints are concatenated as input features so the detector can also use the spatial cue that Detecting and Correcting False Transients in Calcium Imaging showed is decisive for misattribution errors — its FaLCon diagnostic flags a transient as suspicious when its spatial profile correlates poorly with the cell's source profile. The third is the federated protocol: FedAvg over sites for the shared components, no plaintext loss telemetry, and participation on a fixed public schedule.
The analysis we will actually do, beyond engineering, is an information argument and its empirical counterpart. The low-pass observation map is many-to-one within the filter's kernel; anomalies that differ only inside the kernel (millisecond synchrony, first-spike latency, event ordering — precisely the codes that Temporal coding carries more stable cortical visual representations than firing rate over time shows carry stable representation, and whose loss under calcium smoothing biases downstream correlation estimates Improved Estimation and Interpretation of Correlations in Neural Circuits) are undetectable in observation space in principle, not merely in practice. We will construct matched normal/anomalous spike-train pairs that the filter maps to near-identical fluorescence at 10–30 Hz frame rates, and measure how much of the detection margin the nonnegative deconvolution restores as a function of frame rate and decay constant $\gamma$. This directly tests whether the 0.44 fidelity ceiling Spikefinder leaves enough margin for detection even when it leaves much of the signal unrecovered — a question none of the deconvolution literature answers, since it evaluates spike-rate recovery rather than anomaly separability.
On the privacy side, we will formalize the event-timing channel: per-round average reconstruction loss at a site is a noisy function of the fraction of anomalous windows in that round's local batch, so a server observing loss trajectories across rounds can localize when anomalous events occurred. We will quantify this channel's capacity, then close it and re-measure, using the attack machinery of Gradient Disaggregation (mixed-integer-programming binary matrix factorization over participation patterns, plus property inference on disaggregated updates) as the evaluation adversary. This extends that paper's setting from static images to continuous physiological time series, which its authors explicitly did not consider. Dual Defense: Enhancing Privacy and Mitigating Poisoning Attacks in Federated Learning motivates the constraint that cryptography on updates alone is not enough — it had to add differential-privacy noise even to encrypted similarity scores, and it leaves operational participation traces intact, which is exactly the channel we target.
Baselines
The naive reference point is fluorescence-domain residual detection: a reconstruction model of the same capacity trained directly on raw or ΔF/F fluorescence traces, with a threshold on the reconstruction error. This is what a practitioner would deploy by default, and it is also the strongest ablation for our key ingredient, because it differs from our pipeline only by the absence of the deconvolution front-end. If it matches our detector, the core claim is false and the proposal reduces to a protocol contribution. It will be run on identical splits with the same tuning budget, and beating it means a strictly higher area under the receiver-operating curve (AUROC) for anomaly detection on the same benchmark partitions.
The strongest existing method for the calcium-specific anomaly task is SEUDO with FaLCon flagging Detecting and Correcting False Transients in Calcium Imaging: a generative demixer that inserts flexible Gaussian "SEUDO-cells" and switches to LASSO-based robust regression when the spatial-correlation diagnostic flags contamination. On a benchmark of over 33,000 human-classified transients, it reduced spurious cross-neuronal correlation from $r = 0.33$ to $r = 0.018$ where the standard pipeline (constrained non-negative matrix factorization) had left 13% of detected transients false in dense CA1. It is the strongest competitor because it is the only prior reconstruction-based anomaly method validated on real calcium contamination, but it processes frames independently — its own stated limitation — so it cannot see temporally extended anomalies. We will run it on the same 33,000-transient benchmark with its published configuration, and beating it means higher average precision on transient classification, with the honest caveat that on purely spatial, single-frame misattribution we expect to match rather than exceed it; the decisive gains should come on temporally structured contamination it cannot model.
For the federated temporal-anomaly setting, the strongest baseline is the best configuration from FedTADBench — reconstruction detectors such as USAD and LSTM-AE trained under FedAvg — applied to calcium traces split across simulated sites. FedTADBench is the only systematic study of federated reconstruction-based anomaly detection, and it found that federated training beat isolated training for some algorithm-dataset pairs (USAD on the PSM server-metrics data), so it defines both the aggregation protocol to copy and the bar for collaboration being worthwhile at all. No reported result found on Lacuna for FedTADBench's per-combination AUC values, so we will re-establish its grid on our data under equal compute and tuning budgets rather than quote a target number. Beating it means higher anomaly-detection AUROC on calcium data at equal communication cost, and, separately, lower event-timing leakage under the same attack.
For context on what mature reconstruction detectors achieve on static images — where no physics-induced shortcut exists — DRÆM reports 98.0 image-level AUROC on MVTec and 68.4 pixel-level average precision DRÆM, and DeScarGAN reports 0.953 AUROC on CheXpert pleural effusion DeScarGAN. We cite these as calibration for what the method family can do when the anomaly is visible in the observation, which is precisely the condition calcium imaging violates.
Why not just…?
Why not just use linear deconvolution and threshold the output? This is a real threat, not a strawman: the Spikefinder challenge found that a "very simple linear-nonlinear model" was competitive with deep architectures, which themselves showed a greater tendency to overfit Community-based benchmarking. Purely linear Wiener filtering, however, fails systematically — it cannot enforce nonnegativity and infers biologically impossible negative spikes when fluorescence drops fast Fast Nonnegative Deconvolution. Our design already concedes the reviewer's point where it is right: the front-end can be the simple nonnegative model, and the contribution is where the residual is computed, not deconvolution sophistication. Experiment one includes a linear-nonlinear front-end ablation with the identical detector behind it; if it matches, the paper's claim shifts accordingly and we will say so.
Why not just improve the spatial demixing pipeline (CNMF/SEUDO)? Because CNMF is the source of the anomalies, not their cure: it misattributes out-of-focus fluorescence, leaving 13% of transients false in CA1 and 9% of "cells" dominated by false events Detecting and Correcting False Transients. SEUDO fixes the spatial channel but explicitly discards temporal kinetics, processing each frame independently. Any anomaly whose signature is temporal — drift, event sequences, synchrony, seizure-like population bursts — is invisible to it by design. Experiment two includes temporally extended contamination that SEUDO cannot model, which is the decisive comparison, alongside the matched spatial benchmark where we expect parity.
Why not just use Secure Aggregation and differential privacy? Secure Aggregation on updates was broken by metadata alone: with check-in telemetry over multiple rounds, the participant matrix was recovered with 100% accuracy for populations over 1,000 users, and once disaggregated, private-image reconstruction jumped from a useless 6.1 to 36.5 PSNR while property inference held an AUC above 0.9, where attacking the aggregate had collapsed to 0.65 Gradient Disaggregation. Dual Defense shows that even homomorphic encryption needs differential-privacy noise on the scores it does expose, and it leaves operational participation traces intact. So cryptography on the update channel does not address the metadata channel at all; our fix removes event-bearing metadata from the protocol rather than encrypting the update vector. Differential privacy on the remaining shared scalars is complementary, and experiment five measures the privacy-utility trade-off of adding it rather than assuming it away.
Why not just train each site locally and share nothing? This eliminates leakage by construction and is the most serious alternative. The counter-evidence is that FedTADBench found federated training beat isolated training for reconstruction detectors on some datasets, plausibly because collaboration regularizes the normal-manifold model against local quirks; but that evidence is on server telemetry, not calcium data, and no reported result found on Lacuna for the per-cell numbers that would settle it. So we treat this as an open empirical question with a stated decision rule: experiment four compares isolated versus federated training on identical calcium partitions, and if isolated training matches federated detection quality, the privacy motivation dissolves and we will report that the contribution reduces to the centralized spike-domain detector — a smaller but still useful paper.
Proposed Experiments and Decisive Checks
Experiment one establishes the physics-induced shortcut and its repair. Using the generative model above, we construct matched pairs of normal and anomalous spike trains (synchrony shifts, latency changes, event reordering) whose fluorescence observations are near-identical at 10–30 Hz, and sweep frame rate and $\gamma$. The prediction is that fluorescence-domain residual AUROC collapses toward chance as frame rate falls while spike-domain residual AUROC stays materially above it; the gap is the paper's central result.
Experiment two evaluates on the real contamination benchmark of Detecting and Correcting False Transients: over 33,000 human-classified transients in dense CA1 and sparser visual cortex. Metrics are transient-classification average precision and residual spurious cross-neuronal correlation, with SEUDO's published $r = 0.018$ as the number to match or beat on the spatial channel, and temporally extended contamination as the channel where we expect a clear margin.
Experiment three calibrates against ground truth. On the Spikefinder benchmark — five datasets, 92 recordings, 73 neurons with simultaneous electrophysiology Community-based benchmarking — we inject anomalies into the ground-truth spike trains and measure detection margin as a function of deconvolution fidelity, using the reported 0.44 average correlation of the top algorithms (versus the 0.36 baseline they improved on) as the fidelity reference point. No reported result found on Lacuna for a numerical correlation coefficient for the FOOPSI filter itself, so we re-run it as a front-end. This experiment answers whether detection degrades gracefully below the fidelity ceiling, or whether anomaly separability needs a fidelity the current indicators cannot deliver — in which case the honest conclusion is that the method awaits faster sensors or voltage indicators A positively tuned voltage indicator for extended electrical recordings in the brain.
Experiment four runs the federation study. We partition the calcium corpora across simulated sites by recording session, dataset, and indicator type — the multi-day OpenScope credit-assignment analysis repository OpenScope CA Analysis is a candidate for realistic multi-session structure, though no reported benchmark result is attached to its metadata — and compare isolated training against FedAvg and SCAFFOLD, following FedTADBench's finding that FedAvg was fastest and most robust while heavier regularizers often hurt FedTADBench. The metric is detection AUROC per site at equal communication and compute budgets, with the decision rule stated above.
Experiment five is the attack. We replicate the disaggregation adversary — mixed-integer programming with hard-threshold singular value decomposition over multi-round participation patterns Gradient Disaggregation — against both a naive federated protocol (free-form loss and participation telemetry) and our hardened one, and add a direct event-timing inference attacker that reads per-round loss trajectories. The metrics are participant-matrix recovery accuracy and event-timing inference AUC. Success means timing AUC near chance under the hardened protocol with a bounded detection-quality loss relative to the naive protocol; failure means the metadata channel cannot be closed without giving up federation, which would itself be a result worth publishing.
References
- Imaging Action Potentials with Calcium Indicators
- DRÆM - A discriminatively trained reconstruction embedding for surface anomaly detection
- Detecting and Correcting False Transients in Calcium Imaging
- FedTADBench: Federated Time-series Anomaly Detection Benchmark
- Gradient Disaggregation: Breaking Privacy in Federated Learning by Reconstructing the User Participant Matrix
- DeScarGAN: Disease-Specific Anomaly Detection with Weak Supervision
- Fast Nonnegative Deconvolution for Spike Train Inference From Population Calcium Imaging
- Community-based benchmarking improves spike rate inference from two-photon calcium imaging data
- Temporal coding carries more stable cortical visual representations than firing rate over time
- Improved Estimation and Interpretation of Correlations in Neural Circuits
- Dual Defense: Enhancing Privacy and Mitigating Poisoning Attacks in Federated Learning
- A positively tuned voltage indicator for extended electrical recordings in the brain