FIGURE SUMMARY
Title

A deep learning framework for automated and generalized synaptic event analysis

Authors
O'Neill, P.S., Baccino-Calace, M., Rupprecht, P., Lee, S., Hao, Y.A., Lin, M.Z., Friedrich, R.W., Mueller, M., Delvendahl, I.
Source
Full text @ Elife

Visualization of model training.

(A) Saliency maps (Simonyan et al., 2013) for four example events of the training data. Darker regions indicate discriminative data segments. Data and saliency values are min-max scaled. (B) The miniML model transforms input to enhance separability. Shown is a Uniform Manifold Approximation and Projection (UMAP) dimensionality reduction of the original training dataset. (C) UMAP of the input to the final ML model layer. Examples of labeled training samples are illustrated. Model training greatly improves linear separability of the two labeled event classes.

Visualization of model training.

(A) Saliency maps (Simonyan et al., 2013) for four example events of the training data. Darker regions indicate discriminative data segments. Data and saliency values are min-max scaled. (B) The miniML model transforms input to enhance separability. Shown is a Uniform Manifold Approximation and Projection (UMAP) dimensionality reduction of the original training dataset. (C) UMAP of the input to the final ML model layer. Examples of labeled training samples are illustrated. Model training greatly improves linear separability of the two labeled event classes.

Impact of dataset size, class balance, and model architecture on training performance.

(A) To test how size of the training dataset impacts model training, we took random subsamples from the MF–GC dataset and trained miniML models using fivefold cross validation. (BD) Comparison of loss (B), accuracy (C) and area under the ROC curve (AUC; D) across increasing dataset sizes. Data are means of model training sessions with k-fold cross-validation. Shaded areas represent SD. Note the log-scale of the abscissa. (E) Comparison of model training with unbalanced training data. (F) Area under the ROC curve for models trained with different levels of unbalanced training data. Unbalanced datasets impair classification performance. (G) Accuracy and F1 score for different model architectures plotted against number of free parameters. The CNN-LSTM architecture provided the best model performance with the lowest number of free parameters. EarlyStopping was used for all models to prevent overfitting (difference between training and validation accuracy <0.3%). ResNet, Residual Neural Network; MLP, multi-layer perceptron.

Fast computation time for event detection using miniML.

(A) Detected events and analysis runtime plotted versus stride. Note that runtime can be minimized by using stride sizes up to 5% of the event window size without impacting detection performance. (B) Analysis runtime with different computer hardware for a 120-s long recording at 50 kHz sampling (total of 6,000,000 samples). Runtime is given as wall time including event analysis. GPU computing enables analysis runtimes shorter than 20 s.

Fast computation time for event detection using miniML.

(A) Detected events and analysis runtime plotted versus stride. Note that runtime can be minimized by using stride sizes up to 5% of the event window size without impacting detection performance. (B) Analysis runtime with different computer hardware for a 120-s long recording at 50 kHz sampling (total of 6,000,000 samples). Runtime is given as wall time including event analysis. GPU computing enables analysis runtimes shorter than 20 s.

A graphical user interface for miniML.

(A) Workflow for synaptic event analysis using miniML. Optional steps include data pre-processing, model selection, and event rejection. (B) Screenshot of the graphical user interface (GUI). Users can use the GUI to load, inspect, and analyze data. After running the event detection, all detected events are marked by red dots. Individual event parameters are displayed in tabular form, where events can be enlarged and rejected. The final results can be saved in different formats via the GUI.

miniML performance on event-free data.

(A) Confidence (top) and raw data with detected events from a MF–GC recording. Dashed line indicates miniML minimum peak height. (B) Recording from the same cell after addition of blockers of synaptic transmission (NBQX, APV, Bicuculline, Strychnine). miniML does not detect any events under these conditions. Note that addition of Bicuculline blocks tonic inhibition in cerebellar GCs, causing a reduction in holding current and reduced noise (Kita et al., 2021).

Extended benchmarking and threshold dependence of event detection.

(A) Example event-free recording (Top) and power density spectrum of the data (Bottom). (B) Top: Data trace from (A) superimposed with simulated synaptic events. Bottom: Amplitude histogram of simulated events for a signal-to-noise ratio (SNR) of 10.8 dB. Solid line represents the log-normal distribution from which event amplitudes were drawn; Inset shows individual simulated events. (C) Recall, precision and F1 score for five detection methods with simulated events that have a 2× faster decay than in Figure 3. (D) Same as in (C), but for events with a 4.5× slower decay time constant. Note that we did not adjust detection hyperparameters for the comparisons in (C) and (D). (E) Runtime of five different synaptic event detection methods for a 120 s section of data recorded with 50 kHz sampling rate. Average wall-time of five runs. * miniML was run using a GPU, and data were downsampled to 20 kHz for the Bayesian analysis. (F) Normalized amplitude of the peaks in the different methods’ detection traces (‘detection peak amplitude’) versus normalized event amplitude. A linear dependence indicates that detection traces contain implicit amplitude information, which will cause a strong threshold dependence of the detection result. Note that miniML’s output does not contain amplitude information. (G) F1 score versus threshold (in % of default threshold value, range 5–195) for different methods.

