Skip to main content
Nature Portfolio logoLink to Nature Portfolio
. 2026 Jul 21;16:33171. doi: 10.1038/s41598-026-62064-7

Combining residual U-Net and data augmentation for dense temporal segmentation of spike wave discharges in single-channel EEG

Saurav Sengupta 1,✉,#, Scott Kilianski 2,#, Suchetha Sharma 1, Sakina Lashkeri 2, Ashley McHugh 2, Mark Beenhakker 2, Donald E Brown 1
PMCID: PMC13683039  PMID: 42481563

Abstract

Manual annotation of spike-wave discharges (SWDs), the electrographic hallmark of absence seizures, is labor-intensive for long-term electroencephalography (EEG) monitoring studies. While machine learning approaches show promise for automated detection, they often struggle with cross-subject generalization due to high inter-individual variability in seizure morphology and signal characteristics. In this study we compare the performance of 16 machine learning classifiers on our own manually annotated dataset of 961 hours of EEG recordings from C3H/HeJ mice, including 22,637 labeled SWDs, and find that a 1D U-Net performs best. We then improve its performance by employing residual connections and data augmentation strategies combining amplitude scaling, Gaussian noise injection, and signal inversion to enhance cross-subject generalization. Our proposed model, AugUNet1D, achieves an average F1-score of 0.90 with balanced precision (0.91) and recall (0.90), representing a 29% relative improvement over the “Twin Peaks” algorithmic baseline and exceptional cross-subject performance. AugUNet1D, pretrained on our manually annotated data, along with the dataset itself, is made public for other users.

Subject terms: Computational biology and bioinformatics, Engineering, Neurology, Neuroscience

Introduction

Absence epilepsy is characterized by brief, sudden lapses in consciousness and accompanying prominent electrographic signals during non-convulsive absence seizures1,2. This form of epilepsy can significantly impact academic performance and social development, as seizures often occur dozens of times a day, causing frequent disturbances in attention3,4. Because the electrographic signals occurring during absence seizures are so prominent, electroencephalography (EEG) is essential for detecting absence seizures. These signals are distinctive, generalized spike-wave discharges (SWDs) that appear suddenly across much of the brain nearly simultaneously. In fact, the SWD serves as a diagnostic hallmark that distinguishes absence epilepsy from other types of epilepsy and attention disorders1,2. Indeed, as absence seizures often occur without obvious external symptoms, detection of SWDs in the EEG is critical for proper diagnosis.

Animal models of absence epilepsy also present with SWDs in EEG recordings5. These animal models are important because they allow researchers to test hypotheses about underlying biological mechanisms driving SWDs using methods that would not otherwise be possible in humans (e.g. genetic knockout/knock-in, intracranial recording, optogenetic manipulation). Understanding the underlying mechanisms generating SWDs in non-human animals will help researchers and clinicians improve treatments for absence epilepsy in humans. There are several rodent models of absence epilepsy, including the C3H/HeJ mouse strain, which shares many characteristics with the human disorder including the presence of spontaneous SWDs in the EEG with coincident behavioral arrest and a sensitivity to the anti-absence drug ethosuximide6,7. This mouse strain carries a mutation of the Gria4 gene, which encodes an AMPA receptor subunit, GluR4. The mutation causes increased duration of synaptic excitation in the reticular thalamus, and ultimately, leads to the appearance of SWDs. C3H/HeJ mice begin having SWDs in the first several weeks of life6 and continue having SWDs into adulthood at a rate of about 45 SWDs per hour8, making them practical for invasive and interventional experiments.

Manual evaluation of EEG recordings remains the gold standard for seizure phenotype assessment, largely due to the inadequacy of current automatic detection algorithms. Machine learning and neural network approaches offer opportunities for automating this process. In fact, while these approaches have existed for decades9, innovations over the last several years have culminated in solutions that automatically label events in raw or minimally preprocessed EEG signals10–12. These approaches extract hierarchical representations from the raw data rather than rely on features extracted from time, frequency, and time-frequency domains13–15. However, such approaches have not yet been tested for the specific use case of automatically detecting SWDs.

Hybrid convolutional neural network-long short-term memory (CNN-LSTM) architectures have shown particular promise by combining spatial feature extraction from CNNs with temporal modeling capabilities of LSTMs16,17. More recently, specialized architectures designed specifically for EEG analysis (e.g., EEGNet18), time series classification (e.g., InceptionTime19), and dense segmentation tasks (e.g., UNet-based models20,21) have emerged as promising approaches for automated physiological signal analysis. Additionally, transformer-based architectures adapted from computer vision, such as DETRtime22 for temporal event detection and SalientSleepNet23 for sleep stage classification, have also been applied to EEG time series analysis.

Considering these numerous approaches to automated event detection, here, we compared the performance of 15 machine learning classifiers to identify optimal SWD detection strategies in the C3H/HeJ mouse model of absence epilepsy. After determining that the 1D residual U-Net performed best, we further improved performance by applying augmentation procedures to the training data. The final result, AugUNet1D, consistently performed well across recordings from 10 mice in our test dataset. We also compared AugUNet1D to a recent algorithmic method using time- and frequency-based features called “Twin Peaks”24. AugUNet1D again showed superior performance, detecting events with features similar to manually labeled SWDs. Overall, our results demonstrate that AugUNet1D is an effective and reliable method for labeling SWDs in EEG from C3H/HeJ mice. Moreover, we establish a workflow for utilizing an untrained version of AugUNet1D that can be applied to detect a diverse set of electrographic events across different biological systems (Fig. 1).

Fig. 1.

Fig. 1

Schematic of EEG data preprocessing, augmentation, and the architecture of the AugUNet1D network. We resample all signals to 100Hz, use augmentations like scaling, inversion and Gaussian noise and apply them randomly to the training signal, and then feed them into a residual 1D-UNet that predicts labels at every time point. We minimize Dice Loss using an Adam optimizer.

Materials and methods

Dataset collection

Animals

