Next Article in Journal
A Browser Fingerprint Authentication Scheme Based on the Browser Cache Side-Channel Technology
Next Article in Special Issue
An Analysis of Traditional Methods and Deep Learning Methods in SSVEP-Based BCI: A Survey
Previous Article in Journal
Modulus Waveform Design Based on Manifold ADMM Idea in Dual-Function Radar–Communication System
Previous Article in Special Issue
Brain–Computer Interface Based on PLV-Spatial Filter and LSTM Classification for Intuitive Control of Avatars
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Robust Automatic Epilepsy Seizure Detection Algorithm Based on Interpretable Features and Machine Learning

1
China Academy of Engineering Physics, Beijing 100088, China
2
School of Mathematics and Physics, North China Electric Power University, Beijing 102206, China
3
Beijing Institute of Applied Physics and Computational Mathematics, Beijing 100094, China
4
Shanghai Zhangjiang Academy of Mathematics, Shanghai 200438, China
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(14), 2727; https://doi.org/10.3390/electronics13142727
Submission received: 7 May 2024 / Revised: 6 July 2024 / Accepted: 10 July 2024 / Published: 11 July 2024
(This article belongs to the Special Issue EEG Analysis and Brain–Computer Interface (BCI) Technology)

Abstract

:
Epilepsy, as a serious neurological disorder, can be detected by analyzing the brain signals produced by neurons. Electroencephalogram (EEG) signals are the most important data source for monitoring these brain signals. However, these complex, noisy, nonlinear and nonstationary signals make detecting seizures become a challenging task. Feature-based seizure detection algorithms have become a dominant approach for automatic seizure detection. This study presents an algorithm for automatic seizure detection based on novel features with clinical and statistical significance. Our algorithms achieved the best results on two benchmark datasets, outperforming traditional feature-based methods and state-of-the-art deep learning algorithms. Accuracy exceeded 99.99% on both benchmark public datasets, with the 100% correct detection of all seizures on the second one. Due to the interpretability and robustness of our algorithm, combined with its minimal computational resource requirements and time consumption, it exhibited substantial potential value in the realm of clinical application. The coefficients of variation of datasets proposed by us makes the algorithm data-specific and can give theoretical guidance on the selection of appropriate random spectral features for different datasets. This will broaden the applicability scenario of our feature-based approach.

1. Introduction

1.1. Background

Epilepsy, as a common neurological disorder, affects over 70 million patients worldwide [1]. It usually leads to 2–3 times more premature mortality than ordinary, burdening families and society [2]. As an unstable situation in epilepsy patients due to the excessive discharge of brain cells, seizures can cause a range of physiological symptoms, such as partial or entire body reactions that are uncontrollable to the complete loss of consciousness. It can even lead to severe injury or death. Fortunately, the World Health Organization (WHO) reports that 70% of people with epilepsy can avoid seizures if they receive timely treatment [3]. Electroencephalogram (EEG) signals are the most important data source for monitoring these brain signals. Therefore, it is essential to identify seizure events from the EEG and diagnose patients with epilepsy early. EEG signals are obtained by amplifying and recording the spontaneous biological potentials of the brain from the scalp through a precision electronic instrument. They are spontaneous and rhythmic electrical activities of brain cells recorded through electrodes. Epileptic disorders are diagnosed by EEG signals on the basis that they capture and record the abnormal electrical activities in the cerebral cortex. The clinical analysis and interpretation of EEG are time-consuming and put a heavy burden on neurologists [4,5]. To reduce the workload of neurologists by giving more timely diagnostic results, many studies focus on the automatic detection of seizures [6]. Data-driven methods such as machine learning and deep learning classifiers are able to classify EEG data and detect epileptic seizures without compromising performance, while revealing underlying patterns [7]. Therefore, relevant algorithms provide enlightening insights into the automatic detection of seizures.
There are four main stages of epilepsy, including interictal state, preictal state, ictal state, and postictal state [8]. The interictal state is the period between two adjacent seizure events. The ictal state is the period during which a seizure occurs. Preictal and postictal states are the states before and after a seizure event, respectively. Broadly speaking, both the preictal and postictal states can be regarded as part of the interictal state. The goal of seizure detection is to distinguish between ictal and interictal state, to assist doctors in timely diagnosis and treatment, and to achieve the early detection of epilepsy patients. At present, data-driven methods in seizure recognition research fall into two categories: end-to-end deep learning methods and feature extraction combined with classifiers. The end-to-end deep learning method can automatically extract features, reducing human intervention. At the same time, it has a good effect on nonlinear and non-stationary signal processing such as EEG, but the features extracted by the deep learning methods have poor interpretation, so it is often not trusted by neurologists and difficult to be used in practice. However, the effectiveness of methods based on the combination of the feature extraction and classifier mainly depends on the feature extraction process, and therefore, may not produce satisfactory results like deep learning methods. Therefore, a robust automatic seizure detection algorithm based on interpretable features and machine learning was proposed in this paper, combining the interpretable features and the reliability of the results. The main contributions of this paper are as follows:
  • Proposed an algorithm based on the combination of feature extraction and machine learning classifier to detect seizure activities, and the results are optimal compared with the state-of-the-art algorithms on two EEG datasets;
  • Based on the experience of clinical experts and the theory of random matrix, the characteristics of epileptic wave numbers and random spectral features were proposed to distinguish ictal and interictal state;
  • Presented an unsupervised detection algorithm tailored to these epileptiform wave features;
  • Defined the coefficient of variation for datasets. It provides a theoretical basis for the adaptive extraction of random spectral features from different datasets.

1.2. Related Works

1.2.1. End-to-End Deep Learning Methods

