Abstract
Interictal epileptiform spikes and high frequency oscillations (HFOs) have proven to be promising neuro biomarkers for seizure onset zone (SOZ) identification in drug-resistant epilepsy. This study presents a sparse signal processing based denoising model for epileptiform spikes. The model was trained on expert-labeled events to remove artifacts and spurious detections from the initial candidate spike pool captured using an amplitude threshold-based detector. We hypothesize that interictal spikes exhibit a sparse representation with a limited number of atoms in analytical dictionary, whereas artifacts, due to their unstructured waveshape, lack such a representation. We employed orthogonal matching pursuit (OMP) with a Gabor analytical redundant dictionary for event representation and Random Forrest (RF) classifier for event classification. The optimal model was further evaluated over the intracranial EEG (iEEG) from 29 subjects during intraoperative monitoring (IOM). Denoising method significantly improved the SOZ delineation of spatial distribution of spike (36% to 52% in IOM). Additionally, we included HFO analysis results to provide further comparison with spikes yielding an average denoised SOZ ratio of 69% in IOM. These advancements could enhance clinical decision-making by offering reliable initial assessments during a brief intraoperative recording.
Keywords: Spike Denoising, Interictal Spike Detection, High Frequency Oscillation, iEEG, Artifact Elimination, OMP, Epilepsy
I. Introduction
Epilepsy manifests as a neurological disorder distinguished by the recurrent onset of spontaneous electrochemical seizures. These seizures disrupt the normal flow of information processing, leading to temporary impairments in cognitive and sensory functions. With an estimated global prevalence of 50 million individuals, epilepsy accounts for approximately 1% of the overall disease burden worldwide [1]. While traditional antiepileptic drugs are effective in controlling seizures for most cases, a significant proportion of patients, approximately 30%, exhibit drug resistance, indicating a lack of adequate seizure control despite appropriate medication trials [1].
In such drug-resistant cases, surgical intervention involving the identification and resection of the epileptogenic zone (EZ) may be pursued. Accurate delineation of the seizure onset zone (SOZ), the brain region where seizures originate, is crucial for successful surgical outcomes [2], [3]. Recent studies have demonstrated that abnormal interictal epileptiform spikes and high-frequency oscillations (HFOs) observed in intracranial electroencephalography (iEEG) recordings can serve as promising neuro biomarkers for localizing the SOZ [4], [5], [6], [7]. In clinical terms, an interictal epileptiform spike is a distinct, sharp transient event, typically lasting between 20 and 70 ms, that stands out clearly from the surrounding background activities [8]. These spikes originate from the synchronous firing of hyperexcitable neurons, representing abnormal electrical activities and are often associated with epilepsy [9]. Additionally, HFOs observed in iEEG within the frequency range of 80 to 600Hz have emerged as highly promising clinical neuro biomarkers for epilepsy [10], [11]. These oscillations are characterized by field potentials that reflect the short transient synchronization of neuronal activity [12].
In addition to neuro biomarkers captured during epilepsy monitoring unit (EMU) recordings, studies have shown that biomarkers associated with ictogenesis are also present in intraoperative monitoring (IOM) recordings [13], [14]. However, IOM recordings are inherently more susceptible to artifacts, highlighting the critical importance of artifact elimination to ensure reliable results. In our previous work, we developed denoising algorithms for HFOs and demonstrated their significance [15]. However, the automatic removal of artifactual spurious events within the pool of spike candidates remains an unresolved challenge. Although intracranial recordings are typically less affected by myogenic or oculogyric artifacts, studies applying spike detectors to such recordings have still reported instances of false detections [16], [17]. This highlights the additional need for an artifact removal step in the analysis to achieve enhanced performance in interictal spikes detection.
This study presents a denoising model using sparse signal processing, trained on expert-labeled events to remove artifacts and spurious detections from candidate spikes pool. We showed that interictal spikes exhibit a sparse representation, utilizing a limited set of atoms from an analytical redundant dictionary, whereas spurious events lack such a structured representation. We applied orthogonal matching pursuit (OMP) to represent candidate events using a sparse set of elements from an analytical redundant dictionary. A random forest (RF) classifier then classified events as real or spurious, eliminating spurious events from the pool of candidates. Furthermore, we evaluated the performance of the model in real scenarios on 29 cases with drug-resistant epilepsy during intraoperative monitoring recordings. By improving the biomarkers performance during IOM, the distribution of these events can provide valuable real-time feedback to clinicians, potentially reducing the need for prolonged iEEG recordings and the associated costs and risks. An overview of this study is provided in Fig. 1a [18], [19].
Fig. 1.