The methods described herein are reported following ARRIVE guidelines (https://arriveguidelines.org/). All procedures were approved by the University of Virginia Animal Care and Use Committee (Charlottesville, VA, USA) and performed in accordance with the NIH Guide for the Care and Use of Laboratory Animals. Animals were housed at 23-25°C under an artificial 12-hour light-dark cycle with food and water ad libitum. Male and female C3H/HeJ mice (Strain #:000659) aged 6-10 weeks were purchased from The Jackson Laboratory and used for the experiments described here. C3H/HeJ mice carry a mutation to the Gria4 gene, which encodes the AMPA receptor subunit GluR4. Mice carrying this mutation develop spontaneous SWDs6.

Electrode implant surgery

Animals were anesthetized with vaporized isoflurane (2-4% for induction, 1-2% for maintenance) mixed with pure oxygen and delivered at a rate of 1 liter/min. The scalp was first shaved and then depilatory cream was applied to remove all remaining hair. The scalp was then cleaned with alternating scrubs of betadine and 70% ethanol three times. After creating a sagittal incision, the underlying fascia was scrubbed away with sterile cotton tipped applicators and an applicator dipped in hydrogen peroxide (3%) was used to clean the skull and increase the visibility of cranial sutures. Burr holes were made above the secondary motor or primary somatosensory cortex. An additional burr hole was made in the center of the interparietal bone overlying the cerebellum. A custom electrode array, consisting of insulated stainless steel wires (A-M systems part no. 791400) with approximately 500μm insulation stripped from the end soldered to a 6-position header of connector pins (Digikey part no. 1212-1786-ND), was then lowered into the surgical field. The wires were carefully placed under the skull in the burr holes using forceps and set into place with UV-curing glue (SDI Wave). When all wires were positioned and glued, the electrode array was cemented to the remaining exposed skull with dental cement (Metabond, Parkell part no. S380). Skin at the perimeter of the incision was pulled tightly around the cement base and secured with cyanoacrylate adhesive or sutured together at the posterior end of the incision. Ketoprofen (5mg/kg) was administered peri-operatively to reduce pain and inflammation. Animals were given at least seven days to recover prior to EEG recording.

Data acquisition

EEG signals were first passed through an operational amplifier to buffer small voltage fluctuations before subsequent amplification. These amplifiers were integrated into custom-made PCBs which connected to the header of pins implanted on the head. In some cohorts, signals were then further amplified 10,000 times by a differential amplifier (A-M systems model 3500) and digitally sampled at 1kHz (AD Instruments Powerlab 16/35 or PowerLab C using LabChart) or 400Hz (Grass AURA-64 LTM using TWin software). In all experiments, the cerebellar electrode served as the common reference for other recording channels. Recordings were continuous–24 hours per day–and were stopped, saved, and restarted once per day. All data analyzed in these experiments was recorded from the electrode in the secondary motor cortex. After the final recordings session, animals were deeply anesthetized with a lethal intraperitoneal injection of 60mg/kg Euthasol (pentobarbital sodium and phenytoin sodium) and then, after the loss of pedal reflex was confirmed, transcardially perfused with phosphate-buffered saline followed by 4% paraformaldehyde.

Manual labeling of spike-wave discharges

SWDs were labeled manually by three trained researchers. The following criteria for labeling SWDs were used: (1) the electrographic event must include at least 5 clear rhythmic spike-wave complexes; and (2) the complexes must occur at short, regular intervals separated by at least 50 milliseconds. Manual labeling was performed in Clampfit (Molecular Devices, San Jose, CA) by placing cursors to bracket the entire SWD (Fig. 2). The duration of manual labeling sessions was recorded.

Fig. 2.

Fig. 2

Examples of SWDs in raw EEG traces. (A) An example EEG trace showing 3 SWDs, each indicated by gray horizontal lines that correspond to manual labels. (B) Expanded view of the portion of the trace within the dotted box in A. High amplitude, rhythmic spike-and-wave patterns that define SWD are clearly visible.

The training data consisted of five days of continuous EEG recording in eight mice, totaling 961.3 hours of recording. On average, it required one hour of manual work to label 8.89 hours of EEG data (Table 1).

Table 1.

Duration (hours) spent scoring the manually labeled dataset.

Scorer Duration to Label (Hours) Duration of Data (Hours) Data-To-Labeling Ratio
Scorer #1 27.3 240.5 8.81
Scorer #2 38.86 360.4 9.27
Scorer #3 41.93 360.4 8.6
Total 108.09 961.3 8.89

In total, 22,637 SWDs were manually labeled across five recording days in eight mice (Fig. 3A). SWD occurrence was variable across mice, ranging from 1,115 (4.9%) to 4,570 (20.2%) SWDs per mouse. The average SWD rate across all mice was 23.55 ± 9.3 per hour (mean ± SD, N = 8 mice). The average duration across all SWDs was 5.83 ± 2.37 seconds and varied little between mice (Fig. 3B). We also characterized the spectral composition of all manually labeled SWDs (Fig. 3C). To this end, the power spectral density of each manually labeled SWD was calculated, from which the peak frequency was determined (Fig. 3C, bottom). The mean peak frequency of all SWDs was 5.72 ± 0.75Hz, again showing little variation across mice (Fig. 3D). The observed event rates, duration, and spectral features in our training dataset are very similar to those in previous reports6–8. Thus, SWD features are generally preserved in C3H/HeJ mice, despite variable SWD occurrence across individuals.

Fig. 3.

Fig. 3

Training dataset statistics and spectral features. (A) Distributions of SWD durations (in seconds) shown separately for each mouse; different colors represent the 8 mice in our training set. (B) Each portion of the whole corresponds to a single mouse. The size of the portion and the number correspond to the number of SWDs in a given mouse. (C) Top: Raw EEG data showing example SWDs in three different mice. Middle: Corresponding spectrograms showing power of the signals at different frequencies across time during the events. Bottom: Power spectral density plots showing the average power at different frequencies across the entire events. Vertical red lines indicate the peak frequency of the corresponding event. (D) The average (± SD) of the peak frequencies of SWDs in the 8 mice included in the training dataset.

Classifying noise and sleep in EEG records

Because EEG power broadly increases during periods of mechanical noise and during sleep, automated methods often falsely detect events during these periods. To assess how various methods perform during such conditions, noise and sleep epochs must be identified in our recordings. To define noise epochs, first, the mean and standard deviation of EEG amplitudes across the entire recording are computed. Then, traces are segmented into consecutive 5-second blocks. Blocks containing amplitudes 20 standard deviations or more beyond the mean are classified as noise (Fig. 4A and B, dotted boxes).

Fig. 4.

Fig. 4

Examples of noise and sleep epochs in EEG traces. (A) EEG trace showing 6 discrete noise epochs identified by dotted boxes. (B) Trace shows the maximum absolute EEG amplitude within consecutive 5-second windows. The orange dotted horizontal line is the threshold used to detect noise and represents 20 standard deviations above the overall absolute mean EEG amplitude. (C) Representative EEG trace with sleep epochs indicated by blue shading. (D) The instantaneous amplitude derived from the Hilbert envelope of the 0.1-4Hz-filtered EEG. The red dotted horizontal line indicates the minimum detection threshold that determines onset and offset of sleep epochs. The trace must also cross the blue dotted horizontal line at least once during an epoch to be classified as sleep. (E) Distribution of the amplitude from the Hilbert envelope of the 0.1-4Hz-filtered EEG. This distribution is generated from the entire recording and therefore contains data recorded when the mouse is awake (low amplitude peak) and asleep (high amplitude peak). Horizontal gray bars in A and C indicate manually labeled SWDs.

Sleep epochs are defined as periods with elevated power in the 0.1-4Hz frequency band (Fig. 4C and D, blue shading). Thus, to identify sleep, the instantaneous amplitude (Hilbert envelope) of the 0.1-4Hz-band EEG is first computed as the magnitude of the analytic signal. Then, a distribution of the instantaneous amplitudes is estimated (Fig. 4E). This distribution is bimodal: the lower-amplitude peak corresponds to wakefulness. The higher-amplitude peak corresponds to slow wave sleep. The midpoint between the two peaks is used as the lower threshold (red dotted line in Fig. 4D and E) to detect the on- and off-set of sleep. Any epoch that does not cross a secondary threshold (the higher-value peak; blue dotted line in Fig. 4D and E) is not considered sleep. Sleep epochs occurring within 20 seconds of each other are merged. We selected this sleep detection approach because it is procedurally simple and well-suited to single-channel EEG recordings. Because we did not seek to classify sleep by stage or depth, this instantaneous amplitude thresholding method is sufficient. Additionally, we observed that SWD detection algorithms often register false positives during periods with sustained high-amplitude EEG signals (see Figs. 7 and 8). Sleep detection using an amplitude thresholding method captured the sleep epochs most likely to trigger false SWD detections even if it missed lower amplitude sleep epochs.

Fig. 7.

Fig. 7

Twin Peaks method shows a bias for shorter events with higher peak frequencies. (A) Mean durations for events detected manually, with AugUNet1D, or with Twin Peaks in all ten mice in the test dataset. (B) Bar heights represent mean durations across all mice. Open circles show the data for each mouse. (C and D) Same as A and B but for peak frequencies of detected events. Error bars show ± standard deviation. *** p< 10-3.

Fig. 8.

Fig. 8

Cross-method comparison of detected events during noise and sleep. (A) Example of the Twin Peaks method falsely detecting two events during periods with high-amplitude cable artifact highlighted in dotted boxes. (B) Overall, very few events were detected during noise epochs, but Twin Peaks detected more than AugUNet1D and manual labeling. (B) The proportion of events that Twin Peaks detects during sleep is higher than the number of manually detected events and those detected by AugUNet1D. (C) Example trace with Twin Peaks falsely detecting many events during sleep which is indicated in blue shading (D) Twin Peaks detects many more events during sleep than manual labeling and AugUNet1D. **** p< 10-4.

Dataset pre-processing

Resampling using torchaudio

The training set consisted of 5 days of single-channel EEG recordings per subject across 8 mice, originally sampled at 1000 Hz. The held-out test set comprised single-channel EEG segments from 10 independent mice originally sampled at 400 Hz. To account for variable sampling rates, we used the torchaudio package established by the PyTorch project to resample all input data to a standard sampling rate of 100Hz. ‘sinc_interp_hann’ is a PyTorch function that performs sinc interpolation with Hann windowing for resampling audio or other time-series signals. All recordings were downsampled to 100 Hz using torchaudio prior to model development and evaluation.

In the context of EEG signal processing for our use case, ‘sinc_interp_hann’ is useful for standardizing sampling rates across different recording devices or datasets, ensuring that neural network models receive consistently sampled input data. The associated high-quality interpolation is especially important for EEG analysis because it preserves the precise timing and frequency characteristics of brain signals that are critical for accurate SWD detection or other neurological event classification strategies.

Therefore, our EEG signal and ground truth labels x[n] are resampled using Inline graphic

Where Inline graphic is the torchaudio Resample transform that converts an EEG signal from its source sampling rate Inline graphic to its target sampling rate: Inline graphic

graphic file with name d33e561.gif

where Inline graphic: Input EEG signal with Inline graphic samples Inline graphic: Resampled EEG signal with Inline graphic samples Inline graphic: Source sampling frequency (Hz) Inline graphic: Target sampling frequency (Hz) r: Resampling ratio

Model building

For our SWD detection task, we adopted a residual 1D U-Net architecture adopted from https://github.com/fepegar/unet/tree/main25. The U-Net was originally developed by Ronneberger et al. (2015)20 for biomedical image segmentation, where it demonstrated remarkable success in precisely delineating cellular structures and tissue boundaries in microscopy images. The architecture’s key innovation is its symmetric encoder-decoder structure with skip connections: the encoder progressively downsamples the input to capture hierarchical spatial features and contextual information, while the decoder upsamples to recover fine-grained spatial details. Crucially, skip connections bridge corresponding encoder and decoder layers, allowing the network to combine high-level semantic features with low-level spatial precision, an essential property for accurate pixel-wise segmentation.

The adaptation of U-Net to temporal segmentation tasks has gained significant traction in recent years across diverse physiological signal processing applications. Perslev et al. (2019)21 pioneered this direction with U-Time, a fully convolutional temporal network for sleep stage classification from EEG data, demonstrating that the U-Net architecture could be successfully applied to sequential physiological signals without requiring recurrent layers. Their work showed that skip connections naturally preserve critical temporal features across multiple time scales, enabling accurate segmentation of sleep stages. Since then, U-Net-based architectures have been successfully deployed for various sequence-to-sequence tasks including seismic phase detection (Zhu & Beroza, 201926), and more recently, seizure detection from continuous EEG recordings (Wu et al., 202527).

The integration of residual connections with U-Net architectures has a well-established history in computer vision, where residual U-Net variants have demonstrated substantial improvements over vanilla U-Net. Zhang et al. (2018)28 introduced ResUNet for road extraction from aerial images, whereas Alom et al. (2018)29 proposed the Recurrent Residual U-Net (R2U-Net) for medical image segmentation. Building on these successes, we incorporated residual connections within each encoding and decoding block of our 1D U-Net architecture. These shortcut connections, inspired by ResNet30 architectures, allow gradients to flow directly through the network during backpropagation, addressing the vanishing gradient problem and enabling stable training of deeper networks. Please find a model description in Supplementary Table 6.

Additionally, recognizing that SWD morphologies vary substantially across individuals, we implemented a comprehensive data augmentation strategy during training. Specifically, we randomly applied amplitude scaling (p=0.5) to account for inter-subject variability in EEG amplitude, Gaussian noise injection (max SNR=0.005) to simulate recording artifacts and improve noise robustness, and signal inversion (p=0.2) to enforce polarity invariance–a critical property given that SWDs can manifest with opposite polarities across recording sites. Figure 1 provides an overview of our training method.

We define our augmentation function as Inline graphic where Inline graphic is an augmentation operator that transforms a single-channel EEG signal Inline graphic to an augmented signal Inline graphic, with T being the number of time samples.

The specific augmentation types used are:

1. Amplitude Scaling

graphic file with name d33e669.gif

2. Additive Gaussian Noise

graphic file with name d33e673.gif

3. Inverting

graphic file with name d33e677.gif

Furthermore, we apply all these augmentations in a probabilistic way such that:

graphic file with name d33e681.gif

Our complete augmentation pipeline is therefore, as follows:

graphic file with name d33e686.gif 1
graphic file with name d33e690.gif 2
graphic file with name d33e695.gif 3
graphic file with name d33e699.gif 4

where

- Inline graphic: Original single-channel EEG signal

- Inline graphic: Augmented EEG signal

- T: Number of time samples

- α: Scaling factor

- Inline graphic: Noise variance

- Inline graphic: Uniform distribution between a and b

- Inline graphic: Normal distribution with mean μ and variance Inline graphic

We further divided a full day of data (signal and label) into 20 second epochs (2000 time points each), before using them for training our model.

Ultimately, the combination of residual learning, U-Net’s hierarchical temporal representations, and augmentation-based regularization proved essential for achieving robust cross-subject generalization across our 10 test mice at 100Hz temporal resolution.

Loss function

Dice Loss is now a standard loss function for segmentation tasks across both computer vision and time series applications, making it a natural choice for our SWD detection framework. Originally popularized in medical image segmentation to effectively address class imbalance and spatial overlap measurement31), Dice Loss has since been successfully adapted to temporal segmentation tasks including sleep stage classification21 and other physiological signal analysis applications. Building on these established successes, we adopted Dice Loss for our cross-subject SWD detection task.

