ROBUSTNESS OF NEURAL SPIKE SORTING TO SAMPLING RATE ...

1 downloads 0 Views 729KB Size Report
the Nyquist rate. Index Terms— Neural data acquisition, action potential, spike sorting, sampling rate, quantization. 1. INTRODUCTION. In neuroscience, it is ...
ROBUSTNESS OF NEURAL SPIKE SORTING TO SAMPLING RATE AND QUANTIZATION BIT DEPTH Yasser Ghanbari1, Panos Papamichalis1, and Larry Spence2 1

Department of Electrical Engineering, Southern Methodist University, Dallas, Texas, USA 2 Plexon Inc., Dallas, Texas, USA [email protected], [email protected], [email protected] ABSTRACT

Extracellular recording of neural signals records the action potentials of neurons adjacent to the electrode as well as the noise generated by the overall neural activity around the electrode. The spike sorting process, i.e., detection of the noisy spikes in the recorded digital signal, feature extraction, and clustering of the spikes has been investigated extensively since it is a challenging problem for neuroscientists. However, the effects of digitization, including the sampling rate and number of bits, on the above three-stage process have not been investigated. This paper addresses the robustness of the spike sorting procedure to variations in the signal bandwidth, sampling rate, and the number of quantization levels (bit depth). Different signalto-noise ratios (SNRs) are used and their effects on clustering are studied, when using principal components analysis (PCA) features. The PCA-based features are shown to be robust to quantization bit depth variations while they are quite sensitive to the sampling rate even when it exceeds the Nyquist rate. Index Terms— Neural data acquisition, potential, spike sorting, sampling rate, quantization

action

1. INTRODUCTION In neuroscience, it is very important to study the behavior of action potentials (spikes). Results from such studies can be used in applications such as neural prosthetics, brainmachine interfaces, investigation of effects of drugs, helping people with visual and auditory problems, etc. This study can be achieved by recording neural signals using electrodes positioned outside the neurons themselves (extracellular recordings). The resulting signal tends to be noisy, as it records not only the spikes from nearby neurons, but also the activities of more distant neurons. Hence, it is necessary to extract the spikes from that noisy signal and then classify them in groups (clusters), each cluster corresponding to one nearby neuron. This process is known as spike sorting.

978-1-4244-3298-1/09/$25.00 ©2009 IEEE

Spike sorting is often defined as a three-stage process where (a) the action potentials or spikes are detected, (b) the number of neurons generating those spikes is determined, and (c) each spike event is assigned to a neuron as the source of the event [1]. At the first stage (spike detection) the spike events are detected using a number of possible techniques, the most popular among them being amplitude thresholding [2]. Once a spike is detected, a vector consisting of a sequence of sample values is extracted to represent that spike. At the next stage an appropriate feature space is determined in order to reduce the dimensionality of time-domain sample vectors in such a way as to produce a well-separated set of clusters in the lower-dimensional space. The number of clusters, representing the number of firing neurons, is determined at this stage. The most popular algorithms proposed for dimensionality reduction include principal components analysis (PCA) [2], wavelet-based techniques [3], and others. The third stage, known as clustering, involves assigning each spike to its originating neuron. The main clustering algorithms used for spike classification include K-means [4], Bayesian clustering and classification [2], template matching [5], and others. This paper addresses the issue of robustness of the spike sorting process to three variables: signal bandwidth, sampling rate, and quantization bit depth. These are important considerations in practical applications, because they affect the selection of the A/D converter and the computational resources needed for spike detection and sorting. As a result, they can have an impact on the cost of the implementations. 2. BASIC ALGORITHMS IN SPIKE SORTING There are many research reports which discuss each of the three stages of sorting. In spike detection, amplitude thresholding is a well known method which has been most often used to detect spike firings [2]. Each spike can be considered as a vector in an n-dimensional space, where n is the number of samples per detected spike waveform. For instance, in our experimentation, the spike vectors are 40 samples long (1 ms per spike at 40 KHz sampling rate). Therefore the next stage uses a dimensionality-reduction