(a) A seven-channel iEEG stream is shown in the top left. Spike detection was performed on the iEEG, followed by an AI-based denoising method applied to the candidate pool. The SOZ identification performance was evaluated in IOM scenarios before and after denoising. (b) Concept of event sparse representation using atoms from the Gabor analytical dictionary and OMP. (c) Block diagram of the denoising tool: detected events undergo sparse representation using the dictionary and OMP to assess representation quality. Features are then extracted, and a random forest classifier distinguishes real from spurious events.
II. Materials and Methods
A. Patient’s demographics and Data Acquisition
We acquired iEEG from 29 patients diagnosed with drug resistant epilepsy at Texas Children’s Hospital (TCH) and St. Luke Hospital of Baylor College of Medicine (BCM) and the University of Minnesota Medical Center. The recordings were acquired in the IOM scenarios at a sampling frequency equal to or greater than 2 kHz. The IOM data length varied from 2.02 minutes to 16.41 minutes with an average of 9.74 minutes. This study was approved by the Institutional Review Boards (IRBs) of BCM, University of Minnesota, and Mayo Clinic, ensuring that all experiments and methods were performed in accordance with relevant guidelines and regulations. Furthermore, informed consent was obtained from all participants and/or their legal guardians prior to incorporating their data into this study. Relevant medical annotations, including SOZ and surgery outcomes, were provided by the clinical team at the affiliated institutes who were blinded to the spike/HFO analyses. The SOZ is defined based on the onset of multiple seizures captured during EMU stays and annotated by the clinical team.
B. Signal Processing
1). Neuro biomarkers Detection:
An amplitude threshold-based spike detector [20] was employed to identify intial pool of epileptiform spikes. The threshold was determined based on the statistical properties of the envelope of the signal. Specifically, signals were downsampled to 200 Hz, bandpass filtered within the spike band (10–80 Hz), and notch filtered at 60 Hz to remove power line interference. The envelope was then extracted using the Hilbert transform. Spikes were detected when the envelope exceeded a threshold, which was estimated from a log-normal distribution, modeled using maximum likelihood estimation (MLE) [21]. To detect HFOs, the Liu et al. [22] amplitude-threshold-based detector was used in this study. The standard deviation (SD) of the filtered signals was computed using a 100-millisecond sliding window with 50% overlap. Next, the median of the SD was calculated over a 1-minute interval, and the amplitude threshold was defined as 5 times the median.
2). Artifact Elimination:
To eliminate artifacts and spurious events from the HFO pool, we utilized our previously established denoising method [15]. For spike candidates, the RF model was trained using a dataset of 17,122 labeled events (from 11 subjects, equally divided between spikes and noise) jointly annotated by three expert reviewers. Majority voting was employed for event labeling, and performance evaluation was done using the leave-one-subject-out cross-validtion. The model represents the events in a sparse fashion using the OMP algorithm and atoms from an analytical redundant Gabor dictionary. The OMP algorithm reconstructs the events by selecting atoms from the dictionary in a greedy fashion. The quality of representation serves as a feature to distinguish between real and spurious events that passed the initial detection. It has been shown that events with neural origins (epileptic spikes and HFOs) can be represented sparsely and efficiently using this dictionary [15]. However, a sparse solution with efficient representation cannot be achieved for events with non-neural origin.
The dictionary comprises a large number of atoms (29,000 atoms) to cover a wide range of frequencies (up to 600 Hz) and time shifts. The Gabor basis of the dictionary is defined as the product of a Gaussian function and a cosine function, which results in capturing the oscillatory nature of the neuro biomarkers. The Gabor basis is defined as:
| (1) |
The parameters of the Gabor atoms, such as time spread (σ), time shift (u), and frequency (ω), are varied based on the events’ time support and frequency content in a systematic fashion similar to our previous work [15]. Dictionary atoms were formulated as the Gabor atoms with different ω, and σ:
| (2) |
The features were extracted from the residual of the signal and the utilized atoms for representation during the OMP iteration. The residual is defined as:
| (3) |
Where is the utilized atom from the dictionary at the iteration and is the corresponding coefficient. The signal residual was computed over iterations, and the following features were extracted: I) Approximation error ( error), which is defined as the ratio of the residual signal to the event. Based on the hypothesis, the approximation error of events with neural origin using a predefined analytical dictionary will be lower than those with non-neural origin i.e., artifacts. II) Variation factor (V-Factor), which is defined as the range of residual divided by the SD of residual, characterizes the local behavior of the residual error in relation to the overall error. III) Line noise, which identifies the total number of selected atoms around 60Hz during the representation. IV) The range and SD of the raw and filtered (>80Hz) events to generalize the aforementioned features with respect to the size of initially detected events. V) The polyspike feature, that is determined by analyzing the maximum frequency of the atoms used to represent different sections of the signal. The signal was divided into three equal parts: the first, center, and last thirds. If the maximum frequency in the first or last third exceeded 75% of the maximum frequency in the center third, the event was marked as a polyspike. After feature extraction, a random forest classifier is employed for the classification of initial candidates into real and spurious, eliminating spurious events from the pool. The accuracy of the RF model was evaluated based on true positives (TP) and true negatives (TN), which were identified when predictions matched the labels for spikes and noise, respectively. False positives (FP) occurred when an artifact was misclassified as a spike, while false negatives (FN) occurred when a spike was misclassified as an artifact.
| (4) |
Events sparse representation concept and denoising block diagram are presented in Fig. 1b and c respectively.
3). IOM Evaluation:
After determining the optimal parameters, spike and HFO detection were performed on iEEG data from 29 subjects, distinct from the 11 cases used for event labeling. The performance of these neuro biomarkers was assessed separately in IOM settings. To evaluate their effectiveness in SOZ delineation, we calculated the SOZ ratio, defined as the proportion of events originating from clinically identified SOZ contacts relative to the total detected events as follows:
| (5) |
The Wilcoxon signed-rank test was utilized for statistical analysis between the initially detected and denoised events. The significance level was considered at 0.05.
III. Results
The sparse reconstruction process was performed for up to 50 iterations for the events. Fig. 2 illustrates the changes in approximation error (a) and V-Factor (b) across iterations for real spikes and spurious events. The receiver operating characteristic (ROC) curves for approximation error and V-Factor are displayed in Fig. 2a, and b, respectively. For approximation error, the maximum separation between the true positive rate (TPR) and false positive rate (FPR) in the ROC occurred at iteration 10, with an area under the curve (AUC) of 0.71. For the V-Factor, the highest AUC (0.71) was achieved at iteration 50, while the lowest (0.59) occurred at iteration 10. Fig. 2c presents the AUC values for the approximation error and V-Factor across different sparsity levels.
Fig. 2.

