Manuscript Offprint
arXiv:2610.37104Hardware-Matched Spiking Neural Networks for Real-Time Purkinje Cell Spike Classification
Arooba Farhan*, Afsah Syed*, Muhammad Fahd Ibrahim Bhatti*, Muhammad Areeb Khalid Kidwai*, Muhammad Ahsan Salar Khan*, Vincenzo Romano†, Muhammad Ali Siddiqi*‡
*Electrical Engineering Department, Lahore University of Management Sciences, Pakistan
†Department of Neuroscience, Erasmus University Medical Center, Rotterdam, The Netherlands
Abstract—Distinguishing Purkinje cell (PC) simple spikes (SSs) from complex spikes (CSs) is key to studying cerebellar function. PC recordings commonly rely on wired headstages, whose tethers restrict natural movement in freely behaving animals. Untethered headstages remove this constraint, but cannot continuously transmit raw recordings within their power budgets, making on-headstage spike classification an attractive form of compression, provided it runs accurately in real time on constrained hardware. This work presents two compact spiking neural networks (SNNs) matched to their target hardware: ConvSNN, which maps to the Matrix Vector Processor (MVP) of an EFM32PG28 microcontroller, and StreamSNN, which processes one waveform value per timestep using learned time constants and fixed synaptic delays for a dedicated SKY130 circuit. Evaluated on cells unseen during training, ConvSNN achieves a CS F1 of 0.873 with 1,018 parameters and StreamSNN 0.837 with 527 parameters, both with eight-bit weights. On the microcontroller, MVP acceleration reduces ConvSNN latency by 62.3% and extends estimated battery life to 33.73 hours on a 50 mAh battery. In SKY130, StreamSNN occupies 0.173 mm² and consumes 0.46 μJ per event, with 0.2 ms of computation within an 8.3 ms end-to-end latency.
Index Terms—Spiking neural networks, Purkinje cells, spike sorting, neuromorphic computing, matrix vector processor
I. INTRODUCTION
Purkinje cells (PCs), the sole output neurons of the cerebellar cortex, are central to motor coordination and learning [1]. Their extracellular activity contains simple spikes (SSs) and complex spikes (CSs), which arise from different synaptic inputs and carry distinct information about cerebellar processing [2] (see Fig. 1B). PC recordings are commonly acquired with wired headstages, whose tethers restrict natural movement in freely behaving animals [3] (see Fig. 1A). Untethered headstages remove this constraint but face a data bottleneck: one channel sampled at 24.414 kHz with 16-bit resolution produces approximately 390 kb/s, making continuous raw-data transmission costly for a battery-powered device and requiring on-headstage compression within tight memory and power budgets.
Spike sorting, which detects spikes and assigns them to classes, offers an extreme form of such compression by reducing each event to a spike type and sample index (Fig. 1C and D). However, many existing PC spike-sorting methods [4]–[8] are computationally demanding, require resources unavailable on constrained embedded platforms, or rely on both local field potentials (LFPs) and single-unit action potentials (APs). Recent works have demonstrated SS/CS classification on a mouse headstage ASIC [9] and on a microcontroller neural accelerator [10], establishing the feasibility of embedded spike sorting. However, these works do not evaluate generalization to unseen PCs, nor do they explore spiking neural networks (SNNs), whose sparse, event-driven computation may further reduce energy.
SNN neurons keep an internal state and communicate through discrete spikes [11], so computation for inputs that do not spike can be skipped. However, SNNs must also update each neuron's state at every timestep, and fewer spikes do not always mean lower hardware cost [12]. Their efficiency therefore depends on the network design, how often neurons spike, and how the computation maps to the target hardware.
In this work, we develop two compact SNNs that classify detected PC events as SSs, CSs, or false positives (FPs), i.e., detections that do not match an annotated spike. Both share a causal detection and preprocessing pipeline but are matched to different hardware targets. ConvSNN processes the full event window at once using shared convolutional filters and spiking neurons, producing regular matrix operations suited to the Matrix Vector Processor (MVP) of the EFM32PG28 microcontroller. StreamSNN instead processes the window one sample per timestep using spiking neurons with learned time constants and fixed synaptic delays, suited to a dedicated digital circuit in the SkyWater 130 nm (SKY130) process. We evaluate both SNNs on recordings from cells unseen during training. The main contributions of this work are:
-
ConvSNN for microcontroller acceleration. An SNN whose shared convolutional filters produce regular matrix operations suited to the EFM32PG28 MVP, achieving 0.873 CS F1 with 1,018 parameters.
-
StreamSNN for dedicated hardware. An SNN that processes one sample per timestep using leaky neurons with learned time constants and fixed synaptic delays, suited to compact digital logic, achieving 0.837 CS F1 with 527 parameters.
-
Embedded implementation and evaluation. We implement ConvSNN on the EFM32PG28 and StreamSNN in SKY130 with a low-cost causal noise-estimation front-end, report latency, energy, and area, and show that both SNNs keep their accuracy with eight-bit weights.