DSP 2009

algorithm, most often employing principal components analysis (PCA) [2]. This method maps a high-dimensional vector to a low-dimensional vector (e.g., a 40-vector to a 2vector), or feature space, in which the first axis points in the direction of maximum variance in the original ndimensional space, the second axis points in the direction of second-greatest variance in the signal, etc. In this feature space, each cluster of vectors corresponds to spikes produced by a single neuron. Assigning each spike to its originating neuron is then a clustering problem, often solved by the K-means algorithm [2]. During signal recording, spikes from nearby neurons are detected together with noise from more distant neurons as well as electrical noise. The goal is to extract the spikes from the noisy signal, and then decide on the number of neurons and determine which spike was fired from which neuron. For all these operations, the main spike attributes used are the spike amplitude and shape. Figure 1 shows an example of a clean amplified spike of 1 ms length, sampled at 40 KHz.

Fig. 1. The shape of a 1-msec spike sampled at 40 KHz. 2.1. Amplitude thresholding Since the most discriminating feature of the spike is its maximum amplitude (positive or negative), the presence of a spike can be reasonably detected using a threshold applied to the neural signal [2]. Determination of the threshold value is one of the challenges in this stage. The absolute value of the threshold is typically chosen equal to three times the standard deviation of the distribution of all the samples in the noisy neural signal. The threshold sign (i.e., using a positive or negative threshold) is also chosen based on the polarity of the signal (i.e., if the spike’s highest amplitude is positive or negative). Figure 2 shows a short piece of a neural signal with negative recording polarity and the threshold based on the distribution of samples. It can be seen that this simple algorithm detects the main spikes in the signal. A typical spike has length around 1 ms, which is also chosen as the spike length in our experiments. Once the point of intersection between the signal and the threshold has been determined, the main spike peak is located. Then a

1 ms vector of samples is extracted symmetrically around the main spike peak.

Fig. 2. A short piece of a real neural signal including the spikes (dark line segments), the noise (light line segments), and the detection threshold (dashed line). 2.2. Principal components analysis (PCA) PCA is used to reduce the dimensionality of the data based on the direction of maximum variance. PCA is an effective approach to finding the orthogonal basis vectors describing the directions of maximum variance in the data distribution. Since we are looking for features discriminating between the spikes fired from different neurons, projecting the data on those directions generates the features that can be used for clustering. In our experimentation, each detected spike is represented by a 40-vector. From all the detected spikes, a 40×40 covariance matrix Σ is generated. Then, the eigenvalues and the (40-long) eigenvectors of Σ are computed. From these eigenvectors, we retain the 2 eigenvectors corresponding to the 2 largest eigenvalues, and we form the 2×40 matrix A, where each row of the matrix is one of the selected eigenvectors. Next, each one of the 40-long vectors X, corresponding to a spike, is transformed to a 2-vector Y by the relationship:

Y2×1 = A2×40 X 40×1 where the elements of Y correspond to the dimensions of the feature space that will be used for clustering. Figure 3(a) shows the PCA feature space plot of 1520 detected spikes in a real neural signal. The spikes were detected using the amplitude thresholding algorithm. The spikes appear to be grouped into five clusters with each cluster representing a neuron. 2.3. K-means clustering and classification Among the many clustering algorithms found in the literature, the K-means algorithm is one of the most popular [4]. Although K-means needs to know the number of clusters beforehand, it is still used in many applications where clustering is required. In our case, since the signal is synthetically generated, the number of clusters is already known. After the number of clusters is determined, the K-

means algorithm runs and groups the feature vectors in clusters. Figure 3(b) shows the result of K-means on the PCA features displayed in Figure 3(a). K-means with K=5 was run and after 10 iterations it classified the features as illustrated with different markers in Figure 3(b).