End-to-end deep learning methods are used to directly and automatically carry out the feature extraction and classification of epilepsy EEG data. According to the framework used, they can be roughly divided into networks based on convolutional neural network (CNN), based on full convolutional network (FCN), based on random convolutional kernel transformation (Rocket), and based on Transformer.
One of the most well-known deep learning techniques is convolutional neural network (CNN), which can extract features by using various filters in the convolutional layer, pooling layer, normalized layer, and fully connected layer [9]. A 1D convolutional neural network-long short-term memory (1D CNN-LSTM) model proposed by Xu et al. [10] combined CNN with the long-short term memory network (LSTM), which can effectively capture and model the long-term dependence relationship to achieve a recognition accuracy of 99.39% in the seizure recognition task. Ismail et al. [11] used Resnet networks to achieve 50 wins out of 85 time classification tasks for UCR and UEA. Resnet adds residual blocks on the basis of traditional CNN, so it can avoid the problem of gradient disappearance during deep network training. Although this kind of deep neural network has excellent classification accuracy, it often has a huge training cost. Eldeleal et al. [12] introduced a new time series lightweight adaptive network (TSLANet) as a general convolutional baseline for different time series tasks. It has an adaptive spectrum module that can use Fourier analysis to enhance feature representation, and an interactive convolution block that enhances the model’s ability to decode complex time patterns, achieving an average classification accuracy of 85.90% across 116 datasets.
In FCN architecture, after the convolutional blocks, the features are input into a global average pooling layer [13] instead of a fully connected layer, which greatly reduces the number of model parameters and is conducive to improving model training efficiency. FCNs are essentially convolutional networks with no local pooling layers. This assures that a time series’ length remains constant throughout the convolutions, which makes it more conducive to fully extracting the information in the time series compared with CNN. The FCN-based temporal classification framework proposed by Wang et al. [14] had an average error per class (MPCE) of 0.023 on 44 benchmark datasets, which is the lowest among all deep learning methods.
Another popular framework with lower computational costs is the random convolutional kernel transform (Rocket). Rocket uses random convolutional kernel to first transform the time series data, and then trains a linear classifier using the transformed features [15]. As the kernel weights are not learned, the computational cost of computing the convolutions is low. However, the original Rocket is a univariate classification model that has not been generalized to multivariate temporal classification tasks. Another limitation is that, when using fixed random convolution kernels, for very large datasets, learning may become “saturated” at some point, making it impossible to continue improving accuracy. To solve these problems, variants such as MiniRocket [16] and MultiRocket [17] were developed. Recently, Dempster et al. [18] proposed Hydra, an algorithm that combines traditional dictionary methods with Rocket, which significantly improved the classification accuracy of Rocket and its variants. Hydra can be trained and tested on 106 datasets in approximately 31 min using a single CPU core.
In recent years, Transformer has attracted great interest from researchers due to its superior performance in natural language processing and speech processing. In particular, Transformer has shown good modeling capabilities in terms of the random dependencies and interactions in sequence data, which is attractive in the field of time series modeling [19]. Baurzhan [20] obtained the optimal result of Parkinson’s gait prediction and recognition by combining transformer encoder layer and two LSTM layers. However, the efficacy of Transformer in time series has also been questioned. For example, the alignment invariance of self-attention mechanisms in Transformer inevitably leads to the loss of time information [21]. In addition, self-attention mechanisms typically require a lot of computational resources, and they are prone to overfitting when trained on smaller datasets.
In summary, although end-to-end deep learning methods generally show superior performance, training models can be time-consuming and it is easier to overfit in mini data [22]. Furthermore, these models are essentially uninterpretable “black boxes” and are often considered unacceptable by neurologists in clinical healthcare settings [23]. Methods that use a combination of feature extraction and machine learning classifiers tend to have lower computational costs and more interpretive results. We combine the recent deep learning models mentioned above, FCN (Wang et al., 2019 [14]), Resnet (Fawaz et al., 2019 [11]), TSLANet (Eldeleal et al., 2024 [12]), Hydra (Dempster et al., 2024 [18]), and Transformer + LSTM (Ignacio, 2023 [20]), which are used as benchmarks to compare with our approach to evaluate the performance of our model.

1.2.2. Feature-Based Methods

The second category methods extract corresponding features according to expert experience or domain knowledge, and then use machine learning classification algorithm to identify seizures. Compared with end-to-end ones, feature engineering makes the results more interpretable and acceptable to neurologists, and the lower computational cost also makes it more potential for application. Traditional EEG analysis extracted features in the time domain, frequency domain, time–frequency domain, space domain, or nonlinear features as input variables, then used a variety of classifiers to classify the EEG data [24,25,26,27,28,29,30,31,32,33,34,35,36]. These features can be categorized based on their interpretation or the domain from which the features are calculated [37]. Chen et al. [38] proposed an algorithm for seizure detection based on time–frequency domain and nonlinear features in 2023. They extracted mixed features such as approximate entropy (ApEn), fuzzy entropy (FuzzyEn), sample entropy (SampEn), and the standard deviation (STD) of EEG signals in the subbands decomposed by discrete wavelet transform (DWT). The classification with CNN network after feature selection through random forest algorithm achieved 99.9% accuracy on the Bonn dataset and 100% accuracy on India dataset. Mahshidh et al. [39] similarly extracted the entropy features of the sub-frequency bands after DWT processing, then used the ensemble algorithm to classify after feature selection, and the seizure detection accuracy rate reached 99.5%. Although the accuracy of these algorithms is high, the calculation of the above time–frequency domain and nonlinear features are often complicated.
Velichko et al. [40] proposed a new entropy NNetEn, which reflected the reservoir information of the time series in the neural network, and demonstrated the practical application of the feature in distinguishing EEG signals from healthy people and patients with Alzheimer’s disease. However, the entropy characteristics depend on the parameters, which need to be adjusted for different application scenarios. And this feature also suffers from the limitation of computational complexity.
Although the features above were primarily constructed from data characteristics observed during the interictal and ictal phases, they still lack convincing clinical background knowledge. Epileptiform discharges are essential markers for physicians to diagnose the presence of seizures in patients. Slimen and Seddik [41] used machine learning methods and took the epileptiform wave number as an indicator to classify the EEG signals. However, they only considered spike waves, although slow and sharp waves also constitute significant indicators for epileptic events that cannot be overlooked.
Random spectral feature extraction, a prevalent technique based on random projection in high dimensional space, has recently gained considerable interest. Liao and Couillet [42] employed the random matrix theory to examine the impact of various nonlinear mappings on feature extraction. They suggested a selection criterion for nonlinear mapping functions based on variance and mean differences in datasets. Their recommendations provide valuable theoretical guidance for selecting appropriate functions for datasets characterized by varying variances and mean differences, albeit without quantitative measurements of the differences in mean and variance.
Considering the classification accuracy and computational complexity, we introduced wave number features and random spectral features with high single-feature discriminability among different categories, which achieve a better classification accuracy than deep neural networks by combining with traditional EEG features.

2. Materials and Methods

2.1. Datasets

This work used two EEG datasets. The first one was collected from Neurology & Sleep Centre, Hauz Khas, New Delhi [43]. After being acquired at a sampling rate of 200 Hz using Grass Telefactor Comet AS40 Amplification System, the signals were filtered between 0.5 and 70 Hz and then segmented into pre-ictal, interictal, and ictal stages by several experts. There are three folders named according to the seizure phase, and each folder contains 50 mat files. Each mat file consists of a sample of 1024 non-overlapping EEG time series data, corresponding to a time duration of 5.12 s. In this work, we used all the interictal and ictal stages data for research.
To test the robustness of our proposed method, it has been tested on another single-channel dataset which was collected at the University of Bonn, Germany [44]. This database has also become a benchmark for seizure detection. As shown in Figure 1, it consists of five subsets (Set A~Set E). Each set of EEG recordings consists of 100 segments. And each segment represented by 4097 samples, with a single channel of 23.6 s and a sampling rate of 173.61 Hz. The five subgraphs in Figure 1 visually show a segment of the five subsets, respectively, in which the first 4000 sample points of modified segments were selected. These segments were selected from the continuous EEG recordings after visual inspection for artifacts. EEG data were obtained from five patients who achieved complete seizure control after removal of one tumor. Among them, sets D and E contained EEG segments of interictal and ictal periods, respectively. Therefore, data from sets D and E were used in this study.

2.2. Methods

The process of feature-based automatic seizure detection based on EEG signals can be divided into data pre-processing, feature extraction, and seizure detection with classification algorithms [45]. Figure 2 presents the normal process of feature-based EEG signal seizure detection algorithm.
EEG as biomedical signals were contaminated by noise and artifacts, and therefore require a pre-processing step to clean up the data [46]. Noise and artifacts arise from physiological activities such as eye blinks, eye movements, and muscle contractions. In addition, the detection equipment itself can cause interference [47]. These can usually be removed using filtering, wavelet analysis, canonical correlation analysis, etc. Feature extraction, as a core component of any pattern recognition system, typically employs mathematically driven algorithms to extract relevant information from the raw data to better characterize patterns at any given point in time [48]. In many cases, integrating the feature extraction components into a pattern recognition system tends to accurately better distinguish between various patterns of interest and produce results faster than using raw data directly. Therefore, feature extraction is considered essential for the development of an efficient intelligent system for epileptic seizure detection. After extracting the relevant features, machine learning classifiers are applied to give detection results.
Datasets used in this article have already undergone pre-processing to remove artifacts, so no further actions are necessary. And the study of pre-processing methods is beyond the scope of this paper. We next introduce features that are interpretable and robust in terms of clinical significance and statistical significance, respectively.