Unlike traditional cross-entropy loss, which treats each pixel or time point independently, Dice Loss considers the global overlap of the segmented regions, making it inherently more robust to class imbalance. This property explains its widespread adoption in both spatial and temporal segmentation tasks. For our application, adopting this approach would not simply predict the majority (non-SWD) class but would instead optimize for accurate detection of the more infrequent event class (i.e. SWD).

Model evaluation

Due to the highly imbalanced nature of our data–where SWDs comprise, at most, 5% of our dataset–we rely on F1-scores, precision and recall to evaluate the performance of our model, as accuracy would not serve as a reliable metric. Our task involves classifying every time point in the signal as either SWD or non-SWD, and the chosen metrics are appropriate for this class imbalanced problem.

All reported metrics are computed on the 10 held-out test mice, which were excluded entirely from model selection, hyperparameter tuning, and augmentation design. The difference in original acquisition rates (400 Hz for test, 1000 Hz for train) further ensures that no implicit signal characteristics from the test distribution could have influenced training decisions.

Here, precision is defined as:

graphic file with name d33e783.gif

recall as

graphic file with name d33e787.gif

and F1- score as

graphic file with name d33e791.gif

where

graphic file with name d33e795.gif

Comparison models

To rigorously evaluate the performance of our proposed AugUNet1D architecture, we selected 16 diverse baseline models spanning multiple methodological paradigms and complexity levels. Our selection strategy was designed to provide comprehensive coverage of approaches used in EEG analysis and time series classification tasks. First, we included four traditional machine learning methods, namely Logistic Regression32, K-Nearest Neighbors33, Decision Tree34, and Random Forest35, which serve as foundational baselines and represent classical approaches to seizure detection that rely on learned feature representations from the input signals. Second, we incorporated several deep learning architectures of varying complexity: (1) standard CNN36 and PyramidalCNN37 for spatial feature extraction; (2) LSTM38 and bidirectional LSTM (biLSTM)39 for temporal modeling; and (3) ConvLSTM40 which combines both spatial and temporal processing. Third, we selected five specialized architectures that have demonstrated success in related physiological signal processing tasks: (1) EEGNet18(specifically designed for EEG classification); (2) InceptionTime19 (a state-of-the-art time series classifier); (3) Xception41 (an efficient convolutional architecture); (4) vanilla U-Net20 (to isolate the contribution of our residual and augmentation enhancements); and (5) SalientSleepNet23 (a recent attention-based architecture for sleep stage classification). Finally, we included DETRtime22, a transformer-based object detection model adapted for time series, to assess whether modern query-based detection paradigms are effective for dense temporal segmentation tasks. This diverse baseline selection enables the systematic evaluation of the relative contributions of different architectural components, including encoder-decoder structures, skip connections, residual learning, recurrent processing, and attention mechanisms to performance, and to determine which design principles are most critical for achieving robust cross-subject SWD detection performance.

Statistical comparison of manual, AugUNet1D, and twin peaks labeling methods

Performance scores (F1, recall, precision) of AugUNet1D and Twin Peaks were compared using paired samples t-tests. Differences in features (i.e., duration and peak frequency) among manually labeled SWDs, AugUNet1D-, and Twin Peaks-labeled events were tested using one-way repeated measures ANOVA with detection method as the main factor. Bonferroni post hoc tests were used to compare groups means among all possible combinations of the three detection methods. All statistical tests were performed in GraphPad Prism 8.0.1 (San Diego, CA). Data are reported as mean ± standard deviation (SD) unless otherwise stated.

Training details

All EEG signals were identically preprocessed. First, raw signals were min-max scaled over their amplitude range to normalize signal magnitudes across subjects. Next, signals were resampled to 100Hz using torchaudio.transforms.Resample to standardize temporal resolution. Finally, the continuous recordings were segmented into 20-second epochs (2000 time points each) to create manageable training examples. The training data from the eight training mice was randomly partitioned into 95% for model training and 5% for validation, with the validation set used to monitor performance and select optimal model checkpoints during training. Batch size was 32.

The AugUNet1D model was trained using the Adam optimizer with an initial learning rate of Inline graphic for a maximum of 50 epochs. We employed a CosineAnnealingLinearWarmup learning rate scheduler to facilitate stable training and optimal convergence, which began with a linear warmup phase over the first 500 steps to gradually increase the learning rate from zero to the initial value, preventing early training instability. Following warmup, the scheduler applied cosine annealing over 1000-step cycles with a minimum learning rate of Inline graphic and a decay factor (gamma) of 0.9, allowing the learning rate to oscillate while gradually decreasing over successive cycles to enable fine-tuning of model parameters. To prevent overfitting and reduce unnecessary computational costs, we implemented early stopping with a patience of 10 epochs that monitored the validation Dice loss and terminated training if no improvement was observed for 10 consecutive epochs. This training configuration balanced exploration during early training phases with exploitation during later stages, whereas the early stopping criterion ensured that models were evaluated at their optimal generalization point rather than after potential overfitting. We report results on the 10 held out test mice as a mean and standard deviation over three runs with random initialization.

For all baseline deep learning methods, we utilized the standardized training code from the DETRtime repository https://github.com/lu-wo/DETRtime/ with necessary modifications to accommodate our mouse EEG dataset and task specifications. Each baseline model was trained for 10 epochs, and the epoch achieving the best validation loss was selected for evaluation on the held-out test set. To account for training variability and ensure robust performance estimates, we trained each baseline model three times with different random initializations and report the mean and standard deviation of precision, recall, and F1-score across these three independent runs. This training protocol ensured fair comparison across all baseline methods while maintaining computational feasibility given the large number of models evaluated.

Results

Performance of machine learning methods

Here, we test the performance of a variety of traditional ML and neural network-based methods.

We specifically evaluated our proposed AugUNet1D model against 15 baseline methods and the Twin Peaks approach across 10 held-out test mice, using precision, recall, and F1-score as our primary evaluation metrics. The baseline methods spanned four methodological categories: (1) traditional machine learning algorithms (Logistic Regression, K-Nearest Neighbors, Decision Tree, Random Forest); (2) pure deep learning architectures (CNN, PyramidalCNN, LSTM, biLSTM, ConvLSTM); (3) specialized physiological signal processing networks (EEGNet, InceptionTime, Xception, U-Net, SalientSleepNet); and (4) transformer-based detection models (DETRtime). Additionally, we compared AugUNet1D against Twin Peaks, the previous state-of-the-art non-machine learning method on this dataset. Figure 5 shows the models’ overall average performance metrics (i.e. F1, recall, and precision scores). Table 2 presents the complete performance comparison across all methods and all 10 test mice.

