# Unsupervised sparse coding-based spiking neural network for real-time spike sorting

Alexis Mélot, Sean U N Wood, Yannick Coffinier, Pierre Yger, Fabien Alibart

► To cite this version:

Alexis Mélot, Sean U N Wood, Yannick Coffinier, Pierre Yger, Fabien Alibart. Unsupervised sparse coding-based spiking neural network for real-time spike sorting. Neuromorphic Computing and Engineering, 2025, 5 (3), pp.034015. 10.1088/2634-4386/ae006b hal-05534780

HAL Id: hal-05534780

https://hal.science/hal-05534780v1

Submitted on 3 Mar 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

Original content from
this work may be used
under the terms of the
Creative Commons
Attribution 4.0 licence.

Any further distribution
of this work must
maintain attribution to
the author(s) and the title
of the work, journal
citation and DOI.

<figure><img src="image_3.png" /></figure>

# Unsupervised sparse coding-based spiking neural network for real-time spike sorting

Alexis Mélot<fnref n="1" />,<fnref n="2" />,* Ⓓ, Sean U N Wood<fnref n="2" />,*, Ⓓ, Yannick Coffinier<fnref n="1" /> Ⓓ, Pierre Yger<fnref n="3" /> Ⓓ and Fabien Alibart<fnref n="1" />,<fnref n="4" /> Ⓓ

E-mail: alexis.melot.etu@univ-lille.fr and sean.wood@usherbrooke.ca

**Keywords:** spiking neural network, sparse coding, spike sorting, unsupervised learning, neuromorphic computing