Fig. 3. (a) PCA feature space for 1520 spikes detected in a real neural signal, (b) clustered PCA feature space using Kmeans with K=5.

local SNRs (four, in our case, for the four spike templates) are the ones mentioned in Figures 7, 9, and 11, below. Also when generating the spike train, the exact firing time of each neuron is recorded so that we can use it later for exact spike detection and classification. The synthesized test signals are used to conduct three experiments: lowpass filtering, decreasing the quantization bit depth, and reducing the sampling rate. The effects of these changes on the results of spike sorting are discussed in the next section.

(1)

(2)

(3)

(4)

3. DATA GENERATION FOR THE EXPERIMENTS Our experiments were conducted using synthetic test signals, in order to have the ground truth available when judging the effects of the different experiments. The neural data recorded in practice consist of the spikes fired by nearby neurons, and the background noise which is primarily a combination of the noise from the analog electronics (preamplifier and filters) and the summation of many smaller spikes from more distant neurons [2]. Therefore the test signal is synthesized to contain all these characteristics. The synthetic neural signal is generated by randomly instantiating spikes selected from one of four templates, as described below. The templates were generated from a real-life neural signal that was recorded with a 40 KHz sampling rate and digitized by a 12-bit quantizer. The analog signal was passed through a 300Hz to 6 KHz bandpass filter before digitization. Then the amplitude thresholding algorithm was applied to the signal and 1 ms-long spikes were extracted. A K-means clustering algorithm grouped the PCA feature points into clusters and the spike waveforms in each cluster were then averaged to construct the spike templates. Four 40-sample templates extracted from the real neural signal are shown in Figure 4. These spike templates are now used to make a synthetic neural signal. We assume that one of the neurons (in random order) fires the related spike every 9 to 11 ms (every 360 to 440 samples). Then, uniformly distributed noise (bandpassfiltered between 300Hz and 6 KHz to make it look like a real neural noise) is added to the spike train at an amplitude such that the desired SNR is produced. However, subsequently, given this overall noise, we estimate the local SNR for each of the different templates (which is different from the overall SNR because of the different template amplitudes and the quiet regions between spikes). These

Fig. 4. Four spike templates extracted by sorting a real neural signal. 4. EXPERIMENTS AND RESULTS Figure 5 shows the spectral content of the four spike templates used in the generation of the synthetic signal.

(1)

(2)

(3)

(4)

Fig. 5. Spectra of the four spike templates displayed in Figure 4. Since the test signals are synthetic, it is known in advance which spike corresponds to what template. Therefore each point in the PCA feature space can be displayed with a different marker based on which neuron it corresponds to. Visual inspection of the PCA plots can be used as a subjective means of identifying changes caused by

varying the bandwidth, sampling rate, and bit depth parameters. A quantitative metric that can be used to assess the same results is the Euclidean distance between the 2dimensional PCA features of the reference signal and the modified signal. In this case, by “Euclidean distance” we mean the sum of Euclidean distances between the feature vectors before an experiment and the corresponding feature vectors after the experiment.

to as low as four bits. This shows that the PCA features are robust to the quantization bit depth.

4.1. Bandwidth reduction In this experiment, the bandwidth of the spikes was reduced from 6 KHz to 5, 4, and 3 KHz. Figure 6 displays the PCA feature space when lowpass filters (LPFs) with cutoff frequency of 6, 5, 4, and 3 KHz are applied to the synthetic neural signal. In this case the synthetic neural signal includes 500 spikes from four neurons each firing approximately 125 spikes in a 5-second period. The average (local) SNR is approximately 13dB, 5dB, 10dB, and 10dB for each of the four neurons, respectively. As noted earlier, since the background noise is assumed to be stationary (typically a legitimate assumption) while the spikes have different amplitudes (and consequently different energies) the average SNR is different for spikes of each neuron. No major difference in cluster appearance was observed after lowpass filtering with a cutoff of 5 kHz. At 4 KHz there was a small degradation in the PCA features, which rapidly deteriorated at cutoff frequencies of 3 KHz and below. Also, the Euclidean distance of the PCA features before and after applying the LPF is provided as a quantitative metric in Figure 7. The Euclidean distance is plotted for two different levels of global SNR (high and low noise), where the four local SNRs shown in each case represent the average SNR for each spike template. The Euclidian distance plot confirms that cutoff frequencies less than 5 KHz make a considerable difference in the PCA feature space. It is also consistent with the PSD plot in Figure 5 which shows that the spikes have their main energy concentrated in the frequency range less than 5 KHz.