Fig. 5.

Fig. 5

Average performance metrics (F1, Recall, Precision) across all recordings in the test dataset. Left-to-right order of bars matches the top-to-bottom order in the legend. Performance by all methods is shown here, except for LSTM and biLSTM, because they yielded zero for all three metrics.

Table 2.

Table shows the performance metrics for each model tested across all 10 of our test mice. The ‘avg’ columns contains the mean and standard deviation over all mice. We can see that our method performs the best on our dataset. Best results in bold.

Classifier Metric M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 avg
Logistic Regression32 precision 0.09 ± 0.00 0.09 ± 0.00 0.10 ± 0.00 0.09 ± 0.00 0.11 ± 0.00 0.10 ± 0.00 0.12 ± 0.00 0.07 ± 0.00 0.07 ± 0.00 0.03 ± 0.00 0.09 ± 0.00
recall 0.98 ± 0.00 0.96 ± 0.00 0.97 ± 0.00 0.98 ± 0.00 0.97 ± 0.00 0.98 ± 0.00 0.97 ± 0.00 0.98 ± 0.00 0.98 ± 0.00 0.99 ± 0.00 0.98 ± 0.00
f1-score 0.16 ± 0.00 0.17 ± 0.00 0.18 ± 0.00 0.16 ± 0.00 0.20 ± 0.00 0.19 ± 0.00 0.22 ± 0.00 0.13 ± 0.00 0.12 ± 0.00 0.06 ± 0.00 0.16 ± 0.00
K-Nearest Neighbors33 precision 0.15 ± 0.00 0.19 ± 0.00 0.14 ± 0.00 0.15 ± 0.00 0.26 ± 0.00 0.17 ± 0.00 0.25 ± 0.00 0.13 ± 0.00 0.10 ± 0.00 0.06 ± 0.00 0.16 ± 0.00
recall 0.70 ± 0.00 0.83 ± 0.00 0.66 ± 0.00 0.79 ± 0.00 0.82 ± 0.00 0.75 ± 0.00 0.71 ± 0.00 0.89 ± 0.00 0.76 ± 0.00 0.83 ± 0.00 0.77 ± 0.00
f1-score 0.25 ± 0.00 0.31 ± 0.00 0.24 ± 0.00 0.25 ± 0.00 0.39 ± 0.00 0.27 ± 0.00 0.37 ± 0.00 0.23 ± 0.00 0.18 ± 0.00 0.11 ± 0.00 0.26 ± 0.00
Decision Tree34 precision 0.27 ± 0.00 0.22 ± 0.00 0.25 ± 0.01 0.26 ± 0.00 0.34 ± 0.01 0.25 ± 0.00 0.36 ± 0.00 0.18 ± 0.00 0.14 ± 0.00 0.09 ± 0.00 0.23 ± 0.00
recall 0.56 ± 0.00 0.66 ± ± 0.00 0.45 ± 0.00 0.60 ± 0.00 0.55 ± 0.01 0.60 ± 0.00 0.64 ± 0.00 0.75 ± 0.01 0.62 ± 0.01 0.59 ± 0.00 0.60 ± 0.00
f1-score 0.36 ± 0.00 0.33 ± 0.01 0.32 ± 0.01 0.36 ± 0.00 0.42 ± 0.00 0.36 ± 0.00 0.46 ± 0.00 0.29 ± 0.00 0.23 ± 0.00 0.16 ± 0.00 0.33 ± 0.00
Random Forest35 precision 0.28 ± 0.01 0.22 ± 0.01 0.24 ± 0.01 0.29 ± 0.01 0.47 ± 0.01 0.20 ± 0.01 0.36 ± 0.00 0.20 ± 0.00 0.13 ± 0.01 0.09 ± 0.01 0.25 ± 0.01
recall 0.37 ± 0.01 0.55 ± 0.02 0.26 ± 0.01 0.44 ± 0.01 0.36 ± 0.02 0.32 ± 0.01 0.34 ± 0.00 0.71 ± 0.02 0.46 ± 0.05 0.44 ± 0.03 0.42 ± 0.02
f1-score 0.32 ± 0.01 0.32 ± 0.01 0.25 ± 0.01 0.35 ± 0.01 0.41 ± 0.02 0.25 ± 0.01 0.35 ± 0.00 0.31 ± 0.01 0.20 ± 0.02 0.15 ± 0.01 0.29 ± 0.01
CNN36 precision 0.66 ± 0.57 0.87 ± 0.06 0.67 ± 0.58 0.67 ± 0.58 0.92 ± 0.04 0.88 ± 0.03 0.84 ± 0.03 0.77 ± 0.03 0.83 ± 0.02 0.33 ± 0.58 0.74 ± 0.21
recall 0.01 ± 0.01 0.34 ± 0.24 0.01 ± 0.01 0.01 ± 0.01 0.78 ± 0.15 0.83 ± 0.04 0.86 ± 0.07 0.89 ± 0.03 0.73 ± 0.06 0.00 ± 0.01 0.45 ± 0.05
f1-score 0.01 ± 0.02 0.46 ± 0.26 0.01 ± 0.02 0.02 ± 0.02 0.84 ± 0.08 0.85 ± 0.01 0.85 ± 0.02 0.83 ± 0.01 0.77 ± 0.03 0.01 ± 0.01 0.47 ± 0.03
PyramidalCNN37 precision 0.67 ± 0.58 0.88 ± 0.02 0.67 ± ± 0.58 0.67 ± 0.58 0.86 ± 0.03 0.82 ± 0.02 0.78 ± 0.01 0.73 ± 0.03 0.77 ± 0.02 0.33 ± 0.58 0.72 ± 0.20
recall 0.10 ± 0.09 0.63 ± 0.05 0.00 ± 0.00 0.08 ± 0.08 0.92 ± 0.04 0.93 ± 0.03 0.95 ± 0.02 0.95 ± 0.03 0.84 ± 0.04 0.01 ± 0.01 0.54 ± 0.04
f1-score 0.17 ± 0.15 0.73 ± 0.03 0.01 ± 0.01 0.14 ± 0.14 0.89 ± 0.00 0.87 ± 0.00 0.86 ± 0.00 0.82 ± 0.01 0.81 ± 0.01 0.01 ± 0.02 0.53 ± 0.03
LSTM38 precision 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00
recall 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00
f1-score 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00
biLSTM39 precision 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00
recall 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00
f1-score 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00 0.00 ± 0.00
ConvLSTM40 precision 0.00 ± 0.00 0.95 ± 0.02 0.00 ± 0.00 0.33 ± 0.58 0.97 ± 0.01 0.97 ± 0.02 0.95 ± 0.01 0.82 ± 0.03 0.96 ± 0.02 0.00 ± 0.00 0.60 ± 0.06
recall 0.00 ± 0.00 0.57 ± 0.07 0.00 ± 0.00 0.00 ± 0.00 0.87 ± 0.02 0.71 ± 0.07 0.81 ± 0.08 0.91 ± 0.03 0.65 ± 0.07 0.00 ± 0.00 0.45 ± 0.02
f1-score 0.00 ± 0.00 0.71 ± 0.06 0.00 ± 0.00 0.00 ± 0.00 0.92 ± 0.02 0.82 ± 0.05 0.87 ± 0.05 0.86 ± 0.01 0.77 ± 0.05 0.00 ± 0.00 0.50 ± 0.02
EEGNet18 precision 0.01 ± 0.02 0.54 ± 0.45 0.02 ± 0.03 0.01 ± 0.02 0.54 ± 0.48 0.12 ± 0.16 0.25 ± 0.38 0.62 ± 0.14 0.20 ± 0.31 0.00 ± 0.01 0.23 ± 0.14
recall 0.01 ± 0.02 0.18 ± 0.18 0.04 ± 0.06 0.03 ± 0.06 0.58 ± 0.50 0.34 ± 0.56 0.40 ± 0.53 0.85 ± 0.12 0.38 ± 0.54 0.02 ± 0.03 0.28 ± 0.21
f1-score 0.01 ± 0.02 0.27 ± 0.25 0.03 ± 0.04 0.02 ± 0.03 0.56 ± 0.49 0.05 ± 0.05 0.15 ± 0.16 0.70 ± 0.06 0.09 ± 0.11 0.01 ± 0.01 0.19 ± 0.10
InceptionTime19 precision 0.85 ± 0.25 0.88 ± 0.06 0.67 ± 0.58 1.00 ± 0.00 0.89 ± 0.04 0.88 ± 0.02 0.84 ± 0.02 0.72 ± 0.02 0.82 ± 0.02 1.00 ± 0.00 0.86 ± 0.05
recall 0.03 ± 0.04 0.62 ± 0.13 0.00 ± 0.01 0.04 ± 0.06 0.90 ± 0.04 0.88 ± 0.03 0.92 ± 0.02 0.94 ± 0.02 0.79 ± 0.02 0.01 ± 0.00 0.51 ± 0.03
f1-score 0.05 ± 0.07 0.72 ± 0.08 0.01 ± 0.01 0.07 ± 0.11 0.89 ± 0.01 0.88 ± 0.02 0.88 ± 0.02 0.81 ± 0.01 0.81 ± 0.02 0.01 ± 0.00 0.51 ± 0.03
Xception41 precision 0.02 ± 0.03 0.94 ± 0.01 0.02 ± 0.03 0.02 ± 0.03 0.92 ± 0.02 0.90 ± 0.04 0.87 ± 0.04 0.75 ± 0.05 0.87 ± 0.06 0.00 ± 0.01 0.53 ± 0.02
recall 0.31 ± 0.54 0.59 ± 0.07 0.31 ± 0.54 0.31 ± 0.54 0.91 ± 0.01 0.89 ± 0.05 0.94 ± 0.02 0.96 ± 0.01 0.82 ± 0.03 0.30 ± 0.52 0.63 ± 0.22
f1-score 0.03 ± 0.05 0.72 ± 0.05 0.04 ± 0.06 0.03 ± 0.06 0.92 ± 0.01 0.90 ± 0.01 0.90 ± 0.02 0.84 ± 0.03 0.84 ± 0.01 0.01 ± 0.02 0.52 ± 0.02
U-Net20 precision 0.99 ± 0.01 0.62 ± 0.51 1.00 ± 0.00 0.99 ± 0.01 0.95 ± 0.02 0.96 ± 0.01 0.94 ± 0.01 0.57 ± 0.11 0.94 ± 0.00 0.98 ± 0.02 0.90 ± 0.05
recall 0.26 ± 0.19 0.34 ± 0.08 0.20 ± 0.27 0.40 ± 0.26 0.86 ± 0.06 0.69 ± 0.13 0.75 ± 0.12 0.97 ± 0.03 0.61 ± 0.11 0.24 ± 0.31 0.53 ± 0.13
f1-score 0.38 ± 0.24 0.39 ± 0.28 0.29 ± 0.34 0.54 ± 0.26 0.90 ± 0.02 0.80 ± 0.09 0.83 ± 0.08 0.71 ± 0.09 0.74 ± 0.08 0.32 ± 0.38 0.59 ± 0.15
SalientSleepNet23 precision 0.27 ± 0.46 0.60 ± 0.41 0.27 ± 0.47 0.25 ± 0.43 0.86 ± 0.09 0.55 ± 0.48 0.85 ± 0.13 0.66 ± 0.01 0.52 ± 0.45 0.21 ± 0.37 0.50 ± 0.25
recall 0.28 ± 0.48 0.44 ± 0.37 0.30 ± 0.52 0.31 ± 0.53 0.69 ± 0.45 0.61 ± 0.53 0.64 ± 0.55 0.95 ± 0.00 0.55 ± 0.48 0.30 ± 0.51 0.51 ± 0.39
f1-score 0.27 ± 0.47 0.50 ± 0.41 0.28 ± 0.49 0.27 ± 0.47 0.67 ± 0.34 0.58 ± 0.50 0.57 ± 0.49 0.78 ± 0.01 0.53 ± 0.46 0.25 ± 0.43 0.47 ± 0.36
DETRtime22 precision 0.06 ± 0.01 0.05 ± 0.01 0.04 ± 0.04 0.04 ± 0.02 0.06 ± 0.01 0.07 ± 0.01 0.06 ± 0.03 0.02 ± 0.02 0.04 ± 0.01 0.01 ± 0.00 0.05 ± 0.01
recall 0.34 ± 0.28 0.32 ± 0.27 0.36 ± 0.31 0.33 ± 0.28 0.31 ± 0.25 0.36 ± 0.30 0.35 ± 0.29 0.31 ± 0.27 0.33 ± 0.26 0.33 ± 0.28 0.33 ± 0.28
f1-score 0.07 ± 0.04 0.07 ± 0.04 0.08 ± 0.07 0.07 ± 0.05 0.08 ± 0.04 0.09 ± 0.05 0.10 ± 0.07 0.04 ± 0.04 0.05 ± 0.01 0.02 ± 0.01 0.07 ± 0.04
Twin Peaks24 precision 0.57 ± 0.00 0.96 ± 0.00 0.59 ± 0.00 0.64 ± 0.00 0.82 ± 0.00 0.82 ± 0.00 0.89 ± 0.00 0.39 ± 0.00 0.71 ± 0.00 0.25 ± 0.00 0.67 ± 0.00
recall 0.73 ± 0.00 0.45 ± 0.00 0.83 ± 0.00 0.92 ± 0.00 0.82 ± 0.00 0.89 ± 0.00 0.86 ± 0.00 0.92 ± 0.00 0.81 ± 0.00 0.95 ± 0.00 0.82 ± 0.00
f1-score 0.64 ± 0.00 0.62 ± 0.00 0.69 ± 0.00 0.75 ± 0.00 0.81 ± 0.00 0.85 ± 0.00 0.87 ± 0.00 0.55 ± 0.00 0.76 ± 0.00 0.40 ± 0.00 0.69 ± 0.00
AugUNet1D (ours) precision 0.92 ± 0.01 0.96 ± 0.01 0.92 ± 0.01 0.87 ± 0.01 0.97 ± 0.02 0.95 ± 0.01 0.94 ± 0.02 0.83 ± 0.02 0.91 ± 0.03 0.79 ± 0.03 0.91 ± 0.06
recall 0.84 ± 0.01 0.66 ± 0.09 0.94 ± 0.00 0.97 ± 0.00 0.89 ± 0.02 0.95 ± 0.00 0.96 ± 0.01 0.95 ± 0.00 0.89 ± 0.02 0.96 ± 0.01 0.90 ± 0.09
f1-score 0.87 ± 0.00 0.78 ± 0.06 0.93 ± 0.01 0.92 ± 0.01 0.93 ± 0.00 0.95 ± 0.00 0.95 ± 0.01 0.89 ± 0.01 0.90 ± 0.01 0.87 ± 0.02 0.90 ± 0.05