Fig. 1. Overview of the proposed system. (A) Conventional wired setup, in which a mouse with a Mini-Amp-64 headstage records PC activity through an amplifier, filter, and ADC. (B) Extracellular PC recording containing simple spikes (SSs) and complex spikes (CSs). (C) On-device spike detection and classification. (D) Output stored as sample index and spike type instead of raw data. (E) The two SNN classifiers: ConvSNN processes the full 57-value window as a fixed input over eight timesteps, while StreamSNN processes one waveform value per timestep through LIF neurons with learned time constants, fixed synaptic delays, and adaptive-threshold (ALIF) neurons.
A. Recorded Data and Preprocessing
We use 64 manually annotated recordings from mouse PCs, each containing one cell, acquired at 24.414 kHz using a Mini-Amp-64 headstage, silicon probes, and an Intan RHD2000 amplifier [15], [16]. Noise levels vary by more than 70× across recordings, from 10 to 775 ADC units, so the same spike can appear at very different amplitudes depending on the recording. We therefore normalize each recording using only past samples x. The baseline is estimated as the median, , and the noise level as , which converts the median absolute deviation to a standard deviation for Gaussian noise [17]. Medians are used because, unlike the mean and standard deviation, they are largely unaffected by spikes. The estimates are computed over a sliding 2 s window that is updated every 0.5 s, and each sample is normalized as .
B. NEO Detection and Waveform Extraction
Candidate events are detected using the nonlinear energy operator (NEO) [9], [13], [14]. NEO computes a sample-wise energy that grows with both signal amplitude and frequency, so it emphasizes sharp, high-amplitude spikes over slower background activity. After light smoothing of the normalized trace, an event is detected when this energy exceeds a fixed multiple of its recent average, followed by a short dead time to prevent repeated detections of the same spike.
Each detection is aligned to the trough of the spike, i.e., its most negative sample. The waveform window spans 30 samples before and 197 samples after the trough ( 9.4 ms) and is reduced to 57 values by four-sample averaging (see Fig. 2). Each detection is labeled by matching it to an annotated spike within 0.5 ms. If both an SS and a CS fall within this range, the CS label is used, and detections with no matching annotation are labeled FPs.
C. SNN Architectures and Training
-
ConvSNN: ConvSNN receives the 57-value waveform as a fixed input over eight timesteps. Four convolutional filters, each seven values wide, extract local features and drive leaky integrate-and-fire (LIF) neurons, which spike when their accumulated membrane potential crosses a threshold. Over the timesteps, each neuron converts its input strength into a spike count, and since the input is fixed, the convolution is computed once and reused. The spikes are averaged over groups of four positions to give 56 features, which feed 16 hidden LIF neurons and three non-spiking outputs; the class with the highest time-averaged output is selected. Since the hidden layers receive binary spikes, their synaptic operations reduce to additions that can be skipped for inactive inputs.
-
StreamSNN: Unlike ConvSNN, StreamSNN processes the 57 waveform values sequentially, one per timestep ( 164 s). Its 16 input LIF neurons have learned decay rates, capturing waveform features at different timescales. Each input neuron receives a weighted sum of the current and previous waveform values, , where and are learned weights, so it can respond to both the level and the local slope of the waveform. Spikes from the input layer reach 16 hidden LIF neurons through fixed, randomly assigned delays of 0–30 timesteps (up to 4.9 ms), and the hidden neurons raise their firing threshold after each spike [18], [19]. Three non-spiking outputs use learned timestep-dependent weights, so the decision depends on when spikes occur as well as how many.
-
Training and Evaluation: Both networks are trained using backpropagation through time, with an arctangent surrogate gradient replacing the zero derivative of the spike threshold during the backward pass [11]. Training uses AdamW, a OneCycle learning-rate schedule peaking at , and a batch size of 512. To address class imbalance, the cross-entropy loss is weighted by , where is the number of training events in class . ConvSNN and StreamSNN are trained for 20 and 16 epochs, respectively, and the checkpoint with the highest validation macro-F1 minus validation loss is kept. Weights are then quantized to 8 bits without retraining.
Our primary evaluation (cell-held-out) uses five-fold cross-validation over recordings: each fold tests on twelve or thirteen recordings (64 in total across the five folds), validates on eight, and trains on the remaining 43–44, so every cell is tested once and never used for training or model selection in its own fold. Since prior works use random event-level splits, where events from the same cell can appear in both training and test sets [8], [10], we also report their 80/10/10 and 40/20/40 splits (random-split) for comparison only. Both models use identical splits. Per-class F1 is computed from precision and recall pooled over all detected test events, and macro-F1 is the mean of the SS, CS, and FP scores. Annotated spikes missed by the detector are excluded from these scores.
D. Hardware Implementation
-
Microcontroller: ConvSNN is deployed on the Silicon Labs EFM32PG28, which combines an Arm Cortex-M33 with an MVP that computes in FP16. Eight-bit weights are stored in flash and expanded to FP16 in RAM at start-up. Average pooling is folded into the weights of the first fully connected layer, and the convolution is expressed as a dense matrix, so each inference uses 17 MVP calls: one for the convolution, whose output is reused across timesteps, and eight for each fully connected layer. The Cortex-M33 performs the LIF updates, skipping convolution neurons that cannot reach threshold, and accumulates the output over the eight timesteps. For comparison, the same network is also run on the Cortex-M33 alone. The deployed model is trained on a random 70/20/10 event-level split.
-
ASIC: StreamSNN is implemented in fixed point, with eight-bit weights and decay factors and 16-bit neuron states with eight fractional bits. The LIF neuron circuit is based on the design of Deng et al [20]. The input filters and neuron updates require multiplications, but each delayed spike from the input layer adds only a weight to the hidden neuron's membrane potential. The fixed delays are implemented by storing each input neuron's recent spikes in a shift register. Although StreamSNN processes samples sequentially, each classification is triggered by a NEO detection, so samples preceding the trough must be buffered. A front end estimates the running median and noise scale over the last 2 s for input normalization from logarithmically spaced block histograms, which need far fewer bits than storing the samples themselves, while a ring buffer retains recent offset-corrected samples so that each event window is available once the trough is detected. Overlapping events are queued (eight entries of about 64 bits) and processed one at a time by a single network context, whose approximately 175 B of state, excluding the 687 B of model parameters, comprises mainly neuron potentials and adaptation values (96 B) and the delay shift registers (62 B).
III. RESULTS
A. SNN Classification Performance
Under cell-held-out evaluation, ConvSNN achieves a CS F1 of 0.873 over all held-out events, compared with 0.837 for StreamSNN (Table I), so StreamSNN trades 0.036 CS F1 for fewer parameters. Computed per recording, the median CS F1 is 0.918 for ConvSNN and 0.876 for StreamSNN, while the lowest scores are 0.037 and 0.046, respectively, on the same recording, which contains only 25 CS events (Fig. 3).