(a) Approximation error across OMP iterations (top) and the corresponding ROC curve (bottom). (b) V-Factor variation over iterations (left) and its ROC curve (right). (C) Area under the curve (AUC) values of the approximation error and V-Factor at different sparsity levels. (d) Accuracy of the RF model trained with different numbers of reconstruction iterations, ranging from 10 to 50. (e) Confusion matrices for RF models trained with 25 and 50 iterations, displayed in the left and right panels, respectively.
Fig. 2d presents the accuracy of the RF model trained with different numbers of reconstruction iterations, ranging from 10 (84.7%) to 50 (88.7%). Fig. 2e displays the confusion matrices for RF models trained with 25 and 50 OMP iterations, shown in the left and right panels, respectively. 25 reconstruction iterations were selected as the optimal trade-off between model performance and computational efficiency.
Fig. 3a illustrates the spatial distribution of epileptiform spikes across recording channels for a single subject (P10) in both the initial detection and post-denoising pools. Spike SOZ accuracy improved from 36% ± 17 to 52% ± 17 after denoising across Engle class I subjects. The HFO results were also provided for these recording scenarios before and after denoising to provide a better comparison between the spike and HFO performance in SOZ identification (Fig. 3b, 69% ± 21 in post-denoising HFO). A statistically significant difference was observed between the SOZ accuracy of the initial and denoised pools for both epileptiform spikes and HFOs in IOM (p = 0.0015 and 0.006) settings. The SOZ accuracy for individual subjects is presented in Fig. 3c.
Fig. 3.