Fig. 6. The PCA features for the spikes of four neurons when a lowpass filter is applied with different cutoff frequencies. The markers “+”, “*”, “o”, and “×” refer to the features for the members of the first, second, third, and fourth spike templates, respectively. Cutoff frequencies (a) 6 KHz, (b) 5 KHz, (c) 4 KHz, and (d) 3 KHz.

Fig. 7. The Euclidean distance of the PCA features for different cutoff frequencies: (a) local SNRs = 3, -5, 0, and 0dB, (b) local SNRs = 43, 35, 40, and 40dB.

4.2. Decreasing the quantization bit depth To investigate the effects of decreasing the quantization bit depth on the PCA features, the same synthetic signals are used as above. In each case, after selecting the number of bits to quantize each sample of the synthetic signal, the resulting signal is submitted to the spike-sorting process and the effects on the PCA feature space are observed. The results for different numbers of quantization bits are displayed in Figure 8. As a quantitative metric, the Euclidean distance between the PCA features for different numbers of quantization bits and the PCA features of 12-bit quantization (and for two different cases of SNR) is also provided in Figure 9. It is observed that the PCA features do not change considerably when the number of bits is reduced

Fig. 8. The PCA features for the spikes of four neurons when the number of quantization bits changes. The markers “+”, “*”, “o”, and “×” refer to the features for the members of the first, second, third, and fourth spike templates, respectively. Quantization bit depth (a) 12-bit, (b) 4-bit, (c) 3-bit, and (d) 2-bit.

Fig. 9. The Euclidean distance of the PCA features for different bit depths: (a) local SNRs = 3, -5, 0, and 0 dB, (b) local SNRs = 43, 35, 40, and 40 dB. 4.3. Reducing the sampling rate Another interesting topic to investigate is the effect of increasing the sampling period (i.e. reducing the sampling rate) on the spike sorting process. The results from such an investigation may help in selecting the appropriate A/D converters. The synthetic signals used for this part of the investigation are the same as those used in the two previous sections. The PCA feature space resulting from sampling rate reduction from 40 KHz down to 30, 25, 20, 15, and 10 KHz are shown in Figure 10. The digital samples at 40 KHz rate are decimated using the “resample” MATLAB command which applies a lowpass filter to avoid aliasing. Figure 11 shows the corresponding results in terms of the Euclidean distance for various SNR. The curves show that the PCA feature space of the neural spikes degrades rapidly when the sampling rate decreases. This indicates high sensitivity of the spike PCA features to the sampling rate. It was shown in previous sections that the spikes are band-limited to frequencies less than 6 KHz and the noise added to make the synthetic signal is also bandpass filtered between 300 Hz and 6 KHz. Therefore, no change in the PCA feature space would be expected for sampling rates above 12 KHz (twice the frequency content of the test neural signal), but the results illustrate that even at 30 KHz sampling rate the PCA feature space is degraded and the clusters start getting split into more than one cluster. For instance, at half the original sampling rate (i.e., at 20 KHz) all the clusters are split into two clusters. At a quarter the original sampling rate (i.e., at 10 KHz) all the clusters are split into four sub-clusters. In order to explain the cluster splitting observed in the experiments, the downsampled spikes related to one of the original clusters (i.e., spikes coming from the same template) were plotted. Figure 12 shows the spikes for all four sub-clusters, corresponding to one original cluster, represented by “+” in Figure 11, for the 10 KHz sampling rate signal. It is obvious that the four PCA sub-clusters are generated because four different wave shapes are constructed after decimation to 10 KHz. This phenomenon is the result of sampling a particular spike template with different phases, depending on where this spike is encountered within the overall neural signal. Since the PCA

feature analysis is performed on the time-domain sample values, such differences in spike shape can result in spurious sub-clusters. If the sampling rate is high enough, the template shape is preserved under the different phases and the effect may not be that pronounced. But this is no longer the case as the sampling rate decreases. Figure 13 illustrates this effect on the first spike template shown in Figure 4 when decimating by a factor of 4 with 2 different phases, one with a zero phase and the other with a phase of two samples. It is seen that the new downsampled spikes differ considerably in the wave shape which will result in splitting the related original cluster into two spurious sub-clusters. These problems could be overcome by proper reconstruction of the sampled waveforms using interpolation. However, that would be computationally expensive. But sampling at 40 kHz is also expensive. So this is a tradeoff between sampling at a lower rate and then using proper reconstruction (e.g. upsampling by interpolation) and sampling at a higher rate and using the raw sample values without interpolation.

Fig. 10. The PCA features for the spikes of four neurons when the sampling rate is reduced. The markers “+”, “*”, “o”, and “×” refer to the features for the members of the first, second, third, and fourth spike templates, respectively. Sampling rates (a) 40 KHz, (b) 30 KHz, (c) 25 KHz, (d) 20 KHz, (e) 15 KHz, and (f) 10 KHz.

Fig. 11. The Euclidean distance of the PCA features for different sampling rates: (a) local SNRs = 3, -5, 0, and 0 dB, (b) local SNRs = 43, 35, 40, and 40 dB.

process only if the LPF cutoff frequency is less than the spike bandwidth. The sorting process was shown to be surprisingly robust to the number of quantization bits even down to four bits. On the other hand, the spike sorting process turns out to be quite sensitive to the sampling rate. These results were also confirmed by tests using a variety of synthetic neural signals having different numbers of spike templates (i.e., different numbers of neurons), and different signal-to-noise ratios. 6. REFERENCES [1] E. N. Brown, R. E. Kass, and P. P. Mitra, “Multiple Neural Spike Train Data Analysis: State of the art and future challenges”, Nature Neuroscience, Vol 7, No. 5, May 2004. [2] M. S. Lewicki, “A review of methods for spike sorting: the detection and classification of neural action potentials”, Network: Computation Neural Syst., Vol. 9, pp. R53-R78, 1998. [3] A. Pavlov, V. A. Makarov, I. Makarova, and F. Panetsos, “Sorting of Neural Spikes: When wavelet based methods outperform principal component analysis”, Neural computing, Vol. 6, pp. 269-281, 2007.

Fig. 12. The spikes for each of the sub-clusters represented by “+” at subplot (f) of Figure 10. Four gray levels are used to display the four sub-clusters of the class “+”.

Fig. 13. Effect of downsampling on the first spike template shown in Figure 4. Decimation is done by a factor of 4 with 2 different phases, one with a zero phase and the other with a phase of two samples. 5. CONCLUSION The effect of lowpass filtering, bit-depth reduction, and sampling rate reduction was investigated on the spike sorting process. The results show that lowpass filtering has the expected effects on the sorting process. It affects this

[4] J. A. Hartigan, Clustering Algorithms, New York: Wiley, 1975. [5] H. Cho, D. Corina, J. F. Brinkley, G. A. Ojemann, and L. G. Shapiro, “A New Template Matching Method using Variance Estimation for Spike Sorting”, 2nd International IEEE EMBS Conference on Neural Engineering, pp. 225228, Mar 2005.

Suggest Documents