Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2021 Jul;19(3):493-514.
doi: 10.1007/s12021-020-09496-2. Epub 2021 Jan 4.

RippleNet: a Recurrent Neural Network for Sharp Wave Ripple (SPW-R) Detection

Affiliations

RippleNet: a Recurrent Neural Network for Sharp Wave Ripple (SPW-R) Detection

Espen Hagen et al. Neuroinformatics. 2021 Jul.

Abstract

Hippocampal sharp wave ripples (SPW-R) have been identified as key bio-markers of important brain functions such as memory consolidation and decision making. Understanding their underlying mechanisms in healthy and pathological brain function and behaviour rely on accurate SPW-R detection. In this multidisciplinary study, we propose a novel, self-improving artificial intelligence (AI) detection method in the form of deep Recurrent Neural Networks (RNN) with Long Short-Term memory (LSTM) layers that can learn features of SPW-R events from raw, labeled input data. The approach contrasts conventional routines that typically relies on hand-crafted, heuristic feature extraction and often laborious manual curation. The algorithm is trained using supervised learning on hand-curated data sets with SPW-R events obtained under controlled conditions. The input to the algorithm is the local field potential (LFP), the low-frequency part of extracellularly recorded electric potentials from the CA1 region of the hippocampus. Its output predictions can be interpreted as time-varying probabilities of SPW-R events for the duration of the inputs. A simple thresholding applied to the output probabilities is found to identify times of SPW-R events with high precision. The non-causal, or bidirectional variant of the proposed algorithm demonstrates consistently better accuracy compared to the causal, or unidirectional counterpart. Reference implementations of the algorithm, named 'RippleNet', are open source, freely available, and implemented using a common open-source framework for neural networks (tensorflow.keras) and can be easily incorporated into existing data analysis workflows for processing experimental data.

Keywords: Deep learning; Hippocampus CA1; Machine learning; Neuroscience; Recurrent neural networks; Sharp wave ripples (SPW-R).

PubMed Disclaimer

Figures