Fig. 2. NEO-based spike detection and waveform extraction. Each detection defines a window spanning 30 samples before and 197 samples after the trough, reduced to 57 input values by four-sample averaging. Right: Functional mapping of ConvSNN onto the EFM32PG28 Cortex-M33 and MVP.
TABLE I CLASSIFICATION F1 OF PROPOSED AND PRIOR CLASSIFIERS.
| Work | Model | Params | Size | SS | CS | FP |
|---|---|---|---|---|---|---|
| Cell-held-out | ||||||
| Ours | ConvSNN | 1,018 | 1,041 B | .958 | .873 | .911 |
| Ours | StreamSNN | 527 | 687 B | .950 | .837 | .894 |
| Random split, 40/20/40 | ||||||
| [10] | SNet-4 int8 | 2,500 | 2.5 kB | .965 | .867 | - |
| [10] | SNet-4 float | 2,500 | - | .970 | .890 | - |
| Ours | ConvSNN | 1,018 | 1,041 B | .967 | .906 | .930 |
| Ours | StreamSNN | 527 | 687 B | .956 | .876 | .907 |
| Random split, 80/10/10 | ||||||
| [8] | ResNet-18 | - | - | .975 | .892 | - |
| Ours | ConvSNN | 1,018 | 1,041 B | .967 | .910 | .930 |
| Ours | StreamSNN | 527 | 687 B | .958 | .874 | .912 |
Five-fold, pooled over all held-out recordings. Our results use eight-bit weights. Dashes indicate unreported results.