(a) Spatial distribution of spikes across recording channels for a single subject in the initial (top) and denoised (bottom) pools. Clinically defined SOZ contacts are indicated by red dashed lines. (b) SOZ ratio of spikes and HFOs across all subjects showing significant differences between initial and denoised pools across Engle class I cases. (c) SOZ ratio for IOM recordings across all subjects, comparing the initial event pool (gray) and denoised pool (purple). Surgical therapy outcome in Engle class is provided for each subject in the bottom panel.
IV. Discussion
This study introduced an Artifact elimination tool utilizing sparse signal processing for epileptiform spikes, designed to identify and remove candidate events with non-neural origin. We demonstrated that the real spikes with the structure in their waveforms can have a sparse representation with a limited number of Gabor atoms, whereas artifacts, due to their unstructured waveshape, lack such a representation. We evaluated the performance of neuro biomarkers in SOZ delineation before and after artifact removal in the IOM. Notably, despite the higher susceptibility of IOM recordings to noise contamination, artifact elimination could further refine the pool of candidates. The analysis of the SOZ ratio demonstrated that eliminating artifacts significantly improved spike SOZ delineation of epileptiform spikes.
Previous studies have demonstrated that while interictal spikes exhibit higher sensitivity, HFOs possess higher specificity for delineating the SOZ [23], [24]. Our findings confirmed that denoised HFOs exhibited better SOZ delineation compared to spikes, likely attributable to the presence of baseline activity across the majority of channels in spike spatial distribution, which can potentially obscure the localization of the true SOZ. We hypothesize further improvement in spike SOZ delineation might be achieved by masking this baseline activity across channels which could be investigated in future works. These findings highlight the potential of the proposed method to enhance clinical decision-making by providing a reliable initial assessment utilizing a brief intraoperative recording.
Acknowledgments
This study was supported by the National Institutes of Health’s BRAIN Initiative under award number UH3NS117944 (NFI), grant R01NS112497 (NFI), and grant R01NS092882-08 (GAW) from the National Institute of Neurological Disorders and Stroke. B.F.B. was supported by the Sundt fellowship of the Mayo Clinic Neurosurgery Department.
References
- [1].WHO, “Epilepsy.” Accessed: Dec. 25, 2024. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/epilepsy
- [2].Vakharia VN, Duncan JS, Witt J, Elger CE, Staba R, and Engel J, “Getting the best outcomes from epilepsy surgery,” Ann Neurol, vol. 83, no. 4, pp. 676–690, Apr. 2018, doi: 10.1002/ana.25205. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [3].Ayyoubi AH et al. , “Mitigating Effects of Packet Loss in Wireless Neural Data Transfer: Exploring the Influence of Low-Cost Recovery Methods on Spikes and HFOs in iEEG,” in 2024 IEEE 67th International Midwest Symposium on Circuits and Systems (MWSCAS), IEEE, Aug. 2024, pp. 591–595. doi: 10.1109/MWSCAS60917.2024.10658804. [DOI] [Google Scholar]
- [4].Karoly PJ et al. , “Interictal spikes and epileptic seizures: their relationship and underlying rhythmicity,” Brain, vol. 139, no. 4, pp. 1066–1078, Apr. 2016, doi: 10.1093/brain/aww019. [DOI] [PubMed] [Google Scholar]
- [5].Marsh ED et al. , “Interictal EEG spikes identify the region of electrographic seizure onset in some, but not all, pediatric epilepsy patients,” Epilepsia, vol. 51, no. 4, pp. 592–601, Apr. 2010, doi: 10.1111/j.1528-1167.2009.02306.x. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [6].Worrell GA, Parish L, Cranstoun SD, Jonas R, Baltuch G, and Litt B, “High-frequency oscillations and seizure generation in neocortical epilepsy,” Brain, vol. 127, no. 7, pp. 1496–1506, Jul. 2004, doi: 10.1093/brain/awh149. [DOI] [PubMed] [Google Scholar]
- [7].Fazli Besheli B et al. , “Using high-frequency oscillations from brief intraoperative neural recordings to predict the seizure onset zone,” Communications Medicine, vol. 4, no. 1, p. 243, Nov. 2024, doi: 10.1038/s43856-024-00654-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [8].Niedermeyer Ernst and Lopes da Silva FH, Electroencephalography : basic principles, clinical applications, and related fields. Lippincott Williams & Wilkins, 2004. [Google Scholar]
- [9].Rosenow F, “Presurgical evaluation of epilepsy,” Brain, vol. 124, no. 9, pp. 1683–1700, Sep. 2001, doi: 10.1093/brain/124.9.1683. [DOI] [PubMed] [Google Scholar]
- [10].Bragin A, Engel J, Wilson CL, Fried I, and Mathern GW, “Hippocampal and Entorhinal Cortex High-Frequency Oscillations (100–500 Hz) in Human Epileptic Brain and in Kainic Acid-Treated Rats with Chronic Seizures,” Epilepsia, vol. 40, no. 2, pp. 127–137, Feb. 1999, doi: 10.1111/j.1528-1157.1999.tb02065.x. [DOI] [PubMed] [Google Scholar]
- [11].Jirsch JD, “High-frequency oscillations during human focal seizures,” Brain, vol. 129, no. 6, pp. 1593–1608, Apr. 2006, doi: 10.1093/brain/awl085. [DOI] [PubMed] [Google Scholar]
- [12].Zelmann R, Mari F, Jacobs J, Zijlmans M, Dubeau F, and Gotman J, “A comparison between detectors of high frequency oscillations,” Clinical Neurophysiology, vol. 123, no. 1, pp. 106–116, Jan. 2012, doi: 10.1016/j.clinph.2011.06.006. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [13].Fedele T et al. , “Automatic detection of high frequency oscillations during epilepsy surgery predicts seizure outcome,” Clinical Neurophysiology, vol. 127, no. 9, pp. 3066–3074, Sep. 2016, doi: 10.1016/j.clinph.2016.06.009. [DOI] [PubMed] [Google Scholar]
- [14].van ‘t Klooster MA et al. , “Tailoring epilepsy surgery with fast ripples in the intraoperative electrocorticogram,” Ann Neurol, vol. 81, no. 5, pp. 664–676, May 2017, doi: 10.1002/ana.24928. [DOI] [PubMed] [Google Scholar]
- [15].Besheli BF et al. , “A sparse representation strategy to eliminate pseudo-HFO events from intracranial EEG for seizure onset zone localization,” J Neural Eng, vol. 19, no. 4, p. 046046, Aug. 2022, doi: 10.1088/1741-2552/ac8766. [DOI] [Google Scholar]
- [16].Dümpelmann M and Elger CE, “Visual and Automatic Investigation of Epileptiform Spikes in Intracranial EEG Recordings,” Epilepsia, vol. 40, no. 3, pp. 275–285, Mar. 1999, doi: 10.1111/j.1528-1157.1999.tb00704.x. [DOI] [PubMed] [Google Scholar]
- [17].Lodder SS, Askamp J, and van Putten MJAM, “Inter-ictal spike detection using a database of smart templates,” Clinical Neurophysiology, vol. 124, no. 12, pp. 2328–2335, Dec. 2013, doi: 10.1016/j.clinph.2013.05.019. [DOI] [PubMed] [Google Scholar]
- [18].Fonov V, Evans A, McKinstry R, Almli C, and Collins D, “Unbiased nonlinear average age-appropriate brain templates from birth to adulthood,” Neuroimage, vol. 47, p. S102, Jul. 2009, doi: 10.1016/S1053-8119(09)70884-5. [DOI] [Google Scholar]
- [19].Fonov V, Evans AC, Botteron K, Almli CR, McKinstry RC, and Collins DL, “Unbiased average age-appropriate atlases for pediatric studies,” Neuroimage, vol. 54, no. 1, pp. 313–327, Jan. 2011, doi: 10.1016/j.neuroimage.2010.07.033. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [20].Janca R et al. , “Detection of Interictal Epileptiform Discharges Using Signal Envelope Distribution Modelling: Application to Epileptic and Non-Epileptic Intracranial Recordings,” Brain Topogr, vol. 28, no. 1, pp. 172–183, Jan. 2015, doi: 10.1007/s10548-014-0379-1. [DOI] [PubMed] [Google Scholar]
- [21].Eliason SR, Maximum likelihood estimation: Logic and practice. 1993. [Google Scholar]
- [22].Liu S et al. , “Stereotyped high-frequency oscillations discriminate seizure onset zones and critical functional cortex in focal epilepsy,” Brain, vol. 141, no. 3, pp. 713–730, Mar. 2018, doi: 10.1093/brain/awx374. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [23].Jacobs J, LeVan P, Chander R, Hall J, Dubeau F, and Gotman J, “Interictal high-frequency oscillations (80–500 Hz) are an indicator of seizure onset areas independent of spikes in the human epileptic brain,” Epilepsia, vol. 49, no. 11, pp. 1893–1907, Nov. 2008, doi: 10.1111/j.1528-1167.2008.01656.x. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [24].Jacobs J, Vogt C, LeVan P, Zelmann R, Gotman J, and Kobayashi K, “The identification of distinct high-frequency oscillations during spikes delineates the seizure onset zone better than high-frequency spectral power changes,” Clinical Neurophysiology, vol. 127, no. 1, pp. 129–142, Jan. 2016, doi: 10.1016/j.clinph.2015.04.053. [DOI] [PubMed] [Google Scholar]