Fig. 1
Fig. 1
Example of a single detected SPW-R event and application of RippleNet to LFP data. a Raw LFP data with an SPW-R event. b Band-pass filtered LFP signal (150–250 Hz). c LFP spectrogram. d Illustration of a bidirectional RippleNet instance and its application to LFP signal X(t) (bottom trace) for predicting time-varying probabilities of SPW-R events ŷ(t) (top trace). The subscript and superscripts annotating each layer denotes input and output dimensions respectively for an input sequence of length N
Fig. 2
Fig. 2
Experimental setup. A set of recordings used for this study were acquired concomitant to two-photon microscopy from head-fixed mice. a Mice were prepared with a single electrode in the the hippocampal CA1 region and a contralateral reference electrode, chronic glass window for two-photon microscopy and a head bar for head fixation. b LFP recordings were recorded concomitant to two-photon microscopy in head-fixed mice
Fig. 3
Fig. 3
Snapshots of experimental data. a Samples of raw LFP traces (X〈1〉(t),X〈2〉(t),…) with at least one labeled SPW-R event. The diamonds mark the times of the labeled events. Each column corresponds to samples j from the validation dataset. b Band-pass filtered LFP traces ϕBPj(t). c Wavelet spectrograms Sj(t,f) computed from the LFP traces
Fig. 4
Fig. 4
a Training and validation loss J as function of training epoch for for unidirectional RippleNet variants. Each instance M1-3 are instantiated using different random seeds. b same as panel (a), but for the non-causal bidirectional variant. c, d Training and validation MSE as function of training epoch
Fig. 5
Fig. 5
Comparison of RippleNet predictions on samples from the validation set. Each column corresponds to different input LFP samples Xj shown at the top. a) Input LFP samples Xj. The diamonds mark the times of labeled SPW-R events. b One-hot encoded label vectors yj(t). c Predictions ŷj(t) made by the different instances of the unidirectional RippleNet variant. SPW-R events found by the peak-finding algorithm are marked with diamond markers. d Same as panel (c), but for the bidirectional RippleNet variant
Fig. 6
Fig. 6
Effect of varying threshold and width parameters for the peak finding algorithm on counts of TP, FP and FN events in the validation dataset and derived metrics for different RippleNet instances. a Each row corresponds to different model instances of the unidirectional RippleNet variant. The columns correspond to different metrics. Colorbars are shared among panels in each column. The cross hatches in the last F1 column correspond to parameter combinations maximizing the F1 score as summarized in Table 5. b Same as panels in (a) but for instances of the bidirectional RippleNet variant
Fig. 7
Fig. 7
Examples of validation samples j resulting in at least one FP prediction per sample. FN predictions may also occur. Columns show a input sequences with times of labeled SPW-R events denoted by diamond markers, b band-pass filtered LFP, c spectrograms and d predictions with detected events. The diamond and upward/downward pointing triangle markers denote times of TP, FP and FN events, respectively
Fig. 8
Fig. 8
Same as Fig. 7, but showing a set of samples with at least one FN prediction per sample
Fig. 9
Fig. 9
Application of RippleNet on continuous data. a 10 s excerpt of input LFP signal X(t) = ϕ(t). The diamonds marks the times of manually labeled SPW-R events. b band-pass filtered LFP ϕBP(t); c Time-frequency resolved spectrogram S(t,f) of the LFP. d label array y(t); e prediction ŷ(t). The diamond and triangle markers represents the times of detected TP and FP SPW-R events using the threshold and width parameters that maximize the F1 score for the model
Fig. 10
Fig. 10
a Cumulative counts of predicted SPW-R events as function of labeled SPW-R events. b Cross-correlation coefficients between predicted ripple event times and labeled event times as function of time lag τ (2ms bin size). c Band-pass filtered LFP SPW-R event energy (EϕBPj) as function of (1ŷj) of SPW-R events (orange dots). The contour lines show the bivariate kernel density estimate of the kdeplot method in the Seaborn plotting library. The top and bottom panel shows labeled and predicted SPW-R events, respectively. d Averaged spectrograms for labeled (top) and predicted (bottom) SPW-R events
Fig. 11
Fig. 11
Labeled events (input LFP, band-pass filtered signal, spectrograms) from the hidden test set with highest and lowest RippleNet confidence. Columns in rows 1–3 show eight events which maximized the RippleNet-predicted probabilities (ŷ(tj)1), while rows 4–6 shows labeled events with the lowest predicted event probability
Fig. 12
Fig. 12
Same as Fig. 11 but for eight FP SPW-R events detected at or above threshold by the RippleNet algorithm

Similar articles

Cited by

References

    1. Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G.S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I., Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L., Kudlur, M., Levenberg, J., Mané, D., Monga, R., Moore, S., Murray, D., Olah, C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K., Tucker, P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O., Warden, P., Wattenberg, M., Wicke, M., Yu, Y., & Zheng, X. (2015). Tensorflow: large-scale machine learning on heterogeneous systems. https://www.tensorflow.org/, Software available from tensorflow.org.
    1. Axmacher N, Elger CE, Fell J. Ripples in the medial temporal lobe are relevant for human memory consolidation. Brain: A Journal of Neurology. 2008;131(7):1806–1817. doi: 10.1093/brain/awn103. - DOI - PubMed
    1. Bai, S., Zico Kolter, J., & Koltun, V. (2018). An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv:1803.01271.
    1. Buzsáki G. Neuronal oscillations in cortical networks. Science. 2004;304(5679):1926–1929. doi: 10.1126/science.1099745. - DOI - PubMed
    1. Buzsáki G. Hippocampal sharp wave-ripple: a cognitive biomarker for episodic memory and planning. Hippocampus. 2015;25(10):1073–1188. doi: 10.1002/hipo.22488. - DOI - PMC - PubMed

Publication types

LinkOut - more resources