Table 2 shows that our proposed AugUNet1D performed best, with an average F1-score of 0.90 ± 0.01, representing a 29% relative improvement over the Twin Peaks baseline (0.69 F1-score) and a 70% relative improvement over the best general deep learning baseline. Notably, AugUNet1D demonstrated exceptional cross-subject consistency with standard deviations of only 0.01-0.02 across all metrics, the lowest variance among all evaluated methods. The model achieved robust individual performance across all test subjects, with F1-scores ranging from 0.87 to 0.93, with Mouse 2 being an outlier, indicating successful generalization to held out mice. Furthermore, AugUNet1D maintained a balanced precision-recall trade-off with 0.91 precision and 0.90 recall, compared to Twin Peaks’ 0.67 precision and 0.81 recall, suggesting that our model achieves superior detection accuracy without sacrificing either sensitivity or specificity.

The baseline methods exhibited dramatically different performance profiles that reveal important insights about architectural requirements for cross-subject SWD detection. Traditional machine learning methods performed poorly across the board, with F1-scores ranging from 0.16 for Logistic Regression to 0.33 for Decision Tree. Despite their consistent performance (low variance), these methods fundamentally struggled with the cross-subject temporal segmentation task likely due to their limited capacity to learn complex hierarchical representations from raw EEG signals. The failure of these methods underscores the necessity of deep learning approaches to solve this challenging problem.

Surprisingly, pure recurrent architectures including LSTM and biLSTM completely failed to learn effective representations, achieving 0.00 F1-scores across all test mice. This catastrophic failure suggests that recurrent networks, despite their theoretical suitability for sequential data, require careful initialization and architectural support to handle cross-subject generalization during high-frequency EEG signals, as shown in the ConvLSTM results. By contrast, standard convolutional architectures achieved moderate success, with vanilla CNN reaching a 0.47 F1-score and PyramidalCNN slightly improving to an F1-score of 0.53. However, these models exhibited high variance in precision (0.74 ± 0.21 for CNN), suggesting inconsistent performance across different subjects. The modest improvement of PyramidalCNN over vanilla CNN indicates that hierarchical feature extraction provides some benefit, but still falls far short for robust cross-subject detection.

Among specialized architectures, vanilla U-Net achieved the highest F1-score of 0.59 ± 0.15, emerging as the strongest general deep learning baseline. However, its high standard deviation of 0.15 reveals significant instability across subjects, highlighting the importance of our residual connection modifications. InceptionTime and Xception both achieved identical performance, demonstrating that multi-scale temporal feature extraction and efficient convolutional designs alone are insufficient to overcome the cross-subject generalization challenge. Most surprisingly, EEGNet achieved only 0.19 ± 0.10 F1-score despite being specifically designed for EEG classification tasks. SalientSleepNet, despite incorporating attention mechanisms, achieved 0.47 ± 0.36 F1-score with extremely high variance (0.36 standard deviation), indicating that attention alone does not guarantee robust cross-subject generalization.

The transformer-based DETRtime model failed dramatically with only 0.07 ± 0.04 F1-score. We hypothesize that query-based object detection paradigms designed for sparse event detection are fundamentally mismatched with dense point-wise temporal segmentation tasks. This result validates our architectural choice of encoder-decoder networks with skip connections over modern detection-based approaches for continuous EEG monitoring applications.

Performance comparison between AugUNet1D and twin peaks