2.2.1. Wave Numbers

Epileptiform discharges with different changes are generally seizures periods’ characteristics. The appearance of spike and sharp waves are some especially key characteristics of epileptic periods, and seizures are also often accompanied by the appearance of slow waves [49]. In view of these facts, we proposed three novel features—spike wave numbers, sharp wave numbers, and slow wave numbers. For the sake of the calculation of wave numbers, we also proposed an unsupervised wave detection algorithm, which can recognize spike, sharp, and slow waves without relevant labels.
As described in Algorithm 1, the unsupervised detective algorithm starts with searching for all maximum local peaks in each sample window. A function named find_peaks in python 3.8 package SciPy [50] was used to search peaks (local maxima) based on the simple value comparison of neighboring samples and returns those peaks whose properties match optionally specified conditions (minimum and/or maximum) for their height, prominence, width, threshold, and distance from each other. According to the definition, spikes are the most basic paroxysmal EEG activity, with a duration of 20~70 ms (14.5~50 Hz), and an amplitude of more than 50 μV. As for sharp wave, the time limit is 70~200 ms (5~14.7 Hz), and wave amplitude is approximately between 100 and 200 μV. And, Slow wave’s frequency is lower than 8 Hz [51]. Then, we choose wave peaks in maximum local peaks by judging whether they meet the definition. We will then delete peaks which are local maxima but not real wave peaks. Finally, we sum the wave numbers of each class of waves in each sample to obtain the features that will be input to the machine learning method.
Algorithm 1. Unsupervised wave detective algorithm
Input:
  EEG sample X;
  Wave-path: { x t , i , y t , i } i = 1,2 , 3 ;
  Amplitude range: : { x a , i , y a , i } i = 1,2 , 3
Output:
  Wave number: n i , i = 1,2,3;
  Wave center position: C i = { c 1 i , c 2 i , , c n i i } , i = 1,2,3;
  • For i = 1 to 3 do
  • Use the function find-peaks to find all local maximum points in X as a set of candidate    peaks for class i t h epileptic wave:
    P i = p 1 i , p 2 i , , p m i i find-peaks(X,i)
  • Select candidate peaks where wave-path and amplitude fall within the range : { x t , i , y t , i } and { x a , i , y a , i } :
        C i = { c 1 i , c 2 i , , c n i i } w a t h p a t h x t , i , y t , i , a m p l i t u d e r a n g e { x a , i , y a , i } P i
  • End for
  • Return n i ,   C i
where i = 1, 2, and 3, these correspond to spike, sharp, and slow waves, respectively. The wave-path and amplitude range are determined by their definitions.

2.2.2. Random Feature

Random feature map is a method of extracting data features by random projection in high-dimensional space. More precisely, for the data x, we generate a random matrix W, whose elements are independently and identically distributed (i.i.d.) random variables, and choose a nonlinear activation function σ ( · ) ; then the random character of the data is given by σ ( W x ) , where the nonlinear function acts on each element of the vector. This is similar to a MLP layer of a neural network, where W is the weight of that layer.
The mathematical expression for random feature extraction is as follows:
Let there be T independent data vectors obeying a Gaussian mixture model with K categories C l a s s 1 ,… C l a s s K , and the data vectors have p dimensions, i.e., x 1 , , x T R p . Given a certain category a, there are T a samples under the category, for a data vector x i from C l a s s a has:
x i = μ a p + ω i
where ω i ~ N ( 0 , C a / p ) for some mean μ a R p and covariance C a R p × p of associated class C a . Here, data are normalized by p to guarantee that x i = O ( 1 ) with high probability when C a = O ( 1 ) .
Denote data matrix as X = [ x 1 , , x T ] R p × T . Before extracting random spectral features, multiply X by random matrix W R n × p , which has independent identically distributed entries. Then, use some nonlinear activation function σ ( · ) to obtain the random feature matrix Σ σ ( W X ) R n × T , whose columns are associated random features of x i . And σ · acts on each element of the vector. Then, we define the Gram matrix of random features as G 1 / n Σ T Σ , the entry(i,j) of which is given by:
G i j = 1 n σ W x i T σ W x j = 1 n k = 1 n σ w k T x i T σ w k T x j
with w k T the k-th row of W. Since w k follows the same known distribution, taking expectation over w = w k of the above equation one results in the average kernel matrix Φ with (i,j) entry of which given by:
Φ x i , x j = E w G i j = E w σ ( w T x i ) σ ( w T x j )
Because we assume that the data obey a Gaussian mixture model, under which the data only contain two meaningful statistics: the mean and covariance. Therefore, we are interested in knowing whether different activation functions extract features with different degrees of bias for these two statistics. In order to give further valuable theoretical results, we start with some notational conventions.
Let C 0 = a = 1 K T a T C a , for a { 1 , , K } , C a 0 = C a C 0 . Then, for random elements,
Ω = ω 1 , ω T R p × T , ϕ = ω i 2 E ω i 2 i = 1 T R T
and, for deterministic elements:
t = 1 / p t r C 1 o , , t r ( C K o ) , M = μ 1 , , μ K
J = j 1 , j T R T × K ,   S = 1 / p ( t r ( C a C b ) ) a , b = 1 K
with j a denotes the canonical vector of C l a s s a such that ( j a ) i = δ x i C l a s s a .
In fact, under the assumption of a mixed Gaussian distribution, we can obtain an estimate of Φ , i.e., Φ ~ , which is defined as:
Φ ~ = d 1 Ω + M J T p T Ω + M J T p + d 2 U B U T + d 0 I T
U = J p , ϕ , B = t T t t t T 1
Φ ~ depends on the activation function only through the constants d 1 , d 2 . Since data are viewed as a random variable, Φ is therefore a random matrix. It can be shown that Φ ~ Φ 0 , as p , T . Note that Ω and t as random matrix and vector, which portray the first- and second-order random fluctuations in the kernel matrix. While M, t, S are non-random matrices and vectors that characterize the statistical features that are naturally extracted after a complex nonlinear random mapping. Specifically for K categories of data, M characterizes the mean value of the data, while t and S characterize the information about the covariance of data. That is to say, activation functions extract features with varying degrees of bias for these two types of statistical information by only two constants, i.e.,   d 1 and d 2 . Thus, we can classify various activation functions according to their theoretical value.
Table 1 presents definitions and examples of different classes of activation functions. Mean-oriented functions are those whose d 1 0 , d 2 = 0 , which asymptotically track only the difference in means. In Table 1, the mean orientation function is sign(t). In contrast, variance-oriented functions which asymptotically track only the difference in variance, since their d 2 0 , d 1 = 0 , such as t , c o s ( t ) and e t 2 / 2 . If d 1 0 and d 2 0 , the function is balanced, it can extract both the difference in mean and variance, and the ratio can be adjusted by the parameters. We have max(t,0) as an example of balanced function in Table 1.
Empirical estimates of the differences in the means and covariances of datasets can be calculated from M T M and t t T + 2 S , respectively. Therefore, by analyzing the differences in the mean and variance statistics of different data classes, we can select activation functions with varying biases to extract features for seizure diagnosis. This approach can enable us make informed decisions about choosing the most suitable activation functions for different types of datasets, improving the accuracy and reliability of the diagnostic process.
To better reflect the difference between the mean and variance of the dataset, we introduce coefficient of variation of dataset as:
c v = t t T + 2 S M T M
The higher the coefficient of variation of a dataset indicates that it is more desirable to extract random spectral features using variance-oriented activation functions. Conversely, random spectral features extracted using mean-oriented activation functions may have better classification results.