Fig. 3. Per-recording F1 scores of ConvSNN and StreamSNN across 64 PCs under cell-held-out evaluation.
Table I also compares our random-split results with published PC classifiers that use the same detector and split ratios. Under the 40/20/40 split, ConvSNN achieves a CS F1 of 0.906 (mean of three seeds), compared with 0.867 for the deployed SNet-4 [10]. Under 80/10/10, ConvSNN and StreamSNN achieve 0.910 and 0.874, compared with 0.892 for ResNet-18 [8].
Eight-bit post-training quantization has little effect under cell-held-out evaluation: CS F1 changes from 0.8737 to 0.8729 for ConvSNN and from 0.8384 to 0.8371 for StreamSNN, and float and int8 decisions agree on and of events,
TABLE II SPIKE-CLASSIFICATION PERFORMANCE WITH/WITHOUT MVP
| Freq. (MHz) | With MVP | Without MVP | ||||
|---|---|---|---|---|---|---|
| 13 | 0.83 | 5.620 | 15.440 | 0.85 | 14.557 | 40.957 |
| 16 | 0.92 | 4.566 | 13.904 | 0.95 | 11.828 | 37.194 |
| 19 | 1.01 | 3.845 | 12.854 | 1.04 | 9.9603 | 34.287 |
| 26 | 1.20 | 2.810 | 11.257 | 1.24 | 7.279 | 29.876 |
| 32 | 1.37 | 2.283 | 10.456 | 1.42 | 5.914 | 27.797 |
| 80 | 2.94 | 0.9286 | 9.009 | 3.07 | 2.465 | 24.973 |
: Avg. current consumption; : Inference time; : Energy cons. per inference.