Supplementary material for this article is available [online](#)

## Abstract

Spike sorting is a crucial step in decoding multichannel extracellular neural signals, enabling the identification of individual neuronal activity. A key challenge in brain–machine interfaces is achieving real-time, low-power spike sorting at the edge while keeping high neural decoding performance. This study introduces the neuromorphic sparse sorter (NSS), a compact two-layer spiking neural network optimized for efficient spike sorting. NSS leverages the locally competitive algorithm for sparse coding to extract relevant features from noisy events with reduced computational demands. NSS learns to sort detected spike waveforms in an online fashion and operates entirely unsupervised. To exploit multi-bit spike coding capabilities of neuromorphic platforms like Intel’s Loihi 2, a custom neuron model was implemented, enabling flexible power-performance trade-offs via adjustable spike bit-widths. Evaluations on simulated and real-world tetrode signals with biological drift showed NSS outperformed established pipelines such as WaveClus3 and PCA + KMeans. With 2-bit graded spikes, NSS on Loihi 2 outperformed NSS implemented with leaky integrate-and-fire neuron and achieved an $F_1$-score of 77% (+10% improvement) while consuming 8.6 mW (+1.65 mW) when tested on a drifting recording, with a computational processing time of 0.25 ms (+60 µs) per inference.

## 1. Introduction

Brain–machine interfaces (BMIs) are critical in bridging communication between neural populations and computational systems, and spike sorting algorithms play a central role in decoding neural activity [1]. By detecting and classifying action potentials (spikes) from recorded neural signals, these algorithms enable the identification of single-neuron (or single-unit) activity, making them indispensable for advancing BMIs and understanding neural circuits [2, 3]. The development of these algorithms follows recent innovations in electrophysiology, particularly high-density microelectrode arrays that have an increased number and density of electrodes, allowing for more detailed neuronal activity recordings [4, 5]. With typical sampling rates between 10 and 30 kHz per electrode, such recording devices generate large volumes of data to process. Although some spike sorting software offers good performance with real-time processing delays even with high electrode numbers [6–9], these solutions depend on parallel hardware acceleration using traditional power-intensive processors (CPUs, GPUs). These approaches require the transmission of raw signals to external devices, which is not feasible for embedded real-time BMIs. A solution is to perform on-chip, *in situ* spike sorting to reduce bandwidth demands by transmitting only sorted action potentials. This minimizes the power required to rapidly transmit high-dimensional neuronal data, thus reducing the risk of brain tissue damage due to heat dissipation [10, 11]. However, the challenge is to design a spike sorting solution that

<footnote n="1">¹ Institut d'Électronique, Microélectronique et de Nanotechnologie, Université de Lille, Villeneuve d'Ascq, France</footnote>

<footnote n="2">² NECOTIS Research Group, Université de Sherbrooke, Sherbrooke, QC, Canada</footnote>

<footnote n="3">³ Lille Neuroscience & Cognition, Université de Lille, Lille, France</footnote>

<footnote n="4">⁴ Laboratoire Nanotechnologies Nanosystemes (LN2)-IRL3463, CNRS, Université de Sherbrooke, INSA Lyon, Université Grenoble Alpes, Ecole Centrale de Lyon, Sherbrooke J1K0A5 Quebec, Canada</footnote>

<footnote>* Authors to whom any correspondence should be addressed.</footnote>
operates efficiently at the edge, balancing rapid data processing for real-time BMIs with the constraints of minimal power consumption and limited computational resources.

The spike sorting process typically consists of four stages: preprocessing, feature extraction/dimensionality reduction, clustering, and optionally, template matching. Preprocessing involves filtering, spike detection, windowing, and spike alignment to generate spatiotemporal spike waveforms (SWs). Feature extraction then reduces the data dimensionality by retaining the most relevant features from these waveforms, then in the clustering step, extracted features are grouped into clusters representing individual neurons. Noisy recording channels complicate SW differentiation, a challenge for spike sorting pipelines. Techniques such as discrete wavelets [3], continuous wavelets [12] or independent component analysis [13] have been used to enhance waveform separability. Clustering is then performed using unsupervised algorithms such as K-means [13, 14], superparamagnetic [3], Gaussian mixture models [15], density-based clustering like DBSCAN [7].

Recent progress in machine learning and deep learning has further advanced spike sorting. Graph-based unsupervised clustering methods, such as GEMsort [16], is an efficient solution to perform online real-time spike sorting, but to date, lack implementation on low-power hardware. In parallel, artificial neural networks (ANNs), particularly convolutional networks and autoencoders, have shown strong performance on large-scale recordings [17]. Autoencoders, which learn compressed latent representations of waveforms, have proven effective for feature extraction [18–20]. In terms of energy consumption, these models can be deployed on low-power edge-AI processors (e.g. edge-tensor processor units) [21] or simplified into shallow two-layer networks [22] to require less CPU computational resources, but they often require supervised training, introducing performance-energy trade-offs [21, 22].

To address the need for low-energy, unsupervised, real-time spike sorting, spiking neural networks (SNNs) offer a promising solution [23, 24]. These networks operate using sparse, spike-based communication and can be trained with bio-inspired Hebbian learning rules such as spike-timing-dependent plasticity [25], or Oja's rule [26]. Notable examples include Werner et al.'s two-layer SNN with filter banks and lateral inhibition for real-time spike sorting of single-channel recording [27] and Bernert and Yvert approach using an attention mechanism to restrict learning to spiking events in tetrode recordings, but require numerous parameters to be trained per channel which complexify potential hardware implementation [28]. More recently, the NeuSort algorithm introduced an adaptive filter bank with Hebbian learning to handle signal non-stationarities such as drifting and new neurons. Despite improved adaptability, hardware implementation remains an open issue.

SNN-based spike sorting methods are compatible with neuromorphic hardware processors. These bio-inspired processors excel in parallel, high-speed computation while consuming significantly less power than traditional computing systems based on von Neumann architectures [29, 30]. Recent advances in neuromorphic computing, such as in-memory analog architectures using memristors [31], have led to SNN-based spike sorting solutions, but remain limited to processing single-channel recordings and have sensitivity to noise [27]. To our knowledge, no spike sorting solution has been implemented on digital neuromorphic chips such as Intel's Loihi 2 [32] and SpiNNaker [33].

In previous work [34], the locally competitive algorithm (LCA) [35], a recurrent ANN with bio-inspired internal neuronal dynamics, was shown to outperform other classical feature extraction methods such as principal component analysis (PCA) [36, 37] and K-singular value decomposition (K-SVD) [6], particularly in SW with low signal-to-noise ratios (SNRs). The LCA network is a sparse code estimator, meaning that it learns to represent high-dimensional data as a linear combination of a small subset of basis vectors, promoting efficiency by ensuring that most coefficients remain zero. The sparse coding method has proven to be effective in filtering out noise, allowing key features to emerge more clearly which enhance further recognition tasks [38, 39]. Loihi 2 and SpiNNaker, support multi-bit spikes (up to 32-bits) to enhance SNNs performance [32]. Leveraging this flexibility, an LCA-based image recognition solution shown that increasing spike bit-width enhances accuracy [40]. This hardware capability provides a flexible trade-off between the performance of classical ANNs and the energy efficiency of SNNs, which is particularly relevant for designing BMIs across diverse scenarios.

This study introduces the neuromorphic sparse sorter (NSS), an SNN designed for low-power, real-time unsupervised spike sorting on neuromorphic platforms. NSS leverages a spiking version of the LCA network to solve the extraction of features and clustering of multichannel SW. Optimized for tetrode recordings in this first study, the aim of NSS is to address key aforementioned challenges in spike sorting at the edge. In the following sections, we detail our methodology, experimental results in simulations and with runs on Loihi 2 neurocores and discuss the broader implications of this approach for advancing BMIs.
## 2. Materials and methods

### 2.1. Real and simulated neural data

The spike sorting performance of the proposed pipeline was measured on a total of nine neural signals. Five of them are synthetic extracellular neural recordings generated using the *spikeinterface* Python library [8] largely used in electrophysiology to benchmark spike sorters. The others are real tetrode datasets (see table 1 for dataset summary).

*   **Synthetic datasets:** first, NSS was tested and parameterized on the synthetic datasets. Five tetrode recordings were generated. The probe design was chosen to resemble, in terms of contact size and spacing, the silicon electrode arrays used to record the real tetrode dataset described below. The simulated recordings, sampled at 10 kHz, are populated with 5 neuron templates. The neuron templates were synthetically generated using the simulator's default model. The neurons were randomly positioned in a 3D space with a maximum depth of 35µm and an area delimited by the positions of the electrode pads with a margin of 5µm. Five recordings were generated, to get a broader range of SNR, where the SNR of neuron *i* is computed as $SNR_i = A_{max,i}/\sigma_b$ where $A_{max,i}$ is the maximum amplitude across all recording channels of the mean SW related to neuron *i*. $\sigma_b$ is the standard deviation of the background noise and was set to be in the range of [8, 12] µV of added Gaussian noise. This noise could be different for each channel to further match real experimental conditions. These synthetic tetrode datasets will be referred as TS₁₋₄ and TS₀ left aside for parameterization of proposed network. The number of detected spike timings within a 3 ms range of each other, or spike overlaps, represent 11.1%, 17.1%, 20.1%, 18.5%, 18.2% for TS₀ to TS₄ respectively (table 1). Additional information related to the pairwise similarity of the bioneuron template shape is given in figure S1.

*   **Real-world datasets:** afterwards, the performance of our pipeline was benchmarked on four real recordings from the hippocampus region CA1 of anesthetized rats, recorded by Buzsaki's Laboratory [40] and made publicly available through the Collaborative Research in Computational Neuroscience platform (crcns.org/data-sets/hc/hc-1). The recordings selected comprise a 4 min-long tetrode extracellular signal along with the juxtacellular potential of one neuron. This latter signal gives the ground-truth spike timings of one neuron in the recording population to assess the performance. The signal is sampled at 10 kHz. From all the datasets available, those with a good signal were selected. Also, we ensured a broad range of SNR for the ground-truth neuron. To that extent, *d5331.01*, *d5611.04*, *d5611.05* and *d5611.06* were studied and will be referred to as TR₁₋₄ respectively. TR₁ is notable for exhibiting drift, meaning that the SWs gradually change shape, likely due to shifts in the alignment between the recording electrodes and the bioneurons.

### 2.2. Proposed neuromorphic spike sorting pipeline

#### 2.2.1. Neural signal preprocessing

The raw multichannel neural recordings undergo three key preprocessing steps: filtering, spike detection, and spike alignment. First, the signals are band-pass filtered between 300 Hz and 3 kHz using a 3rd-order Butterworth filter to eliminate local field potentials, 50–60 Hz powerline noise, and other high-frequency electrical noise. Spike detection is then performed using a classical thresholding approach, where spikes are identified at five times the median absolute deviation (MAD), a robust estimator of background noise in electrophysiological data [41]. The detection performance of this method in terms of precision and false positive rate (FP-rate) is better than the nonlinear energy operator [42] used by previous low-power spike sorting approaches [11, 43], notably NeuSort [44] (table 1 and figure S2 for more details). For each suprathreshold window indicating a spike event, only the timestamp of the largest peak across all recording channels is retained. This thresholding method is widely adopted in spike sorting due to its low computational demands [45]. Finally, a 3 ms window centered around the largest peak across channels is extracted. The resulting SW are then flattened as vectors of dimension 120 (4 channels of 30 samples each) to form the input data of NSS.

In the proposed pipeline, the term ‘spike’ can refer to different phenomena, so precise terminology is used to avoid ambiguity. A SW refers to a processed putative spike detected from the extracellular multichannel recording. A plain spike represents the firing of an artificial neuron within the NSS network. Additionally, the terms bioneuron and unit specifically refers to the neurons being analyzed, real or simulated, as distinct from the artificial neuron models in the NSS network.

#### 2.2.2. Sparse coding with the LCA

Sparse coding is inspired by the behavior of neurons in the primary visual cortex (V1) [46]. This method, when applied to an input $x \in \mathbb{R}^L$ generates a simpler representation in the form of a sparse vector $a \in \mathbb{R}^M$, where most coefficients are zeros. The signal is approximated as a linear combination $\hat{x} = Da$, where $D$ is a dictionary composed of $M$ column vectors $d_m \in \mathbb{R}^L$ also called *atoms*. Typically, $M \ge L$, and the dictionary is
<table><caption>**Table 1.** Sum up of the synthetic and real world extracellular recordings used to assess NSS spike sorting performance.</caption><thead><tr><th rowspan="2">Type</th><th rowspan="2">Name</th><th colspan="2">Characteristics</th><th colspan="4">Detection metrics</th></tr><tr><th>SNR</th><th>Spiking rate (Hz)</th><th>Total number of SW</th><th>Precision (%)</th><th>FP-rate (%)</th><th>Overlap rate (%)</th></tr></thead><tbody><tr><td rowspan="5">Synthetic</td><td>TS<sub>0</sub></td><td>4.4, 8.3, 9.3, 12.0</td><td>6.7, 6.5, 6.5, 7.2</td><td>6511</td><td>95.0</td><td>19.4</td><td>16.5</td></tr><tr><td>TS<sub>1</sub></td><td>3.2, 5.5, 6.9, 12.4, 13.1</td><td>6.5, 6.1, 6.9, 8.4, 8.8</td><td>8036</td><td>86.7</td><td>15.9</td><td>17.1</td></tr><tr><td>TS<sub>2</sub></td><td>3.2, 4.1, 6.2, 10.5, 15.4</td><td>7.5, 8.4, 7.7, 8.4, 8.6</td><td>8303</td><td>80.8</td><td>20.8</td><td>20.1</td></tr><tr><td>TS<sub>3</sub></td><td>4.9, 5.4, 6.3, 10.1, 12.0</td><td>7.0, 8.3, 8.7, 9.1, 8.8</td><td>9883</td><td>94.8</td><td>11.5</td><td>18.5</td></tr><tr><td>TS<sub>4</sub></td><td>3.5, 9.5, 10.1, 10.2, 11.5</td><td>7.1, 8.6, 9.0, 7.8, 7.0</td><td>8847</td><td>90.0</td><td>12.1</td><td>18.2</td></tr><tr><td rowspan="4">Real-world</td><td>TR<sub>1</sub><sup>a</sup></td><td>8.0</td><td>3.5</td><td>3516</td><td>99.7</td><td>—</td><td>—</td></tr><tr><td>TR<sub>2</sub><sup>b</sup></td><td>5.9</td><td>2.2</td><td>2198</td><td>99.1</td><td>—</td><td>—</td></tr><tr><td>TR<sub>2</sub></td><td>4.4</td><td>0.8</td><td>2188</td><td>99.5</td><td>—</td><td>—</td></tr><tr><td>TR<sub>3</sub></td><td>4.3</td><td>0.9</td><td>2538</td><td>94.6</td><td>—</td><td>—</td></tr></tbody></table>

then said to be overcomplete. The sparse representation **a** for a given dictionary is found by solving the least absolute shrinkage and selection operator optimization problem (equation (1)). This problem could also be referred as the basis pursuit denoising problem [41]. The sparse representation **a** for a given dictionary is computed by balancing the trade-off between reconstruction accuracy and the sparsity of the solution,

$$ \min_{\mathbf{a}} \left( 1/2 \|\mathbf{x} - \mathbf{D}\mathbf{a}\|_{2}^{2} + \lambda \|\mathbf{a}\|_{1} \right). \qquad (1) $$

The problem is solved by minimizing the residual error between the input and the sparse reconstruction in the form of the mean-squared error in (equation (1)). The second term is a cost function on the sparse vector that ensures the vector is sparse, usually the $l_1$-norm is used so the problem is convex and a unique solution can be found [47]. The factor $\lambda$ is a trade-off parameter between these two terms and is data dependent. Various sparse code solvers have been proposed [48–50]. For this work, the LCA network was selected due to the possibility to convert it to a SNN using spiking neuron models [51], while still converging to a unique and optimal sparse code solution [47].

Spiking versions of LCA have been implemented on Loihi [30] and TrueNorth [52] neuromorphic chips to efficiently compute sparse codes from natural images. In their foundational work [35], Rozell et al introduced the LCA neuron model as leaky integrators (LIs) that dynamically adjust their membrane potentials to minimize the objective function (1) w.r.t. **a**. The membrane potential of the LI neurons is governed by an ODE:

$$ \tau \frac{du}{dt} = D^T x - u - (D^T D - I) a. \qquad (2) $$

A given input sample $x \in \mathbb{R}^L$, or in our case a SW, is presented multiple times for the neurons to converge to a stable output activation, by competing to activate through recurrent lateral inhibition connections: $W_r = -(D^T D - I)$. The number of iterations needed for the network membrane and sparse coefficient to converge is data dependent and varies with the neuron leak time constant. In our case, it is set to 200 iterations during the learning phase and then reduced to 32 when the dictionary has converged. The terms of the right-hand side of (2) represent the projection of the input onto the dictionary or the input bias at each iteration, the leak of the membrane potential $u$ and the lateral inhibition originating from neurons whose membrane potential has surpassed a threshold $\lambda$: $a = T_\lambda(u)$ where $T_\lambda$ is an activation function. Several functions have been proposed for $T_\lambda$ [35], the most used is the soft-thresholding or softshrink function that corresponds to the $l_1$-norm as the sparsity cost function in (1) [41]. As demonstrated in [35], this cost function on the sparsity of the sparse coefficients noted $C(a)$ is determined by the chosen activation function with the relation: $T_\lambda(u) = u - \lambda \frac{dC(a)}{da}$.

The LCA denoising capability is closely linked to the threshold selection of the activation function in LI neurons. Higher thresholds result in fewer neuron activations, leading to sparser representations of the input. While this can leave a higher residual error, it significantly reduces energy consumption, an important consideration for hardware implementations. Conversely, lower thresholds lead to more neuron activation, capturing finer details of the input but also retaining more noise. Achieving an optimal balance between these extremes allows the input to be denoised while preserving key features [34, 53].

<footnote><sup>a</sup> TR<sub>1</sub> present a drift (figure 6).</footnote>

<footnote><sup>b</sup> Duration of all recording is 240 s except TR2 which is equal to 200 s.</footnote>
<figure><img src="image_4.png" /></figure>

### 2.2.3. Learning rule

The training process follows a two-step approach, similar to many sparse-coding solvers: first, the sparse-coding inference is performed using a fixed dictionary, and once the sparse coefficients are determined, the dictionary is updated.

Initially, the dictionary $D$ can be set using wavelet basis functions or randomly selected input samples [54, 55]. However, studies have demonstrated that dictionaries learned directly from the input signal result in more effective representations in terms of both quality and sparsity [56, 57]. Consequently, after random initialization, the dictionary is learned through an update rule derived from the gradient of (1)

$$ \Delta D = \eta (x - Da) \otimes a + E \quad (3) $$

where $\otimes$ represents the outer product between $a$ the sparse code and the residual error, $\eta$ is the learning rate. This learning rule is a direct gradient descent. The forward pass uses the quantized activation function to compute the internal dynamics during the iterations of each input, then the decoded activation is used for the learning process (equation (3)). This rule bears similarity to Hebbian learning, particularly in its causal form, where learning only occurs when a neuron spikes, reinforcing the connection between active neurons and the input that triggered their firing. This mechanism is advantageous as it aligns well with event-driven SNNs. To ensure stability and robustness in the training process an anti-Hebbian term is added to (equation (3)) in the form of a random zero-mean Gaussian noise matrix $E$ of variance equal to 0.03.

### 2.2.4. Neuromorphic sparse coding-based spike sorting

The proposed spike sorting pipeline is illustrated in figure 1. NSS (figure 1(c)) is a two-layer network where each layer corresponds to a single LCA network with recurrent connections. This architectural choice was motivated by a previous study that demonstrated the benefit of stacking multiple layers of sparse-coding solvers to learn hierarchical representations where higher layers combine dictionary elements from the previous layer to create new more global and abstract ones [58].

The first LCA, denoted as $LCA_1$, takes as input the flattened and preprocessed SW and extract its features in the form of a sparse code. At each iteration, only a subset of neurons in $LCA_1$ are active given the imposed sparsity constraint. The output of $LCA_1$ are fed directly into the second LCA ($LCA_2$). In this sense, the entire NSS behaves similarly to a conventional two-layer neural network.

The second layer serves as a clustering method. Its role is to assign the input to a class. The method used is a argmax-based labeling, where the class is defined as the index of the most active artificial neuron in $LCA_2$
<table><caption>**Table 2.** NSS hyperparameters.</caption><thead><tr><th>Parameters</th><th>Description</th><th>Value</th></tr></thead><tbody><tr><td>M<sub>1</sub>, M<sub>2</sub></td><td>Dictionary sizes/number of neurons per layer.</td><td>120, 10</td></tr><tr><td>λ, λ<sub>LIF</sub></td><td>Firing threshold.</td><td>0.03, 1.06</td></tr><tr><td>τ</td><td>Leak time constant.</td><td>2 ms</td></tr><tr><td>η</td><td>Scheduled learning rate.</td><td>0.07 → 0.01</td></tr><tr><td>Δt</td><td>Discrete time step.</td><td>0.1 ms</td></tr><tr><td>—</td><td>Scheduled number of time steps per SW.</td><td>200 → 50</td></tr></tbody></table>

at the end of the presentation steps of an SW. To minimize the memory footprint, the ‘winning’ neuron is determined on the last 10 time steps of the SW presentation, which does not affect the dynamics of NSS.

The proposed NSS network is designed to perform unsupervised online learning on small batches of SW. It is trained in a layer-by-layer fashion. A scheduled learning rate was used to ensure a continuous adaptation throughout the recording, with strong learning phase for the first 60 s of recordings and a slower learning phase afterwards (table 2).

### 2.2.5. Graded spiking neuron model

The LCA network, originally composed of LI neurons [35], replicates the continuous dynamics of biological neurons, but lacks the binary spiking output characteristic of SNNs. Spiking versions of LCA using leaky integrate-and-fire (LIF) neurons have been proposed for neuromorphic hardware, demonstrating significant power reductions [30, 59]. Motivated by the second-generation Loihi chip, which supports multi-bit spikes, an LCA-based image and video recognition solutions were developed leveraging this hardware capability. This approach enhanced performance while maintaining the temporal sparsity of SNNs and the spatial sparsity of the LCA’s sparse code [60]. It used a method to quantize the activation function of LCA derived from the temporally diffused quantizer (TDQ) [61]. Originally introduced by Voelker et al to create ‘hybrid SNNs’, the TDQ is used to quantize neuron activation into discrete steps while propagating quantization errors over time. This mechanism enables networks to leverage the high precision of ANNs during training while smoothly transitioning to spiking regimes for inference. Also, the gradient descent training method remains valid since TDQ has a derivative equal to 1, as demonstrated in [61]. Their study showed a significant performance increase for bit-width close to 4-bits. TDQ serves as a generalized N-bit stepwise quantizer, transforming a non-spiking neuron’s continuous output into discrete steps. The key mechanism of TDQ, represented as a block diagram in figure 2, involves quantizing the neuron’s activation at each time step, while propagating the resulting quantization error forward in time to minimize its impact on the network’s performance. A rectified version of the softshrink function was used for NSS to avoid negative activation and thus simplify Loihi 2 implementation. The TDQ algorithm applied the latter activation function can be reformulated as follows:

$$ \left\{ \begin{array}{l} \tilde{a}_s(t) = T_\lambda(u(t), s) = \frac{T_\lambda(u(t)) + v(t-1)}{s} \cdot s \\ v(t) = a(t) - \tilde{a}_s(t) \end{array} \right. \qquad (4) $$

The key parameter *s* determines the quantization step or ‘spike height’ of the neuron output. It is defined by the ratio of the output range of the activation function and the chosen graded spike bit-width *N*: *s* = 1/(2^N - 1). In our case, NSS outputs are bounded because SW are normalized to the unit norm to ensure stability. Also, the dictionary atoms (NSS weights) are normalized with *L*<sub>2</sub>-norm to ensure that equation (2) stays true [35], so in the end |*T*<sub>λ</sub>(*c*)| ≤ 1 is verified. The quantization error, noted *v* in equation (4), is the difference between the continuous output *a*(*t*) and its discrete representation *ã*<sub>s</sub>(*t*). As the parameter *s* decreases the neuron behaves more like its original non-spiking form, while larger values increase the temporal sparsity of spiking, allowing the neuron to spike less frequently but still preserve the same average output. Thus, the TDQ allows for a flexible trade-off between sparsity and accuracy, making it possible to interpolate between classical 32-bit activation functions in ANNs and the discrete binary outputs of spiking neurons in SNNs as displayed in figure 2. The TDQ is equivalent to the spiking integrate-and-fire neuron model for *s* ≤ 1 without a refractory period when applied to the ReLU activation [61]. The rectified softshrink function is a ReLU-like function with the only difference that the threshold λ ∈ ]0, 1], preventing neurons with low membrane voltages from firing, thus acting as the sparsity coefficient. In the rest of the article, if a specific value of *N* is used to run NSS, then it will be noted NSS-*N*bit.
<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /><figcaption>**Figure 2.** The TDQ algorithm applied on the LCA activation function. (a) Block diagram of the TDQ algorithm applied to the rectified softshrink activation function used for LCA neuron. (b) Examples of the impact of varying *N* when *x* from (a) is a sinus. (c) Sparse reconstruction from the output of the first LCA layer (LCA₁) of NSS from a detected SW when varying the bit-width of the graded spikes. LCA₁ is trained with *N* = 1,2,4 or 8.</figcaption></figure>