2.2.3. Traditional Features

In this paper, we choose several previous prevalent features that have been proven effective in EEG seizure recognition. They are correlation dimension (CD) [25], detrended fluctuation analysis (DFA) [26,27], Lyapunov exponent (LE) [28,29], Higuchi fractal dimension (HFD) [30,31,32], Hurst exponent (HE) [25], singular value decomposition entropy (SVD) [33], Fisher information (FI) [34], and Petrosian fractal dimension (PFD) [35] to describe the EEG state of patients. The feature extraction is performed by PyEEG in Python [52]. Since a single sample in the Bonn dataset has nearly four times as many sample points as in New Delhi dataset, calculating the correlation dimension and Lyapunov exponent can become very complicated. Therefore, we only use traditional features other than these two on the Bonn dataset. These traditional features, together with the wave numbers and random features proposed by us, are used as the input of SVMs (support vector machines) model to obtain the classification result of a seizure or not. Specifically, the detailed information of each traditional feature used in the algorithm is shown in Table 2:

2.3. Settlement and Evaluation

In our feature-based models, prevalent machine learning classifier SVM was used to judge whether patients are suffering from a seizure or not. In order to verify the two new types of features proposed in our algorithm, we performed ablation experiments on the features. To verify the advanced nature of the algorithm, experiments are performed to compare our method with the state-of-the-art methods.
To ensure that the effectiveness of the model depends only on the quality of the features, not on the intermediate steps, all feature-based methods will be trained using the SVM model with default parameters, i.e., the kernel function chooses a Gaussian kernel function with a penalty coefficient C = 1, gamma = 1/(number of features × sample variance). The 100 samples of length 1024 in the New Delhi dataset and the 200 samples of length 4027 in the Bonn dataset were randomly divided into the training and testing set of the original EEG data in the ratio of 6:4, and the corresponding features were extracted and used as SVM model’s input. For end-to-end methods, the raw EEG samples in the divided training set and testing set were directly used as inputs to them, which would automatically train and infer to output classification results.
To perform the reliability and the effectiveness of the obtained results, accuracy, precision, specificity, and sensitivity were calculated to estimate the proficiency of methods used in this work:
A c c u r a c y = T P + T N T P + T N + F P + F N × 100 %
P r e c i s i o n = T P T P + F P × 100 %
S p e c i f i c i t y = T N T N + F P × 100 %
S e n s i t i v i t y = T P T P + F N × 100 %
To assess the complexity of the model and the likelihood of clinical application, we also calculated the cost of time required for model training and inference.
Due to the stochastic nature of the algorithm results, taking into account fairness and time cost, we conducted 1000 experiments for each of all feature-based methods and 20 experiments for neural network methods. Each method selected its best five results for calculating the average of the evaluation index scores to estimate the performance.

3. Results

3.1. Feature Extraction

3.1.1. Wave Numbers

As shown in Figure 3, the three types of epileptic waves were completely separated, and local maxima which were not peak points were not recognized as peaks. Additionally, epileptic waves numbers between seizure segments and non-seizure segments were significantly different. Only a small number of slow waves were detected in non-seizure samples during the interictal state, which is reasonable because normal electrical activity in the brain also produces slow waves, which tend to follow spikes and sharp waves in abnormal discharges. In contrast, the algorithm detected a large number of spikes, sharp waves, and slow waves in the seizure sample. On the one hand, this result, which is consistent with a priori knowledge, proves the validity of the algorithm. On the other hand, it also implies the rationality of using a number of waveforms as classification features.

3.1.2. Random Spectral Features

We first obtained the variance and mean difference estimates of each dataset, then the coefficient of variation can be calculated. The details are shown in Table 3 as follows.
Table 3 shows that the estimated mean difference and variance difference of the New Delhi dataset are 27.51 and 1989.05, respectively. And, the mean difference estimate for the Bonn dataset is 53.71 and the variance difference estimate is 6547.83. Obviously, both datasets are variance-oriented. So the variance-oriented activation functions, i.e., t , c o s ( t ) and e t 2 / 2 were chosen to extract random spectral features separately. And, the random spectral features were the first three eigenvectors of the Gram matrix given the activation function.

3.2. Ablation Experiments

We classified the traditional features used in the algorithm according to the nonlinear domain, time domain, and frequency domain, and then investigated the evaluation metrices after using the original single class features, adding wave number features, adding random spectral features and adding above two novel features at the same time. At the end, we also examined the enhancement effect of wave numbers, random spectral features, and two new types of features when using all traditional features for classification. On the two datasets, our experimental results are shown in Table 4 and Table 5.
From the tables, it can be seen that, in both datasets, the addition of wave numbers and random features significantly improved the classification accuracy of the model, regardless of using a single type of traditional feature or using all traditional features. For the effect of single-type features to improve accuracy, random features are superior to wave numbers. For instance, in the New Delhi dataset, after adding wave numbers to the traditional features, the accuracy reached 96.77%, while, when random features were added, the accuracy reached 99.88%. Among all kinds of traditional features, nonlinear features had the best single type classification accuracy, reaching 81.42%. After adding two new features, the accuracy reached 99.88%. The accuracy of the seizure detection reached 99.99% by combining the two new features with all the traditional EEG features.
As for the Bonn dataset, the random features and wave numbers still have a significant enhancement effect on seizure detection. And, nonlinear features still have the best single-type classification accuracy, reaching 90.15%, but after adding our two new features, the accuracy increases to 99.86%. The accuracy of seizure detection reached 100% by the fusion of our two new features and all the traditional EEG features. This shows that two kinds of new features are conducive to improving the detection effect.
To further validate the advantages of our proposed features over traditional ones, the features used as inputs to the classifier were projected to a two-dimensional space and visualized using the T-SNE (t-distributed stochastic neighbor embedding) algorithm. If the points of high-dimensional feature vectors from the different classes of samples after dimensionality reduction are dissimilar or distant from each other in the low-dimensional space, it means that the features have a strong discriminability.
In Figure 4, we show the visualized results of the T-SNE algorithm. It can be seen from the figure that, compared with traditional features, wave numbers and random features have a better differentiation degree. This is mainly because wave numbers are related to the gold standard of the clinical interpretation of EEG. And, random features are extracted according to the characteristics of the dataset, which have better data adaptability than the traditional features. This explains why our algorithm achieves optimal results on both benchmark datasets.

3.3. Contrast Experiments