Fig. 4. Estimated battery life for the complete head-stage using battery capacities of 12, 25, and .
respectively.
B. MCU Implementation
Real-time performance: Table II compares classification latency on the Cortex-M33 alone with MVP-assisted execution. Both configurations operate at the lowest-current clock frequency that meets the 2.5 ms inference deadline, determined by the minimum interspike interval (Fig. 1B): 32 MHz for the MVP-assisted implementation and 80 MHz for the CPU-only implementation. At equal clock (80 MHz), the MVP reduces classifier latency from 2.465 ms to 0.929 ms (62.3%), allowing the MVP-assisted version to meet the deadline at 32 MHz (2.283 ms), while NEO detection takes approximately 9 s at 80 MHz and 23 s at 32 MHz. Although spike-driven execution would need about 3,400 synaptic operations per event instead of 9,100 dense multiply-accumulates, the MVP executes the layers densely, so the speedup comes from acceleration rather than spike sparsity. Acquiring the post-trough waveform takes approximately 8.1 ms, in addition to computation time. On the device, the int8 weights occupy 16.4 kB of flash, larger than the 1,041 B model because the convolution is stored as a dense matrix, and are expanded to a 32.8 kB FP16 copy in RAM for the MVP.
Device autonomy: Battery life was estimated from current measured with the Energy Profiler, including the classification and detector workloads and the average current of the ADC and STT-RAM [21] (Fig. 4). By meeting the deadline at a lower clock, the MVP lowers the average current. For a 50 mAh battery, the estimated operating time is 17.04 hours for the CPU-only version and 33.73 hours with the MVP. This shows that MVP assisted implementation provides nearly twice the battery life of the CPU-only version.
TABLE III ASIC RESULTS IN SKY130 AT A 100 NS CLOCK PERIOD.
| Metric | Classifier | Detector | Whole chip |
|---|---|---|---|
| Area (mm2) | 0.173 | 0.047 | 1.59 |
| Power (mW) | 2.30 | 1.49 | 15.95 |
| Latency (ms) | 0.20 | 0.16 | 8.31 |
| Energy per event (μJ) | 0.46 | - | 3.20 |
| Energy per sample (nJ) | - | 61 | - |
C. ASIC Implementation
Per event, StreamSNN requires approximately 5,800 small integer multiplications for input filtering and neuron updates, while its hidden synapses perform only additions, approximately 5,300 spike-driven operations compared with 19,300 dense multiply-accumulates. On the 80/10/10 random split, the bit-exact fixed-point reference of the ASIC datapath achieves SS/CS/FP F1 of 0.959/0.872/0.911, within 0.002 of the eight-bit model in Table I, and agrees with floating-point decisions on of 160,274 test events. On the same events, the histogram-based noise estimator preserves of decisions relative to the exact median. Event windows overlap by 1.9 on average, with of events overlapping at most six windows and at most eight observed.
Table III reports post-layout results from LibreLane in SKY130 at a 100 ns clock period. Network energy per event is power multiplied by 1,995 clock cycles, and detector energy per sample uses one 24.414 kHz sample period. The latency of 8.3 ms is dominated by the 8.1 ms wait for the 197 post-trough samples. Network computation adds 0.2 ms, and the four-stage detector pipeline (0.16 ms) overlaps with this wait.
IV. CONCLUSION
This work presented two hardware-matched SNNs for real-time PC spike classification. Evaluated on cells unseen during training, ConvSNN achieves a CS F1 of 0.873 with 1,018 parameters and StreamSNN 0.837 with 527 parameters, both with eight-bit weights, and under the random-split conventions of prior work ConvSNN improves CS F1 from 0.867 to 0.906 with less than half the model storage. On the EFM32PG28, MVP acceleration reduces ConvSNN latency by and extends estimated battery life from 17.04 hours to 33.73 hours, while in SKY130, StreamSNN occupies and consumes per event, with latency dominated by waveform acquisition. These results show that SNN efficiency depends on the platform: the MVP gains from dense acceleration rather than spike sparsity, whereas the ASIC exploits binary spikes to replace hidden-layer multiplications with additions. Future work will validate the system in freely behaving animals.
ACKNOWLEDGMENT
The authors used Claude (Anthropic) for grammar and text refinement; all technical content, results, and claims were produced and verified by the authors.
REFERENCES
[1] C. I. De Zeeuw, F. E. Hoebeek, L. W. J. Bosman, M. Schonewille, L. Witter, and S. K. Koekkoek, “Spatiotemporal firing patterns in the cerebellum,” Nature Reviews Neuroscience, vol. 12, no. 6, pp. 327–344, 2011.
[2] V. Romano, A. L. Reddington, S. Cazzanelli, R. Mazza, Y. Ma, C. Strydis, M. Negrello, L. W. Bosman, and C. I. De Zeeuw, “Functional convergence of autonomic and sensorimotor processing in the lateral cerebellum,” Cell reports, vol. 32, no. 1, p. 107867, 2020.
[3] A. de Groot, B. J. van den Boom, R. M. van Genderen, J. Coppens, J. van Veldhuijzen, J. Bos, H. Hoedemaker, M. Negrello, I. Willuhn, C. I. De Zeeuw et al., “Ninscope, a versatile miniscope for multi-region circuit investigations,” Elife, vol. 9, p. e49987, 2020.
[4] A. Markanday, J. Bellet, M. E. Bellet, J. Inoue, Z. M. Hafed, and P. Thier, “Using deep neural networks to detect complex spikes of cerebellar purkinje cells,” Journal of neurophysiology, vol. 123, no. 6, pp. 2217–2234, 2020.
[5] G. Zur and M. Joshua, “Using extracellular low frequency signals to improve the spike sorting of cerebellar complex spikes,” Journal of Neuroscience Methods, vol. 328, p. 108423, 2019. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0165027019302808
[6] E. Sedaghat-Nejad, M. A. Fakharian, J. Pi, P. Hage, Y. Kojima, R. Soetedjo, S. Ohmae, J. F. Medina, and R. Shadmehr, “P-sort: an open-source software for cerebellar neurophysiology,” Journal of neurophysiology, vol. 126, no. 4, pp. 1055–1075, 2021.
[7] T. Michikawa, K. Isobe, and S. Itohara, “A spike-sorting method based on hierarchical clustering to discriminate extracellularly recorded simple spikes and complex spikes from cerebellar purkinje cells,” bioRxiv, pp. 2021–09, 2021.
[8] M. F. Owais, H. Saleem, L. P. L. Landsmeer, V. Romano, C. Strydis, and M. A. Siddiqi, “Spike sorting of purkinje cells via adaptive histogram thresholding and deep learning,” in 2026 IEEE Engineering in Medicine and Biology Conference (EMBC). IEEE, 2026.
[9] M. A. Siddiqi, D. Vrijenhoek, L. P. Landsmeer, J. van der Kleij, A. Gebregiorgis, V. Romano, R. Bishnoi, S. Hamdioui, and C. Strydis, "A lightweight architecture for real-time neuronal-spike classification," in Proceedings of the 21st ACM International Conference on Computing Frontiers, 2024, pp. 32–40.
[10] K. Fatima, V. Romano, C. Strydis, and M. A. Siddiqi, “Real-time, low-power purkinje cell spike sorting for headstage systems in freely moving mice,” in Proceedings of the 2025 IEEE Biomedical Circuits and Systems Conference (BioCAS). IEEE, 2025, pp. 274–278.
[11] J. K. Eshraghian, M. Ward, E. O. Neftci, X. Wang, G. Lenz, G. Dwivedi, M. Bennamoun, D. S. Jeong, and W. D. Lu, “Training spiking neural networks using lessons from deep learning,” Proceedings of the IEEE, vol. 111, no. 9, pp. 1016–1054, 2023.
[12] A. Bhattacharjee, R. Yin, A. Moitra, and P. Panda, “Are snns truly energy-efficient? a hardware perspective,” in 2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2024, pp. 13311–13315.
[13] S. Mukhopadhyay and G. Ray, “A new interpretation of nonlinear energy operator and its efficacy in spike detection,” IEEE Transactions on biomedical engineering, vol. 45, no. 2, pp. 180–187, 1998.
[14] Y. Yang and A. J. Mason, “Hardware efficient automatic thresholding for neo-based neural spike detection,” IEEE Transactions on Biomedical Engineering, vol. 64, no. 4, pp. 826–833, 2016.
[15] Cambridge NeuroTech, Mini-Amp-64 User Guide – Version 1.0, 2020.
[16] Intan Technologies, LLC, RHD2000 Series Digital Electrophysiology Interface Chips, 2023.
[17] R. Q. Quiroga, Z. Nadasdy, and Y. Ben-Shaul, “Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering,” Neural computation, vol. 16, no. 8, pp. 1661–1687, 2004.
[18] I. Hammouamri, I. Khalfaoui Hassani, and T. Masquelier, "Learning delays in spiking neural networks using dilated convolutions with learnable spacings," in International Conference on Learning Representations, 2024. [Online]. Available: https://proceedings.iclr.cc/paper_files/paper/2024/hash/4df1cc5a7528b7197ad8ae76ff30107a-Abstract-Conference.html
[19] B. Yin, F. Corradi, and S. M. Bohté, “Accurate and efficient time-domain classification with adaptive spiking recurrent neural networks,” Nature Machine Intelligence, vol. 3, no. 10, pp. 905–913, 2021.
[20] Q. Deng, J. Ma, H. Cai, H. You, M. Kanchwala, J. Xu, A. Amirsoleimani, J. Zariffa, and R. Genov, “Multiplierless spiking neural network for motor signal decoding in the peripheral nervous system,” in 2024 IEEE Biomedical Circuits and Systems Conference (BioCAS), 2024, pp. 1–5.
[21] Everspin Technologies. (2024) Spin-transfer Torque MRAM Technology. [Online]. Available: https://www.everspin.com/