0% found this document useful (0 votes)
55 views

Neural - Data - Science - 1 Spike Detection

This document discusses methods for analyzing neural data recorded from the brain. It describes several methods for recording brain activity like microelectrodes, tetrodes, and Neuropixels probes. It then covers the process of spike sorting, including spike detection, feature extraction from waveforms, dimensionality reduction using techniques like PCA, and clustering neurons. The goal is to extract meaningful features that can discriminate between neurons while being robust to noise.

Uploaded by

fdasffd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Neural - Data - Science - 1 Spike Detection

This document discusses methods for analyzing neural data recorded from the brain. It describes several methods for recording brain activity like microelectrodes, tetrodes, and Neuropixels probes. It then covers the process of spike sorting, including spike detection, feature extraction from waveforms, dimensionality reduction using techniques like PCA, and clustering neurons. The goal is to extract meaningful features that can discriminate between neurons while being robust to noise.

Uploaded by

fdasffd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Neural Data Science

Spike detection and feature extraction


Prof. Dr. Philipp Berens
Institute for Ophthalmic Research, Tübingen
David Hubel & Thorsten Wiesel

2 | Philipp Berens harvard.edu


Methods for recording brain activity

3 | Philipp Berens
Hong & Lieber, 2019
Methods for recording brain activity

Hong & Lieber, 2019


Tungsten microelectrodes
Tetrodes
Utah array
Silicon probes
Neuropixels

960 sites Jun et al, Nature, 2017


More about neuropixels

https://www.biorxiv.org/content/10.1101/2020.10.27.358291v1

10 | Philipp Berens
The Problem

Ecker et al., 2010

Buszaki, 2004
Triangulation

Channel 1
Channel 2
Channel 3
Tetrode

Channel 4

Neuron 1 Neuron 2

Amp. Channel 4
Amp. Channel 3
Neuron 2

Neuron 1

10 mm Amp. Channel 2 Amp. Channel 1


Spike sorting
• Raw data
• Spike detection
• Feature extraction
• Clustering
• Verification
Raw signal

Tetrodes: 4 channels in parallel!


Remove LFP and high frequency noise
A quick detour on time series filtering
https://bookdown.org/rdpeng/timeseriesbook/filtering-time-series.html

16 | Philipp Berens
A quick detour on time series filtering
https://bookdown.org/rdpeng/timeseriesbook/filtering-time-series.html

17 | Philipp Berens
Butterworth bandpass filter

http://scipy-cookbook.readthedocs.io/items/idx_signal_processing.html
Spike detection

Threshold at 𝑵𝝈
Low threshold
High threshold

Robust estimation of 𝝈:

𝒙−𝒙 ഥ
𝝈
ෝ = 𝒎𝒆𝒅𝒊𝒂𝒏
𝟎. 𝟔𝟕𝟒𝟓

Quian-Quiroga 2004
Why is this an estimate of the standard deviation?
• 𝑀𝐴𝐷 = 𝑚𝑒𝑑𝑖𝑎𝑛 |𝑥 − 𝑥|ҧ

1 𝑋−𝜇 𝑀𝐴𝐷 𝑀𝐴𝐷


• 2 = 𝑃( 𝑋 − 𝜇 < 𝑀𝐴𝐷)=𝑃 < = 𝑃 |𝑍| <
𝜎 𝜎 𝜎

𝑀𝐴𝐷 𝑀𝐴𝐷 1
•Φ −Φ − =
𝜎 𝜎 2
𝑀𝐴𝐷 𝑀𝐴𝐷 1
•Φ −1+ Φ =
𝜎 𝜎 2
𝑀𝐴𝐷 3
•Φ =4
𝜎

1 1
•𝜎= 3 𝑀𝐴𝐷 = 𝑀𝐴𝐷 = 0.675 𝑀𝐴𝐷
Φ−1 1.4826
4

20 | Philipp Berens
Detect spikes and extract waveforms

[s, t] = detectSpikes(y, Fs)


w = extractWaveforms(y, s)
https://www.biorxiv.org/content/10.1101/061481v1.full
Spike sorting
• Raw data
• Spike detection
• Feature extraction
• Clustering
• Verification
Problem: curse of dimensionality
• 4 channels × 32 samples = 128 dimensions
• Problems:
- Memory issues
- Computing time
- Model complexity / number of parameters
• Dimensionality reduction
Which features to choose?

• Goal: small set of features that discriminate


between different neurons
• Robust against noise?
• What is good may depend on the spike sorting
algorithm (shape of distribution)
“Descriptive features”

Energy
Peak-to-peak
amplitude

Peak-to-trough
ratio

Width Etc…
Problems
• Sometimes undefined (no trough)
• Non gaussian distributions
• Correlated

Feature 2
Energy
Peak-to-
Feature 1
peak
amplitude
Peak-to-
trough ratio

See also
Quian-Quiroga, 2004
Width
PCA
1. Find direction capturing maximum variance
2
𝑤 = arg max ෍ 𝑤 𝑇 𝑥𝑖 , 𝑠. 𝑡. 𝑤 = 1
w
𝑖
2. Minimal reconstruction error
2
𝑇
𝑤 = arg min 𝑋 − 𝑤𝑤 𝑋
w

• solve eigenvalue problem

https://stats.stackexchange.com/questions/2691/
making-sense-of-principal-component-analysis-eigenvectors-eigenvalues
Principal component analysis (PCA)
• Finds an orthogonal basis for the data
• First PC is the direction of largest variance

• → A few components capture most of the variance


Problem with PCA
Largest variance – multiple peaks

Larger variance

Better for clustering


Kernel PCA
1
• 𝐶 = 𝑁 σ𝑖 𝑥𝑖 𝑥𝑖𝑇
• Use nonlinear kernel functions instead:
• 𝑘 𝑥𝑖 , 𝑥𝑗 =< 𝜙 𝑥𝑖 , 𝜙 𝑥𝑗 >
Autoencoder networks

Wu, 2018, arxiv

Hinton & Salakhutdinov, 2006


Spike sorting
• Raw data
• Spike detection
• Feature extraction
• Clustering
• Verification

You might also like