Our algorithm was compared with the state-of-the-art methods mentioned in the related work section. Among the deep learning methods that serve as benchmarks for comparison are FCN (Wang et al., 2019 [14]), Resnet (Fawaz et al., 2019 [11]), TSLANet (Eldeleal et al., 2024 [12]), Hydra (Dempster et al., 2024 [18]), and Transformer + LSTM (Ignacio, 2023 [20]), which use raw EEG data as input to the model. Benchmarking methods based on features are entropy features (Mahshid and Zahra, 2023 [39]), time–frequency domain and nonlinear features (Chen et al., 2023 [38]), and neural network entropy features (Velichko et al., 2023 [40]). The comparative results of the model evaluation metrics in both datasets are presented in Table 6 and Table 7.
On both datasets, our method achieved the highest accuracy and specificity. Specifically, our method on the Bonn dataset achieved 100% in all metrics, which indicated that our algorithm did not have any leakage and misdetection on this dataset, and outperformed all the state-of-the-art algorithms. And, the accuracy was improved by 1.25% compared to the sub-optimal method.
In the New Delhi dataset, the Transformer + LSTM framework had better precision and sensitivity performance, but our algorithm also achieved sub-optimal 99.99%. In addition, the accuracy and specificity of Transformer + LSTM were 95.5% and 91.3%, while the accuracy and specificity of our algorithm were 99.99% and 100%. This showed that our judgment of the non-seizure segments was more accurate. In terms of seizure recognition, the gap between us and that deep learning algorithm is minimal. In summary, compared with deep learning methods, our algorithm outperformed or came close to them and was more interpretable.
Among all the most advanced feature-based methods, the method using time–frequency and nonlinear features had the best performance, achieving sub-optimal results on both datasets, with an accuracy of 99.34% on the New Delhi dataset and 96.2% on the Bonn dataset. Our algorithm was significantly superior to this method, which further reflected that the features we extract were more applicable. Additionally, compared with feature-based methods, our algorithm combined timing information and clinical experience, made it more conducive to the interpretation of features.
In addition, considering the complexity of the model affects the training cost and inference speed. Moreover, the inference speed further affects the physicians’ experience in using the intelligent algorithms. Therefore, we also compare the training time and inferring time of each model and present the results in Table 8.
As can be seen in Table 8, our algorithm on both datasets took significantly less time than deep learning models such as FCN, Resnet, and Hydra. It was also less time consuming than feature-based methods. Since the computation of traditional features was more complex, the inference of Transformer + LSTM and TSLANet on the New Delhi dataset took less time than ours, but our method for training was far less expensive than either. Moreover, because the complexity of computing wave numbers and random spectral features was very low, our method also took much less time than the other time–frequency domain, nonlinear features, and entropy features for feature extraction.
Our method took 0.49 s to infer on the Bonn dataset and 2.45 s to infer on the New Delhi dataset, which was also acceptable for clinical application. Therefore, taking into account the model accuracy and the time consumption, our model has the most potential to be applied in the clinic.

4. Discussion

From the experimental results of two datasets, both our proposed wave number features and random features significantly improved the performance of the feature-based seizure detection algorithm. This indicated that these two types of features were highly robust and effective. Additionally, it also outperformed all neural network approaches with significantly less time and computational cost.
Furthermore, the significance of our proposed coefficient of variation can be explained by comparing the coefficient of variation of the two datasets with their evaluation scores. Theoretically, the larger the coefficient of variation, the larger the difference in variance compared to the mean. The better seizure diagnosis was based on random spectral features in this case. It can be seen in Table 9 that the New Delhi dataset had a larger coefficient of variation than the Bonn one, and random features did work better on it. A Mann–Whitney test was also conducted for the accuracy of two datasets, and took “α = 0.05”. We obtained “p-value = 0.00 < α”, i.e., random spectral features were statistically more effective on the New Delhi dataset than on the other one.
More importantly, the wave number feature comes from clinical experience and the random spectral feature has a statistical mechanism. This makes our proposed features interpretable, and clearly our approach is more credible compared to those black box models.

5. Conclusions

In this paper, we proposed wave numbers and random spectral features and combined them with a machine learning classification algorithm to form an effective automatic seizure detection algorithm. The coefficient of variation we proposed to provide theoretical guidance for selecting suitable random spectral features for different datasets was also verified to be statistically valid. Our method achieved 99.99% and 100% accuracy on the New Delihi and Bonn epilepsy public datasets, respectively, demonstrating the generalizability of this method.
In ablation experiments, we verified that the proposed features can significantly improve the classification accuracy. In comparison experiments, our seizure detection algorithm achieved the best results on both benchmark datasets. Moreover, our method spent much less time than state-of-the-art deep learning methods in model training and met the requirements of clinical applications in terms of inference time consumption.
The datasets used in this study were all single-channel, and our approach will be extended to multi-channel clinical EEG data in the future. And the validity of the coefficients of variation of the datasets also needs to be validated in more EEG datasets. It is also an interesting topic to further study the theory and threshold of random feature selection based on the size of coefficient of variation.

Author Contributions

S.L. completed the entire study of the experiment and writing. J.Y. and X.W. provided guidance and revised the manuscript. Y.Z. and X.Y. provided advice and research ideas. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by the Key Project of National Natural Science Foundation of China [Grant NSFC12031016, Grant NSFC12026607] and the National Key R&D Program of China [Grant 2020YFA0712203, Grant 2020YFA0712201].

Data Availability Statement

Data we used in this paper are from public databases. The patients involved in the database have provided ethical approval and informed consent. Users can download relevant data for free for research and publish relevant articles. Here, are the download links for the two public datasets we used: New Delhi EEG dataset: https://www.researchgate.net/publication/308719109_EEG_Epilepsy_Datasets (accessed on 9 July 2024). Bonn EEG dataset: https://www.ukbonn.de/epileptologie/arbeitsgruppen/ag-lehnertz-neurophysik/downloads/ (accessed on 9 July 2024).

Acknowledgments