## 2.3. Experimental setups

### 2.3.1. Hyper-parameter optimization

The dictionary in the LCA network can either be fixed, using predefined basis functions or it can be learned directly from the input data. Studies have shown that learning the dictionary and optimizing LCA hyper-parameters from the input signal yields more effective representations in terms of both reconstruction quality and sparsity [34, 56, 57].

To ensure a consistent evaluation and avoid overfitting on the real-world dataset where the availability of ground-truth spike timing is limited, the hyper-parameters of NSS were optimized using an evolutionary genetic algorithm on a dedicated dataset TS₀ and then fixed for the other datasets (see figure S4 for a complementary sensitivity analysis). The optimization algorithm used was the Tree-structured Parzen estimator selected by default by the optuna Python library, with its default search parameters.

Table 2 summarizes the hyperparameters of NSS used in this study. The dictionary size, beyond a certain point, has little impact on the sorting performance. In our previous work [34], we demonstrated that increasing the dictionary size to ten times overcomplete (M = 10 × L) yields a performance gain of less than 0.1% in the F₁-score compared to M = L. Since a larger dictionary mainly increases processing time and energy consumption, a one-time overcomplete dictionary was chosen for LCA₁, while a dictionary with 10 atoms was used for LCA₂. The output layer (or dictionary) was chosen larger than the number of bioneurons to demonstrate that NSS performs well without prior knowledge of the recorded biological network. Figure S3 evaluates the impact of the dictionary size of LCA₂ on NSS performance and compares it with the LCA₁ + KMeans pipeline. The comparison highlights a key advantage of LCA₂ over KMeans as a clustering method: LCA₂ does not require prior knowledge for parameterization.