Recently, “Twin Peaks” was developed for detecting SWDs generated by the WAG/Rij rat model of absence epilepsy, an approach that showed strong performance24. To determine how AugUNet1D compares to Twin Peaks at a granular resolution, we applied both methods to our test dataset and compared performance metrics as well as features of detected events (i.e. durations and peak frequencies).

In these comparisons, performance was measured on a whole event basis. That is, if a detected event had any overlap with a manually labeled event, it was considered a true positive. We classified events with no such overlap at all as false positives (Fig. 6A). Similarly, only manually labeled events that were missed entirely were considered false negatives (Fig. 6B). Using this approach AugNet1D had a significantly higher mean F1 score (0.95 ± 0.04) than Twin Peaks (0.71 ± 0.15; t(9) = 5.34, p< 10-3). AugNet1D also showed higher precision (0.96 ± 0.03) than Twin Peaks (0.58 ± 0.18; t(9) = 7.38, p< 10-4). Twin Peaks exhibited a slightly higher recall (0.96 ± 0.07) than AugUNet1D (0.94 ± 0.06; t(9) = 3.95, p = 0.003), but the magnitude of the effects observed for F1 and precision scores were far larger. Because F1 scores balance precision and recall, we conclude that AugUNet1D outperformed Twin Peaks in our test dataset, having better F1 scores in every recording therein (Fig. 6C) .

Fig. 6.

Fig. 6

False positives, negatives, confusion matrices and F1 scores for AugUNet1D and Twin Peaks. (A) Example of false positive in the dotted blue box. (B) Example of false negative in the dotted gray box. Blue lines correspond to events detected by AugUNet1D. Gray lines correspond to manually labeled events in A and B. (C) Confusion matrices and F1 scores for AugUNet1D and Twin Peaks prediction approaches for each mouse in the test dataset. Proportions in colored panels are as follows: Top left, true positives to all positives. Top right, false positives to all positives. Bottom left, false negatives to all negatives. Bottom right, true negatives to all negatives. These values were calculated on a per event basis, meaning that, for example, a predicted SWD was considered true if it had any overlap with an manually labeled SWD and false otherwise.

We also systematically compared features of events detected by AugUNet1D and Twin Peaks to determine if either method has a bias towards particular event types. Specifically, we compared the peak frequency of detected events and the average duration of events, which, in our original training data, were similar across time and across mice. A one-way repeated measures ANOVA revealed a significant effect of detection method on event duration (F(2,18) = 92.7, p< 10-4; Fig. 7A). Post hoc comparison showed that Twin Peaks detected events that were significantly briefer (2.35 ± 0.74s) than those detected either manually (4.88 ± 0.89s; t(9) = 11.7, p< 10-3) or by AugUNet1D (4.93 ± 0.82s; t(18) = 11.9, p< 10-3; Fig. 7B). One-way repeated measures ANOVA also showed a significant effect of detection method on peak frequencies (F(2,18) = 18.25, p< 10-4; Fig. 7C). Twin Peaks detected events with higher frequencies (6.58 ± 0.42Hz) than those detected by AugUNet1D (6.13 ± 0.14Hz; t(18) = 5.26, p< 10-3) or manually (6.14 ± 0.13Hz; t(9) = 5.2, p< 10-3; Fig. 7D). There were no significant differences between AugUNet1D and manual detection in event duration (t(18) = 0.2, p> 0.99) or peak frequency (t(18) = 0.06, p> 0.99). To summarize, in addition to performing better in terms of overall F1 score, AugUNet1D also detected events with features similar to manually labeled SWDs. By contrast, Twin Peaks detected events with higher peak frequencies and shorter durations.

Event detection during noise and sleep

We next asked whether events were erroneously detected during sleep or during electrographic noise induced by movement, poor mechanical connection, cable swinging, or during sleep. Briefly, noise epochs were defined by blocks of time filled with artificially high amplitude EEG signal (see Materials and Methods, Fig. 8A). These recordings had very few noise epochs overall, making it difficult to estimate how these three methods performed during those periods. One-way repeated measures ANOVA revealed no significant effect of detection method on the proportion of events during noise (F(2,18) = 2.411, p = 0.214; Fig. 8B).

Sleep epochs were identified by an increased amplitude in the 0.1 to 4Hz-bandpass filtered EEG signal (see Materials and Methods; Fig. 8C). One-way repeated measures ANOVA revealed a significant effect of detection method on the proportion of events during sleep (F(2,18) = 35.06, p< 10-4). Post hoc comparisons showed that a greater proportion of events during sleep were detected by Twin Peaks (0.46 ± 0.15) than by manual labeling (0.17 ± 0.07; t18 = 7.36 p< 10-4) and AugUNet1D (0.18 ± 0.017; t18 = 7.14 p< 10-4). There was no difference between manually detected and AugUNet1D-detected events (t(18) = 0.22, p> 0.99, Fig. 8D). In conclusion, short, non-SWD events are erroneously detected by Twin Peaks during sleep.

Ablation studies

Results of different augmentations

AugUNet1D uses several data augmentation strategies during training to diversify the dataset and improve generalization to new, unseen data. We conducted an ablation study to assess the individual and combined contributions of each data augmentation strategy: Gaussian noise injection, signal inversion, and amplitude scaling–on the cross-subject SWD detection performance of our residual 1D U-Net architecture. The results reveal critical insights into the role of augmentation in achieving robust generalization. Results are presented in Table 3.

Table 3.

Model performance for different chosen augmentations. We can see scaling provides the most benefit for our use case.

Augmentation Test precision Test recall Test F1
No Augmentation 0.9464 0.2755 0.4268
Gaussian Noise 0.9544 0.3116 0.4698
Invert 0.9591 0.3631 0.5267
Scaling 0.8783 0.8442 0.8609
All augmentations 0.9092 0.8618 0.8848

Without any data augmentation, the model achieved high precision (0.9464) but catastrophically low recall (0.2755), resulting in a poor F1-score of 0.4268. This severe imbalance indicates that the unaugmented model learned to be extremely conservative in its predictions, likely defaulting to predicting the majority (non-SWD) class to minimize false positives. Although the model could identify SWDs with high confidence when it made positive predictions, it missed the vast majority of bona fide SWDs, rendering it clinically ineffective.

Including Gaussian noise augmentation alone into the model provided only marginal improvement, increasing recall to 0.3116 and the F1-score to 0.4698 while maintaining high precision (0.9544). This modest benefit suggests that noise injection helps the model become slightly more robust to signal variations, but does not fundamentally address the class imbalance problem. Signal inversion augmentation showed slightly greater impact, improving recall to 0.3631 and F1-score to 0.5267 with precision of 0.9591.

By contrast, amplitude scaling augmentation alone produced a dramatic transformation in model behavior, achieving a recall of 0.8442 and F1-score of 0.8609. While precision decreased moderately to 0.8783, the substantial gain in recall demonstrates that scaling augmentation is by far the most critical component for cross-subject generalization.

Ultimately, combing all three augmentation strategies yielded the best overall performance with an F1-score of 0.8848, achieving an optimal balance between precision (0.9092) and recall (0.8618). The combined approach outperformed even amplitude scaling alone, indicating that while scaling addresses the primary challenge of amplitude variability, the additional regularization resulting from noise injection and the polarity invariance from signal inversion provide complementary benefits that further improve model robustness.

Results of increasing percentage of training data

Because AugUNet1D performs well when labeling SWDs, we were motivated to evaluate model perforamnce when trained with fewer events (our training dataset was quite large: 22,637 SWDs, 173,160 20-second segments). To estimate the quantity of training data needed to achieve adequate performance, we investigated the data efficiency of our proposed AugUNet1D model by training on varying fractions of the available training data (5%, 10%, 25%, 50%, 75%, and 90%), and then evaluating performance on the same held-out test set. Our results (Table 4) demonstrate remarkable data efficiency while revealing important insights about the model’s learning dynamics and the role of training data quantity in cross-subject generalization.

Table 4.

Table showing the performance of the proposed model with different fractions of the training data. The total number of labeled 20-second segments is 173160.

Training data percentage # Labeled segments Test precision Test recall Test F1
5% 8658 0.9350 0.7289 0.8192
10% 17316 0.9353 0.7166 0.8115
25% 43290 0.9281 0.7913 0.8543
50% 86580 0.9214 0.7956 0.8538
75% 129870 0.9184 0.7952 0.8524
90% 155844 0.9331 0.8007 0.8618

By limiting the training dataset to only 5%, the model achieved surprisingly strong performance with an F1-score of 0.8192, maintaining high precision (0.9350) and reasonable recall (0.7289). This result indicates that the combination of our residual U-Net architecture and comprehensive augmentation strategy enables effective learning from limited labeled data, a potentially critical advantage for SWD detection applications where obtaining large, annotated datasets is excessively laborious, expensive, or time-consuming. Performance improvements were most pronounced when increasing training data from 10% to 25%, with the F1-score increasing to 0.8543. This substantial gain indicates that while the model can learn basic SWD patterns from minimal data, exposure to a more diverse set of training examples significantly enhances generalization.