We would like to thank the Neurology & Sleep Centre, Hauz Khas, New Delhi and Bonn University’s Epileptology department for making their databases available. We also thank Zhiguang Wang, Weizhong Yan, and Tim Oates for making their code publicly available, which has greatly facilitated this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Löscher, W.; Potschka, H.; Sisodiya, S.M.; Vezzani, A. Drug resistance in epilepsy: Clinical impact, potential mechanisms, and new innovative treatment options. Pharmacol. Rev. 2020, 72, 606–638. [Google Scholar] [CrossRef]
  2. Thurman, D.J.; Logroscino, G.; Beghi, E.; Hauser, W.A.; Hesdorffer, D.C.; Newton, C.R.; Scorza, F.A.; Sander, J.W.; Tomson, T.; Epidemiology Commission of the International League Against Epilepsy. The burden of premature mortality of epilepsy in high-income countries: A systematic review from the Mortality Task Force of the International League Against Epilepsy. Epilepsia 2017, 58, 17–26. [Google Scholar] [CrossRef]
  3. Iasemidis, L.D. Seizure prediction and its applications. Neurosurg. Clin. 2011, 22, 489–506. [Google Scholar] [CrossRef]
  4. Ullah, I.; Hussain, M.; Aboalsamh, H. An automated system for epilepsy detection using EEG brain signals based on deep learning approach. Expert Syst. Appl. 2018, 107, 61–71. [Google Scholar] [CrossRef]
  5. Shoeb, A.H.; Guttag, J.V. Application of machine learning to epileptic seizure detection. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), Haifa, Israel, 21–24 June 2010; pp. 975–982. [Google Scholar]
  6. Molina, E.; Sarmiento Torres, C.E.; Salazar-Cabrera, R.; López, D.M.; Vargas-Cañas, R. Intelligent telehealth system to support epilepsy diagnosis. J. Multidiscip. Healthc. 2020, 13, 433–445. [Google Scholar] [CrossRef]
  7. Siddiqui, M.K.; Morales-Menendez, R.; Huang, X.; Hussain, N. A review of epileptic seizure detection using machine learning classifiers. Brain Inform. 2020, 7, 5. [Google Scholar] [CrossRef]
  8. Farooq, M.S.; Zulfiqar, A.; Riaz, S. Epileptic seizure detection using machine learning: Taxonomy, opportunities, and challenges. Diagnostics 2023, 13, 1058. [Google Scholar] [CrossRef]
  9. Woodbright, M.; Verma, B.; Haidar, A. Autonomous deep feature extraction based method for epileptic EEG brain seizure classification. Neurocomputing 2021, 444, 30–37. [Google Scholar] [CrossRef]
  10. Xu, G.; Ren, T.; Chen, Y.; Che, W. A one-dimensional cnn-lstm model for epileptic seizure recognition using eeg signal analysis. Front. Neurosci. 2020, 14, 578126. [Google Scholar] [CrossRef]
  11. Ismail Fawaz, H.; Forestier, G.; Weber, J.; Idoumghar, L.; Muller, P.A. Deep learning for time series classification: A review. Data Min. Knowl. Discov. 2019, 33, 917–963. [Google Scholar] [CrossRef]
  12. Eldele, E.; Ragab, M.; Chen, Z.; Wu, M.; Li, X. Tslanet: Rethinking transformers for time series representation learning. arXiv 2024, arXiv:2404.08472. [Google Scholar]
  13. Lin, M.; Chen, Q.; Yan, S. Network in network. arXiv 2013, arXiv:1312.4400. [Google Scholar]
  14. Wang, Z.; Yan, W.; Oates, T. Time series classification from scratch with deep neural networks: A strong baseline. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), Anchorage, AK, USA, 14–19 May 2017; pp. 1578–1585. [Google Scholar]
  15. Dempster, A.; Petitjean, F.; Webb, G.I. ROCKET: Exceptionally fast and accurate time series classification using random convolutional kernels. Data Min. Knowl. Discov. 2020, 34, 1454–1495. [Google Scholar] [CrossRef]
  16. Dempster, A.; Schmidt, D.F.; Webb, G.I. Minirocket: A very fast (almost) deterministic transform for time series classification. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, Singapore, 14–18 August 2021; pp. 248–257. [Google Scholar]
  17. Tan, C.W.; Dempster, A.; Bergmeir, C.; Webb, G.I. MultiRocket: Multiple pooling operators and transformations for fast and effective time series classification. Data Min. Knowl. Discov. 2022, 36, 1623–1646. [Google Scholar] [CrossRef]
  18. Dempster, A.; Schmidt, D.F.; Webb, G.I. Hydra: Competing convolutional kernels for fast and accurate time series classification. Data Min. Knowl. Discov. 2023, 37, 1779–1805. [Google Scholar] [CrossRef]
  19. Wen, Q.; Zhou, T.; Zhang, C.; Chen, W.; Ma, Z.; Yan, J.; Sun, L. Transformers in time series: A survey. arXiv 2022, arXiv:2202.07125. [Google Scholar]
  20. Available online: https://www.kaggle.com/datasets/baurzhanurazalinov/parkinsons-freezing-submission-models (accessed on 6 May 2024).
  21. Zeng, A.; Chen, M.; Zhang, L.; Xu, Q. Are transformers effective for time series forecasting? In Proceedings of the AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; Volume 37, pp. 11121–11128. [Google Scholar] [CrossRef]
  22. Ahmed, S.F.; Alam, M.S.B.; Hassan, M.; Rozbu, M.R.; Ishtiak, T.; Rafa, N.; Mofijur, M.; Shawkat Ali, A.B.M.; Gandomi, A.H. Deep learning modelling techniques: Current progress, applications, advantages, and challenges. Artif. Intell. Rev. 2023, 56, 13521–13617. [Google Scholar] [CrossRef]
  23. Rasheed, K.; Qayyum, A.; Ghaly, M.; Al-Fuqaha, A.; Razi, A.; Qadir, J. Explainable, trustworthy, and ethical machine learning for healthcare: A survey. Comput. Biol. Med. 2022, 149, 106043. [Google Scholar] [CrossRef]
  24. Wang, L.; Xue, W.; Li, Y.; Luo, M.; Huang, J.; Cui, W.; Huang, C. Automatic epileptic seizure detection in EEG signals using multi-domain feature extraction and nonlinear analysis. Entropy 2017, 19, 222. [Google Scholar] [CrossRef]
  25. Geng, S.; Zhou, W.; Yuan, Q.; Cai, D.; Zeng, Y. EEG non-linear feature extraction using correlation dimension and Hurst exponent. Neurol. Res. 2011, 33, 908–912. [Google Scholar] [CrossRef]
  26. Jospin, M.; Caminal, P.; Jensen, E.W.; Litvan, H.; Vallverdú, M.; Struys, M.M.; Vereecke, H.E.; Kaplan, D.T. Detrended fluctuation analysis of EEG as a measure of depth of anesthesia. IEEE Trans. Biomed. Eng. 2007, 54, 840–846. [Google Scholar] [CrossRef] [PubMed]
  27. Adda, A.; Benoudnine, H. Detrended fluctuation analysis of EEG recordings for epileptic seizure detection. In Proceedings of the 2016 International Conference on Bio-Engineering for Smart Technologies (BioSMART), Dubai, United Arab Emirates, 4–7 December 2016; pp. 1–4. [Google Scholar]
  28. Swiderski, B.; Osowski, S.; Rysz, A. Lyapunov exponent of EEG signal for epileptic seizure characterization. In Proceedings of the 2005 European Conference on Circuit Theory and Design, Cork, Ireland, 2 September 2005; Volume 2, pp. II/153–II/156. [Google Scholar]
  29. Osowski, S.; Swiderski, B.; Cichocki, A.; Rysz, A. Epileptic seizure characterization by Lyapunov exponent of EEG signal. COMPEL—Int. J. Comput. Math. Electr. Electron. Eng. 2007, 26, 1276–1287. [Google Scholar] [CrossRef]
  30. Khoa TQ, D.; Ha, V.Q.; Van Toi, V. Higuchi fractal properties of onset epilepsy electroencephalogram. Comput. Math. Methods Med. 2012, 2012, 461426. [Google Scholar] [CrossRef]
  31. Kesić, S.; Spasić, S.Z. Application of Higuchi’s fractal dimension from basic to clinical neurophysiology: A review. Comput. Methods Programs Biomed. 2016, 133, 55–70. [Google Scholar] [CrossRef]
  32. Polychronaki, G.E.; Ktonas, P.Y.; Gatzonis, S.; Siatouni, A.; Asvestas, P.A.; Tsekou, H.; Sakas, D.; Nikita, K.S. Comparison of fractal dimension estimation algorithms for epileptic seizure onset detection. J. Neural Eng. 2010, 7, 046007. [Google Scholar] [CrossRef] [PubMed]
  33. Zhang, T.; Chen, W.; Li, M. Generalized Stockwell transform and SVD-based epileptic seizure detection in EEG using random forest. Biocybern. Biomed. Eng. 2018, 38, 519–534. [Google Scholar] [CrossRef]
  34. Martin, M.T.; Pennini, F.; Plastino, A. Fisher’s information and the analysis of complex signals. Phys. Lett. A 1999, 256, 173–180. [Google Scholar] [CrossRef]
  35. Moctezuma, L.A.; Molinas, M. Classification of low-density EEG for epileptic seizures by energy and fractal features based on EMD. J. Biomed. Res. 2020, 34, 180. [Google Scholar] [CrossRef]
  36. Yuan, Q.; Zhou, W.; Liu, Y.; Wang, J. Epileptic seizure detection with linear and nonlinear features. Epilepsy Behav. 2012, 24, 415–421. [Google Scholar] [CrossRef]
  37. Boonyakitanont, P.; Lek-Uthai, A.; Chomtho, K.; Songsiri, J. A review of feature extraction and performance evaluation in epileptic seizure detection using EEG. Biomed. Signal Process. Control. 2020, 57, 101702. [Google Scholar] [CrossRef]
  38. Chen, W.; Wang, Y.; Ren, Y.; Jiang, H.; Du, G.; Zhang, J.; Li, J. An automated detection of epileptic seizures EEG using CNN classifier based on feature fusion with high accuracy. BMC Med. Inform. Decis. Mak. 2023, 23, 96. [Google Scholar] [CrossRef] [PubMed]
  39. Dastgoshadeh, M.; Rabiei, Z. Detection of epileptic seizures through EEG signals using entropy features and ensemble learning. Front. Hum. Neurosci. 2023, 16, 1084061. [Google Scholar] [CrossRef]
  40. Velichko, A.; Belyaev, M.; Izotov, Y.; Murugappan, M.; Heidari, H. Neural Network Entropy (NNetEn): Entropy-Based EEG Signal and Chaotic Time Series Classification, Python Package for NNetEn Calculation. Algorithms 2023, 16, 255. [Google Scholar] [CrossRef]
  41. Slimen, I.B.; Seddik, H. Automatic recognition of epileptiform eeg abnormalities using machine learning approaches. In Proceedings of the 2020 5th International Conference on Advanced Technologies for Signal and Image Processing (ATSIP), Sousse, Tunisia, 2–5 September 2020; pp. 1–4. [Google Scholar]
  42. Liao, Z.; Couillet, R. On the spectrum of random features maps of high dimensional data. In Proceedings of the 35th International Conference on Machine Learning, PMLR, Stockholm, Sweden, 10–15 July 2018; pp. 3063–3071. [Google Scholar]
  43. Swami, P.; Panigrahi, B.K.; Nara, S.; Bhatia, M. EEG Epilepsy Datasets. 2016. Available online: https://www.researchgate.net/publication/308719109_EEG_Epilepsy_Datasets?channel=doi&linkId=57ecad4e08aebb1961ffb802&showFulltext=true (accessed on 6 May 2024).
  44. Andrzejak, R.G.; Lehnertz, K.; Mormann, F.; Rieke, C.; David, P.; Elger, C.E. Indications of nonlinear deterministic and finite-dimensional structures in time series of brain electrical activity: Dependence on recording region and brain state. Phys. Rev. E 2001, 64, 061907. [Google Scholar] [CrossRef] [PubMed]
  45. Ein Shoka, A.A.; Dessouky, M.M.; El-Sayed, A.; Hemdan, E.E.D. EEG seizure detection: Concepts, techniques, challenges, and future trends. Multimed. Tools Appl. 2023, 82, 42021–42051. [Google Scholar] [CrossRef]
  46. Slimen, I.B.; Boubchir, L.; Mbarki, Z.; Seddik, H. EEG epileptic seizure detection and classification based on dual-tree complex wavelet transform and machine learning algorithms. J. Biomed. Res. 2020, 34, 151. [Google Scholar] [CrossRef]
  47. Jiang, X.; Bian, G.B.; Tian, Z. Removal of artifacts from EEG signals: A review. Sensors 2019, 19, 987. [Google Scholar] [CrossRef] [PubMed]
  48. Ding, S.; Zhu, H.; Jia, W.; Su, C. A survey on feature extraction for pattern recognition. Artif. Intell. Rev. 2012, 37, 169–180. [Google Scholar] [CrossRef]
  49. Adams, R.D.; Victor, M.; Ropper, A.H.; Daroff, R.B. Principles of neurology. Neuropsychiatry Neuropsychol. Behav. Neurol. 1997, 10, 220. [Google Scholar]
  50. Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Burovski, E.; Peterson, P.; Weckesser, W.; Bright, J.; et al. SciPy 1.0: Fundamental algorithms for scientific computing in Python. Nat. Methods 2020, 17, 261–272. [Google Scholar] [CrossRef] [PubMed]
  51. Kane, N.; Acharya, J.; Beniczky, S.; Caboclo, L.; Finnigan, S.; Kaplan, P.W.; Shibasaki, H.; Pressler, R.; van Putten, M.J. A revised glossary of terms most commonly used by clinical electroencephalographers and updated proposal for the report format of the EEG findings. Revision 2017. Clin. Neurophysiol. Pract. 2017, 2, 170. [Google Scholar] [CrossRef] [PubMed]
  52. Bao, F.S.; Liu, X.; Zhang, C. PyEEG: An open source python module for EEG/MEG feature extraction. Comput. Intell. Neurosci. 2011, 2011, 406391. [Google Scholar] [CrossRef] [PubMed]
