Can a 66,000 Parameter Spiking Transformer Detect Seizures?

A close look at what ST-Spikformer achieved on a standard EEG benchmark, and the validation its results still need
Three in the Morning on the Monitoring Ward
The child has been wired for four days. Eighteen electrodes sit under a gauze cap, each one bleeding a thin trace onto a monitor at the nurses station, and the room is quiet except for the soft tick of recording software writing another minute to disk. At 3:14 a.m. the tracing changes. Not dramatically, not all at once, but the frontal channels begin to synchronize, the amplitude climbs, and a rhythm that was not there ten seconds ago starts to organize itself across the left hemisphere. Nobody sees it. The technologist is two rooms away, and the hours on either side of the event look, to a tired human eye, much the same.
Here is the finding at the center of this article. Researchers at the University of Da Nang have reported a 66,000 parameter spiking transformer that identified seizure windows in the CHB-MIT EEG benchmark with 90 percent sensitivity and 99 percent specificity under a subject-dependent test protocol. What makes the work interesting is not that the model is brain-inspired. It is that the design folds electrode relationships, signal timing, and attention into one very small network. What the work has not yet done is test that network on patients it has never seen, or run it on low-power neuromorphic hardware.
The gap the scene above describes explains why anybody bothers. Roughly fifty million people live with epilepsy worldwide, and about thirty percent of them do not respond to antiseizure medication, which means their care depends on long-term recordings that somebody has to read. Agreement between expert readers on those recordings approaches forty-six percent, a number that says less about the readers than about the difficulty of the material. Meanwhile the recordings keep coming, and continuous ambulatory monitoring outside the hospital multiplies the volume further.
Automation is the obvious answer, and deep learning has supplied plenty of it. Convolutional networks, recurrent networks, graph networks, and transformers have all been pointed at scalp EEG with respectable accuracy. Many of the highest performing among them, however, were evaluated on server-class hardware rather than designed around the power and memory budget of a portable device. Continuous battery-powered operation is achievable in some specialized systems, yet it stays a demanding systems-engineering problem rather than something a parameter count alone can settle.
One idea deserves to sit at the front, because it is the cleanest account of why this particular architecture matters. The notable move is not the use of spikes. Plenty of models use spikes. The notable move is using spikes to process two dimensions of EEG at once, what is happening across the electrodes and how the pattern is changing through time, then handing the merged result to an attention mechanism that weighs which parts of it carry signal. Four questions, stacked. Which channels are behaving together? How is the electrical pattern evolving? Which relationships in the combined representation matter most? And can all of that run on sparse spike events rather than dense, continuously valued activations?
A Different Kind of Arithmetic
Spiking neural networks compute differently. Rather than passing continuous activation values from layer to layer, they typically communicate through discrete spike events, in a simplified analogy to biological neurons. The workhorse unit is the leaky integrate and fire neuron, a stripped down digital model of a nerve cell. It accumulates incoming signal, gradually loses some of that accumulated charge, and communicates outward only when it crosses a threshold and emits a binary spike. Between spikes its internal state continues to leak and integrate input, but it sends no continuous activation value onward.
That outward silence is where the savings are supposed to live. On hardware designed for spiking workloads, such as Intel Loihi, IBM TrueNorth, or the Synapse Xylo chip, synaptic updates can often avoid the dense multiply-accumulate pattern that conventional networks depend on, particularly when activity stays sparse. Whether that translates into a large system-level energy saving is a separate question, and it depends on the chip, the mapping, memory traffic, spike rate, input encoding overhead, and whatever conventional operations remain in the pipeline.
That distinction belongs up front rather than in a footnote. The architecture described here was designed around the energy advantages of sparse spiking computation, but the researchers did not measure power consumption on neuromorphic silicon. Their experiments ran in PyTorch on an NVIDIA T4 GPU. What the study supports is a very compact spiking model with strong window-level detection scores. What it does not support is any specific claim about energy drawn by a deployed device.
Prior spiking designs for seizure detection have already staked out this territory. SCNet, DBSNet, and the Spiking Conformer all report competitive accuracy at a fraction of the theoretical compute cost. Even so, a gap remained in how these architectures handle raw EEG. Convolutional front ends excel at short-range morphology, the sharp spike-and-wave shapes that define ictal activity within a single channel. Self-attention excels at long-range relationships, allowing a model to examine how different parts of the signal relate to one another across the whole window. Most designs pick one strength or bolt the two together loosely, and the quality of what attention receives depends entirely on what the convolution produced upstream.
Hien N. Cao, Thanh V. Vu, Khoa T. D. Phan, and Hanh T. M. Tran built ST-Spikformer to fold both into a single compact spiking pipeline shaped around EEG.
What the Model Actually Sees
Strip away the notation and the flow is straightforward. A four second EEG segment arrives as eighteen simultaneous electrode traces, each sampled two hundred fifty-six times per second, which comes to 1,024 numbers per channel. Across its two branches, the model converts intermediate representations into spike trains, pulls out patterns both across the channels and along the time axis, compresses the result into sixty-four compact representations, then asks an attention mechanism which relationships among those representations carry information. Exactly where each branch performs its spike encoding differs between the two paths, as the branch descriptions below spell out. At the end it produces one number, the probability that the window contains a seizure.
Architecture at a glance. Two parallel branches, one spatial and one temporal, merged by a single learned gating scalar. Four simulation time steps. Sixty-four tokens at a sixty-four dimensional embedding. One Spikformer block with four attention heads. Temporal kernel of fifteen samples. Eighteen input channels, 1,024 samples per window. Total parameter count 66,000. Trained fifty epochs with Adam at a learning rate of five times ten to the negative fourth, using PyTorch and SpikingJelly on an NVIDIA T4.
Two Branches Reading the Same Signal
The architecture splits incoming multichannel EEG into parallel paths before either one has committed to an interpretation.
The spatial branch works on the raw input first. A pointwise convolution projects across channels, followed by batch normalization, and then a depthwise convolution captures localized patterns among the ordered electrode channels supplied to it. Because spiking computation needs a temporal axis, the resulting features are replicated across four simulation time steps, normalized again, and converted into spike trains.
That output should not be read as a direct estimate of anatomical or functional brain connectivity. Scalp electrodes record volume-conducted mixtures of underlying neural activity, and the relationships the branch learns depend partly on how the channels were ordered and preprocessed before they reached it. What the branch produces is a learned statistical description of structure across the channel dimension, useful to the classifier without carrying a neuroanatomical claim.
The temporal branch operates from spiking inputs directly. A temporal convolution with a fairly wide kernel, fifteen samples across, sweeps along the length of each channel to catch morphological patterns as they evolve. A grouped spatial convolution then aggregates channel-wise information before normalization and spike encoding. What emerges here is a description of how the signal changes over time within each electrode.
Neither view alone tells the whole story, which brings the design to its most interesting component.
One Number That Balances the Two Streams
Rather than concatenating the two branches or averaging them with a fixed weight, the authors introduced a single learnable scalar passed through a sigmoid function. That scalar becomes a mixing coefficient. The fused representation is the temporal features weighted by the coefficient plus the spatial features weighted by whatever remains.
Worth being precise about what this is and is not. One global learned mixing coefficient balances the two feature streams across the entire dataset. It is not a dynamic attention weight that shifts by patient, by channel, by segment, or by seizure phase, and it appears to be fixed once training ends. So the claim is narrower than case-by-case adaptation. The network learns one dataset-level balance between cross-channel structure and within-channel dynamics rather than assuming that balance in advance, which is still a cleaner solution than a hand-set hyperparameter.
Because mixing continuous values breaks the binary discipline of a spiking network, the authors re-encode the merged features as spikes through another normalization and integrate-and-fire stage. Whether the resulting activity is sparse enough to deliver the energy behavior the design is reaching for is a property that should be measured rather than assumed.
Compressing the Signal into Tokens
Attention over 1,024 raw samples would be wasteful, so a convolution and pooling stage compresses the fused spike representation into sixty-four tokens, each carrying a sixty-four dimensional embedding. Rather than asking the attention mechanism to grind through every sample individually, the network hands it sixty-four compact representations of the four second window. Spike encoding follows the compression rather than preceding it, which keeps the token stream event-driven.
Why the Transformer Matters
A reasonable question at this stage is why any attention mechanism is needed once the convolutions have done their work.
Consider what a seizure actually is on the page. It is rarely defined by one electrode or one instant. The pattern emerges across several channels, builds, spreads, and evolves across seconds. A convolution focuses on local neighborhoods. Attention can model relationships across the tokenized window, weighing every token against every other token, which lets the network ask whether something happening early in the segment relates to something happening late in it, including patterns that reflect activity distributed across several channels at once.
Query, key, and value features are computed by convolution, normalization, and a spiking activation, so attention operates on spike-based representations rather than continuous ones. Four heads work in parallel, and the attended output rejoins the input through a residual connection. A spiking multilayer perceptron built from two pointwise convolutions with spike activations completes the block, again with a residual path around it. The readout takes a maximum across the token dimension, feeds the result through a linear layer, and averages predictions across the four simulation time steps.
Notably, the architecture uses exactly one such block, and the whole model contains only 66,000 parameters. That makes it a candidate for further profiling on edge and neuromorphic hardware. Parameter count alone settles very little about deployability, however, since real-world viability also turns on spike rate and activity, activation and state memory costs, input encoding overhead, latency, how cleanly the design maps onto a particular chip, and what fraction of the pipeline is genuinely event-driven. Related work in this area has reported large reductions in operation counts against non-spiking counterparts, which is a compute-primitive result rather than a measured power figure.
Preparing a Lopsided Dataset
Raw EEG is dirty, and the preprocessing pipeline reflects that. A notch filter strips narrowband interference from mains electricity at fifty or sixty hertz. A bandpass filter between half a hertz and fifty hertz attenuates slow baseline drift below and muscle artifact above, isolating the frequency bands where clinically meaningful brain activity lives. Recordings are resampled to two hundred fifty-six hertz and cut into overlapping four second windows across the eighteen electrodes common to every subject.
Then comes the harder problem. Seizures occupy a vanishing fraction of any long recording, so a naive classifier that always answers no would score beautifully and help nobody. The researchers generated multiple overlapping ictal windows while undersampling interictal ones, settling on a one to five ratio. Normalization statistics were computed per subject and per channel from the training portion only, then applied unchanged to the held-out test data.
The authors used focal loss with a focusing parameter of two and a class-weighting term of 0.75 to handle the remaining imbalance. The stated intent is to push the model toward hard-to-classify seizure segments and to reduce missed ictal events. Whether that weight lands practical emphasis on missed seizures rather than on false alarms depends on how the class weight is assigned in the implementation, since focal loss conventions differ on that point, so the code is the place to confirm it.
What the Evaluation Produced
Testing used the CHB-MIT Scalp EEG Database, twenty-three commonly used recording cases drawn from twenty-two pediatric subjects with intractable epilepsy, since case chb21 is a later recording from the same person as chb01. The set holds roughly nine hundred eighty-three hours of data containing one hundred ninety-eight annotated seizures. The authors describe it as twenty-three recording cases and evaluate all of them, a convention this article follows when reporting their per-case results. Seventy percent of each patient’s recordings went to training and thirty percent to testing.
Averaged across all cases, ST-Spikformer reached 96.2 percent accuracy, 90 percent sensitivity, and 99 percent specificity. Against the spiking baselines the comparison is favorable on multiple axes at once. A prior spiking network reported 93.3 percent accuracy at 80.9 thousand parameters, while a convolutional spiking model reported 94.7 percent accuracy at 9.9 thousand parameters. ST-Spikformer lands above both on accuracy while staying far below the parameter counts of the convolutional networks in the comparison, which run to 1.57 million and 9.6 million respectively.
Readers should study that table with care, however. One of the convolutional baselines reports 99 percent accuracy, higher than what ST-Spikformer achieved, though at a sensitivity of 84 percent and roughly 145 times as many parameters. The trade being offered is clear enough, but the paper’s framing of best overall performance deserves qualification, since accuracy alone does not favor the new model.
The Number That Matters More Than Accuracy
Which raises a point that shapes how any seizure detection result should be read.
Accuracy can mislead badly in this setting. The overwhelming majority of a long EEG recording contains no seizure whatsoever, so a system can post an impressive accuracy figure while quietly missing consequential events. Sensitivity, also called recall, asks the sharper question. Of the seizure segments that actually occurred, how many did the model catch? Specificity asks the complement. Of the segments containing no seizure, how many did the model correctly leave alone? A detector that alarms constantly will catch everything and become useless within a day, since nobody keeps responding to an alert that cries wolf.
ST-Spikformer detected nine of every ten labeled seizure windows on average while holding specificity at 99 percent. It also missed one in ten. And as the subject-level results show shortly, that average conceals cases where the miss rate ran three times higher.
From Windows to Seizures
One more translation step stands between these numbers and clinical interpretability.
The paper reports performance on short EEG windows, whereas clinicians care about complete seizure events, about false alerts accumulated over hours or days, and about how quickly an alarm follows onset. A model may classify most windows correctly and still be impractical if it generates too many alerts per day or misses the first clinically actionable seconds of an event. The metrics that would settle this include event-level sensitivity, meaning how many seizures were caught at least once, false alarms per hour or per twenty-four hours, detection latency measured from annotated onset, behavior at onset and offset boundaries, and worst-case rather than average patient performance.
None of those appear in this paper, which is common in window-classification work and not a flaw unique to these authors. Anybody reading window-level scores as a proxy for bedside usefulness is nonetheless making a leap the data does not license.
Where It Struggles, and Why That Matters
Subject-level results tell a more textured story than the average does. Case chb23 came in near perfect at 0.998 accuracy and 0.998 recall. Cases chb10 and chb09 both cleared 98.9 percent accuracy. At the other end, chb17 recovered only 66.2 percent of its seizure windows, chb14 only 72.1 percent, and chb20 only 73.8 percent, even though all three held specificity above 99 percent. The model was not crying wolf on those patients. It was staying silent when it should have spoken.
Qualitative plots of chb23 and chb17 make the difference legible. The successful case shows predicted seizure spans lining up cleanly with ground truth. The difficult case shows delayed and fragmented predictions clustered around seizure onset, exactly the moment when a clinical alarm carries the most value, and exactly the behavior that event-level latency metrics would have quantified.
The broader lesson deserves stating outright. The spread between patients may matter more than the average across them. A detector that performs beautifully for one person and poorly for another has a generalization problem that a single headline number will happily conceal.
A Detail Worth Watching
One inconsistency surfaces in the manuscript itself. The prose describes spiking self-attention as removing softmax normalization in order to preserve sparsity and the event-driven character of the computation. Yet the corresponding equation retains a softmax over scaled query-key products.
Technical readers will recognize why that matters, since a softmax reintroduces continuous-valued arithmetic at precisely the point the design claims to have eliminated it, which bears directly on any energy argument. Nontechnical readers can take the simpler version, that the written description and the mathematical definition of the attention mechanism appear to disagree. Anyone building on the public implementation should check the released code against the text before assuming either version.
The Test That Still Matters, an Unseen Patient
The single most consequential result in this paper is the one it does not yet contain.
This is a subject-dependent evaluation, also called intra-patient. Seventy percent of each subject’s recordings trained the model and thirty percent tested it, meaning every patient in the test set also appears in the training set. The reported scores describe performance on patients whose recordings were already represented during training, not generalization to somebody new.
A related implementation detail deserves an explicit answer. The crucial question is whether the train and test partition was defined at the recording level before overlapping windows were generated. Should windows have been created first and then assigned randomly to training or testing, near-duplicate segments could appear on both sides of the split and inflate the scores. Should the seventy thirty division have happened at the recording level beforehand, that particular risk drops sharply. The manuscript does not make the sequence explicit, and the code should.
The experiment that would settle the larger question is simple to state. Train on some patients, then test on a patient the model has never encountered. The authors name that leave-one-out protocol as their next step and correctly call it the most clinically relevant setting available to them. Even a strong result there would not close the matter, since external validation across institutions, electrode montages, age groups, and recording systems would still be needed before anyone could speak about clinical readiness.
Dataset scope compounds the point. CHB-MIT earns its benchmark status because it is public, well annotated, and widely used, which makes results comparable across research groups. It remains twenty-three pediatric patients recorded at one institution, a narrow slice of what clinical practice contains.
An Evidence Ledger
Sorting the claims into three groups keeps the boundary clean.
Supported by the experiments, a 66,000 parameter architecture built from dual spatial and temporal branches, gated fusion, sixty-four tokens, four simulation time steps, and one attention block reached 96.2 percent accuracy, 90 percent recall, and 99 percent specificity on subject-dependent CHB-MIT windows, above the spiking baselines it was compared against, and at a far smaller parameter count than the convolutional comparators.
Suggested by the design but not measured, sparse spike-driven computation and a small parameter count point toward viability at the edge, toward lower energy draw on neuromorphic processors, and toward prolonged monitoring that a conventional network could not sustain on a battery.
Untested so far, actual chip-level energy, latency, and reliability, generalization to unseen patients and to multiple sites, event-level false alarm and latency behavior, and any form of wearable, intensive care, or closed-loop clinical performance.
Where This Could Go
The paper reports no clinical deployment, no wearable operation, and no closed-loop stimulation. What follows is extrapolation from the design, offered because the combination of compact size, spike-based processing, and low parameter count points toward settings worth watching.
Ambulatory monitoring stands first in line. A behind-the-ear or headband recorder running this class of model could timestamp candidate events continuously at home over weeks, supplementing seizure diaries and clinician review rather than replacing them, since patients fill those diaries in from memory and often fill them in wrong. Neurologists adjusting medication could then potentially work from objectively logged candidate events rather than recalled ones, subject to validation and expert review.
Intensive care units offer a second setting. Nonconvulsive status epilepticus in sedated or comatose patients produces no visible motor signs and can only be caught on EEG, so a monitor that flags suspicious windows could help prioritize EEG review and potentially shorten time to recognition.
Closed-loop neurostimulation represents a third and more demanding target. Responsive stimulation devices already implanted in drug-resistant patients must detect clinically relevant patterns reliably and operate within strict latency and power constraints, on a budget measured in microwatts. Spike-based detection running on neuromorphic silicon could potentially fit that envelope, assuming the expected energy advantages hold up under real hardware measurement. Worth stating plainly, a four second window classifier does not map automatically onto responsive neurostimulation, which additionally requires very low false-positive rates, patient-specific calibration, robust artifact handling, safety validation, and a full detection-to-stimulation pipeline.
Presurgical evaluation benefits as well, since consistent automated marking across hundreds of hours would give epileptologists a cleaner starting map when localizing the zone they intend to resect. And in regions where trained EEG readers are scarce, a potentially lower-cost system with onboard detection could eventually broaden access, provided accuracy, usability, regulatory approval, and cost all hold up in practice.
What This Study Actually Shows
ST-Spikformer is not yet a wearable seizure detector, and its reported results do not establish that it will generalize to a new patient, produce acceptable alarm rates over days of monitoring, or draw little power on neuromorphic hardware. What the study does show is narrower and useful. A small spiking model can combine local EEG structure, temporal evolution, and token-level attention while posting competitive window-level performance on a standard subject-dependent benchmark, and one learned scalar can set the balance between two feature streams rather than an engineer setting it by hand.
The next decisive tests are now clear enough. A recording-level split audit comes first, followed by event-level false alarm and latency metrics, validation on unseen patients and on independent datasets, and measured energy, latency, and reliability on target hardware. The authors released their implementation publicly and named two of those tests themselves. The groundwork now exists for somebody to run the rest.
Reference
Cao, H. N., Vu, T. V., Phan, K. T. D., and Tran, H. T. M. (2026). Spatio-Temporal Spiking Transformer for Epileptic Seizure Detection on EEG Signals. In Proceedings of the 2026 11th International Conference on Applying New Technology in Green Buildings (ATiGB), Danang, Vietnam, July 10 to 11, 2026, pp. 1854 to 1859. IEEE. DOI 10.1109/ATIGB70203.2026.11628149. Implementation available at https://github.com/ngochien108/ST-Spikformer