Once optimized, NSS is a rather small network with 130 neurons, and L · M₁ + M₁ · M₂ + M₁² + M₂² = 30100 synapses from which there are L · M₁ + M₁ · M₂ = 15600 learnable parameters, naming the forward weights. To estimate scalability, let us consider a hypothetical 64-channel recording with an input size L = 1920 and M₁ = L. In this case, the total number of synapses grows to ~7.6 million, which still fits within the capacity of a single Loihi 2 chip.
<figure><img src="image_8.png" /><figcaption>Figure 3. Examples of spike sorting using the NSS model on a simulated (TS) and a real tetrode (TR). (a) Sorting result on TS1 after NSS training has converged (after 60 s of recording). Displayed for a 5 s snapshot of the recording. Top: tetrode recording traces. Middle: ground-truth raster of simulated bioneuron spiking events. Bottom: inferred raster plot constructed by combining NSS sorted spike labels with detected spike timings from the thresholding phase. (b) Same as (a) for the real tetrode recording TR1.</figcaption></figure>

### 2.3.2. Comparison with other sorters

NSS was compared to two widely used spike sorting methods, PCA + KMeans (PCAKM) [62] and WaveClus3 [63], which serve as lightweight baseline methods in the literature. The methodologies were applied as follows:

* PCA + KMeans: the first three principal components per channel were retained to reduce the dimensionality of SW. KMeans clustering was then applied, with $K = 5$ for simulated datasets and $K = 3$ for real datasets, in alignment with the number of sorted classes produced by NSS and prior studies using HC-1 datasets [18, 44]. SW from the first 60 s of recordings were used to train the PCA and initialize the KMeans centroids, while the remainder was used for evaluation.

* WaveClus3: a Python implementation of WaveClus3 was used with default parameters. The algorithm automatically optimized its temperature within the preset range.

Unlike NSS, both PCAKM and WaveClus3 operate in an offline fashion, requiring multiple iterations over the entire dataset of SW. In contrast, NSS processes data online, aligning with real-time spike sorting requirements. To further contextualize the performance of NSS within the landscape of existing spike sorters, we compared it against Tridesclous<fnref n="5" />, Spyking-Circus [7] and Kilosort [6], using their default parameter settings.

### 2.3.3. Evaluation criteria

The evaluation of the performance of our neuromorphic spike sorting algorithm starts by matching each ground truth neuron to NSS inferred units with the highest agreement score.

The agreement score between each pair of ground truth and inferred units is calculated as the ratio of overlapping spikes in both rasters, considering a tolerance window of 1 ms, to the total number of spikes in both spike trains. An illustration of the ground truth and inferred rasters is given in figure 3. Each ground truth neuron is then matched to the inferred unit that achieves the highest agreement score.

To assess sorting accuracy, we use the $F_1$-score, a metric that balances precision and recall, offering a comprehensive measure of classification performance. Widely used in the spike sorting literature [28, 44], the $F_1$-score is calculated for each matched pair using the following formula:

$$F_1 = \frac{2 * TP}{(2 * TP + FN + FP)} \qquad (5)$$

<footnote n="5">⁵ https://github.com/tridesclous/tridesclous.</footnote>
where TP, FN, and FP stand for true positives, false negatives, and false positives, respectively. For synthetic datasets, where the ground truth spike timings for all neurons are known, an $F_1$-score is computed for each neuron. In the real tetrode datasets, where only the spike timings of a single ground truth neuron are available, we calculate the $F_1$-score for this specific neuron only.

### 2.3.4. Neuromorphic implementation

The tests with a neuromorphic chip were performed using Intel Loihi 2 chips. These recent hardware versions allow graded spikes, which motivated the choice of the TDQ algorithm. First, NSS was trained offline on a CPU with $N = 8$ on the first 60 s of $TS_1$ and $TR_1$. Then the frozen weights, time constant, and input SW detected after 60 s for validation were converted to match the chip's fixed-point (32-bit integers) representation requirements. The energy and power consumption, were measured on the board ncl-ext-og-05 and partition *Oheogulch*. The software version used to program the chip was *Lava 0.9.0*.

The implementation of NSS on Loihi 2 required the programmation of a custom micro-programmed neuron model. The whole network used 2 neurocores out of the 128 available per chip. The $I\O$ transfer time or off-chip communications took on average 117.5 ms to transfer a SW encoded into 32-bit graded spikes and read NSS outputs. This is a notable latency attributed to current hardware limitations expected to be corrected in future versions. All subsequent inference time measurements reflect only the neurocores computation time and exclude $I\O$ latency.

No on-chip learning was performed in this study, as the current Loihi 2 architecture does not support layerwise learning rules required by NSS. The implementation of dictionary learning with LCA using local synaptic updates remains, to our knowledge, an open research problem [64]. Addressing this challenge falls outside the scope of the current work.

To benchmark performance and power consumption, we compared NSS with TDQ algorithm (NSS-TDQ) with a version using LIF neurons (NSS-LIF) on Loihi 2. The LIF threshold ($\lambda_{LIF} = 1.06$) was optimized experimentally on the $TS_0$ dataset using the aforementioned *Python* optimization library.

## 3. Results and discussion

The performance of the NSS model was evaluated on both simulated and real tetrode recordings. Figures 3(a) and (b) illustrate examples of NSS spike sorting results over 5 s segments from a simulated ($TS_1$) and a real ($TR_1$) recording, respectively. NSS learns to sort tetrode neural signals in a fully online and unsupervised manner. Comparison of the inferred and ground-truth rasters demonstrates a strong alignment between matched spike trains (indicated by colored boxes), with minimal false negatives observed. On average, NSS requires processing approximately 2400 SW to reach stability for simulated datasets 1200 for real datasets. Given the simulated neurons' spiking rates (6–10 Hz), this equates to a convergence time of 62.5 s on average, with only a few hundreds of processed SW per bioneuron (figure 4(a)).

In the following sections, NSS sorting performances will be analyzed in depth across selected recordings, benchmarked against WaveClus3 and PCA + KMeans methods, and evaluated for hardware efficiency on the Loihi 2 neuromorphic chip.

### 3.1. Impact of quantization

The number of bits, $N$, chosen to encode the spike height in the TDQ algorithm (figure 2(b)) significantly impacts the temporal sparsity of NSS. Temporal sparsity is defined as the average proportion of time steps during which NSS neurons remain inactive. For each SW presentation, this corresponds to 20 ms (200 time steps) during the strong learning phase and 3.2 ms (32 time steps) thereafter. When $N$ is low, neurons accumulate quantization error over multiple time steps before reaching a sufficient higher spike height, thus reducing their firing rate, and thus increasing temporal sparsity (figure 2(b)) which theoretically would save energy. It is worth mentioning that this spike height mechanism differs from the all-or-nothing behavior of a standard LIF neuron, instead functioning as a multi-bit quantized approximation of NSS activation function. Higher values of $N$ not only reduce the quantization error but also improve detected SW distinguishability (figure 2(c)), which enhances performance in the second layer of NSS. This layer, responsible for classification, receives more refined and denoised approximations of the input waveform, resulting in improved spike sorting accuracy. In figure 4, the impact of varying $N$ on NSS spike sorting performance is analyzed. As expected, the overall number of spikes (regardless of height) emitted by NSS per input SW rises rapidly for $N<8$-bits, after which it plateaus (figure 4(c)). Additionally, the $F_1$-score gain relative to NSS-1bit results (noted NSS-1bit $F_{1\infty}$ in figure 4) start stabilizing at $N = 2$ or 3 for both simulated and real recordings.

This outcome suggests an optimal balance for choosing $N$ that maintains the number of spikes emitted by NSS to sort a single SW below 1000 (figure 4(b)) while benefiting from the performance gain of higher graded spike precision. Based on these findings, $N = 2$ was selected for the remainder of the study as it
<figure><img src="image_9.png" /></figure>

captures this balance of energy savings, temporal sparsity, and classification performance gains. See supplementary figure S5 for the detailed impact of *N* on NSS sparsity.

## 3.2. Performance comparison

The performance of our proposed sorting pipeline on simulated and real tetrode recordings is presented in figure 5. In terms of $F_1$-score, NSS consistently outperforms both PCA + KMeans and WaveClus3 across most SNRs observed in these simulated datasets (figure 5 circles). NSS effectively handles varying noise levels and signal quality, benefiting from the demonstrated denoising ability of LCA [19, 41, 53]. On real datasets, NSS again shows competitive performance (figure 5 triangles). In terms of robustness to drift NSS outperforms PCA + KMeans but WaveClus3 is better, and we notice that on average NSS shows more robustness towards high overlaps rates.

The figure 6 illustrates the drift of $TR_1$, with detected spikes from the ground-truth-labeled neuron changing shape over time. As a result all three methods exhibit a decline in $F_1$-score over time. Despite operating offline, WaveClus3 showed a decline of performance over time. However, NSS, which learns in an unsupervised online fashion unlike the other selected methods only slightly underperforms in $F_1$-score over the entire dataset compared to WaveClus3. Addressing drift correction is left for future work.

Apart from drift adaptation, long-term spike sorting solutions also face challenges due to heterogeneous firing rates, as some bioneurons may exhibit intermittent activity. This effect is observed in the $TR_1$ recording trace (figure 6(a)) where the ground truth bioneuron shows silent period during the strong learning phase of NSS (<60 s) and after. This did not have a detrimental effect on the performance of NSS at all, it still stabilized after it has processed enough SW per bioneuron. The impact of newly firing bioneuron after network convergence has not been observed in real datasets or examined in simulations. This phenomenon is known to be a challenge for sparse code solvers because it requires an increase of dictionary size and thus more computations [65], this will be a focus of future work. Despite this limitation, NSS demonstrates competitive performance in controlled settings. However, its accuracy remains lower compared to more resource-intensive spike sorting methods such as Tridesclous, Spyking-Circus [7] and Kilosort [6] (table 3). These algorithms benefit from more computationally complex pipelines, with steps dedicated to handle overlapping spikes [7] and drift [6].
<figure><img src="image_10.png" /><figcaption>**Figure 5.** Benchmarking NSS sorting performance against WaveClus3 and PCA + KMeans on simulated and real tetrode datasets. The results are averaged over 20 trials with different random weight initializations. The first 60 s of the recordings are used for training the methods. The pairwise F₁-score comparison of the three sorting pipelines are plotted. Each colored dot represents the sorting F₁-score for a bioneuron, either simulated (circle) or real (triangle), with color indicating its associated SNR computed on the extracellular recording.</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>**Figure 6.** Robustness to drift on real dataset of NSS-2bit (CPU experiments). (a) Extracellular recording trace for channel 1 of TR₁. There is a ground truth SW amplitude attenuation due to drift in TR₁. Spikes are highlighted by packets of 100 SW. (b) Average waveform over 100 SW. (c) F₁-score comparison of the three methods on TR₁. Average F₁-score and 95% confidence interval calculated at every 200 processed spikes. Since the first 60 s are used for training PCA and initializing KMeans clusters, the results are plotted starting from that time.</figcaption></figure>
<table><caption>**Table 3.** Comparison of NSS with other spike sorting software.</caption><thead><tr><th rowspan="2">Recording name</th><th colspan="4">Spike sorter F<sub>1</sub>-score (%)</th></tr><tr><th>NSS-2bit</th><th>Kilosort4</th><th>Trideclous</th><th>Spyking-Circus</th></tr></thead><tbody><tr><td>TS<sub>1</sub></td><td>81.8</td><td>84.3</td><td>71.3</td><td>86.5</td></tr><tr><td>TS<sub>2</sub></td><td>73.4</td><td>73.5</td><td>88.6</td><td>87.2</td></tr><tr><td>TS<sub>3</sub></td><td>83.1</td><td>88.1</td><td>78.8</td><td>92.6</td></tr><tr><td>TS<sub>4</sub></td><td>74.8</td><td>76.4</td><td>81.0</td><td>81.1</td></tr><tr><td>TR<sub>1</sub></td><td>71.4</td><td>N/A</td><td>73.2<sup>a</sup></td><td>61.6<sup>a</sup></td></tr><tr><td>TR<sub>2</sub></td><td>52.7</td><td>68.1</td><td>81.0<sup>a</sup></td><td>71.4<sup>a</sup></td></tr><tr><td>TR<sub>3</sub></td><td>27.6</td><td>N/A</td><td>N/A</td><td>N/A</td></tr><tr><td>TR<sub>4</sub></td><td>25.5</td><td>N/A</td><td>N/A</td><td>N/A</td></tr></tbody></table>

The initial release of Spyking-Circus was employed to process these two datasets, whereas subsequent analyses used the most recent version of the software.

N/A: performance not available because of errors when running these sorters on these recordings.

<figure><img src="image_12.png" /><figcaption>**Figure 7.** Hardware mapping of NSS on Loihi 2. Diagram showing NSS implementation across two neurocores on a Loihi 2 chip, illustrating the system's hardware organization.</figcaption></figure>

<table><caption>**Table 4.** Power and time consumption of NSS on Loihi 2. Comparison of TDQ and LIF neurons.</caption><thead><tr><th>Neural recording</th><th>Neuron model LIF or TDQ Bit-width</th><th>Dynamic power (mW)</th><th>NSS processing time (ms)</th><th>Dynamic energy (μJ)</th><th>Energy delay product (μJ·s)</th><th>F<sub>1</sub>-score (%)</th></tr></thead><tbody><tr><td rowspan="5">TS<sub>1</sub></td><td>LIF</td><td>5.20</td><td>0.19</td><td>1.01</td><td>191.9</td><td>75.3</td></tr><tr><td>1</td><td>6.89</td><td>0.28</td><td>1.93</td><td>540.2</td><td>74.7</td></tr><tr><td>2</td><td>6.76</td><td>0.33</td><td>2.26</td><td>745.8</td><td>80.2</td></tr><tr><td>4</td><td>12.26</td><td>0.34</td><td>4.07</td><td>1383.8</td><td>80.5</td></tr><tr><td>8</td><td>15.04</td><td>0.34</td><td>4.96</td><td>1686.4</td><td>82.1</td></tr><tr><td rowspan="5">TR<sub>1</sub></td><td>LIF</td><td>7.95</td><td>0.19</td><td>1.54</td><td>292.6</td><td>80.4<sup>a</sup></td><td>59.0<sup>b</sup></td></tr><tr><td>1</td><td>7.11</td><td>0.25</td><td>1.76</td><td>440.0</td><td>83.7<sup>a</sup></td><td>66.7<sup>b</sup></td></tr><tr><td>2</td><td>8.60</td><td>0.26</td><td>2.24</td><td>582.4</td><td>87.2<sup>a</sup></td><td>71.4<sup>b</sup></td></tr><tr><td>4</td><td>12.79</td><td>0.27</td><td>3.30</td><td>891.0</td><td>87.5<sup>a</sup></td><td>74.1<sup>b</sup></td></tr><tr><td>8</td><td>18.30</td><td>0.27</td><td>4.68</td><td>1263.6</td><td>87.5<sup>a</sup></td><td>74.1<sup>b</sup></td></tr></tbody></table>

### 3.3. NSS time/energy consumption on Loihi 2

Figure 7 shows how NSS is mapped onto two neurocores of the Loihi 2 chip, with each core hosting one network layer. The first and second layers use approximately 77 KB and 6 KB of SRAM, respectively, for neuron states and 12-bit synaptic weights. The efficiency of NSS on Loihi 2 was measured on datasets TS₁ and TR₁ and compared to a version of NSS implemented with LIF neurons. The default LIF neuron model proposed on Loihi 2 chip was used. Table 4 summarizes the comparative performance of these NSS versions on Loihi 2.

In the table, the power consumed by NSS is characterized by the dynamic power, whereas the static power measured on average at 450 mW is related to the hardware basis function that cannot be controlled. In preliminary CPU-based experiments, NSS-2bits demonstrated a favorable trade-off, reducing the total spike count and significantly boosting the sorting F₁-score (see figure 4). As anticipated, increasing spikes bit-width led to a higher dynamic power consumption for NSS-TDQ measured on Loihi 2, alongside notable improvements in the sorting F₁-score. For instance, for the TR₁ dataset, NSS-2bits, compared to NSS-LIF increased the energy-delay product from 292.6 μJ·s to 582.4 μJ·s (or 1.99 mW/channel and 2.15 mW/channel respectively) while raising the F₁-score from 59.0% to 71.4% for the last 100 waveforms.

<footnote><sup>a</sup> F₁-score computed with precision and recall publicly available on Flatiron's Institute website SpikeForest.</footnote>

<footnote><sup>a</sup> Computed on 100 SW before drift from NSS outputs on Loihi 2.</footnote>

<footnote><sup>b</sup> Computed on the last 100 SW.</footnote>
The measured dynamic powers to sort 4-channel SW remain as expected above the power consumed by spike sorting ASICs processors that go as low as 0.175 uW/ch [11]. A recent study compared some spike sorting processors [18], which process multiple single-channel waveforms in parallel to optimize the workload. In our case, NSS uses 40% of the two allocated neurocores, which suggests further optimization could be done and that in the same way as the previously cited study, more recording channels could be processed in parallel. Otherwise, the inference time per SW remained below 0.4 ms, demonstrating the suitability of NSS for real-time processing of tetrode recordings. This processing time does not include the input/output communication latency to the neurocores and is measured by loading a flattened SW directly onto the neurocores at the start as an input bias to the neuron model.

These findings underscore NSS's potential, but further optimization is feasible. Currently, the online training is conducted off-chip with $N = 8$ on a small batch of 16 SW. More energy savings could be achieved by performing on-chip learning with low output spike bit-width. Future work will focus on continuous adaptation to address drift in real time across diverse scenarios (e.g. fast, non-homogeneous, irreversible) and in high-channel-count recordings, aiming to enhance both efficiency and robustness.

Overall, using graded spikes and increasing the spike bit-width of NSS to $N = 2$ showed good power-performance trade-offs for the tested recordings, but in the end the solution is conditioned by the available power at the edge. To address this, our proposed solution harnesses the flexibility in spike precision that the TDQ algorithm offers. NSS is a flexible sorting method adaptable to various BMI applications, where lower precision may be sufficient. Thus, NSS presents a versatile solution for unsupervised real-time spike sorting.

## 4. Conclusion

In this study, we introduced the NSS, a compact two-layer neural network designed for online unsupervised spike sorting on neuromorphic hardware with minimal computational cost. NSS demonstrated superior performance compared to PCA + KMeans and WaveClus3 across a wide range of SNRs in both simulated and real recordings. NSS was implemented Intel's neuromorphic chip Loihi 2 that enables graded spikes up to 32 bits of precision. With a custom-made neuron model incorporating the TDQ algorithm, NSS demonstrated flexibility on the power-performance trade-off, by changing only one parameter, namely the spike bit-width, *N*. The use of graded spikes with height encoded using 2 bits instead of LIF neuron, raised the spike sorting $F_1$-score from 59.0% to 71.4% on a real recording after 4 min of slow drift. This increase of performance came at a marginal added dynamic power consumed from 7.95 mW to 8.60 mW. These findings point that NSS is an effective, low-power solution for spike sorting on neuromorphic platforms that propose graded spikes. The simplicity of changing the spike height to meet diverse real-time neural processing needs, make it a promising candidate for scalable deployment in BMIs and similar applications.

## Data availability statement

The data that support the findings of this study are openly available at the following URL/DOI: https://github.com/NECOTIS/NSS-Neuromorphic-Sparse-Sorter.

## Acknowledgments

The project was funded by the MEIE research chair in neuromorphic computing and the ERC-IONOS Project No. 773228. The authors would like to express their gratitude to the Digital Research Alliance of Canada for providing access to computing clusters, and to the Intel Neuromorphic Research Community for granting access to Loihi 2 chips and for their valuable support.

## ORCID iDs

Alexis Mélot D 0009-0001-4305-8566

Sean U N Wood D 0000-0002-6821-1619

Yannick Coffinier D 0000-0001-7433-2102

Pierre Yger D 0000-0003-1376-5240

Fabien Alibart D 0000-0002-9591-220X
## References

[1] Quiroga R Q 2012 Concept cells: the building blocks of declarative memory functions *Nat. Rev. Neurosci.* **13** 587–97

[2] Buccelli S *et al* 2019 A neuromorphic prosthesis to restore communication in neuronal networks *iScience* **19** 402–14

[3] Quiroga R Q, Nadasy Z and Ben-Shaul Y 2004 Unsupervised spike detection and sorting with wavelets and superparamagnetic clustering *Neural Comput.* **16** 1661–87

[4] Jun J J *et al* 2017 Fully integrated silicon probes for high-density recording of neural activity *Nature* **551** 232–6

[5] Steinmetz N A *et al* 2021 Neuropixels 2.0: a miniaturized high-density probe for stable, long-term brain recordings *Science* **372** eabf4588