Figure 1. A visual presentation of class-5 EEG signals in Bonn epilepsy dataset. The horizontal axis represents the number of samples of the EEG signals and the vertical axis represents sample value.
Figure 1. A visual presentation of class-5 EEG signals in Bonn epilepsy dataset. The horizontal axis represents the number of samples of the EEG signals and the vertical axis represents sample value.
Electronics 13 02727 g001
Figure 2. Feature-based EEG signal seizure detection algorithm flow.
Figure 2. Feature-based EEG signal seizure detection algorithm flow.
Electronics 13 02727 g002
Figure 3. Spike, sharp, and slow waves detected in the EEG samples. (a) is a non-seizure sample while (b) comes from a seizure one.
Figure 3. Spike, sharp, and slow waves detected in the EEG samples. (a) is a non-seizure sample while (b) comes from a seizure one.
Electronics 13 02727 g003
Figure 4. Visualization results of various combinations of features in the New Delhi dataset clustered using the T-SNE algorithm. (ac) The single-type feature clustering results of traditional features, wave numbers, and random features, in that order. (d) The result of visualizing the clustering of all the features used in our algorithm. The seizure and non-seizure samples are labeled 1 and 0, respectively.
Figure 4. Visualization results of various combinations of features in the New Delhi dataset clustered using the T-SNE algorithm. (ac) The single-type feature clustering results of traditional features, wave numbers, and random features, in that order. (d) The result of visualizing the clustering of all the features used in our algorithm. The seizure and non-seizure samples are labeled 1 and 0, respectively.
Electronics 13 02727 g004
Table 1. Coefficients d 1 and d 2 in Φ ~ for different activation functions.
Table 1. Coefficients d 1 and d 2 in Φ ~ for different activation functions.
σ ( · ) d 1 d 2
t 0 1 / 2 π τ
cos ( t ) 0 e τ / 4
e t 2 / 2 0 1 / 4 ( τ + 1 ) 3
sign ( t ) 2 / π τ 0
max ( t , 0 ) 1/4 1 / 8 π τ
Table 2. The traditional features used in our proposed algorithm with their belonging category.
Table 2. The traditional features used in our proposed algorithm with their belonging category.
Feature CategoryFeatures
Nonlinear featuresDFA, LE, HFD, PFD
Frequency domain featuresSVD, FI
Time domain featuresCD, HE
Table 3. Variance and mean difference estimates and coefficient of variation of datasets (rounded to two decimal places).
Table 3. Variance and mean difference estimates and coefficient of variation of datasets (rounded to two decimal places).
DatasetStatistics
MeanVarianceCoefficient of Variation
New Delhi27.511989.051.62
Bonn53.716547.831.51
Table 4. Metric scores of classifiers under each combination of features in ablation experiments on the New Delhi dataset (rounded to two decimal places—where accuracy, precision, specificity, sensitivity are percentages).
Table 4. Metric scores of classifiers under each combination of features in ablation experiments on the New Delhi dataset (rounded to two decimal places—where accuracy, precision, specificity, sensitivity are percentages).
Feature TypeMetrics
FeaturesAccuracyPrecisionSpecificitySensitivity
NonlinearNonlinear81.4282.4880.6681.76
+Wave numbers97.2797.3798.7497.33
+Random features99.5099.5099.5599.09
+Wave numbers and Random features 99.8899.8899.7499.87
Time domainTime domain77.3278.4372.2177.65
+Wave numbers97.2797.3798.7497.33
+Random features99.5099.5099.0999.55
+Wave numbers and Random features99.8899.8899.7499.87
Frequency domainFrequency domain63.4266.6767.0464.39
+Wave numbers97.0797.1698.5797.14
+Random features99.5099.5399.0299.51
+Wave numbers and Random features99.6399.6499.2499.62
TraditionalTraditional88.0088.3385.1888.07
+Wave numbers96.7796.90 98.2596.84
+Random features99.8899.87100.0099.88
+Wave numbers and Random features99.9999.99100.0099.99
Table 5. Metric scores of classifiers under each combination of features in ablation experiments on the Bonn dataset (rounded to two decimal places—where accuracy, precision, specificity, sensitivity are percentages).
Table 5. Metric scores of classifiers under each combination of features in ablation experiments on the Bonn dataset (rounded to two decimal places—where accuracy, precision, specificity, sensitivity are percentages).
Feature TypeMetrics
FeaturesAccuracyPrecisionSpecificitySensitivity
NonlinearNonlinear90.1591.0096.0690.21
+Wave numbers92.8493.5798.6592.91
+Random features99.4899.4999.9799.49
+Wave numbers and Random features 99.8699.8699.9999.86
Time domainTime domain72.0375.2460.8772.34
+Wave numbers92.4392.6391.8892.49
+Random features99.2599.27100.0099.26
+Wave numbers and Random features99.9699.9699.9999.96
Frequency domainFrequency domain73.2575.1273.6473.57
+Wave numbers91.4891.7792.9291.57
+Random features99.2699.27100.0099.26
+Wave numbers and Random features99.9399.9399.9999.93
TraditionalTraditional95.0795.3698.0795.12
+Wave numbers95.8796.0798.7795.9
+Random features99.9699.96100.0099.96
+Wave numbers and Random features100100100100
Table 6. Metrics of seizure detection for each model in New Delhi dataset (rounded to two decimal places—where accuracy, precision, specificity, sensitivity are percentage. The optimal results are marked in bold red and the sub-optimal results are underlined in blue).
Table 6. Metrics of seizure detection for each model in New Delhi dataset (rounded to two decimal places—where accuracy, precision, specificity, sensitivity are percentage. The optimal results are marked in bold red and the sub-optimal results are underlined in blue).
CategoryMetrics
MethodAccuracy (↑)Precision (↓)Specificity (↑)Sensitivity (↓)
End-to-EndFCN
[14] 2019
93.5093.3794.1998.82
Resnet
[11] 2019
97.8597.8198.0098.76
Transformer + LSTM
[20] 2023
95.5100.0091.30100
TSLANet
[12] 2024
92.5095.4591.3094.11
Hydra
[18] 2024
97.5095.83100.0094.12
Feature-basedEntropy features
[39] 2023
98.7598.7598.78100
Neural network
Entropy
[40] 2023
95.0094.1295.6594.12
Time–frequency and nonlinear features
[38] 2023
99.3499.6799.0499.71
OursAll proposed features99.9999.99100.0099.99
Table 7. Metrics of seizure detection for each model in the Bonn dataset (rounded to two decimal places—where accuracy, precision, specificity, and sensitivity are percentages. The optimal results are marked in bold red and the sub-optimal results are underlined in blue.).
Table 7. Metrics of seizure detection for each model in the Bonn dataset (rounded to two decimal places—where accuracy, precision, specificity, and sensitivity are percentages. The optimal results are marked in bold red and the sub-optimal results are underlined in blue.).
CategoryMetrics
MethodAccuracy (↑)Precision (↑)Specificity (↑)Sensitivity (↑)
End-to-endFCN
[14] 2019
90.0090.3690.0094.51
Resnet
[11] 2019
97.2597.4097.25100
Transformer + LSTM
[20] 2023
92.594.7490.0095.00
TSLANet
[12] 2024
98.75100.0097.5100.00
Hydra
[18] 2024
96.25100.0092.5100.00
Feature-basedEntropy features
[39] 2023
93.1393.1393.1392.5
Neural Network
Entropy
[40] 2023
87.585.0089.4785.71
Time–frequency and nonlinear features
[38] 2023
96.2096.3493.0098.05
OursAll proposed features100.00100.00100.00100.00
Table 8. The model training time in the training set and the inference time in the testing set for each method for seizure detection on two datasets. The results are shown as the model training time (inferring time), in seconds (s).
Table 8. The model training time in the training set and the inference time in the testing set for each method for seizure detection on two datasets. The results are shown as the model training time (inferring time), in seconds (s).
CategoryMethodsDuration(s)
New DelhiBonn
End-to-endFCN29.62 (2.62)507.88 (2.12)
Resnet3841.88 (5.68)4543.89 (8.87)
TSLANet229.94 (0.47)664.86 (0.47)
Transformer + LSTM266.14 (0.74)1180.54 (2.71)
Hydra1332.54 (7.1)6301.72 (52.32)
Feature-basedEntropy features15.6 (3.83)172.31 (112.90)
Neural network
Entropy
1254.19 (842.75)2518.16 (1687.02)
Time–frequency and
nonlinear features
6.94 (4.45)203.56 (112.2)
Wave numbers0.71 (0.02)0.92 (0.01)
Random spectral features0.40 (0.01)1.9 (0.04)
OursAll proposed features10.5(2.45)2.21(0.49)
Table 9. Variance, mean estimates, and coefficients of variation of two datasets and accuracy of feature-based method only use random spectral features (rounded to two decimal places).
Table 9. Variance, mean estimates, and coefficients of variation of two datasets and accuracy of feature-based method only use random spectral features (rounded to two decimal places).
DatasetStatistics
MeanVarianceCoefficient of VariationAccuracy
New Delhi27.511989.051.6299.62
Bonn53.716547.831.5199.55
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Liu, S.; Zhou, Y.; Yang, X.; Wang, X.; Yin, J. A Robust Automatic Epilepsy Seizure Detection Algorithm Based on Interpretable Features and Machine Learning. Electronics 2024, 13, 2727. https://doi.org/10.3390/electronics13142727

AMA Style

Liu S, Zhou Y, Yang X, Wang X, Yin J. A Robust Automatic Epilepsy Seizure Detection Algorithm Based on Interpretable Features and Machine Learning. Electronics. 2024; 13(14):2727. https://doi.org/10.3390/electronics13142727

Chicago/Turabian Style

Liu, Shiqi, Yuting Zhou, Xuemei Yang, Xiaoying Wang, and Junping Yin. 2024. "A Robust Automatic Epilepsy Seizure Detection Algorithm Based on Interpretable Features and Machine Learning" Electronics 13, no. 14: 2727. https://doi.org/10.3390/electronics13142727

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop