Stream-based Hebbian eigenfilter for real-time neuronal spike discrimination
© Yu et al; licensee BioMed Central Ltd. 2012
Received: 21 December 2011
Accepted: 10 April 2012
Published: 10 April 2012
Principal component analysis (PCA) has been widely employed for automatic neuronal spike sorting. Calculating principal components (PCs) is computationally expensive, and requires complex numerical operations and large memory resources. Substantial hardware resources are therefore needed for hardware implementations of PCA. General Hebbian algorithm (GHA) has been proposed for calculating PCs of neuronal spikes in our previous work, which eliminates the needs of computationally expensive covariance analysis and eigenvalue decomposition in conventional PCA algorithms. However, large memory resources are still inherently required for storing a large volume of aligned spikes for training PCs. The large size memory will consume large hardware resources and contribute significant power dissipation, which make GHA difficult to be implemented in portable or implantable multi-channel recording micro-systems.
In this paper, we present a new algorithm for PCA-based spike sorting based on GHA, namely stream-based Hebbian eigenfilter, which eliminates the inherent memory requirements of GHA while keeping the accuracy of spike sorting by utilizing the pseudo-stationarity of neuronal spikes. Because of the reduction of large hardware storage requirements, the proposed algorithm can lead to ultra-low hardware resources and power consumption of hardware implementations, which is critical for the future multi-channel micro-systems. Both clinical and synthetic neural recording data sets were employed for evaluating the accuracy of the stream-based Hebbian eigenfilter. The performance of spike sorting using stream-based eigenfilter and the computational complexity of the eigenfilter were rigorously evaluated and compared with conventional PCA algorithms. Field programmable logic arrays (FPGAs) were employed to implement the proposed algorithm, evaluate the hardware implementations and demonstrate the reduction in both power consumption and hardware memories achieved by the streaming computing
Results and discussion
Results demonstrate that the stream-based eigenfilter can achieve the same accuracy and is 10 times more computationally efficient when compared with conventional PCA algorithms. Hardware evaluations show that 90.3% logic resources, 95.1% power consumption and 86.8% computing latency can be reduced by the stream-based eigenfilter when compared with PCA hardware. By utilizing the streaming method, 92% memory resources and 67% power consumption can be saved when compared with the direct implementation of GHA.
Stream-based Hebbian eigenfilter presents a novel approach to enable real-time spike sorting with reduced computational complexity and hardware costs. This new design can be further utilized for multi-channel neuro-physiological experiments or chronic implants.
KeywordsBrain-machine interface Spike sorting Hebbian eigenfilter Hardware Principal component analysis
Recently, multi-electrode arrays (MEAs) have become increasingly popular for neuro-physiological experiments in vivo [1–4] or in vitro [5–8]. Compared with other methods of signal acquisition, such as Electroencephalography (EEG)  and Electrocorticographical (ECoG) , MEAs provide the capability of recording neuronal spikes from specific regions of the brain with high signal-to-noise ratio [1, 5]. The substantial temporal and spatial resolutions provided by MEAs facilitate the studies of neural network dynamic , plasticity , learning and information processing  and the developments of high performance brain-machine interface (BMI) for emerging applications, such as motor rehabilitation for paralyzed or stroke patients [14–16].
Neuronal spike trains recorded by electrodes encompass noises introduced by measurement instruments, interferences from other vicinity neurons and action potentials from unknown number of neurons. Neural signal processing that extracts useful information from noisy spike trains is necessary for spike information decoding and neural network analysis in subsequent processes. In most MEA based systems, especially the MEA based brain-machine interface (BMI), spike sorting that discriminates neuronal spikes to corresponding neurons is among the very first steps of signal processing [17–19] and its correctness significantly affects the reliability of the subsequent analysis .
PCA-based spike sorting
Calculating PCs requires computationally expensive operations, including covariance matrix calculation and eigenvalue decomposition. Besides, a large volume of neuronal spikes needs to be temperately stored for training PCs. Large size memories are therefore required. While large computational complexity and memory usage are not issues for recording and analysis of 100 channel systems , they are critical concerns for systems with large number of channels (> 1000), and especially for implantable systems, which have tight constraints of hardware size and power consumptions.
GHA for calculating PCs of neuronal spikes
GHA-basedspike feature extraction
Neuronal spikes, ;
Initial synaptic weight, ;
Learning rate, η ;
Principal components of neuronal spikes, ;
1. Initialize synaptic weight and learning rate η, j = 1
2. Calculate the mean vector of the aligned spikes
3. Zero-mean transformation
4. Perform Hebbian learning on zero-mean data
5. If j= N, the algorithm stops, otherwise j = j+ 1, go to step 4
Compared with conventional PCA algorithms, GHA does not involve complicated matrix computations, such as covariance matrix calculation and eigenvalue decomposition. Also, the algorithm has the ability to filter a specified number of most significant PCs. Since most variances of aligned spikes are captured by the first few PCs, computing the leading PCs can effectively reduce a lot of computational efforts.
Although GHA eliminates computationally expensive operations, large memory resources are still required in the training procedure. Large size hardware memories consume significant hardware resources and power, which makes GHA impractical for systems with tight constraints on hardware resources and power consumption.
In this paper, a new algorithm, namely stream-based Hebbian eigenfilter, is proposed to mitigate the problem associated with the large memory required in the training procedure. Neural signals can be regarded as pseudo-stationary in considering of a short recording period and relatively stable recording condition. The stream-based algorithm exploits the pseudo-stationary characteristic of neural spikes and, thus eliminates the need for temporary storage in the Hebbian learning. In order to justify the streaming method and evaluate the performance of the stream-based eigenfilter, both clinical and synthetic spike trains were used in this study. The accuracy of spike sorting using the stream-based Hebbian eigenfilter was evaluated by comparing with conventional PCA algorithms. The improvements in memory size and power consumption were rigorously evaluated using FPGA devices. The hardware performance of our method was also compared with FPGA-based PCA. Evaluation results show that our proposed approach mitigates the expensive hardware requirement of PCA, and further enables real-time multi-channel recording systems and future BMI systems.
Stream-based Hebbian eigenfilter
Memory resources are expensive in terms of hardware design, especially for implantable or portable applications. Large size memory will consume large portions of hardware resources in hardware constrained systems. Reducing storage resources allows integrating more computing resources in a single device, and further enables parallel processing for a large number of channels at the same time. In addition, large memories contribute significant power consumption and thermal dissipation of hardware, which should be minimized for implantable or portable applications. In this section, we proposed a method, so-called stream-based Hebbian eigenfilter, to reduce the extremely large memory associated with Hebbain training by utilizing the pseudo-stationary property of neuronal spikes.
Recorded neural signals have non-stationary nature which is mainly due to the relative movements between the recording electrodes and the recorded neurons. Also, the magnitude of spike could change during excitation block or post inhibitory rebound excitation or spike frequency adaptation, and the shape of the spike could change when other ion channels are recruited, such as calcium-dependent potassium channels. However, neural signals can be regarded as pseudo-stationary in considering of a short recording period and relatively stable condition, simply because the chance of disturbance is small.
During a period of time, in which pseudo-stationarity exists, the shape of a neuronal spike stays relatively fixed and can only be disturbed by various noises. This similarity in recorded neuronal signals can be utilized to reduce the temporary storage requirement. That the same operation performed on signals from different recording periods can lead to similar results due to the similarity of signals. For mean calculation, it means that mean values of spikes from different recording periods are similar under the pseudo-stationary property. Hebbian eigenfilter can use the mean vector obtained from the previous recording period as an approximate mean of current spikes when performing zero-mean transformation and Hebbian learning. Therefore, there is no need to store a certain subset of data for both mean calculation and zero-mean transformation, and the corresponding memory requirement is eliminated.
Algorithm of stream-based Hebbian Eigenfilter for spike sorting
Neuronal spikes, ;
Initial synaptic weight, ;
Learning rate, η;
Principal components of neuronal spikes, ;
1. Initialize synaptic weight and learning rate η, j = 1
2. Calculate the mean vector of n aligned spikes
a. i= 1,
b. When new spike arrives
c. If i equals to n, , and go to step 3. Otherwise i = i + 1, go to Step 2.b
3. When new spike arrives, subtract the mean vector obtained from step 2
4. Perform Hebbian x learning on
5. If j= N, the algorithm stops, otherwise j = j + 1, go to step 3
Stream-based Hebbain eigenfilter uses data sets from different recording periods for mean calculation and Hebbian learning. It is an approximate method based on the precondition of pseudo-stationarity of neuronal spikes. In order to justify the pseudo-stationarity, we evaluated the discrepancy in mean and PCs obtained by stream-based eigenfilter and conventional PCA. In order to test the performance of the eigenfilter in the spike sorting scenario, the accuracy of spike sorting using stream-based Hebbain eigenfilter was further evaluated, and compared with that using conventional PCA algorithm. In addition, both streaming and non-streaming eigenfilter were implemented on FPGAs to evaluate the memory and power consumption reduced by utilizing the stream-based method.
In order to verify the streaming method, realistic neuronal spike shapes, background noises and vicinity neuronal interference should be taken into account in the evaluation. Both clinical data  and sophisticated synthetic spikes  were utilized for the evaluation. These synthetic spike trains accurately model various background noises and neuronal spikes profile that appear at single-channel clinical recordings.
For quantitatively evaluating the performance of the Hebbian spike sorting algorithm, spike trains with known spike times and classifications should be employed. Clinical extracellular recording with realistic spike shapes and noise interferences is one option for qualitative studies. However, it is difficult to determine the precise classifications and the source of the spike from clinical measurement and these are the "ground truth" for any effective quantitative evaluation. Although these recordings can be further manually annotated by experts, it has been shown that manually clustered spikes have relative low accuracy and reliability . For these reasons, synthetic spike trains were utilized to quantify the performance of the proposed algorithm.
Computational complexity evaluation
In order to quantitatively evaluate the computational complexity, we used the number of operations and hardware memories required by an algorithm in the study. By comparing stream-based Hebbian eigenfilter with GHA and a group of traditional PCA algorithms, the computationally economical property of the proposed method was demonstrated. The operation and memory counts of stream-based Hebbian eigenfilter were obtained according to the algorithm shown in Table 2. The computational complexity of GHA was derived according to Table 1. Conventional PCA algorithms are composed by covariance matrix calculation and eigenvalue decomposition of covariance matrix. For eigenvalue decomposition, three commonly used symmetric eigenvalue decomposition methods were taken into account for our comparison, which were the orthogonal iteration , the symmetric QR algorithm  and the Jacobi method . Operation and memory counts for covariance matrix calculation and symmetric matrix decomposition algorithms were derived according to standard texts on matrix computation .
The algorithm of stream-based eigenfilter was developed under Matlab R2009b. Matlab built-in functions, princomp, was used as the conventional PCA routine. For evaluating the performance of spike sorting using stream-based Hebbian eigenfilter and PCA, NEO-based spike detection algorithm was developed using Matlab, and Matlab built-in functions, kmeans, was used for K-means clustering.
Xilinx FPGA was used for hardware implementation and evaluation. The targeting device is Xilinx Spartan6 FPGA (xc6slx75t). Xilinx System Generator was our hardware design tool, which is a schematic based design tool. Working in Matlab Simulink environment makes System Generator easy for hardware-software co-design and hardware verification. We obtained the hardware resources usage through Xilinx ISE tool. The hardware power was obtained from Xilinx Xpower tool.
Results and discussion
In this section, the computational complexity of stream-based Hebbian eigenfilter are evaluated and compared with GHA and other conventional PCA algorithms in terms of operation counts and memory consumption. Hebbian and conventional PCA algorithms are all based on matrix computations. The complexity of matrix computations is associated with the dimension of matrixes. Particularly, for spike feature extraction, it is determined by the dimension of aligned neuronal spikes. In our evaluation, we suppose the number of spikes for PCA training is 1024, each spike contains 64 samples, and the first two PCs are calculated.
Comparison on computational complexity between PCA methods and Hebbian eigenfilter
× 10 6
× 10 6
× 10 3
(bits) × 10 6
Hebbian eigenfilter (HE)
Stream-based HE (SHE)
Orthogonal iteration (OI) based PCA
QR method based PCA
Jacobi method based PCA
OI vs SHE
QR vs SHE
Jacobi vs SHE
Table 3 also lists the memory consumptions of GHA, stream-based eigenfilter and conventional PCA algorithms. In order to estimate the memory requirement, we suppose that each sample is represented by 16 bits. Because of not requiring covariance matrix and matrixes related to eigenvalue decomposition, GHA needs smaller memory than conventional PCA algorithms. But, large size memory is still needed for mean calculation and the following zero-mean transformation. Through employing stream-based processing that estimates the mean value by using the previous data, stream-based Hebbian algorithm does not require the large memory for buffering neuronal spikes for mean and zero-mean transformation. Thus, it consumes the smallest memory. Compared with GHAand PCA, around 99% memories can be reduced by the stream-based eigenfilter.
Area and performance comparison between FPGA-based Hebbi an eigenfilter and PCA
(SHE vs PCA)
Number of slice
Number of BRAM
Learning latency (μs )
Table 4 also compares the hardware performance between the FPGA-based Hebbian eigenfilter and PCA hardware . Hardware performances are varied if different technologies and devices are employed for the implementations. Especially, hardware performances using ASIC (application specific integrated circuit) and FPGAs are different for a particular design. To obtain a fair comparison, we normalized the performance of the ASIC-based PCA hardware  to FPGA equivalent and compared with our implementations. These would provide insightful quantitative evaluations between the different approaches in terms of hardware performance. But these results shouldn't be regarded as specifications of system performances.
Suppose the PCA hardware architectures have the same computing capability as the Hebbian eigenfilter, under the same clock frequency latency will be proportional to the computational complexity. Latency (or delay) results are reported in Table 4. The Hebbian eigenfilter approach has a significant advantage in delay that is 7.6 times faster than the PCA hardware. This is critical to be employed in real-time spike sorting. The Hebbian eigenfilter approach also has significant improvement in hardware resources. Hardware logic resources can be significantly reduced by 10.3 times when compared to the PCA hardware. Finally, we evaluated the power consumption. Results show that the stream-based Hebbian eigenfilter have 20.5 times improvement when compared to the PCA hardware implementations in terms of power consumption.
This paper presents a novel stream-based Hebbian eigenfilter for spike sorting. It calculates principal components of neuronal spikes based on an effective auto-associative Hebbian learning, which is computationally economical. A stream-based computing scheme is proposed to effectively reduce the memory requirements by utilizing the pseudo-stationarity of neuronal spikes. Evaluation results show that the stream-based eigenfilter is as accurate as conventional PCA methods for spike sorting. The computational complexity of the proposed method is ten times less than that of conventional PCA. By utilizing the streaming method, 92% memory resources and 67% power consumption can be saved when compared with non-streaming eigenfilter. Compared with FPGA-based PCA hardware, the proposed eigenfilter reduces logic resources and power consumption by 10.3 and 20.5 times respectively. The new method enables real-time spike sorting for multi-channels neuro-physiological experiments and can be further utilized by implantable systems for chronic diseases.
We follow a widely acceptable approach [33, 34] to convert the ASIC design into FPGA results. Particularly, FPGA implementation is 4.5 times slower than the corresponding ASIC design. In terms of area, FPGA implementation is 21 times larger than equivalent ASIC design in terms of area, and 128 logic counts in FPGAs equals to 0.82 mm2 in 90 nm CMOS technology . Also, FPGA consumes 12 times more power than the equivalent ASIC.
This work is supported by EPSRC grant EP/E044662/1, National Natural Science Foundation of China grant 61006021 and Beijing Natural Science Foundation grant 4112029. Chi-Sang Poon was supported by U.S. National Institutes of Health grants HL067966 andRR028241.
- Warren D, Fernandez E, Normann R: High-resolution two-dimensional spatial mapping of cat striate cortex using a 100-microelectode array. Neuroscience 2001, 105: 19–31. 10.1016/S0306-4522(01)00174-9View ArticleGoogle Scholar
- Maynard EM, Nordhausen CT, Normann RA: The Utah intracortical electrode array: A recording structure for potential brain-computer interfaces. Electroencephalogr Clin Neurophysiol 1997, 102(3):228–239. 10.1016/S0013-4694(96)95176-0View ArticleGoogle Scholar
- Normann RA, Maynard EM, Rousche PJ, Warren DJ: A neural interface for a cortical vision prosthes. Vision Res 1999, 39(15):2577–2587. 10.1016/S0042-6989(99)00040-1View ArticleGoogle Scholar
- Rousche PJ, Pellinen DS, Pivin DP, Williams JC, Vetter RJ, Kipke DR: Flexible polyimide-based intracortical electrode arrays with bioactive capability. IEEE Trans Biomed Eng 2001, 48(3):361–371. 10.1109/10.914800View ArticleGoogle Scholar
- Imfeld K, Neukom S, Maccione A, Bornat Y, Martinoia S, Farine P, Koudelka-Hep M, Berdondini L: Large-scale, high-resolution data acquisition system for extracellular recording of electrophysiological activity. IEEE Trans Biomed Eng 2008, 55(8):2064–2073.View ArticleGoogle Scholar
- Berdondini L, Massobrio P, Chiappalone M, Tedesco M, Imfeld K, Maccione A, Koudelka-Hep M, Martinoia S: Extracellular recordings from locally dense microelectrode arrays coupled to dissociated cortical cultures. J Neuroscience Methods 2009, 177: 386–396. 10.1016/j.jneumeth.2008.10.032View ArticleGoogle Scholar
- Frey U, Egert U, Heer F, Hafizovic S, Hierlemann A: Microelectronic system for high-resolution mapping of extracellular electric fields applied to brain slices. Biosens Bioelectron 2009, 24: 2191–2198. 10.1016/j.bios.2008.11.028View ArticleGoogle Scholar
- Hierlemann A, Frey U, Hafizovic S, Heer F: Growing cells atop microelectronic chips: Interfacing electrogenic cells in vitro with CMOS-based microelectrode arrays. Proc IEEE 2011, 99(2):252–284.View ArticleGoogle Scholar
- Blankertz B, Dornhege G, Krauledat M, Mller K, Kunzmann V, Losch F, Curio G: The Berlin brain-computer interface: EEG based communication without subject training. IEEE Trans Neural Syst Rehabil Eng 2006, 14(2):147–152. 10.1109/TNSRE.2006.875557View ArticleGoogle Scholar
- Gunduz A, Sanchez JC, Carney PR, Principe JC: Mapping broadband electrocorticographic recordings to two-dimensional hand trajectories in Humans. Neural Netw special issue on Brain-Machine Interfaces 2009, 22(9):1257–1270.Google Scholar
- Gandolfo M, Maccione A, Tedesco M, Martinoia S, Berdondini L: Tracking burst patterns in Hippocampal cultures with high-density CMOS-MEAs. J Neural Eng 2010, 7(5):056001. 10.1088/1741-2560/7/5/056001View ArticleGoogle Scholar
- Vogt A, Wrobel G, Meyer W, Knoll W, Offenhausser A: Synaptic plasticity in micro patterned neuronal networks. Biomaterials 2005, 26(15):2549–2557. 10.1016/j.biomaterials.2004.07.031View ArticleGoogle Scholar
- Puchalla J, Schneidman E, Harris R, Berry M: Redundancy in the population code of the retina. Neuron 2005, 46: 493–504. 10.1016/j.neuron.2005.03.026View ArticleGoogle Scholar
- Santhanam G, Ryu SI, Yu BM, Afshar A, Shenoy V: A high-performance brain-computer interface. Nature 2006, 442: 195–198. 10.1038/nature04968View ArticleGoogle Scholar
- Nicolelis MAL: Brain-machine interfaces to restore motor function and probe neural circuits. Nat Rev Neurosci 2003, 4: 417–422. 10.1038/nrn1105View ArticleGoogle Scholar
- Hochberg LR, Serruya MD, Friehs GM, Mukand JA, Saleh M, Caplan AH, Branner A, Chen D, Penn RD, Donoghue JP: Neuronal ensemble control of prosthetic devices by a human with tetraplegia. Nature 2006, 442: 164–171. 10.1038/nature04970View ArticleGoogle Scholar
- Linderman M, Santhanam G, Kemere C, Gilja V, O'Driscoll S, Yu BM, Afshar A, Ryu SI, Shenoy KV, Meng TH: Signal processing challenges for neural prostheses. IEEE Signal Processing Magzine 2008, 25: 18–28.View ArticleGoogle Scholar
- Lewicki M: A review of methods for spike sorting: the detection and classification of neural action potentials. Network: Comput Neural Syst 1998, 9: 53–78. 10.1088/0954-898X/9/4/001View ArticleGoogle Scholar
- Zumsteg Z, Kemere C, O'Driscoll S, Santhanam G, Ahmed R, Shenoy K, Meng T: Power feasibility of implantable digital spike sorting circuits for neural prosthetic systems. IEEE Trans Neural Syst Rehabil Eng 2005, 13: 272–279. 10.1109/TNSRE.2005.854307View ArticleGoogle Scholar
- Carmena J, Lebedev M, Crist RE, O'Doherty J, Santucci D, Dimitrov D, Patil P, Henriquez C, Nicolelis MA: Learning to control a brain-machine interface for reaching and grasping by primates. PLoS Biol 2003, 1(2):193–208.View ArticleGoogle Scholar
- Obeid I, Wolf P: Evaluation of spike-detection algorithms for a brain-machine interface application. IEEE Trans Biomed Engin 2004, 51(6):905–911. 10.1109/TBME.2004.826683View ArticleGoogle Scholar
- Kim K, Kim S: Neural spike sorting under nearly 0-dB signal-to-noise ratio using nonlinear energy operator and artificial neural-network classifier. IEEE Trans Biomed Eng 2000, 47: 1406–1411. 10.1109/10.871415View ArticleGoogle Scholar
- Plexon [http://www.plexon.com/plexon_products.html]
- Yu B, Mak T, Li X, Xia F, Yakovlev A, Sun Y, Poon CS: Real-time FPGA-based multi-channel spike sorting using Hebbian eigenfilters. IEEE Journal on Emerg and Selected Topics in Circuits and Syst 2011, 1(4):502–515.View ArticleGoogle Scholar
- Haykin SS: Neural networks and learning machines. New York: Prentice Hall; 2009.Google Scholar
- Quiroga R, Nadasdy Z, Ben-Shaul Y: Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering. Neural Comput 2004, 8: 1661–1687.View ArticleGoogle Scholar
- Wave clus [http://www2.le.ac.uk/departments/engineering/research/bioengineering/neuroengineering-lab/spike-sorting.html]
- Harris K, Henze D, Csicsvari K, Hirase H: Accuracy of tetrode spike separation as determined by simultaneous intracellular and extracellular measurements. J Neurophysiol 2000, 84: 401–414.Google Scholar
- Smith L, Mtetwa N: A tool for synthesizing spike trains with realistic interference. J Neurosci Methods 2007, 159: 170–180. 10.1016/j.jneumeth.2006.06.019View ArticleGoogle Scholar
- MacQueen J: Some methods for classification and analysis of multivariate observations. Proceedings of 5th Berkeley Symposium on Mathematical Statistics and Probability, Berkeley, University of California Press 1967, 1: 281–297.MathSciNetGoogle Scholar
- Golub G, Loan C: Matrix computation. The Johns Hopkins University Press; 1996.Google Scholar
- Chen T, Chen K, Yang Z, Cockerham K, Liu W: A biomedical multiprocessor SoC for close-loop neuroprosthetic application. IEEE International Solid-State Circuits Conference 2009, 434–435.Google Scholar
- Kuon I, Rose J: Measuring the gap between FPGAs and ASICs. ACM/SIGDA International Symposium on Field-Programmable Gate Arrays 2006, 21–30.Google Scholar
- Compton K, Hauck S: Automatic design of area-efficient configurable ASIC cores. IEEE Trans Comput 2007, 56(5):662–672.MathSciNetView ArticleGoogle Scholar
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.