[6] Pachitariu M, Steinmetz N, Kadir S, Carandini M and Kenneth D H 2016 Kilosort: realtime spike-sorting for extracellular electrophysiology with hundreds of channels *bioRxiv* (https://doi.org/10.1101/061481)

[7] Yger P *et al* 2018 A spike sorting toolbox for up to thousands of electrodes validated with ground truth recordings *in vitro* and *in vivo* *elife* **7** e34518

[8] Buccino A P, Hurwitz C L, Garcia S, Magland J, Siegle J H, Hurwitz R and Hennig M H 2020 Spikeinterface, a unified framework for spike sorting *elife* **9** 1–24

[9] Chung J E *et al* 2017 A fully automated approach to spike sorting *Neuron* **95** 1381–94.e6

[10] Kim S, Tathireddy P, Normann R A and Solzbacher F 2007 Thermal impact of an active 3-D microelectrode array implanted in the brain *IEEE Trans. Neural Syst. Rehabil. Eng.* **15** 493–501

[11] Do A T, Zeinolabedin S M A, Jeon D, Sylvester D and Kim T T H 2019 An area-efficient 128-channel spike sorting processor for real-time neural recording with 0.175 µ W/Channel in 65-nm CMOS *IEEE Trans. Very Large Scale Integr. (VLSI)* *Syst.* **27** 126–37

[12] Soleymankhani A and Shalchyan V 2021 A new spike sorting algorithm based on continuous wavelet transform and investigating its effect on improving neural decoding accuracy *Neuroscience* **468** 139–48

[13] Takahashi S, Anzai Y and Sakurai Y 2003 A new approach to spike sorting for multi-neuronal activities recorded with a tetrode—how ICA can be practical *Neurosci. Res.* **46** 265–72

[14] Veerabhadrappa R, Hassan M U, Zhang J and Bhatti A 2020 Compatibility evaluation of clustering algorithms for contemporary extracellular neural spike sorting *Front. Neurosci.* **14** 34

[15] Toosi R, Akhaee M A and Dehaqani M R A 2021 An automatic spike sorting algorithm based on adaptive spike detection and a mixture of skew-t distributions *Sci. Rep.* **11** 1–18

[16] Mohammadi Z, Denman D J, Klug A and Lei T C 2024 A fully automatic multichannel neural spike sorting algorithm with spike reduction and positional feature *J. Neural Eng.* **21** 046039

[17] Buccino A P, Garcia S and Yger P 2022 Spike sorting: new trends and challenges of the era of high-density probes *Prog. Biomed. Eng.* **4** 022005

[18] Seong C, Lee W and Jeon D 2021 A multi-channel spike sorting processor with accurate clustering algorithm using convolutional autoencoder *IEEE Trans. Biomed. Circuits Syst.* **15** 1441–53

[19] Kechris C, Delitzas A, Matsoukas V and Petrantonakis P C 2021 Removing noise from extracellular neural recordings using fully convolutional denoising autoencoders *43rd Annual Int. Conf. of the IEEE Engineering in Medicine & Biology Society (EMBC)* (Mexico, 01–05 November) (https://doi.org/10.1109/EMBC46164.2021.9630585)

[20] Radmanesh M, Rezaei A, Jalili M, Hashemi A and Goudarzi M M 2022 Online spike sorting via deep contractive autoencoder *Neural Netw.* **155** 39–49

[21] Rokai J, Ulbert I and Márton G 2023 Edge computing on TPU for brain implant signal analysis *Neural Netw.* **162** 212–24

[22] Meyer L M, Samann F and Schanze T 2023 DualSort: online spike sorting with a running neural network *J. Neural Eng.* **20** 056031

[23] Zhu X, Wang Q and Lu W D 2020 Memristor networks for real-time neural activity analysis *Nat. Commun.* **11** 2439

[24] Gupta I, Serb A, Khiat A, Zeitler R, Vassanelli S and Prodromakis T 2016 Real-time encoding and compression of neuronal spikes by metal-oxide memristors *Nat. Commun.* **7** 1–9

[25] Vigneron A and Martinet J 2020 A critical survey of STDP in spiking neural networks for pattern recognition *Int. Joint Conf. on Neural Networks* (https://doi.org/10.1109/IJCNN48605.2020.9207239)

[26] Oja E 1997 The nonlinear PCA learning rule in independent component analysis *Neurocomputing* **17** 25–45

[27] Werner T, Vianello E, Bichler O, Garbin D, Cattaert D, Yvert B, De Salvo B and Perniola L 2016 Spiking neural networks based on OxRAM synapses for real-time unsupervised spike sorting *Front. Neurosci.* **10** 474

[28] Bernert M and Yvert B 2019 An attention-based spiking neural network for unsupervised spike-sorting *Int. J. Neural Syst.* **29** 1850059

[29] Davies M, Wild A, Orchard G, Sandamirskaya Y, Guerra G A F, Joshi P, Plank P and Risbud S R 2021 Advancing neuromorphic computing with Loihi: a survey of results and outlook *Proc. IEEE* **109** 911–34

[30] Davies M *et al* 2018 Loihi: a neuromorphic manycore processor with on-chip learning *IEEE Micro* **38** 82–99

[31] Shchanikov S *et al* 2021 Designing a bidirectional, adaptive neural interface incorporating machine learning capabilities and memristor-enhanced hardware *Chaos Solitons Fractals* **142** 110504

[32] Orchard G *et al* 2021 Efficient neuromorphic signal processing with Loihi 2 *IEEE Workshop on Signal Processing Systems, SiPS: Design and Implementation* pp 254–9

[33] Painkras E, Plana L A, Garside J, Temple S, Galluppi F, Patterson C, Lester D R, Brown A D and Furber S B 2013 SpiNNaker: a 1-W 18-core system-on-chip for massively-parallel neural network simulation *IEEE J. Solid-State Circuits* **48** 1943–53

[34] Mélot A, Alibart F, Yger P and Wood S U N 2023 Sparse coding-based multichannel spike sorting with the locally competitive algorithm *Dans 2023 IEEE Biomedical Circuits and Systems Conf. (Biocas)* (Toronto) (https://doi.org/10.1109/BioCAS58349.2023.10388594)

[35] Rozell C J, Johnson D H, Baraniuk R G and Olshausen B A 2008 Sparse coding via thresholding and local competition in neural circuits *Neural Comput.* **20** 2526–63

[36] Hilgen G *et al* 2017 Unsupervised spike sorting for large-scale, high-density multielectrode arrays *Cell Rep.* **18** 2521–32

[37] Rossant C *et al* 2016 Spike sorting for large, dense electrode arrays *Nat. Neurosci.* **19** 634–41

[38] Lundquist S Y, Mitchell M and Kenyon G T 2017 Sparse coding on stereo video for object detection (arxiv:1705.07144)

[39] Samkunta J, Ketthong P, Mai N T, Kamal M A S, Murakami I and Yamada K 2024 Feature extraction based on sparse coding approach for hand grasp type classification *Algorithms* **17** 240

[40] Gold C, Henze D A, Koch C and Buzsáki G 2006 On the origin of the extracellular action potential waveform: a modeling study *J. Neurophysiol.* **95** 3113–28

[41] Donoho D L 1995 De-noising by soft-thresholding *IEEE Trans. Inf. Theory* **41** 613
[42] Malik M H et al 2016 Automatic threshold optimization in nonlinear energy operator based spike detection Proc. Annual Int. Conf. IEEE Engineering in Medicine and Biology Society, EMBS vol 2016 pp 774–7

[43] Do A T et al 2014 A hybrid NEO-based spike detection algorithm for implantable brain-IC interface applications Proc.—IEEE Int. Symp. on Circuits and Systems p 23932396

[44] Hang Y, Qi Y and Pan G 2023 NeuSort: an automatic adaptive spike sorting approach with neuromorphic models J. Neural Eng. 20 056006

[45] Gagnon-Turcotte G, Camaro C O D and Gosselin B 2015 Comparison of low-power biopotential processors for on-the-fly spike detection Proc.—IEEE Int. Symp. on Circuits and Systems vol 2015 pp 802–5

[46] Olshausen B A and Field D J 1997 Sparse coding with an overcomplete basis set: a strategy employed by V1? Vis. Res. 37 3311–25

[47] Tang P T P, Lin T-H and Davies M 2017 Sparse coding by spiking neural networks: convergence theory and computational results (arXiv:1705.05475)

[48] Aharon M, Elad M and Bruckstein A 2006 K-SVD: an algorithm for designing overcomplete dictionaries for sparse representation IEEE Trans. Signal Process. 54 4311–22

[49] Lee H, Battle A, Raina R and Ng A Y 2006 Efficient sparse coding algorithms Advances in Neural Information Processing Systems (Vancouver) vol 19

[50] Gregor K and Lecun Y 2010 Learning fast approximations of sparse coding Proc. 27th Int. Conf. on Machine Learning (https://doi.org/10.5555/3104322.3104374)

[51] Hasan M M and Holleman J 2020 Spiking sparse coding algorithm with reduced inhibitory feedback weights IEEE 63rd Int. Midwest Symp. on Circuits and Systems (MWSCAS) (Springfield, MA, USA) pp 1040–3

[52] Fair K L, Mendat D R, Andreou A G, Rozell C J, Romberg J and Anderson D V 2019 Sparse coding using the locally competitive algorithm on the TrueNorth neurosynaptic system Front. Neurosci. 13 754

[53] Olshausen B A 2013 Highly overcomplete sparse coding Human Vision and Electronic Imaging p 86510S

[54] Pichevar R, Najaf-Zadeh H and Mustiere F 2010 Neural-based approach to perceptual sparse coding of audio signals Proc. Int. Joint Conf. on Neural Networks (https://doi.org/10.1109/IJCNN.2010.5596912)

[55] Gao X and Xiong H 2016 A hybrid wavelet convolution network with sparse-coding for image super-resolution 2016 IEEE Int. Conf. on Image Processing (Phoenix, AZ, USA) pp 1439–43

[56] Xiong T, Zhang J, Martinez-Rubio C, Thakur C S, Eskandar E N, Chin S P, Etienne-Cummings R and Tran T D 2018 An unsupervised compressed sensing algorithm for multi-channel neural recording and spike sorting IEEE Trans. Neural Syst. Rehabil. Eng. 26 1121–30

[57] Bahadi S, Rouat J and Plourde É 2021 Adaptive approach for sparse representations using the locally competitive algorithm for audio IEEE Int. Workshop on Machine Learning for Signal Processing (https://doi.org/10.1109/MLSP52302.2021.9596348)

[58] Chen Y, Paiton D M and Olshausen B A 2018 The sparse manifold transform (arXiv:1806.08887)

[59] Woods W and Teuscher C 2019 Fast and accurate sparse coding of visual stimuli with a simple, ultralow-energy spiking architecture IEEE Trans. Neural Netw. Learn. Syst. 30 2173–87

[60] Parpart G et al 2022 Dictionary LEARNING WITH ACCUMULATOR NEURONS (arXiv:2205.15386)

[61] Voelker A R, Rasmussen D and Eliasmith C 2020 A spike in performance: training hybrid-spiking neural networks with quantized activation functions (arXiv:2002.03553)

[62] Adamos D A, Kosmidis E K and Theophilidis G 2008 Performance evaluation of PCA-based spike sorting algorithms Comput. Methods Prog. Biomed. 91 232–44

[63] Chaure F J, Rey H G and Quiroga R Q 2018 Innovative- methodology: a novel and fully automatic spike-sorting implementation with variable number of features J. Neurophysiol. 120 1859–71

[64] Watkins Y, Thresher A, Schultz P F, Wild A, Sornborger A and Kenyon G T 2019 Unsupervised dictionary learning via a spiking locally competitive algorithm ACM Int. Conf. Proc. Series, Association for Computing Machinery (https://doi.org/10.1145/3354265.3354276)

[65] Song A H, Flores F J and Ba D 2020 Convolutional dictionary learning with grid refinement IEEE Trans. Signal Process. 68 2558–73