Extended benchmarking and threshold dependence of event detection.

(A) Example event-free recording (Top) and power density spectrum of the data (Bottom). (B) Top: Data trace from (A) superimposed with simulated synaptic events. Bottom: Amplitude histogram of simulated events for a signal-to-noise ratio (SNR) of 10.8 dB. Solid line represents the log-normal distribution from which event amplitudes were drawn; Inset shows individual simulated events. (C) Recall, precision and F1 score for five detection methods with simulated events that have a 2× faster decay than in Figure 3. (D) Same as in (C), but for events with a 4.5× slower decay time constant. Note that we did not adjust detection hyperparameters for the comparisons in (C) and (D). (E) Runtime of five different synaptic event detection methods for a 120 s section of data recorded with 50 kHz sampling rate. Average wall-time of five runs. * miniML was run using a GPU, and data were downsampled to 20 kHz for the Bayesian analysis. (F) Normalized amplitude of the peaks in the different methods’ detection traces (‘detection peak amplitude’) versus normalized event amplitude. A linear dependence indicates that detection traces contain implicit amplitude information, which will cause a strong threshold dependence of the detection result. Note that miniML’s output does not contain amplitude information. (G) F1 score versus threshold (in % of default threshold value, range 5–195) for different methods.

Event detection in different synaptic preparations.

(A) Amplitude histogram with kernel-density estimate (light blue line) of miniML-detected events for the mouse granule cell recording shown in Figure 4. (B) Detected events for miniML and matched-filtering approaches. Color-coded representative examples of events unique to any of the three detection methods are shown. (C) Detected events for miniML and two finite-threshold approaches with representative unique detected events. (DF) Same as in (AC), but for the calyx of Held example. (GH) Same as in (AC), but for the Golgi cell example. Due to the slower event kinetics, miniML was run with a 1.5× larger window size. (JL) Same as in (AC), but for the hiPSC-derived neuron example. Example event traces were filtered for display purposes with a 18-samples Hann window.

Event detection in different synaptic preparations.

(A) Amplitude histogram with kernel-density estimate (light blue line) of miniML-detected events for the mouse granule cell recording shown in Figure 4. (B) Detected events for miniML and matched-filtering approaches. Color-coded representative examples of events unique to any of the three detection methods are shown. (C) Detected events for miniML and two finite-threshold approaches with representative unique detected events. (DF) Same as in (AC), but for the calyx of Held example. (GH) Same as in (AC), but for the Golgi cell example. Due to the slower event kinetics, miniML was run with a 1.5× larger window size. (JL) Same as in (AC), but for the hiPSC-derived neuron example. Example event traces were filtered for display purposes with a 18-samples Hann window.

Recall depends on event kinetics.

(A) Recall versus event kinetics for the MF–GC model. Kinetics (i.e. rise and decay time constants) of simulated events were changed as indicated. miniML robustly detects events with up to ∼fourfold slower kinetics (dark blue, dashed line indicates 80% recall). Resampling of the data improves the recall in synthetic data with altered event kinetics (light blue). (B) Event kinetics for different preparations and/or recording modes. Data are normalized to MF–GC mEPSCs (dashed line).

Recall depends on event kinetics.

(A) Recall versus event kinetics for the MF–GC model. Kinetics (i.e. rise and decay time constants) of simulated events were changed as indicated. miniML robustly detects events with up to ∼fourfold slower kinetics (dark blue, dashed line indicates 80% recall). Resampling of the data improves the recall in synthetic data with altered event kinetics (light blue). (B) Event kinetics for different preparations and/or recording modes. Data are normalized to MF–GC mEPSCs (dashed line).

Transfer learning facilitates model training across different datasets.

(A) Loss and accuracy versus number of training dataset samples for three different datasets (mouse MF–GC mEPSPs, Drosophila NMJ mEPSCs, zebrafish (ZF) spontaneous EPSCs). Dashed lines indicate transfer learning (TL), whereas solid lines depict results from full training. Points are averages of fivefold cross-validation and shaded areas represent 95% CI. (B) Average AUC, accuracy, and training time for TL using 500 samples, and full training using 4000 samples. Error bars denote 95% CI.

Synaptic event detection for neurons in a full-brain explant preparation of adult zebrafish.

(A) Application of TL to facilitate event detection for EPSC recordings. (B) Extraction of amplitudes, event frequencies, decay times, and rise time for all neurons in the dataset (n = 34). Bars are means and error bars denote SD. (C) Typical (mean) event kinetics for the analyzed neurons, ordered by decay times. Event traces are peak-normalized. (D–E) Example recordings with slow (dark blue) and fast (light blue) event kinetics. (F) Examples of events taken from (D–E), illustrating the diversity of kinetics within and across neurons. (G) Distribution of event decay kinetics across single events for two example neurons (traces shown in (D–E)). (H) Distribution of event rise kinetics across single events for same two example neurons. (I) Mapping of decay times (color-coded as in (C)) onto the anatomical map of the recording subregion of the telencephalon. (J) Mean decay and rise times are correlated across neurons. (K) Decay time distributions are broader (SD of decay time distributions) when mean decay times are larger. (L) Input resistance as a proxy for cell size is negatively correlated with the decay time.