Beyond 50% of training data, performance improvements plateaued, with 75% and 90% of data yielding F1-scores of 0.8524 and 0.8618, respectively. Notably, evaluating the precision-recall dynamics across different training data fractions revealed interesting patterns. Precision remained remarkably stable across all conditions (0.9184-0.9353), whereas recall showed primary improvements as training data increased (0.7166 at 10% to 0.8007 at 90%). This pattern indicates that the model maintains consistent specificity regardless of training set size but requires more diverse training examples to improve its sensitivity to varied SWD manifestations.

These findings have important practical implications for the deployment of seizure detection systems. The strong performance achieved with only 25-50% of training data suggests that effective models can be developed without requiring exhaustive data collection from large numbers of subjects. However, the plateau beyond 50% also indicates that simply collecting more data from the same subject population may not substantially improve cross-subject performance. Instead, improvements may require either architectural innovations, more sophisticated augmentation strategies, or the inclusion of training data from more diverse subject populations with varied seizure characteristics.

Results of different values of probability of applying amplitude scaling

Finally, we conducted a hyperparameter study to resolve the optimal probability (p) for applying amplitude scaling augmentation during training, evaluating probabilities ranging from 0.1 to 0.5. Our results (5) revealed a critical trade-off between precision and recall that is directly influenced by the augmentation probability, with substantial implications for model robustness and clinical utility.

The results are available in Table 5.

Table 5.

Table showing model scores when different probabilities of amplitude scaling are chosen.

Scale (p) Test precision Test recall Test F1
0.1 0.9451 0.7680 0.8474
0.2 0.9239 0.8003 0.8577
0.3 0.9435 0.7602 0.8420
0.4 0.9378 0.7628 0.8413
0.5 0.9092 0.8618 0.8840

At lower augmentation probabilities (p=0.1, 0.3, and 0.4), the model exhibited consistently high precision (0.9378-0.9451) but relatively modest recall (0.7602-0.7680), resulting in F1-scores between 0.841 and 0.847. This pattern indicates that when amplitude scaling is applied infrequently during training, the model learns conservative decision boundaries that prioritize specificity over sensitivity. While such models make few false positive predictions, they fail to detect approximately 23-24% of actual SWDs, limiting their clinical utility for patient monitoring applications where missing SWDs can have serious consequences.

A notable exception emerged at p=0.2, which achieved competitive performance with an F1-score of 0.8577 through a more balanced precision-recall profile (0.9239 precision, 0.8003 recall). This observation suggests that a moderate augmentation frequency provides some improvement in recall while maintaining strong precision. However, increasing the augmentation probability to p=0.5 produced the optimal performance with an F1-score of 0.884, representing the best overall detection capability. This configuration achieved a substantial gain in recall to 0.8618 while maintaining strong precision at 0.9092, successfully detecting approximately 86% of SWDs with 91% of positive predictions being correct.

Discussion

Reliably and accurately detecting events of interest in EEG signals is a common problem. Manually scanning through EEG traces and demarcating relevant intervals is time intensive and can be affected by extraneous factors like scorer experience, bias, and attention level. Attempts to automatically detect salient EEG events often involve using features in the time and frequency domains of the EEG (e.g. spectral profiles, changes in powers of specific frequency bands, waveform shape)24,42–44, machine learning approaches9,45, or a combination of both14,46. However, when detecting frequent, spontaneous SWDs observed during long continuous recordings from C3H/HeJ mice, we found available methods inadequate. Inspired by U-Nets used in image segmentation and classification20,47,48, we applied the same neural network architecture to the problem of SWD detection. The result is AugUnet1D, a U-Net neural network architecture for 1-dimensional time series data that uses data augmentation strategies during training to optimize SWD detection.

After training the network with 961 hours of EEG recording, including 22,637 SWDs labeled manually by experienced researchers, AugUNet1D was tested on 10 EEG recordings from 10 different mice not included in the original training dataset. It achieved an overall average F1 score of 0.90 with a recall of 0.89 and precision of 0.90 (2). By comparison with all other models, it is clear that the combination of AugUNet1D’s encoder-decoder architecture with skip connections, residual learning for gradient stability, and data augmentation significantly improve performance on cross-subject SWD detection. The U-Net architecture implemented in AugUNet1D permits the network to create hierarchical temporal representations, which explain much of its success on this data labeling task. Traditional machine learning approaches like Decision Tree and Logistic Regression performed far worse than AugUNet1D, likely due to their limited capacity to learn complex hierarchical representations from raw EEG signals. Recurrent architectures including LSTM and biLSTM also failed despite their theoretical suitability for sequential data, although ConvLSTM showed some promise. The inability of these models to produce any meaningful predictions indicates that temporal modeling alone, without spatial feature extraction through convolution, is insufficient for this task. Other architectures (e.g., EEGNet) likely fail because they were designed for multi-channel spatial-spectral feature extraction which differs fundamentally from the dense temporal segmentation required for SWD detection. Finally, a recently published time- and frequency-based method, Twin Peaks, was also inferior to AugUNet1D and has lower temporal resolution. AugUNet then represents the best overall method for SWD detection for our dataset.

Additionally, while AugUNet1D outputs time-point-wise binary labels with high precision and recall, no post-processing was applied to consolidate fragmented predictions. Continuity-based smoothing or minimum duration thresholding is recommended for event-wise SWD detection in practice and is left as a direction for future refinement.

In addition to performing better overall, one especially important advantage of AugUNet1D is that it can very precisely segment SWDs. It marks the starts and ends of detected events very close to where trained researchers draw event boundaries (see Fig. 8 for examples). Time- and frequency-based detection methods rely on changes in the power spectrum, which has poor temporal resolution as a consequence of computing a Fourier Transform over a finite time window. Therefore, the time resolution of the detection signal is only a fraction of the time resolution of the original EEG data acquired. Similarly, machine learning applied to chunked data49 or pre-detected candidate events14 also presents the same segmentation problem: the beginning and end of an event lack temporal resolution. AugUNet1D avoids this problem altogether by reading the entire, continuous data and treating every sample as a discrete point to label rather than grouping samples into blocks with homogeneous compositions.

Another notable feature of AugUNet1D is its robust performance during periods when other SWD detection methods fail. Time- and frequency-based methods tend to falsely detect events during sleep when the overall EEG amplitude increases. Therefore, methods that rely on changes in EEG amplitude to detect SWDs also tend to detect events during sleep (Fig. 8C). Transient, non-pathological EEG oscillations during sleep can increase power in the SWD frequency band (5-7Hz for C3H/HeJ mice ) substantially and are often erroneously detected by thresholding in that frequency band. Overall, false detections during sleep pose a serious problem for time- and frequency-based detection methods. SWDs can happen during sleep50,51 so excluding sleep altogether is not an adequate solution. AugUNet1D presents a superior alternative by learning the SWD pattern itself rather than its spectral composition or simplified waveform features which can be shared by non-pathological EEG events.

In conclusion, AugUNet1D is more effective for automatically identifying SWDs in our dataset than all other methods tested here. It outperforms all other traditional machine learning methods, neural networks, and the Twin Peaks algorithm. Furthermore, AugUNet1D is robust, performing well even in conditions where other methods fail (e.g., during slow-wave sleep). We also anticipate that AugUNet1D can be applied more generally to detect a range of EEG signals, including non-SWD EEG events and that AugUNet1D will be valuable for experimenters and clinicians alike; the data presented herein show that trained researchers require nearly one hour to manually label every nine hours of continuous EEG data. AugUNet1D can perform this task much more efficiently and does not require users to actively process data.

Supplementary Information

Author contributions

S.Sen and S.K. analyzed results and wrote the manuscript. S.Sen, S.K., D.E.B., and M.B. conceived experiment and analysis approaches and edited the manuscript. S.Sen developed the primary deep learning architecture. S.Sharma implemented traditional machine learning approaches for comparison. S.K., S.L., A.M. collected EEG data and manually labeled SWDs.

Funding

This work was supported by the National Institutes of Health under grants R01 NS126594, R01 NS131670, and T32 DK007646.

Data availability

Data Availability Statement: Data can be found with this DOI:https://doi.org/10.5281/zenodo.17982389 Code available here: https://github.com/ssen7/augunet1D.

Declarations

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Saurav Sengupta and Scott Kilianski have contributed equally to this work.

Supplementary Information

The online version contains supplementary material available at https://doi.org/10.1038/s41598-026-62064-7.

