AbstractâDetecting action potentials has an important role in analyzing extracellular neuronal recordings. Current algorithms require subjective tuning by a user ...
Proceedings of the 26th Annual International Conference of the IEEE EMBS San Francisco, CA, USA • September 1-5, 2004
Action Potential Detection with Automatic Template Matching S. Kim1, J. McNames1, K. Burchiel2 1
Biomedical Signal Processing Laboratory, Electrical and Computer Engineering, Portland State University, Oregon, USA 2 Department of Neurological Surgery, Oregon Health and Science University, Oregon, USA
Abstract—Detecting action potentials has an important role in analyzing extracellular neuronal recordings. Current algorithms require subjective tuning by a user in the form of user-specified parameters. This paper describes a fully automatic template-matching spike detection algorithm that does not require any tuning. This algorithm is robust to noise and performs better than an optimum threshold detection algorithm.
Some algorithms use an entire action potential as a templatemodel, which are called the template-matching algorithms [4]. The main concept of this algorithm is to choose one of many model templates automatically from a template library and calculating the distance of a microelectrode-recording signal from the model template of an action potential at time t. When the distance is small enough at a certain time t, a detector classifies the signal as an action potential. Although most procedures in this technique are automatic, it still requires a user’s visual inspection of the optimal threshold for the distance. Its performance highly depends on how many diverse model templates the template library has. Above all, the algorithms described above require a user’s intervention or preprocessing of extracellular neuronal recordings before they actually detect action potentials. The objectives of this paper were to develop the algorithm for template-matching spike detection which does not require any user intervention or preprocessing of signals and to assess its performance in comparison with that of an optimum threshold detection algorithm. The new technique will help neurophysiologists detect action potentials of various morphologies in extracellular neuronal recordings faster and more reliably than the optimum threshold detection algorithm.
Keywords—action potential, globus pallidus internus (GPi), microelectrode recording (MER), stereotactic deep brain stimulation (DBS) surgery, subthalamus nucleus (STN).
I. INTRODUCTION Neurons communicate with one another by firing action potentials. They are often simply called ‘spikes.’ Detecting action potentials is a very important prerequisite for analysis of the extracellular neuronal recording’s characteristics. When an extracellular neuronal recording does not have strong background noise, simple hardware threshold detection works reliably. It becomes a challenge to detect action potentials when an extracellular neuronal recording has significant amount of background noise. Several software-oriented action potential detection algorithms have been introduced as computers’ data processing speed increases [1] [2]. Among them, a threshold detection algorithm and a feature-matching algorithm are the most common ones. The threshold detection technique is the simplest technique and many neurosurgeons use it in practice. After visual inspection of extracellular neuronal recordings, a user sets a threshold for amplitude and a detector declares an action potential every time the signal exceeds the user-specified threshold. When the action potential’s amplitude is significantly greater (>3 times) than that of background noise, finding the optimum threshold is a relatively easy task [3]. However, when background noise is strong, it is hard to find the optimum threshold and performance of the threshold detector becomes poor even if a user chooses the optimum threshold. The feature-matching algorithm collects feature data of typical action potentials prior to the detection process of action potentials. A detector declares an action potential when a signal’s features match those of typical action potentials. Although golden rules do not exist for what kinds of features are the best, there are several features that are used widely such as peak amplitude, rising/falling slopes and duration of an action potential [2].
0-7803-8439-3/04/$20.00©2004 IEEE
II. METHODOLOGY A. Detection Algorithm Step 1: The first step is to detect all positive amplitude local maxima. The duration of an action potential is typically no greater than 1.3 ms. The relationship between a sampling frequency and the number of sample points for a model template can be expressed as N = fs × T (1) where, N is the number of sample points, fs is the sampling frequency in kHz and T is the duration of a single action potential in ms. Now, each positive amplitude local maximum corresponds to a sequence of N number of sample points, which are from the N/2 sample point prior to each local maximum to the N/2 sample point subsequent to each local maximum. Step 2: The second step is to calculate the energy of each sequence of N sample points around each local maximum. The sum of squared values of N sample
41
points yields the energy of the action potential candidates. Step 3: The third step is to plot the histogram of the energy of all action potential candidates and detect the lowest non-zero bin between two large modes automatically. The energy level at the center of this bin is the threshold to distinguish noise and action potentials. Since typical true action potentials have distinguishable amount energy in comparison to noise, the histogram will appear similar to Fig. 1.
positives) from the initial detection based on signal energy. Step 5: The fifth step is to shift this model template over the original extracellular neuronal recording and calculate the distance between the model template and an N-length segment of the recording. The distance of each segment from the model template at time t is expressed as N −1
D(t ) = ∑ (s(t − iTs ) − mi )
2
(2)
i =0
where, Ts is the time interval between two closest sample points (1/fs), s(t-iTs) is the amplitude of the extracellular neuronal recording at time t-iTs and mi is the amplitude of the ith sample point of the model template.
Fig. 1. The energy histogram of action potential candidates. Note that it has two large modes where each mode corresponds to the typical energy of noise and action potentials.
The energy histogram in Fig. 1 has two large modes; one is at around zero energy level and the other is at a high energy level. The bin width of the histogram is 1/100 of the entire energy range, which is 0 ~ 10. Action potential candidates, whose energy is greater than the threshold, are used to create a model template in step 4. Fig. 2 shows an example of the superimposed image of the action potential candidates. They are aligned at the peak of each action potential candidate.
Fig. 3. The histogram of distance between a model template and Nlength segments of an extracellular neuronal recording.
Fig. 3 illustrates the typical histogram of this distance between the model template and each segment of an extracellular neuronal recording. If the morphology of a segment of an extracellular neuronal recording is close to the model template, the segment’s distance from the model template will be close to zero. The bin width of the histogram in Fig. 3 is 1/1000 of the entire distance axis range, which is 0 ~ 5. Again, the lowest bin between zero distance and the large distance with a big mode is automatically selected and the distance at the center of that bin becomes a threshold to distinguish true spikes and noise.
Time (ms) Fig. 2. The superimposed action potential candidates. Each dot represents the median of amplitude at each sample point.
Step 4: The fourth step is to create a model template, which consists of N sample points. The dots in Fig. 2 represent the N points of a model template and each dot is the median at each sample point. We chose to use median because it is robust to artifact and outliers (false
Fig. 4. The original extracellular neuronal recording and peaks of all detected action pontentials.
42
FP + FN (4) TP + FN where, FP stands for false positives, FN for false negatives and TP for true positives [6].
Fig. 4 illustrates the original extracellular neuronal recording and peaks of all detected action potentials. To increase the accuracy of detection, one may iterate the processes described above. Fig. 5 shows the entire procedure of the algorithm.
TE =
(a) A clear MER signal.
Fig. 5. The entire procedure of the algorithm.
B. Assessment We assessed the performance the new algorithm in comparison with the optimum threshold detection algorithm at various signal-and-noise ratios (SNR). SNR is defined as P (3) SNR = s Pn where, Ps is the estimated power of an original extracellular neuronal recording and Pn is the estimated power of added noise. Since SNR is only an estimate, it is biased towards a larger value than the actual SNR. SNR is 1 when the variance of added white Gaussian noise equals that of an original microelectrode recording. Fig. 6 depicts the clear microelectrode recording signal and the noise-added signal with 0.5 of SNR. Three microelectrode recording signals were used to assess the new algorithm. Each signal contained clear action potentials and little background noise. Then, Gaussian noise was added to those original clear microelectrode recording signals. The SNR of an original signal is infinity because no noise (zero power) is added. There are several ways to measure the performance of a spike detection algorithm. In this paper, we used the total error as a measurement of performance. The total error is the ratio between the total number of falsely detected spikes and missed true spikes and that of all true spikes. The total error can be defined as
(b) A noise-added MER signal. Fig. 6. Comparison of clear and noise-added MER signals.
Since synthetic Gaussian noise is added to the original microelectrode recordings, the performance as measured by TE partly depends on the synthetic noise. To demonstrate the sensitivity of the TE to the synthetic noise, we report the mean TE, 5th percentile and 95th percentile from 100 simulations at each value of SNR. TE computation requires the true action potentials (TP) to have already been detected. Thus, the assessment could not be applied in practice.
III. RESULTS
A. Data Collection A commercialized data acquisition system with 22.05 kHz sampling frequency was used to collect microelectrode recordings during a stereotactic deep brain stimulation surgery for Parkinson’s disease. Three microelectrode recording signals were analyzed from three different subjects; they are Globus Pallidus internus (GPi), Globus Pallidus externus (GPe), and Subthalamus Nucleus (STN) signals. The length of each recording was 5 s. Action
43
B. Assessment
potentials in the microelectrode recordings were annotated based on visual inspection so that they can be used as references for assessment of the new algorithm.
Figs. 7 through 9 depict the total error of the adaptive automatic template-matching algorithm and the threshold detection algorithm at different SNR’s. Each vertical bar represents the 5th and 95th percentiles of total errors, which are the results of a Monte Carlo simulation with 100 realizations. On the average, when SNR is below 0.8, the algorithm detects action potentials more accurately than the optimum threshold detection algorithm does. When SNR is greater than 0.8, there is no significant difference in performance between two algorithms.
IV. CONCLUSION Fig. 7. The comparison of the total error (GPi).
We described a new algorithm for detecting action potentials in extracellular neuronal recordings. The new algorithm is based on template matching. Unlike other template matching algorithms, the algorithm estimates the action potential morphology (template) from the recording. Unlike other action potential detection algorithms, the new algorithm is completely automatic and does not require the user to pick any thresholds. The performance of the new algorithm on four recordings with synthetic noise consistently performed better than an optimized threshold detection algorithm.
REFERENCES Fig. 8. The comparison of the total error (GPe). [1] M. S. Lewicki, “A review of methods for spike sorting: the detection and classification of neural action potentials, ” Network: Computation in Neural Systems, 9(4): R53-R78, 1998. Available: http://www-2.cs.cmu.edu/~lewicki/ [2] J. H. Cocatre-Zilgien and F. Delcomyn, “A slope-based approach to spike discrimination in digitized data,” in Journal of Neuroscience Methods, vol. 33. pp. 241-249, 1990. [3] Edmund M. Glaser and Daniel S. Ruchkin, “Principles of Neurobiological Signal Analysis,” Academic Press, p.303-306, 1976. [4] F. Worgotter, W. J. Daunicht, and R. Eckmiller, “An on-line spike form discriminator for extracellular recordings based on an analog correlation technique,” in Journal of Neuroscience Methods, vol.17, pp.141-151, 1986 . [5] J. H. Falkenberg, J. McNames, and K. J. Burchiel, “Statistical methods of analysis and visualization of extracellular microelectrode recordings,” Annual International Conference of the IEEE Engineering in Medicine and Biology – Proceedings, Cancun, Mexico, pp. 2515-2518, 17-21, September, 2003. Available: http://bsp.pdx.edu [6] Recommended Practice/American National Standard, ANSI/AAMI ECE 57: Testing and reporting performance results of cardiac rhythm and ST segment measurement algorithms, 1998.
Fig. 9. The comparison of the total error (STN).
Various power of Gaussian noise was added to the original clear microelectrode signals. The original signal contained some noise, so the estimate of the signal power is higher than the true signal power and the estimate of the noise power is smaller than the true noise power. Thus, the estimate of the SNR is biased towards a higher value than the actual SNR. The acceptance interval was ±0.25 ms, which is 20 % of the typical action potential duration, 1.3 ms.
44