Event detection at <italic toggle='yes'>Drosophila</italic> neuromuscular synapses upon altered glutamate receptor composition.

(A) Two-electrode voltage-clamp recordings from wild-type (WT) Drosophila NMJs were analyzed using miniML with transfer learning. (B) Left: Example voltage-clamp recording with detected events highlighted. Right: Three individual mEPSCs on expanded time scale. (C) Left: All detected events from the example in (B) overlaid with the average (blue line). Right: Event amplitude histogram. (D–F) Same as in (A–C), but for GluRIIA mutant flies. (G) Comparison of median event amplitude for WT and GluRIIA NMJs. Both groups are plotted on the left axes; Cohen’s d is plotted on a floating axis on the right as a bootstrap sampling distribution (red). The mean difference is depicted as a dot (black); the 95% confidence interval is indicated by the ends of the vertical error bar. (H) Event frequency is lower in GluRIIA mutant NMJs than in WT. (I) Knockout of GluRIIA speeds event decay time. (J) Faster event rise times in GluRIIA mutant NMJs.

Optical detection of spontaneous glutamate release events in cultured neurons using iGluSnFR3 and miniML.

(A) miniML was applied to recordings from rat primary culture neurons expressing iGluSnFR3. Data from Aggarwal et al., 2023. (B) Example epifluorescence image of iGluSnFR3-expressing cultured neurons. Image shows a single frame with three example regions of interest (ROIs) indicated. (C) ΔF/F0 traces for the regions shown in (B). Orange circles indicate detected optical minis. Note the different signal-to-noise ratios of the examples. (D) Top: Heatmap showing average optical minis for all sites with detected events, sorted by amplitude. Bottom: Grand average optical mini. (E) Top: Histogram with kernel density estimate (solid line) of event amplitudes for n = 1524 ROIs of the example in (B). Note the log-scale of the abscissa. Bottom: Event frequency histogram.

mEPSP detection in ASAP5 recordings.

(A) Signal-to-noise ratio (SNR) of mEPSPs in electrophysiology and ASAP5 for five neurons. (B) Overlay of simultaneous current-clamp and ASAP5 recording. Events detected by miniML in both types of recordings are indicated. (C) Examples of mEPSPs detected in the electrophysiology data that were either detected by miniML in ASAP5 data (orange dots) or missed (blacked dots). (D) mEPSP amplitude versus optical amplitude for detected events in five neurons (color-coded). Line is a linear fit to the data (slope = 0.95 mV/−%ΔF/F0, Pearson correlation coefficient = 0.83). (E) Event half decay time (Left) and rise time (Right) for five neurons from electrophysiology (’Ephys’) and ASAP5 data. Data were calculated from the event averages of each cell. The lower sampling rate of imaging acquisition (400 Hz) vs. electrophysiology (10,000 Hz) likely contributes to the slower event kinetics observed in ASAP5 data.

mEPSP detection in ASAP5 recordings.

(A) Signal-to-noise ratio (SNR) of mEPSPs in electrophysiology and ASAP5 for five neurons. (B) Overlay of simultaneous current-clamp and ASAP5 recording. Events detected by miniML in both types of recordings are indicated. (C) Examples of mEPSPs detected in the electrophysiology data that were either detected by miniML in ASAP5 data (orange dots) or missed (blacked dots). (D) mEPSP amplitude versus optical amplitude for detected events in five neurons (color-coded). Line is a linear fit to the data (slope = 0.95 mV/−%ΔF/F0, Pearson correlation coefficient = 0.83). (E) Event half decay time (Left) and rise time (Right) for five neurons from electrophysiology (’Ephys’) and ASAP5 data. Data were calculated from the event averages of each cell. The lower sampling rate of imaging acquisition (400 Hz) vs. electrophysiology (10,000 Hz) likely contributes to the slower event kinetics observed in ASAP5 data.

Methods comparison for event detection in ASAP5 recordings.

(A) Average waveforms of detected events in ASAP5 data for miniML (n = 101 events), template-matching (n = 82 events), and deconvolution (n = 15 events). Data are from the example shown in Figure 9C, shaded areas represent SEM. (B) Recall of events in ASAP5 data versus mEPSP amplitude for miniML, template-matching, and deconvolution. Lines are averages of five recordings with SEM as shaded area. (C) F1 score for event detection in ASAP5 data was higher using miniML (0.53 ± 0.04 , mean ± SEM) than for template-matching (0.39 ± 0.05; Cohen’s d, 1.35) and deconvolution (0.17 ± 0.01; Cohen’s d, 5.1). Bars are median values, n = 5 neurons.

Acknowledgments
This image is the copyrighted work of the attributed author or publisher, and ZFIN has permission only to display this image to its users. Additional permissions should be obtained from the applicable author or publisher of the image. Full text @ Elife