References

  • 1.Panayiotopoulos, C. P. Typical absence seizures and related epileptic syndromes: assessment of current state and directions for future research. Epilepsia49, 2131–2139 (2008). [DOI] [PubMed] [Google Scholar]
  • 2.Tenney, J. R. & Glauser, T. A. The current state of absence epilepsy: can we have your attention? the current state of absence epilepsy. Epilepsy Currents13, 135–140 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Caplan, R. et al. Childhood absence epilepsy: behavioral, cognitive, and linguistic comorbidities. Epilepsia49, 1838–1846 (2008). [DOI] [PubMed] [Google Scholar]
  • 4.Loring, D. W. Paying attention to school achievement in childhood absence epilepsy: School achievement in childhood absence epilepsy. Epilepsy Currents14, 68–70 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.van Luijtelaar, G., Onat, F. Y. & Gallagher, M. J. Animal models of absence epilepsies: what do they model and do sex and sex hormones matter?. Neurobiology Disease72, 167–179 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Frankel, W. N. et al. Development of a new genetic model for absence epilepsy: Spike-wave seizures in c3h/he and backcross mice. J. Neurosci.25, 3452–3458 (2005). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Beyer, B. et al. Absence seizures in c3h/hej and knockout mice caused by mutation of the ampa receptor subunit gria4. Hum. Mol. Genet.17, 1738–1749 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Ellens, D. J. et al. Development of spike-wave seizures in c3h/hej mice. Epilepsy Res.85, 53–59 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Jandó, G., Siegel, R. M., Horváth, Z. & Buzsáki, G. Pattern recognition of the electroencephalogram by artificial neural networks. Electroencephalogr. Clin. Neurophysiol.86, 100–109 (1993). [DOI] [PubMed] [Google Scholar]
  • 10.Johansen, A. R. Epileptiform spike detection via convolutional neural networks. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) 754–758 (IEEE, 2016). [DOI] [PMC free article] [PubMed]
  • 11.Acharya, U. R., Oh, S. L., Hagiwara, Y., Tan, J. H. & Adeli, H. Deep convolutional neural network for the automated detection and diagnosis of seizure using eeg signals. Comput. Biol. Med.100, 270–278 (2018). [DOI] [PubMed] [Google Scholar]
  • 12.Ullah, I. et al. An automated system for epilepsy detection using eeg brain signals based on deep learning approach. Expert Syst. Appl.107, 61–71 (2018). [Google Scholar]
  • 13.Wang, L. et al. Automatic epileptic seizure detection in eeg signals using multi-domain feature extraction and nonlinear analysis. Entropy19, 222 (2017). [Google Scholar]
  • 14.Pfammatter, J. A., Maganti, R. K. & Jones, M. V. An automated, machine learning-based detection algorithm for spike-wave discharges (swds) in a mouse model of absence epilepsy. Epilepsia Open4, 110–122 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Lestari, F. P. et al. Epileptic seizure detection in eegs by using random tree forest, naïve bayes and knn classification. In Journal of Physics: Conference Series, vol. 1505, 012055 (IOP Publishing, 2020).
  • 16.Xu, G., Ren, T., Chen, Y. & Che, W. A one-dimensional cnn-lstm model for epileptic seizure recognition using eeg signal analysis. Front. Neurosci.14, 578126 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Cao, X., Zheng, S., Zhang, J., Chen, W. & Du, G. A hybrid cnn-bi-lstm model with feature fusion for accurate epilepsy seizure detection. BMC Med. Inform. Decis. Mak.25, 6 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Lawhern, V. J. et al. Eegnet: a compact convolutional neural network for eeg-based brain-computer interfaces. J. Neural Eng.15, 056013 (2018). [DOI] [PubMed] [Google Scholar]
  • 19.Finding alexnet for time series classification. Fawaz, H. I., Lucas, B., Forestier, G., Pelletier, C. & Schmidt, D. F. Jonathanweber, geoffrey i. webb, lhassane idoumghar, pierre-alain muller, and françois petitjean. 2020. inceptiontime. Data Min. Knowl. Disc.34, 1936–1962 (2020). [Google Scholar]
  • 20.Ronneberger, O., Fischer, P. & Brox, T. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, 234–241 (Springer, 2015).
  • 21.Perslev, M., Jensen, M., Darkner, S., Jennum, P. J. & Igel, C. U-time: A fully convolutional network for time series segmentation applied to sleep staging. Adv. Neural Inform. Process. Syst.32 (2019).
  • 22.Wolf, L. A deep learning approach for the segmentation of electroencephalography data in eye tracking applications (2022) arXiv:2206.08672 arXiv preprint.
  • 23.Jia, Z. et al. Salientsleepnet: Multimodal salient wave detection network for sleep staging. arXiv preprint arXiv:2105.13864 (2021).
  • 24.Iotchev, I. B. et al. The twin peaks method of automated spike-wave detection: A two-step two-criteria matlab application. J. Neurosci. Methods409, 110199 (2024). [DOI] [PubMed] [Google Scholar]
  • 25.Pérez-García, F. fepegar/unet: Pytorch implementation of 2d and 3d u-net. Zenodo (2020).
  • 26.Zhu, W. & Beroza, G. C. Phasenet: a deep-neural-network-based seismic arrival-time picking method. Geophys. J. Int.216, 261–273 (2019). [Google Scholar]
  • 27.Wu, K., Zhao, Z. & Yener, B. Seizuretransformer: Scaling u-net with transformer for simultaneous time-step level seizure detection from long eeg recordings. arXiv preprint arXiv:2504.00336 (2025).
  • 28.Zhang, Z., Liu, Q. & Wang, Y. Road extraction by deep residual u-net. IEEE Geosci. Remote Sens. Lett.15, 749–753 (2018). [Google Scholar]
  • 29.Alom, M. Z., Hasan, M., Yakopcic, C., Taha, T. M. & Asari, V. K. Recurrent residual convolutional neural network based on u-net (r2u-net) for medical image segmentation. arXiv preprint arXiv:1802.06955 (2018).
  • 30.He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. corr abs/1512.03385 (2015) (2015).
  • 31.Milletari, F., Navab, N. & Ahmadi, S.-A. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 2016 fourth International conference on 3D vision (3DV), 565–571 (Ieee, 2016).
  • 32.Hosmer, D. W. & Lemeshow, S. Applied Logistic Regression (John Wiley & Sons, New York, 2000), 2nd edn.
  • 33.Cover, T. M. & Hart, P. E. Nearest neighbor pattern classification. IEEE Trans. Inf. Theory13, 21–27 (1967). [Google Scholar]
  • 34.Breiman, L., Friedman, J., Olshen, R. A. & Stone, C. J. Classification and Regression Trees (Wadsworth, Belmont, CA, 1984). [Google Scholar]
  • 35.Breiman, L. Random forests. Mach. Learn.45, 5–32 (2001). [Google Scholar]
  • 36.LeCun, Y., Bengio, Y. & Hinton, G. Deep Learn. Nature521, 436–444 (2015). [DOI] [PubMed] [Google Scholar]
  • 37.Ullah, I. & Petrosino, A. About pyramid structure in convolutional neural networks. In 2016 International joint conference on neural networks (IJCNN), 1318–1324 (IEEE, 2016).
  • 38.Hochreiter, S. & Schmidhuber, J. Long short-term memory. Neural Comput.9, 1735–1780 (1997). [DOI] [PubMed] [Google Scholar]
  • 39.Graves, A. & Schmidhuber, J. Framewise phoneme classification with bidirectional lstm networks. In Proceedings. 2005 IEEE International Joint Conference on Neural Networks, 2005., vol. 4, 2047–2052 (IEEE, 2005). [DOI] [PubMed]
  • 40.Shi, X. Convolutional lstm network: A machine learning approach for precipitation nowcasting. Adv. Neural. Inf. Process. Syst. 28, (2015).
  • 41.Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition 1251–1258 (2017).
  • 42.Van Hese, P. et al. Automatic detection of spike and wave discharges in the eeg of genetic absence epilepsy rats from strasbourg. IEEE Trans. Biomed. Eng.56, 706–717 (2008). [DOI] [PubMed] [Google Scholar]
  • 43.Ovchinnikov, A., Lüttjohann, A., Hramov, A. & Van Luijtelaar, G. An algorithm for real-time detection of spike-wave discharges in rodents. J. Neurosci. Methods194, 172–178 (2010). [DOI] [PubMed] [Google Scholar]
  • 44.Özmen, B. Automatic detection of seizure activity from eeg recordings of genetic rat model of absence epilepsy. In 2021 29th Signal Processing and Communications Applications Conference (SIU) 1–4 (IEEE, 2021).
  • 45.Navas-Olive, A., Rubio, A., Abbaspoor, S., Hoffman, K. L. & de la Prida, L. M. A machine learning toolbox for the analysis of sharp-wave ripples reveals common waveform features across species. Commun. Biol.7, 211 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Baser, O., Yavuz, M., Ugurlu, K., Onat, F. & Demirel, B. U. Automatic detection of the spike-and-wave discharges in absence epilepsy for humans and rats using deep learning. Biomed. Signal Process. Control76, 103726 (2022). [Google Scholar]
  • 47.Komura, D. & Ishikawa, S. Machine learning methods for histopathological image analysis. Comput. Struct. Biotechnol. J.16, 34–42 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Yuan, Y. & Cheng, Y. Medical image segmentation with unet-based multi-scale context fusion. Sci. Rep.14, 15687 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49.Kashefi Amiri, H., Zarei, M. & Daliri, M. R. Epileptic seizure detection from electroencephalogram signals based on 1d cnn-lstm deep learning model using discrete wavelet transform. Sci. Rep.15, 32820 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50.Halász, P., Terzano, M. G. & Parrino, L. Spike-wave discharge and the microstructure of sleep-wake continuum in idiopathic generalised epilepsy. Neurophysiologie Clinique/Clinical Neurophysiology32, 38–53 (2002). [DOI] [PubMed] [Google Scholar]
  • 51.Sitnikova, E. Sleep disturbances in rats with genetic pre-disposition to spike-wave epilepsy (wag/rij). Front. Neurol.12, 766566 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Data Availability Statement

Data Availability Statement: Data can be found with this DOI:https://doi.org/10.5281/zenodo.17982389 Code available here: https://github.com/ssen7/augunet1D.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES